This simulator aims to reduce the uncertainty involved in adversarial systems by using effective probing strategies to reduce the event spaces. It simulates attack graphs, where each node represents an event and edges represent causal relationships. By applying Bayesian inference and dynamic probability updates, it helps identify the most probable attack paths while pruning unlikely scenarios.
To install the required dependencies, run:
pip install -r requirements.txt
Ensure that requirements.txt contains all necessary libraries like gradio, networkx, numpy, plotly, etc.
Usage
1. Run the Simulation
You can run the attack graph simulation by invoking the following command in your terminal:
python attack_simulator.py
2. Input Logs
The simulator accepts logs from websites or other hackable platforms, parsed in a JSON-like format. Each log entry should contain actor, event, and timestamp.
Example log format:
[
{"actor": "user", "event": "login", "timestamp": "2026-01-25T12:00:00"},
{"actor": "attacker", "event": "exploit", "timestamp": "2026-01-25T12:05:00"}
]
3. Custom Probabilities
Optionally, you can input custom probabilities for each event in the attack graph. This helps in adjusting the likelihood of certain attack paths being more probable.
Example of custom probabilities JSON:
[
{"id": "user-login-event-1", "probability": 0.7},
{"id": "attacker-exploit-event-1", "probability": 0.9}
]
4. Running the Attack Simulation
After inputting the logs and probabilities, the simulator builds the attack graph, updates probabilities using Bayesian inference, and visualizes the most probable attack paths.
The simulation can be run through a Gradio interface, allowing real-time updates and visual exploration of the attack graph.
Features
Graph Building: Construct attack graphs based on input logs with actors, events, and timestamps.
Probability Engine: Dynamically adjust probabilities using Bayesian inference, refining the likelihood of events based on prior knowledge.
Graph Visualization: Visualize the attack graph interactively using Plotly and NetworkX for clear insights.
Dynamic Pruning: Prune unlikely paths based on probability thresholds, ensuring focus on the most probable attack scenarios.
Customizable Input: Customize event probabilities and add evidence to refine the attack graph simulation.
Requirements
Python 3.7+
Gradio
NetworkX
NumPy
Plotly
To install the necessary dependencies, run:
pip install -r requirements.txt
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.