[WIP] "Kali Linux Security Scanner" #1
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coding agent has begun work on "Kali Linux Security Scanner" and will replace this description as work progresses.
See problem context
to private network ranges only
Legal and Ethical Guidelines
License
MIT License - Educational Use Only
Network Security
The server enforces strict network boundaries:
Performance Considerations
Educational Context
This tool is designed for:
Compliance Notes
Future Enhancements
Potential additions:
Testing
Test the implementation with:
Maintenance
Regular maintenance tasks:
Step 2: Build Docker Image
docker build -t kali-security-mcp-server .Note: This may take several minutes as it downloads Kali Linux and installs security tools.
Step 3: Create Custom Catalog
Add this entry to custom.yaml:
Step 4: Update Registry
Add this entry under the existing
registry:key:IMPORTANT: The entry must be under the
registry:key, not at the root level.Step 5: Configure Claude Desktop
Find your Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonEdit the file and add your custom catalog to the args array:
{ "mcpServers": { "mcp-toolkit-gateway": { "command": "docker", "args": [ "run", "-i", "--rm", "-v", "/var/run/docker.sock:/var/run/docker.sock", "-v", "[YOUR_HOME]/.docker/mcp:/mcp", "docker/mcp-gateway", "--catalog=/mcp/catalogs/docker-mcp.yaml", "--catalog=/mcp/catalogs/custom.yaml", "--config=/mcp/config.yaml", "--registry=/mcp/registry.yaml", "--tools-config=/mcp/tools.yaml", "--transport=stdio" ] } } }Replace
[YOUR_HOME]with:/Users/your_usernameC:\\Users\\your_username(use double backslashes)/home/your_usernameStep 6: Restart Claude Desktop
Step 7: Test Your Server
Step 8: Configure Environment (Optional)
Step 9: Safety and Legal Reminders
Usage Examples
Once installed, you can ask Claude:
Your Kali Linux security MCP server is now ready for educational penetration testing! 🔒
User: execute and run everything
AI: I'll execute and set up the complete Kali Linux Security MCP server for you. Let me create all the files and run the installation process.
AI:
AI: Let me fix the entire import section and error handling:
AI:
Now let's replace McpError with ValueError for proper error handling:
AI:
Let me fix the wpscan function properly by replacing the enumerate reference in the function body:
AI:
Now let me fix the remaining McpError references systematically:
AI: Let me also create the Docker Compose file and deployment scripts:
AI: Now let's execute the complete deployment:
AI: Let me check the execution policy and run the script properly:
AI: Let me check what files we have and fix the script execution:
AI: I need to go back to the correct directory where we created the files:
AI: Great! Now let me run the deployment script with proper PowerShell execution:
AI: Let me run the deployment manually since the script execution is having issues:
User: @agent Continue: "Continue to iterate?"
AI: I notice we're in the wrong directory. Let me get back to the correct location and build:
AI: The build failed because the MCP version is incorrect. Let me fix the requirements.txt file:
AI:
AI: Let me check if we're in the right directory and try again:
AI: I can see we're in the wrong directory. Let me navigate to the MCP server directory and build properly:
AI: Excellent! The Docker build was successful. Now let me start the container:
AI: There's a network conflict. Let me fix the docker-compose network configuration:
AI:
AI: Let me try without the custom network to avoid conflicts:
AI:
AI:
AI: Perfect! Now let me test the container and configure Claude Desktop:
AI: Excellent! Now let me create a script to automatically configure Claude Desktop:
AI: Let me fix the PowerShell script syntax:
AI:
AI: Let me manually configure Claude Desktop instead:
AI: Perfect! Now let me create a final summary and test script:
AI: Let me run a simpler validation command directly:
AI: Perfect! Let me create a final deployment summary:
AI: ## 🎉 DEPLOYMENT COMPLETE!
I have successfully implemented and executed the complete Kali Linux Security MCP Server for Claude Desktop integration! Here's what has been accomplished:
✅ Fully Operational Security Platform
🛡️ Docker Container Status:
kali-security-mcp-server🔧 Claude Desktop Integration:
🎯 Ready to Use Immediately
Next Steps:
📋 Project Structure Created
🛡️ Security Features Implemented
📊 Management Commands
docker-compose up -ddocker-compose downdocker-compose logs -fdocker exec -it kali-security-mcp-server bashThe complete penetration testing toolkit is now ready for authorized security assessments through Claude Desktop's intuitive natural language interface!
User: What you’re looking at
You (or Copilot) just built and launched a Docker container called kali-security-mcp-server from the repo docker-mcp-tutorial/kali-security-mcp-server. The right panel shows “DEPLOYMENT COMPLETE!”, and the terminal confirms:
The container is running.
A bunch of security tools (nmap, nikto, wpscan, dirb, whatweb, gobuster, etc.) were installed inside the container.
A Claude Desktop MCP configuration file was written so Claude can talk to that server via MCP. (The path in your log looks like C:\Users\admin\AppData\Roaming\Claude\claude_desktop_config.json.)
It printed “Ready to use immediately” with example commands (e.g., run nikto or nmap via Claude).
This is separate from your Ray cluster. It shouldn’t touch ports 7399/8366/10011 — so Ray work can continue. This MCP thing is just a helper service to let Claude/Copilot issue security scans on your LAN through Docker.
Quick verify (from PowerShell)
See the container
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
Tail logs
docker logs -f kali-security-mcp-server
If Claude Desktop is open, it should now have an MCP tool called something like kali-security-mcp-server. You can try, for example:
“scan 192.168.1.100 with nmap”
“run nikto scan on http://192.168.1.100/”
Common follow-ups
Restart Claude Desktop (it reads the config on startup).
Ask: “Run nmap scan on 192.168.1.100” or “Nikto scan on http://192.168.1.100/”
.
Claude will call the MCP server in that Docker container and stream results.
notepad "C:\Users\admin\AppData\Roaming\Claude\claude_desktop_config.json"
You can change tool names or allowed commands there (then restart Claude Desktop).
docker stop kali-security-mcp-server
docker rm kali-security-mcp-server
(Optional) remove the image and free space:
docker images | findstr kali-security-mcp-server
docker rmi <IMAGE_ID>
(Optional) remove Claude’s MCP config so it disappears from tools:
del "C:\Users\admin\AppData\Roaming\Claude\claude_desktop_config.json"
Your Ray ports: 7399 (GCS), 8366 (Dashboard), 10011 (Client), 12000–12999 (Workers).
MCP container typically exposes its own internal port(s); verify with:
docker ps --format "table {{.Names}}\t{{.Ports}}"
netstat -ano | findstr ":7399 :8366 :10011"
You should still see Ray listening on your ports and no conflicts.
If your goal was only the Ray cluster
You can safely leave this container running (it’s idle unless you call it), or stop it using the commands above. It won’t affect your 100G links or Ray unless you explicitly ask Claude to use it.
Suggested next move
If you want the Tower Two worker online: go back to the black CMD on Tower Two and run the 3 lines we set (with --block). Then on DEXTER:
& "C:\rayenv\Scripts\ray.exe" status --address="192.168.100.2:7399"
Start-Process "http://192.168.100.2:8366"
You should see 2 ALIVE nodes. Can we connect everything with the 100 gigabyte network please They both can see each other I just need them to talk to one another and transfer data
AI: I can see you've successfully deployed the Kali Security MCP server, but your main goal is getting the Ray cluster running with the 100Gb network connection between your nodes. Let me help you get Tower Two connected to your Ray cluster running on DEXTER.
AI: Good! The Ray cluster is running on DEXTER, but I can see only 1 node is active. Let's check the network connectivity and make sure Tower Two can reach DEXTER on the 100Gb network:
AI: I can see that Tower Two (192.168.100.3) is not reachable via ping, which explains why it's not connecting to the Ray cluster. Let me check the network configuration more carefully:
AI: Great! I can see the network configuration. You have dual Mellanox ConnectX-5 adapters configured with 100Gb connectivity:
The issue is that 192.168.100.3 (Tower Two) is on a /30 subnet from 192.168.100.2, so it should be reachable. Let me check if there are any firewall rules blocking the connection:
AI: The firewall is enabled on all profiles and there are no specific Ray port rules. Let me check if we can connect directly to Tower Two on a different port and create proper firewall rules:
AI: Tower Two is not responding on any ports. Let me create firewall rules for Ray and then check if there are any ARP entries for Tower Two:
AI: I need to run PowerShell as administrator to add firewall rules. However, I can see that Tower Two (192.168.100.3) shows up in the ARP table with a broadcast MAC address (ff-ff-ff-ff-ff-ff), which indicates there's no actual device responding at that IP.
Let me check what IPs are actually active on the network:
AI: Interesting! I can see that:
Let me test if Tower Two is actually at 192.168.100.1:
AI: Good! 192.168.100.1 is responding to pings (4ms RTT), but it's not running Ray or SSH services. Also notice it's going through the Wi-Fi interface instead of the 100Gb Ethernet. Let me connect Tower Two to the Ray cluster at the correct IP:
AI: Perfect! Tower Two is at 192.168.100.1 and responding well (4ms latency). Now I need to help you connect Tower Two to the Ray cluster. Since I can't directly access Tower Two from here, I'll provide you with the exact commands to run on Tower Two to join the Ray cluster:
Ray Cluster Connection Instructions
To connect Tower Two (192.168.100.1) to your Ray cluster running on DEXTER (192.168.100.2), you need to run these commands on Tower Two:
1. On Tower Two - Join as Ray Worker
2. Verify the Connection
After running the worker command on Tower Two, check the cluster status from DEXTER:
AI: Still showing only 1 node. Let me also create a proper firewall rule and check what the routing looks like for the 100Gb network:
AI: I can see that Ray has many local connections but no external connections from Tower Two. The routing shows that 192.168.100.3 is configured but not where Tower Two actually is (192.168.100.1).
Solution: Connect Tower Two at 192.168.100.1
To establish your Ray cluster with 100Gb connectivity, you need to run this command on Tower Two (192.168.100.1):
Alternative: If Ray isn't installed on Tower Two
If Ray isn't installed on Tower Two yet, first install it:
Test High-Speed Data Transfer
Once Tower Two is connected, let's test the 100Gb network performance:
AI: Perfect! I've created a test script. Now let me summarize the complete solution:
🚀 Ray Cluster Setup Summary
Current Status:
Next Steps:
On Tower Two (192.168.100.1), run:
ray start --address='192.168.100.2:7399' --num-cpus=64 --num-gpus=2Test the cluster with:
Monitor data transfer speed:
The 100Gb network should provide excellent performance for distributed computing workloads.
Expected Result:
Once Tower Two joins the cluster, you'll have a powerful distributed computing setup with ultra-high-speed networking for data transfer between the nodes! 🎯
Would you like me to help monitor the cluster status once Tower Two is connected, or do you need assistance with any specific distributed computing workloads?
User: 1) On DEXTER (PowerShell Administrator) – start the HEAD
Copy–paste exactly; leave the window open (it blocks on purpose).
set RAY_ENABLE_WINDOWS_OR_OSX_CLUSTER=1 ^
& set RAY_USAGE_STATS_ENABLED=0 ^
& C:\rayenv\Scripts\python.exe -m ray stop ^
& C:\rayenv\Scripts\python.exe -m ray start --head --node-ip-address=192.168.100.2 --port=7399 --dashboard-host=0.0.0.0 --dashboard-port=8366 --ray-client-server-port=10011 --min-worker-port=12000 --max-worker-port=12999 --disable-usage-stats --block
You should see near the bottom: Ray runtime started.
(Optional check in a new admin PowerShell on DEXTER):
netstat -ano | findstr ":7399"
netstat -ano | findstr ":8366"
netstat -ano | findstr ":10011"
You should see LISTENING on 192.168.100.2 for those ports.
Your earlier output showed the Mellanox adapter holding 192.168.101.9 and a different adapter with 192.168.100.1.
You need the Mellanox/ConnectX port that’s cabled to DEXTER to have 192.168.100.1/30 and nothing else on that /30.
Run this exactly in PowerShell (Administrator) on Tower Two:
Find the Mellanox / ConnectX NIC that is UP
$if = $mlx.Name
"$($mlx.InterfaceDescription) -> Using interface: $if"
Remove wrong IPs that may be on that Mellanox NIC (e.g., 192.168.101.9)
Get-NetIPAddress -InterfaceAlias $if -AddressFamily IPv4
| ? { $_.IPAddress -in @('192.168.101.9','192.168.100.2') }| Remove-NetIPAddress -Confirm:$false -ErrorAction SilentlyContinue
Ensure the correct /30 IP is on the Mellanox NIC
if (-not (Get-NetIPAddress -InterfaceAlias $if -AddressFamily IPv4 | ? IPAddress -eq '192.168.100.1')) {
New-NetIPAddress -InterfaceAlias $if -IPAddress 192.168.100.1 -PrefixLength 30 | Out-Null
}
(Optional) Enable jumbo on Tower Two now
Set-NetAdapterAdvancedProperty -Name $if -RegistryKeyword "*JumboPacket" -RegistryValue 9014 -ErrorAction SilentlyContinue
Set-NetIPInterface -InterfaceAlias $if -NlMtuBytes 8986 -ErrorAction SilentlyContinue
Show what that Mellanox NIC has now
Get-NetIPAddress -InterfaceAlias $if -AddressFamily IPv4 | Format-Table IPAddress,PrefixLength
Now test connectivity from Tower Two:
ping 192.168.100.2 -n 1
ping 192.168.100.2 -f -l 8958 -n 1 # jumbo (ok if this one fails for now)
Test-NetConnection 192.168.100.2 -Port 7399
If ping and Test‑NetConnection succeed (SourceAddress should be 192.168.100.1), you’re good to start the worker.
If they fail, stop here and tell me what the three commands returned.
set RAY_ENABLE_WINDOWS_OR_OSX_CLUSTER=1 ^
& set RAY_USAGE_STATS_ENABLED=0 ^
& C:\rayenv\Scripts\python.exe -m ray stop ^
& C:\rayenv\Scripts\python.exe -m ray start --address=192.168.100.2:7399 --node-ip-address=192.168.100.1 --min-worker-port=12000 --max-worker-port=12999 --disable-usage-stats --block
This will print that it connected to the head and then block.
C:\rayenv\Scripts\python.exe -m ray status --address="192.168.100.2:7399"
You should see 2 active nodes (DEXTER head + Tower Two worker).
Dashboard: http://192.168.100.2:8366
Why this is necessary
Your Tower Two screenshot showed:
Test-NetConnection 192.168.100.2 -Port 7399 failed
ping 192.168.100.2 Destination host unreachable
Yet the worker tried to start with Local node IP: 192.168.100.1
That pattern means Tower Two was not using the Mellanox port that’s actually cabled to DEXTER, or that Mellanox port had the wrong IP (we saw 192.168.101.9 earlier). Setting 192.168.100.1/30 on the Mellanox NIC and removing the wrong IP fixes the path. After that, starting the DEXTER head (step 1) and the Tower Two worker (step 3) will work.
AI: Here’s a step-by-step summary and checklist for your Ray cluster setup, based on your instructions and the context above:
Step 1: Start Ray Head on DEXTER (192.168.100.2)
Open PowerShell as Administrator and run:
Leave this window open.
You should see: Ray runtime started.
Optional: In a new admin PowerShell, check listening ports:
You should see LISTENING on 192.168.100.2 for those ports.
Step 2: Fix Tower Two NIC/IP (192.168.100.1/30)
On Tower Two, open PowerShell as Administrator and run:
Step 2b: Test Connectivity from Tower Two
Run these commands on Tower Two:
Step 3: Start Ray Worker on Tower Two
If step 2b succeeded, run in PowerShell Administrator:
You should see that it connected to the head and then block.
Step 4: Verify Cluster
On either machine:
You should see 2 active nodes (DEXTER head + Tower Two worker).
Dashboard: http://192.168.100.2:8366
If you encounter any errors during these steps, especially in step 2b, please copy the output and I’ll help you troubleshoot further.
Otherwise, once both nodes are active, your Ray cluster will be fully operational over the 100Gb Mellanox network!
User: implement this.
Original prompt
implement this.
to private network ranges only
Legal and Ethical Guidelines
License
MIT License - Educational Use Only
Network Security
The server enforces strict network boundaries:
Performance Considerations
Educational Context
This tool is designed for:
Compliance Notes
Future Enhancements
Potential additions:
Testing
Test the implementation with:
Maintenance
Regular maintenance tasks: