# mohamed2007sarhan/shad0wsploit2 architecture

> Architecture diagram of the GitHub repository mohamed2007sarhan/shad0wsploit2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohamed2007sarhan/shad0wsploit2
- Repository: https://github.com/mohamed2007sarhan/shad0wsploit2

## Overview

Shad0wSploit is a CLI ReAct agent: a user starts or resumes a task, the orchestrator gathers task context, asks an LLM for the next action, runs a discovered tool, and uses its output to continue or finish. Persistent task state and cross-task deductions support recovery and learning. The tool tree also exposes system, network, web, and repository operations. The graph follows README capabilities and sampled entry-point and memory code; unsampled tool wiring and individual tool behavior are represented only where the tree or README supports them.

Main entry points: [`main_agent.py`](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py) (Tool execution), [`memory/memory_manager.py`](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py) (Memory manager), [`tools/run_shell.py`](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/run_shell.py) (Shell tools), [`tools/process_manager.py`](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/process_manager.py) (Process control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent runtime"]
  node_cli["Task CLI<br/>[main_agent.py]"]
  node_orchestrator["ReAct orchestrator<br/>[main_agent.py]"]
  node_discovery["Tool discovery"]
  node_runner["Tool execution<br/>[main_agent.py]"]
end

subgraph group_memory["Task memory"]
  node_memory_manager["Memory manager<br/>[memory_manager.py]"]
  node_task_store[("Task database<br/>[memory_manager.py]")]
  node_task_files["Task workspace<br/>[memory_manager.py]"]
end

subgraph group_tools["Tool arsenal"]
  node_shell["Shell tools<br/>[run_shell.py]"]
  node_files["File operations<br/>[file_manager.py]"]
  node_processes["Process control<br/>[process_manager.py]"]
  node_network["Network tools<br/>[port_scanner.py]"]
  node_web["Web search tools<br/>[web_search.py]"]
  node_git["Git operations<br/>[git_manager.py]"]
end

subgraph group_integrations["External systems"]
  node_model["Language model"]
  node_host["Local host"]
  node_web_services["Web services"]
  node_git_remote["Git remote"]
end

node_user(("User"))

node_user -->|"starts or resumes"| node_cli
node_cli -->|"enters task loop"| node_orchestrator
node_orchestrator -->|"loads and saves state"| node_memory_manager
node_memory_manager -->|"reads and writes tasks"| node_task_store
node_memory_manager -->|"reads and writes workspace"| node_task_files
node_orchestrator -->|"requests next action"| node_model
node_model -->|"returns response"| node_orchestrator
node_orchestrator -->|"finds tool signatures"| node_discovery
node_orchestrator -->|"dispatches action"| node_runner
node_runner -->|"runs command"| node_shell
node_runner -->|"runs file action"| node_files
node_runner -->|"runs process action"| node_processes
node_runner -->|"runs network action"| node_network
node_runner -->|"runs search action"| node_web
node_runner -->|"runs git action"| node_git
node_shell -->|"executes on"| node_host
node_processes -->|"inspects or controls"| node_host
node_network -->|"queries targets"| node_web_services
node_web -->|"searches"| node_web_services
node_git -->|"pushes or pulls"| node_git_remote

click node_cli "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py"
click node_orchestrator "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py"
click node_discovery "https://github.com/mohamed2007sarhan/shad0wsploit2/tree/main/tools"
click node_runner "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py"
click node_memory_manager "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py"
click node_task_store "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py"
click node_task_files "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py"
click node_shell "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/run_shell.py"
click node_files "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/file_manager.py"
click node_processes "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/process_manager.py"
click node_network "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/port_scanner.py"
click node_web "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/web_search.py"
click node_git "https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/git_manager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_orchestrator,node_discovery,node_runner,node_user toneBlue
class node_memory_manager,node_task_store,node_task_files toneAmber
class node_shell,node_files,node_processes,node_network,node_web,node_git toneMint
class node_model,node_host,node_web_services,node_git_remote toneRose
```

## Components

### Agent runtime

- [Task CLI](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py): `main_agent.py`
- [ReAct orchestrator](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py): `main_agent.py`
- [Tool discovery](https://github.com/mohamed2007sarhan/shad0wsploit2/tree/main/tools): `tools`
- [Tool execution](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/main_agent.py): `main_agent.py`

### Task memory

- [Memory manager](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py): `memory/memory_manager.py`
- [Task database](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py): `memory/memory_manager.py`
- [Task workspace](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/memory/memory_manager.py): `memory/memory_manager.py`

### Tool arsenal

- [Shell tools](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/run_shell.py): `tools/run_shell.py`
- [File operations](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/file_manager.py): `tools/file_manager.py`
- [Process control](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/process_manager.py): `tools/process_manager.py`
- [Network tools](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/port_scanner.py): `tools/port_scanner.py`
- [Web search tools](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/web_search.py): `tools/web_search.py`
- [Git operations](https://github.com/mohamed2007sarhan/shad0wsploit2/blob/main/tools/git_manager.py): `tools/git_manager.py`

### External systems

- **Language model**
- **Local host**
- **Web services**
- **Git remote**

### Other components

- **User**

## Connections

- User → Task CLI: starts or resumes
- Task CLI → ReAct orchestrator: enters task loop
- ReAct orchestrator → Memory manager: loads and saves state
- Memory manager → Task database: reads and writes tasks
- Memory manager → Task workspace: reads and writes workspace
- ReAct orchestrator → Language model: requests next action
- Language model → ReAct orchestrator: returns response
- ReAct orchestrator → Tool discovery: finds tool signatures
- ReAct orchestrator → Tool execution: dispatches action
- Tool execution → Shell tools: runs command
- Tool execution → File operations: runs file action
- Tool execution → Process control: runs process action
- Tool execution → Network tools: runs network action
- Tool execution → Web search tools: runs search action
- Tool execution → Git operations: runs git action
- Shell tools → Local host: executes on
- Process control → Local host: inspects or controls
- Network tools → Web services: queries targets
- Web search tools → Web services: searches
- Git operations → Git remote: pushes or pulls
