This project is an educational Command and Control (C2) attack framework simulation designed for cybersecurity education and demonstration purposes.
The solution consists of three projects:
- C2SimulationFramework.Common: Shared library containing communication protocols, message types, and security utilities.
- C2SimulationFramework.Client: C2 agent/client console application that simulates a compromised system.
- C2SimulationFramework.Server: WPF-based C2 server application with a user interface for managing connected clients and sending commands.
- Multiple communication protocols (HTTP and DNS)
- Command message system with various simulated attack capabilities
- Secure communication with encryption simulation
- Client information gathering
- Command response handling
- Dark-themed server UI
The easiest way to test the application is to use the included RunDemo.bat script:
- Open a command prompt or PowerShell window
- Navigate to the solution root folder
- Run
.\RunDemo.bat - The script will build the solution and start both the server and client applications
- The server starts first, followed by the client after a 5-second delay
- Once both applications are running, you can:
- Start the server with the default settings (127.0.0.1:5000)
- See the client automatically connect to the server
- Send commands from the server to the client
- View the results in the server UI
- Run the
RunDemo.batscript, which will:- Build the solution
- Start the C2 server
- Wait 5 seconds
- Start a client agent
-
Build the solution:
dotnet build -
Start the server:
dotnet run --project C2SimulationFramework.Server\C2SimulationFramework.Server.csproj -
Start one or more client agents:
dotnet run --project C2SimulationFramework.Client\C2SimulationFramework.Client.csproj
-
In the server application:
- Click "Start Server" in the Settings tab
- Wait for clients to connect
- Select a client from the list
- Choose a command type
- Configure command arguments
- Click "Send Command"
-
The client will:
- Register with the server
- Receive and execute commands
- Send responses back to the server
- Ping: Checks if the client is responsive
- Echo: Returns a specified message
- Sleep: Pauses the client for a specified time
- ExecuteShellCommand: Simulates running a shell command
- GetSystemInfo: Retrieves system information
- ListDirectory: Lists files in a directory
- ScanPort: Simulates port scanning
- Terminate: Stops the client agent
This framework is designed for educational purposes only to demonstrate C2 concepts. It should not be used for any malicious purposes.
- .NET 9.0 SDK
- Windows OS (for the WPF server application)
This project is for educational use only.