An educational Python-based Command and Control (C2) framework featuring a TCP server, web-based management dashboard, native desktop fallback, and multi-format payload exporter.
Security notice: This project is intended exclusively for educational purposes and authorized testing in isolated environments. Do not deploy it on systems without explicit permission.
Reverse Shell Controller (RSC) consists of four primary components:
| Component | Description |
|---|---|
| Server | TCP server listening on port 4444. |
| Web Dashboard | Flask-based interface running on 127.0.0.1:8000. |
| Tk Dashboard | Native desktop fallback interface. |
| Exporter | Packages client source code and dependencies into portable ZIP archives. |
| Client | Connects to the configured server. |
┌──────────────────────┐
│ Web Dashboard │
│ 127.0.0.1:8000 │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ Server │
│ TCP :4444 │
└──────────▲───────────┘
│
Optional Ngrok
TCP Tunnel
│
┌──────────▼───────────┐
│ Client │
│ Authorized Testing │
└──────────────────────┘
- Flask-based web management dashboard.
- Native Tkinter desktop fallback.
- TCP server operating on port
4444. - Multi-format payload export.
- Automatic authentication using rotating HMAC tokens.
- Optional Ngrok TCP tunneling.
- ZIP-based packaging of payloads and required dependencies.
The exporter supports the following formats:
| Format | Extension |
|---|---|
| Python | .py |
| Shell | .sh |
| Windows Batch | .bat |
| JavaScript | .js |
| Executable | .exe |
Generated archives are stored in the builds/ directory.
- Python 3.10 or newer.
- pip.
- Flask.
- Ngrok (optional, for remote connectivity).
The Ngrok binary is included in the repository root.
Using pip:
pip install flaskOn Arch Linux:
sudo pacman -S python-flaskClone the repository:
git clone https://github.com/Tetousz/Reverse-shell-public.git
cd Reverse-shell-publicInstall the required dependencies:
pip install -r requirements.txtVerify the Python installation:
python3 --versionNgrok is optional for local testing.
To configure Ngrok, obtain an authentication token from your Ngrok account and execute:
./ngrok config add-authtoken <TOKEN>Start the tunnel on port 4444:
./ngrok tcp 4444Keep the Ngrok process running while using the application.
Important: Ngrok must be running before exporting a payload if remote connectivity is required. The exporter detects the active tunnel and incorporates its forwarding configuration into the generated archive.
If the Ngrok address changes after restarting the tunnel, previously exported payloads must be regenerated.
RSC provides two dashboard interfaces.
Start the Flask dashboard:
python3 -m web.mainThe browser opens automatically.
Dashboard address:
http://127.0.0.1:8000
If the web interface is unavailable, start the native desktop dashboard:
python3 -m dashboard.main- Start the Web Dashboard.
- Click Start Server.
- Click Export Payload.
- Select the required output format.
- Complete the export operation.
The exporter generates a ZIP archive in:
builds/
Each archive contains the selected payload and the required core/ Python package.
Exported payloads use automatic authentication. The exporter embeds the master secret into the generated payload, allowing the client to calculate its rotating HMAC authentication token.
No separate authentication token needs to be supplied through the command line.
Example archive structure:
payload_py.zip
├── payload_py.py
└── core/
├── ...
The exact contents depend on the selected payload format.
Testing should be performed only in an isolated environment or on systems for which you have explicit authorization.
Extract the generated archive:
mkdir -p /tmp/test/
unzip builds/payload_py.zip -d /tmp/test/Navigate to the extracted directory:
cd /tmp/test/Run the Python payload:
python3 payload_py.pyVerify the connection status through the Web Dashboard.
Remote connectivity requires an active Ngrok tunnel during payload export.
The exported archive contains the forwarding configuration detected at export time. When the archive is transferred to another authorized test machine, the client uses that configuration to connect back through the tunnel.
The server and Ngrok tunnel must remain active.
If Ngrok restarts and assigns a different forwarding address, export a new payload.
Port 4444 is already in use
Another process may already be listening on TCP port 4444.
Identify the process:
sudo lsof -i :4444Alternatively:
sudo ss -ltnp | grep 4444Stop the conflicting process if appropriate, then restart the application.
Ngrok forwarding address changed
Free Ngrok addresses can change when the tunnel is restarted.
Previously exported payloads retain their original forwarding configuration.
To resolve this:
- Start Ngrok again.
- Verify the current forwarding address.
- Restart the server if necessary.
- Export a new payload.
ModuleNotFoundError: No module named 'flask'
Flask is missing from the active Python environment.
Install it using:
python3 -m pip install flaskVerify the installation:
python3 -m pip show flaskOn Arch Linux:
sudo pacman -S python-flaskDashboard does not open automatically
Open the dashboard manually:
http://127.0.0.1:8000
Ensure the Web Dashboard process is running and that port 8000 is available.
- Use RSC only in controlled environments and on systems you are authorized to test.
- Do not expose management interfaces to untrusted networks.
- Treat exported payloads as sensitive files.
- Embedded authentication secrets must not be distributed publicly.
- Restrict access to the server and its generated builds.
- Stop the server and tunnel when testing is complete.
See the repository's LICENSE file for licensing terms.