Skip to content

AI-assisted ethical hacking framework using Kali Linux, Docker, and MCP

Notifications You must be signed in to change notification settings

Foolish-admin/Docker-Kali-MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kali-MCP

AI-Assisted Ethical Hacking Framework (Execution-Grounded)


Overview

Kali-MCP is an AI-assisted ethical hacking framework that integrates a large language model (Claude) with a real Kali Linux execution environment using the Model Context Protocol (MCP).

Unlike prompt-only AI systems, this framework executes real commands inside Kali Linux and forces the AI to reason strictly based on actual command output.

This prevents hallucination and ensures evidence-based decision making.


Key Concept

Most AI security tools can only:

  • Suggest commands
  • Explain attack paths
  • Assume expected results

Kali-MCP goes further:

  • Executes real tools (Nmap, Metasploit, etc.)
  • Returns raw stdout/stderr
  • Enforces execution-grounded reasoning
  • Prevents simulated outputs

Architecture

Claude (AI Model) ↓ MCP Bridge (JSON-RPC stdio) ↓ Kali MCP Server (Flask API) ↓ Kali Linux Docker Container ↓ Real Security Tools

The MCP layer acts as a strict execution contract between the AI and the operating system.


Features

  • Real Kali Linux (kali-rolling)
  • Docker-isolated execution
  • Model Context Protocol (MCP) integration
  • JSON-RPC tool interface
  • Evidence-based AI reasoning
  • Portable architecture

Project Structure

kali-mcp-project/
│
├── bridge/
│   └── kali_mcp_stdio.py
│
├── docker/
│   ├── Dockerfile
│   └── kali_mcp_server.py
│
├── requirements.txt
│
├── claude_config_example.json
│
└── README.md

Prerequisites

You must install:

  • Docker Desktop (with WSL2 enabled)
  • Python 3.10+
  • Claude Desktop (with MCP support enabled)

Installation

1. Clone Repository

git clone https://github.com/Foolish-admin/Docker-Kali-MCP.git
cd Docker-Kali-MCP

2. Install Python Dependencies

pip install -r requirements.txt

3. Build Docker Image

docker build -t kali-mcp docker/

4. Run Container

docker run -d -p 5000:5000 --name kali-mcp kali-mcp

5. Configure Claude MCP

Copy claude_config_example.json into your Claude config directory and adjust if needed.

Ensure the bridge path points to:

bridge/kali_mcp_stdio.py

Usage

Once running, the AI can call the MCP tool:

  • Tool name: kali_run
  • Input: shell command string
  • Output: raw stdout, stderr, return code

Example:

nmap -sV 192.168.1.10

The output returned to the AI is always the real execution result.


Example Workflow

  1. AI performs reconnaissance
  2. Enumerates services
  3. Identifies vulnerabilities
  4. Executes exploitation tools
  5. Adapts strategy based on real output

All reasoning is grounded in actual system responses.


Ethical Use Disclaimer

This project is strictly for:

  • Educational purposes
  • Authorized lab environments
  • Capture The Flag (CTF) platforms
  • Controlled security research

Do NOT use against systems without explicit authorization.

The author is not responsible for misuse.


Author

Sai Charan Nalagarla

About

AI-assisted ethical hacking framework using Kali Linux, Docker, and MCP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published