How to Simulate Ransomware Attack Projects Using OMNeT++

To simulate a ransomware attack in OMNeT++ can be difficult as ransomware attacks usually includes file encryption and ransom demands, that are more software-oriented than purely network-based. but, we can simulate key contexts of a ransomware attack in OMNeT++ by concentrate on how the ransomware spreads via a network, how it interact with a Command and Control (C2) server, and how it impact networked systems (such as  blocking access to services, data exfiltration).

The below are the procedures to simulate the process in OMNeT++.

Steps to Simulate Ransomware Attack Projects in OMNeT++

  1. Set up OMNeT++ and INET Framework
  • Install OMNeT++: Download and install OMNeT++.
  • Install INET Framework: INET deliver the essential network protocols such as TCP, UDP, and IP that we will need for replicate network-based communication among devices. You can download it from the INET GitHub page.
  1. Understand Ransomware Network Behavior

A typical ransomware attack usually has the following phases:

  1. Initial Infection: A user downloads and implements the ransomware via malicious email attachments; drive-by downloads, etc.
  2. Lateral Movement: The ransomware spreads via the network to infect more systems (via SMB, RDP, or other protocols).
  3. Command and Control (C2) Communication: The infected system interacts with a remote server to create encryption keys, report infection status, or receive instructions.
  4. Data Exfiltration (Optional): Some ransomware variants exfiltrate sensitive data to the attacker’s server before encryption.
  5. Encryption: The ransomware encodes files, interpretation them inaccessible until a ransom is paid.
  1. Define the Network Topology (NED File)

To replicate a ransomware attack in a networked environment, generate a topology that contain legitimate hosts (end users and servers), an attacker node that spreads ransomware, and a Command and Control (C2) server to which the ransomware communicates.

Example NED File for Ransomware Attack Simulation:

network RansomwareAttackNetwork

{

submodules:

user1: StandardHost {

@display(“i=device/pc”);

}

user2: StandardHost {

@display(“i=device/pc”);

}

server: StandardHost {

@display(“i=device/server”);

}

attacker: StandardHost {

@display(“i=device/laptop”);

}

c2Server: StandardHost {

@display(“i=device/cloud”);

}

router: Router {

@display(“i=abstract/router”);

}

connections:

user1.pppg++ <–> PointToPointLink <–> router.pppg++;

user2.pppg++ <–> PointToPointLink <–> router.pppg++;

attacker.pppg++ <–> PointToPointLink <–> router.pppg++;

server.pppg++ <–> PointToPointLink <–> router.pppg++;

c2Server.pppg++ <–> PointToPointLink <–> router.pppg++;

}

In this network:

  • user1 and user2 are legitimate networked users.
  • server is a centralized resource (such as a file server or database server).
  • attacker simulates the node in which the ransomware originates or the infected machine that spreads the ransomware.
  • c2Server is the Command and Control server to that impacted machines communicate.
  • router associates all nodes in the network.
  1. Configure Legitimate Network Traffic

The legitimate users can interact with the server using standard protocols (like TCP or UDP). This configuration enables you to monitor on how the ransomware impacts normal network traffic and system behaviour.

Example Configuration for User-to-Server Communication in omnetpp.ini:

network = RansomwareAttackNetwork

sim-time-limit = 200s

# Legitimate TCP traffic from user1 to the server

*.user1.numTcpApps = 1

*.user1.tcpApp[0].typename = “TcpBasicClientApp”

*.user1.tcpApp[0].connectAddress = “server”

*.user1.tcpApp[0].connectPort = 80

*.user1.tcpApp[0].sendBytes = 100000  # Send 100KB of data

# Legitimate TCP traffic from user2 to the server

*.user2.numTcpApps = 1

*.user2.tcpApp[0].typename = “TcpBasicClientApp”

*.user2.tcpApp[0].connectAddress = “server”

*.user2.tcpApp[0].connectPort = 80

*.user2.tcpApp[0].sendBytes = 50000  # Send 50KB of data

# Configure server to respond to legitimate traffic

*.server.numTcpApps = 1

*.server.tcpApp[0].typename = “TcpBasicServerApp”

*.server.tcpApp[0].localPort = 80

  1. Implement the Ransomware Behavior

The ransomware behaviour in OMNeT++ can be emulated by the attacker sending malicious traffic to infect users and systems. This can contain spreading infection over the network, interacts with the C2 server, and replicates file encryption.

Example C++ Code for Simulating Ransomware Spread:

class Ransomware : public cSimpleModule

{

private:

simtime_t spreadInterval;  // Time interval between infection attempts

cMessage *spreadTimer;     // Timer for scheduling infection spread

protected:

virtual void initialize() override;

virtual void handleMessage(cMessage *msg) override;

void spreadInfection();

void communicateWithC2();

};

void Ransomware::initialize()

{

spreadInterval = par(“spreadInterval”);  // Infection spread interval

spreadTimer = new cMessage(“spreadTimer”);

scheduleAt(simTime(), spreadTimer);  // Start spreading the infection

}

void Ransomware::handleMessage(cMessage *msg)

{

if (msg == spreadTimer) {

spreadInfection();

scheduleAt(simTime() + spreadInterval, spreadTimer);  // Schedule the next infection attempt

}

}

void Ransomware::spreadInfection()

{

// Example of sending infection traffic to another user

EV << “Spreading ransomware infection to other users…\n”;

cPacket *infectPacket = new cPacket(“InfectionPacket”);

infectPacket->setByteLength(512);  // Example infection packet size

// Send infection attempt to user2 (this can be extended to infect other machines)

send(infectPacket, “out”);

// Simulate communication with C2 after infecting

communicateWithC2();

}

void Ransomware::communicateWithC2()

{

EV << “Communicating with Command and Control (C2) server…\n”;

cPacket *c2CommPacket = new cPacket(“C2CommunicationPacket”);

c2CommPacket->setByteLength(256);  // Packet size for C2 communication

send(c2CommPacket, “out”);

}

In this implementation:

  • spreadInfection() transmit malicious packets to other users or systems in the network, replicates on how ransomware spreads via the network.
  • communicateWithC2() simulates interaction with a C2 server after infection, implementing on how ransomware might report to a remote attacker or request encryption keys.
  1. Configure the Ransomware in omnetpp.ini

The .ini file will set up the ransomware’s behaviour that contain how frequently it spreads and interacts with the C2 server.

Example Configuration for Ransomware Attack in omnetpp.ini:

network = RansomwareAttackNetwork

sim-time-limit = 200s

# Configure the attacker to spread ransomware and communicate with C2

*.attacker.numApps = 1

*.attacker.app[0].typename = “Ransomware”

*.attacker.app[0].spreadInterval = 10s  # Ransomware spreads every 10 seconds

# Legitimate traffic from user1 and user2 to the server

*.user1.numTcpApps = 1

*.user1.tcpApp[0].typename = “TcpBasicClientApp”

*.user1.tcpApp[0].connectAddress = “server”

*.user1.tcpApp[0].connectPort = 80

*.user1.tcpApp[0].sendBytes = 100000

*.user2.numTcpApps = 1

*.user2.tcpApp[0].typename = “TcpBasicClientApp”

*.user2.tcpApp[0].connectAddress = “server”

*.user2.tcpApp[0].connectPort = 80

*.user2.tcpApp[0].sendBytes = 50000

In this configuration:

  • The attacker spreads ransomware every 10 seconds, targeting legitimate users in the network.
  • Legitimate users are sending normal traffic to the server.
  1. Run the Simulation

Once the network and ransomware attack features are set up, execute the simulation in OMNeT++ using Qtenv or Tkenv to envision the traffic flow and infection spread via the network.

  1. Analyse the Results

After executing the simulation, we can measure the following:

  • Infection Spread: track on how many users were infected by the ransomware over time.
  • Communication with C2 Server: track the frequency and volume of communication among affected systems and the C2 server.
  • Impact on Legitimate Traffic: Evaluate how the ransomware affected legitimate network traffic that contains latency or packet loss.
  1. Extend the Simulation

Here are a few ways to prolong the simulation of a ransomware attack:

  1. Lateral Movement: Emulate how the ransomware moves laterally by infecting other systems in the network (such as SMB protocol-based spread).
  2. Encryption Simulation: incorporate behaviours to simulate “file encryption” by delaying legitimate communication or simulating service unavailability on infected systems.
  3. Ransom Note Delivery: Replicate the ransom demand by transmits special messages or commands to users after infection.
  4. Data Exfiltration: Apply the data exfiltration phase, in which sensitive data is transmitting to the attacker’s C2 server before file encryption.
  5. Defensive Mechanisms: Execute network-based defence mechanisms such as Intrusion Detection Systems (IDS), firewalls, or antivirus detection for ransomware traffic.

Example Project Structure:

RansomwareAttackSimulation/

├── src/

│   └── RansomwareAttackNetwork.ned     # Network topology for ransomware attack

│   └── Ransomware.cc                   # Ransomware behavior implementation

├── omnetpp.ini                         # Simulation configuration

└── Makefile                            # Build file for compiling the project

 

In the above demonstration we provide the complete simulation process procedures to execute the ransom aware attack that executes in OMNeT++ tool. If you did like to know more details regarding the layer 3 routed protocol let me know!

Hit up phdprime.com with all your project requirements, including your base and reference papers, and we’ll provide you with thorough results. Need help with a Command and Control (C2) server for your projects? We’ve got you covered. Let phdprime.com take care of your Ransomware Attack Projects simulation, and we guarantee you’ll receive your simulated results promptly and with top-notch quality.

Opening Time

9:00am

Lunch Time

12:30pm

Break Time

4:00pm

Closing Time

6:30pm

  • award1
  • award2