A simple C2 (Command and Control) server that controls an agent, allowing it to execute shell commands, capture keyboard input, and upload/download files.
- Available as a CLI and as a WebUI
- Listens for connections from agents (via TCP)
- Sends commands and receives output from agents
- Stores logs (keystrokes, command results, etc.)
- Handles file transfers (upload/download)
- Initiates connection to the server (reverse shell model)
- Executes remote shell commands
- Captures keystrokes (basic keylogger)
- Uploads and downloads files
-
Clone the repository
git clone https://github.com/FjoGeo/Python_C2.git cd Python_C2 -
Install dependencies
pip install flask pynput
python server/c2_server.py python server/c2_webui.pyThen open a browser and go to:
- http://127.0.0.1:5000 (on the same machine)
- or http://<your-local-ip>:5000 (from another device on your network)
From there you can:
- Enter and send commands
- View output from the agent
- Upload and download files
Edit the IP address in agent.py to match your server:
server_host = "192.168.x.x"
server_port = 9999Then run the agent on the target machine:
python agent.py