Skip to content

This project simulates random walks on graphs and incorporates a Man-in-the-Middle (MitM) attack simulator targeting the nodes within the graph.

Notifications You must be signed in to change notification settings

Kaushal1011/CS441ManInMiddleAttackSimulator

Repository files navigation

CS441ManInMiddleAttackSimulator

The video explains and showcases what the program can do.

Overview

This project simulates random walks on graphs and incorporates a Man-in-the-Middle (MitM) attack simulator targeting the nodes within the graph. The graphs have been produced by Dr Mark Grechanik's NetGameSim repository. The project aims to shed light on the potential vulnerabilities and robustness of networks against MitM attacks. Utilizing Apache Spark and GraphX, the simulator provides insights into how successful or failed attacks transpire based on the network's structure and nodes' properties.

The linked file contains a detailed overview of the algorithms used in this project for:

  1. Random Walk
  2. MitM Attack

Requirements

  • Apache Spark
  • GraphX library for Spark
  • Typesafe Config library

Setup

  1. Clone the repository:
    git clone
    
  2. Build the project:
    sbt clean compile assembly
    This will create a jar file in the target/scala-2.12 directory.
  3. Run Tests:
    sbt test
    This will run the tests in the src/test/scala directory.

Usage

  1. Configuration:

    • Use the ConfigFactory to load configurations regarding the simulation settings such as walk length, initial nodes percentage, and simulation iterations.
  2. Execution:

    # Using spark-submit
    spark-submit --class Main [path_to_jar] <nodeFileOG> <nodeFilePath> <edgeFilePath> <outputFilePath>

    Arguments:

    • nodeFileOG: Original graph's node file path.
    • nodeFilePath: Perturbed graph's node file path.
    • edgeFilePath: Perturbed graph's edge file path.
    • outputFilePath: Path where the output stats will be saved.

example run instructions:

spark-submit --class Main ./target/scala-2.12/CS441HW2MitM-assembly-0.1.0-SNAPSHOT.jar ./input/NodesOut.txt ./input/NodesPerturbedOut.txt ./input/EdgesPerturbedOut.txt ./output/sparkS
  1. Output:
    • The results include the number of successful, failed, misidentified, and uneventful attacks.
    • These stats are saved to the specified output file for further analysis.

Visualization

The repo is accompanied by a submodule capabale of visualising the random walks made during a run. The project produces a logs file in the log directory that log file can be processed by the LogViz module accompanied by the project. It will take input the log file and produce log file for each iteration such that it can be uploaded and visualised by the Visualiser. Example of the visualisation is shown below.

For initial graph (red nodes are initial nodes, blue are the ones that were walked).

initial

This is how the walk progresses

walk

Some examples of the log files which can be visualised are placed in Example Vis Logs directory. These can be uploaded to Visualiser to see the visualisation live.

Features

  1. Graph Construction:

    • Parses nodes and edges from input files to create a graph representation.
    • Allows dynamic linking of nodes and their respective edges for flexibility.
  2. Random Walk:

    • Simulates random walks on the graph, starting from a subset of nodes.
    • The walks are directed based on the neighbors of the current node.
  3. Man-in-the-Middle Attack:

    • For each node visited during the random walk, the simulator attempts a MitM attack.
    • Tracks successful, failed, misidentified, and uneventful attacks for analysis.
  4. Configurable Parameters:

    • Enables configuration of the walk length, initial node percentages, and number of iterations for simulation.
    • Provides flexibility for research experiments.
  5. Logging & Output:

    • Offers comprehensive logging for tracking the flow and results of the simulations.
    • Saves summarized statistics to an output file.

About

This project simulates random walks on graphs and incorporates a Man-in-the-Middle (MitM) attack simulator targeting the nodes within the graph.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages