MalwareC2Server is a safe command-and-control simulation for local lab and detection-engineering use. It models the structure of a C2 workflow without implementing arbitrary command execution, persistence, or offensive behavior.
The project models:
- agent registration
- task queueing
- agent polling
- task execution using a small set of benign built-in actions
- structured reporting back to the server
This repository version does not execute arbitrary shell commands and does not function as real malware. The agent only supports a fixed set of harmless tasks:
collect_hostnamecollect_oscollect_timeheartbeat
- Python 3
- Flask for the local coordination API
- Requests for agent HTTP communication
- Standard library:
argparse,datetime,platform,uuid
MalwareC2Server/
|-- C2Server.py
|-- MalwareClient.py
|-- README.md
`-- requirements.txt
python -m pip install -r requirements.txtcd D:\Cybersec\MalwareC2Server
python C2Server.pyExample using PowerShell:
Invoke-RestMethod -Method Post -Uri http://127.0.0.1:8080/queue-task -ContentType "application/json" -Body '{"agent_id":"agent-lab-01","task_name":"collect_hostname"}'python MalwareClient.py --server http://127.0.0.1:8080 --agent-id agent-lab-01 --poll-count 3Invoke-RestMethod http://127.0.0.1:8080/agents
Invoke-RestMethod http://127.0.0.1:8080/reportsPOST /registerPOST /queue-taskGET /task?agent_id=<id>POST /reportGET /agentsGET /reportsGET /health
- command-and-control workflow simulation
- REST API design for agent coordination
- agent registration and polling patterns
- structured telemetry and reporting
- malware-analysis-lab workflow without offensive execution features