Skip to content

MurtazaSaherwala/MARL-and-MADDPG

Repository files navigation

Multi-Agent Reinforcement Learning for Red Teaming & Penetration Testing

Python PyTorch License: MIT Last Commit Issues Stars

A final-year project implementing Multi-Agent Deep Deterministic Policy Gradient (MADDPG)
for simulating red-team penetration testing strategies in a cybersecurity environment.


📌 Overview

This project simulates a red-team penetration testing scenario using Multi-Agent Reinforcement Learning (MARL).
Agents represent attackers attempting to discover and exploit vulnerabilities in a simulated computer network,
with the ultimate goal of compromising a designated target node.


✨ Features

  • Multi-Agent environment for red-team style attack simulations.
  • Cybersecurity network modeled as a graph with nodes and services.
  • Implementation of MADDPG (Multi-Agent Deep Deterministic Policy Gradient).
  • Training and evaluation scripts with visualization support.
  • Custom Replay Buffer for experience replay.

📂 Project Structure

├── training.py # Main training loop

├── evaluate.py # Run trained agents

├── cyber_env.py # Custom cybersecurity environment

├── maddpg.py # MADDPG agent and neural networks

├── requirements.txt # Python dependencies

└── README.yaml # Project documentation


⚙️ Installation

  1. Clone the repository:
    git clone https://github.com/your-username/MARL-RedTeam.git
    cd MARL-RedTeam
  2. Create a virtual environment:
python3 -m venv venv
source venv/bin/activate   # Linux/Mac
venv\Scripts\activate      # Windows
  1. Install dependencies:
pip install -r requirements.txt

🚀 Training

Run the training script:

python training.py

Progress is displayed every 100 episodes with:

  • Average reward
  • Success rate

🧪 Evaluation

  • After training, save agent weights
  • Evaluate trained agents:
    python evaluate.py

📊 Visualization

During training, results are plotted:

  • Episode Rewards
  • Success Rate (rolling average)

The environment can also render:

  • Node states
  • Compromised systems

📦 Requirements

  • Python 3.10+
  • PyTorch
  • NumPy
  • NetworkX
  • Matplotlib

🔮 Future Work

  • More realistic vulnerability models
  • Blue-team (defender) agents -Larger, dynamic network topologies Transfer learning for different environments

📜 License

This project is licensed under the MIT License.

About

This is a research Repo for MARL using MADDPG

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages