Skip to content

An educational Command and Control (C2) attack framework simulation designed for cybersecurity education and demonstration purposes.

Notifications You must be signed in to change notification settings

arhadnane/C2SimulationFramework

Repository files navigation

C2 Simulation Framework

This project is an educational Command and Control (C2) attack framework simulation designed for cybersecurity education and demonstration purposes.

Project Structure

The solution consists of three projects:

  1. C2SimulationFramework.Common: Shared library containing communication protocols, message types, and security utilities.
  2. C2SimulationFramework.Client: C2 agent/client console application that simulates a compromised system.
  3. C2SimulationFramework.Server: WPF-based C2 server application with a user interface for managing connected clients and sending commands.

Features

  • 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

Running the Demo

The easiest way to test the application is to use the included RunDemo.bat script:

  1. Open a command prompt or PowerShell window
  2. Navigate to the solution root folder
  3. Run .\RunDemo.bat
  4. The script will build the solution and start both the server and client applications
  5. The server starts first, followed by the client after a 5-second delay
  6. 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

How to Run

Option 1: Using the Demo Script

  1. Run the RunDemo.bat script, which will:
    • Build the solution
    • Start the C2 server
    • Wait 5 seconds
    • Start a client agent

Option 2: Manual Execution

  1. Build the solution:

    dotnet build
    
  2. Start the server:

    dotnet run --project C2SimulationFramework.Server\C2SimulationFramework.Server.csproj
    
  3. Start one or more client agents:

    dotnet run --project C2SimulationFramework.Client\C2SimulationFramework.Client.csproj
    

Usage Instructions

  1. 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"
  2. The client will:

    • Register with the server
    • Receive and execute commands
    • Send responses back to the server

Supported Commands

  • 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

Educational Purpose

This framework is designed for educational purposes only to demonstrate C2 concepts. It should not be used for any malicious purposes.

Requirements

  • .NET 9.0 SDK
  • Windows OS (for the WPF server application)

License

This project is for educational use only.

About

An educational Command and Control (C2) attack framework simulation designed for cybersecurity education and demonstration purposes.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published