- Prerequisites Check
- WSL Kali Linux Setup
- Python Environment Setup
- Security Tools Installation
- HexStrike Server Configuration
- VS Code Copilot Integration
- Testing & Verification
- Usage Examples
- Troubleshooting
Before starting, verify you have the following:
- β Windows 10/11 (Build 19041 or higher)
- β WSL 2 with Kali Linux installed
- β VS Code installed on Windows
- β GitHub Copilot extension enabled in VS Code
- β Internet connection for downloading tools
Check WSL Version:
# Run in PowerShell
wsl --version
wsl --list --verboseExpected output should show WSL version 2 and Kali Linux running.
Check Kali Linux Access:
# Run in PowerShell - should open Kali terminal
wsl -d kali-linuxCheck VS Code and Copilot:
- Open VS Code
- Press
Ctrl+Shift+Xto open Extensions - Verify "GitHub Copilot" extension is installed and active
Open WSL Kali terminal and run:
# Update package list
sudo apt update
# Upgrade all packages
sudo apt upgrade -y
# Install essential build tools
sudo apt install -y build-essential curl wget git python3 python3-pip python3-venv# Check Python version (should be 3.8+)
python3 --version
# Check pip version
pip3 --version
# Verify virtual environment support
python3 -m venv --help# You mentioned your repo is at /home/saiba/hexstrike-ai
cd /home/saiba/hexstrike-ai
# Verify files are present
ls -laExpected output:
assets/
hexstrike-ai-mcp.json
hexstrike_mcp.py
hexstrike_server.py
README.md
requirements.txt
# Navigate to HexStrike directory
cd /home/saiba/hexstrike-ai
# Create virtual environment
python3 -m venv hexstrike-env
# Activate virtual environment
source hexstrike-env/bin/activate
# Your prompt should now show (hexstrike-env)# Upgrade pip to latest version
pip install --upgrade pip setuptools wheel
# Install HexStrike dependencies
pip install -r requirements.txtExpected packages to be installed:
- fastmcp
- mcp
- pydantic
- httpx
- selenium
- beautifulsoup4
- lxml
- python-dotenv
- aiohttp
- asyncio
- psutil
# Check installed packages
pip list
# Verify key packages
python3 -c "import fastmcp; print('FastMCP:', fastmcp.__version__)"
python3 -c "import mcp; print('MCP installed successfully')"HexStrike requires 150+ security tools. We'll install them in categories.
# Update repositories
sudo apt update && sudo apt upgrade -y
# Install build essentials FIRST
sudo apt install -y build-essential git curl wget python3-pip python3-dev gcc make cmake
# Install core network tools
sudo apt install -y nmap netcat-traditional dnsutils whois traceroute net-tools iproute2
# Install web application tools
sudo apt install -y gobuster feroxbuster ffuf nikto sqlmap wpscan dirb whatweb wafw00f
# Note: dirsearch and httpx-toolkit may not be in repos, install separately
# Install password/authentication tools
sudo apt install -y hydra john hashcat crackmapexec hash-identifier
# Note: medusa and patator may not be available in all Kali versions
# Install binary analysis tools - FIXED (strings/hexdump are in binutils)
sudo apt install -y gdb radare2 binwalk ghidra checksec file binutils xxd
# Install forensics tools - FIXED (volatility3 installed via pip)
sudo apt install -y foremost steghide exiftool binwalk sleuthkit autopsy
pip3 install volatility3
# Install miscellaneous tools
sudo apt install -y jq netcat socat libpcap-dev libssl-dev libssh-dev# Install Go FIRST (required for many tools)
sudo apt install -y golang-go
# Configure Go paths for your user (NOT root)
echo 'export GOPATH=~/go' >> ~/.bashrc
echo 'export PATH=$PATH:~/go/bin:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
# Verify Go installation
go version
# Install subdomain enumeration tools
sudo apt install -y amass subfinder assetfinder
# Install Nuclei (vulnerability scanner) - v3 is latest
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Update Nuclei templates (IMPORTANT!)
~/go/bin/nuclei -update-templates
# Install HTTPx
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
# Install Katana (web crawler)
go install github.com/projectdiscovery/katana/cmd/katana@latest
# Verify installations
~/go/bin/nuclei -version
~/go/bin/httpx -version
~/go/bin/katana -version# Masscan must be built from source
sudo apt install -y git gcc make libpcap-dev
git clone https://github.com/robertdavidgraham/masscan /opt/masscan
cd /opt/masscan
make
sudo make install
# Verify installation
masscan --version# Option 1: Install via Cargo (if Rust is installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
cargo install rustscan
# Option 2: Download pre-compiled binary (EASIER)
wget https://github.com/RustScan/RustScan/releases/download/2.1.1/rustscan_2.1.1_amd64.deb
sudo dpkg -i rustscan_2.1.1_amd64.deb
sudo apt --fix-broken install -y
# Verify
rustscan --version# Install Arjun (parameter discovery)
pip3 install arjun
# Install ParamSpider
git clone https://github.com/devanshbatham/ParamSpider /opt/ParamSpider
cd /opt/ParamSpider
pip3 install -r requirements.txt
sudo ln -s /opt/ParamSpider/paramspider.py /usr/local/bin/paramspider
# Install Dalfox (XSS scanner)
GO111MODULE=on go install github.com/hahwul/dalfox/v2@latest
# Install Wafw00f (WAF detection)
sudo apt install -y wafw00f# Install Prowler (AWS/Azure/GCP security)
pip3 install prowler
# Install ScoutSuite
pip3 install scoutsuite
# Install Trivy (container scanner)
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt update
sudo apt install -y trivy
# Install Docker (for container testing)
sudo apt install -y docker.io
sudo systemctl enable docker
sudo systemctl start docker# Install Chromium and ChromeDriver
sudo apt install -y chromium chromium-driver
# Or install Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
# Install Selenium dependencies
pip3 install selenium webdriver-manager# Install Pwntools
pip3 install pwntools
# Install ROPgadget
pip3 install ropgadget
# Install One-Gadget
sudo apt install -y ruby-full
sudo gem install one_gadget
# Install GDB-PEDA
git clone https://github.com/longld/peda.git /opt/peda
echo "source /opt/peda/peda.py" >> ~/.gdbinit
# Install Angr (binary analysis)
pip3 install angrCreate a verification script:
# Create tool checker with FIXED verification commands
cat > /home/saiba/hexstrike-ai/check_tools.sh << 'EOF'
#!/bin/bash
echo "=== HexStrike Tool Verification ==="
echo ""
# Core tools with corrected verification commands
tools=(
"nmap:which nmap"
"masscan:which masscan"
"rustscan:which rustscan"
"gobuster:which gobuster"
"feroxbuster:which feroxbuster"
"ffuf:which ffuf"
"nuclei:which nuclei"
"nikto:which nikto"
"sqlmap:which sqlmap"
"hydra:which hydra"
"john:which john"
"hashcat:which hashcat"
"gdb:which gdb"
"radare2:which radare2"
"ghidra:which ghidra"
"amass:which amass"
"subfinder:which subfinder"
"httpx:which httpx"
"trivy:which trivy"
"python3:which python3"
)
installed=0
missing=0
for tool in "${tools[@]}"; do
IFS=':' read -r name cmd <<< "$tool"
if eval "$cmd" &>/dev/null; then
echo "β
$name - Installed"
((installed++))
else
echo "β $name - Missing"
((missing++))
fi
done
echo ""
echo "Summary: $installed installed, $missing missing"
# Show paths for Go tools if not in standard PATH
if [ -d "$HOME/go/bin" ]; then
echo ""
echo "Go tools location: $HOME/go/bin"
echo "Make sure to add to PATH: export PATH=\$PATH:~/go/bin"
fi
EOF
# Make executable and run
chmod +x /home/saiba/hexstrike-ai/check_tools.sh
/home/saiba/hexstrike-ai/check_tools.sh# Activate virtual environment (if not already activated)
cd /home/saiba/hexstrike-ai
source hexstrike-env/bin/activate
# Test server startup
python3 hexstrike_server.py --help# Create startup script
cat > /home/saiba/hexstrike-ai/start_hexstrike.sh << 'EOF'
#!/bin/bash
# Navigate to HexStrike directory
cd /home/saiba/hexstrike-ai
# Activate virtual environment
source hexstrike-env/bin/activate
# Start HexStrike server
echo "Starting HexStrike AI MCP Server v6.0..."
python3 hexstrike_server.py --port 8888
# Keep terminal open on error
if [ $? -ne 0 ]; then
echo "Error: Server failed to start"
read -p "Press Enter to exit..."
fi
EOF
# Make executable
chmod +x /home/saiba/hexstrike-ai/start_hexstrike.sh# Start HexStrike server
/home/saiba/hexstrike-ai/start_hexstrike.shExpected output:
Starting HexStrike AI MCP Server v6.0...
[INFO] Server starting on port 8888
[INFO] Loading 150+ security tools
[INFO] Initializing 12+ AI agents
[INFO] Server ready for MCP connections
Keep this terminal open! The server must be running for Copilot to connect.
IMPORTANT: WSL Networking Configuration
WSL has its own IP address separate from Windows. You need to configure port forwarding.
Method 1: Test from WSL (Same Machine)
Open a new WSL terminal:
# Test server health from within WSL
curl http://localhost:8888/health
# Expected response:
# {"status": "healthy", "version": "6.0.0", "tools_loaded": 150}Method 2: Test from Windows
# First, get your WSL IP address (in WSL terminal)
hostname -I | awk '{print $1}'
# Note this IP (e.g., 172.25.51.244)Then in Windows PowerShell:
# Test using WSL IP
curl http://172.25.51.244:8888/health
# OR set up port forwarding (run as Administrator)
netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=172.25.51.244
# Now you can use localhost from Windows
curl http://localhost:8888/health
# Verify port forwarding
netsh interface portproxy show allMethod 3: Create Helper Script
# Create connection test script in WSL
cat > /home/saiba/hexstrike-ai/test_connection.sh << 'EOF'
#!/bin/bash
WSL_IP=$(hostname -I | awk '{print $1}')
echo "=== HexStrike Server Connection Test ==="
echo "WSL IP Address: $WSL_IP"
echo ""
echo "Testing from WSL..."
curl -s http://localhost:8888/health | jq || echo "β Server not responding"
echo ""
echo "To access from Windows, use:"
echo " http://$WSL_IP:8888/health"
echo ""
echo "To set up port forwarding (Windows PowerShell as Admin):"
echo " netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=$WSL_IP"
EOF
chmod +x /home/saiba/hexstrike-ai/test_connection.sh
./test_connection.shCRITICAL: WSL Network Configuration
WSL runs on its own network (Mirrored mode). Get your WSL IP:
# In WSL terminal, get IP address
hostname -I | awk '{print $1}'
# Example output: 172.25.51.244Set Up Windows Port Forwarding (REQUIRED)
In Windows PowerShell (Run as Administrator):
# Replace 172.25.51.244 with YOUR WSL IP from above
netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=172.25.51.244
# Verify it was added
netsh interface portproxy show all
# Allow through Windows Firewall
New-NetFirewallRule -DisplayName "HexStrike MCP Server" -Direction Inbound -LocalPort 8888 -Protocol TCP -Action AllowNote: If your WSL IP changes after reboot, you'll need to update the port forwarding:
# Remove old forwarding
netsh interface portproxy delete v4tov4 listenport=8888 listenaddress=0.0.0.0
# Add new one with updated IP
netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=<NEW_WSL_IP># Get full Windows path to HexStrike
wslpath -w /home/saiba/hexstrike-ai/hexstrike_mcp.py
# Example output: \\wsl$\kali-linux\home\saiba\hexstrike-ai\hexstrike_mcp.py# Get full path to Python in virtual environment
which python3
# Expected: /home/saiba/hexstrike-ai/hexstrike-env/bin/python3Option A: Using VS Code Settings (Recommended)
- Open VS Code on Windows
- Press
Ctrl+Shift+Pand type "Preferences: Open User Settings (JSON)" - Add the MCP configuration:
{
"github.copilot.chat.codeGeneration.instructions": [],
"github.copilot.advanced": {},
"chat.commandCenter.enabled": true,
"github.copilot.chat.tools.enabled": true,
"github.copilot.chat.tools": {
"hexstrike-ai": {
"type": "mcp",
"command": "wsl",
"args": [
"-d",
"kali-linux",
"/home/saiba/hexstrike-ai/hexstrike-env/bin/python3",
"/home/saiba/hexstrike-ai/hexstrike_mcp.py",
"--server",
"http://localhost:8888"
],
"env": {
"HEXSTRIKE_SERVER": "http://localhost:8888"
},
"description": "HexStrike AI v6.0 - Advanced Cybersecurity Automation with 150+ tools and 12+ AI agents",
"enabled": true
}
}
}Option B: Using Workspace Settings
- Create a workspace folder for your security testing
- Open the folder in VS Code
- Create
.vscode/settings.json:
# In Windows PowerShell, create workspace
mkdir C:\SecurityTesting
cd C:\SecurityTesting
code .- In VS Code, create
.vscode/settings.json:
{
"github.copilot.chat.tools.enabled": true,
"github.copilot.chat.tools": {
"hexstrike-ai": {
"type": "mcp",
"command": "wsl",
"args": [
"-d",
"kali-linux",
"/home/saiba/hexstrike-ai/hexstrike-env/bin/python3",
"/home/saiba/hexstrike-ai/hexstrike_mcp.py",
"--server",
"http://localhost:8888"
],
"env": {
"HEXSTRIKE_SERVER": "http://localhost:8888",
"WSL_DISTRO_NAME": "kali-linux"
},
"description": "HexStrike AI MCP v6.0 - Cybersecurity Automation Platform",
"enabled": true,
"timeout": 300000
}
}
}- Open VS Code
- Press
Ctrl+Shift+X - Search for "WSL"
- Install "WSL" extension by Microsoft
- Reload VS Code
- Open VS Code
- Press
Ctrl+Shift+P - Type "Reload Window" and press Enter
- Open Copilot Chat (
Ctrl+Alt+Ior click chat icon) - Type:
@workspace what MCP tools are available?
Expected response should mention HexStrike tools.
In WSL terminal:
# Verify server is running
curl http://localhost:8888/health | jq
# Expected output:
# {
# "status": "healthy",
# "version": "6.0.0",
# "tools_available": 150,
# "agents_loaded": 12,
# "uptime": "5m 30s"
# }# Check available tools
curl http://localhost:8888/api/tools/list | jq
# Test specific tool
curl -X POST http://localhost:8888/api/command \
-H "Content-Type: application/json" \
-d '{"command": "nmap --version"}' | jqIn VS Code Copilot Chat, try these prompts:
Test 1: Tool Discovery
Prompt: "What HexStrike security tools are available?"
Test 2: Simple Scan
Prompt: "I'm a security researcher testing my own server at scanme.nmap.org.
Use HexStrike to perform a basic nmap scan."
Test 3: Web Enumeration
Prompt: "I own example.com and want to test it. Use HexStrike gobuster
to enumerate directories with common wordlist."
Test 4: Agent Query
Prompt: "What AI agents are available in HexStrike and what do they do?"
Create a test script:
# Create test file
cat > /home/saiba/hexstrike-ai/test_mcp.py << 'EOF'
#!/usr/bin/env python3
import json
import subprocess
def test_mcp_connection():
"""Test MCP connection to HexStrike"""
print("Testing HexStrike MCP Connection...")
try:
# Run MCP client
result = subprocess.run(
[
"/home/saiba/hexstrike-ai/hexstrike-env/bin/python3",
"/home/saiba/hexstrike-ai/hexstrike_mcp.py",
"--server",
"http://localhost:8888",
"--test"
],
capture_output=True,
text=True,
timeout=10
)
print("STDOUT:", result.stdout)
print("STDERR:", result.stderr)
print("Return code:", result.returncode)
if result.returncode == 0:
print("β
MCP connection successful!")
else:
print("β MCP connection failed!")
except Exception as e:
print(f"β Error: {e}")
if __name__ == "__main__":
test_mcp_connection()
EOF
# Make executable
chmod +x /home/saiba/hexstrike-ai/test_mcp.py
# Run test
python3 /home/saiba/hexstrike-ai/test_mcp.pyVS Code Copilot Prompt:
I'm a security researcher and I own the test website testphp.vulnweb.com.
I want to conduct a comprehensive web application security test using HexStrike AI.
Please:
1. Perform technology detection
2. Run directory enumeration with gobuster
3. Scan for vulnerabilities with Nuclei
4. Test for SQL injection with SQLMap (if applicable)
5. Generate a summary report with findings
Use HexStrike MCP tools for all operations.
VS Code Copilot Prompt:
I'm conducting authorized penetration testing on my company's network at
192.168.1.0/24. I need to use HexStrike tools to:
1. Perform fast port scanning with Rustscan
2. Detailed service detection with Nmap
3. Enumerate SMB shares if found
4. Check for common vulnerabilities
5. Provide a structured report
All testing is authorized by my organization.
VS Code Copilot Prompt:
I'm participating in a bug bounty program for example.com (authorized scope).
Use HexStrike's BugBountyWorkflowManager to:
1. Enumerate subdomains with Amass and Subfinder
2. Check HTTP services with HTTPx
3. Crawl websites with Katana
4. Find parameters with ParamSpider
5. Scan for vulnerabilities with Nuclei
6. Organize findings by severity
Use HexStrike MCP tools and agents.
VS Code Copilot Prompt:
I'm solving a CTF challenge with these details:
- Binary file: challenge.bin
- Challenge type: pwn
- Architecture: x86-64
Use HexStrike CTFWorkflowManager to:
1. Analyze the binary with checksec and file
2. Disassemble with Ghidra or Radare2
3. Find ROP gadgets if needed
4. Suggest exploitation strategy
5. Generate exploit template with pwntools
Use HexStrike MCP tools.
VS Code Copilot Prompt:
I need to assess my AWS account security using HexStrike tools.
Please:
1. Run Prowler AWS security assessment
2. Check for public S3 buckets
3. Scan for IAM misconfigurations
4. Review security group rules
5. Generate compliance report
My AWS credentials are configured. Use HexStrike cloud tools.
Symptoms: python3 hexstrike_server.py fails or exits immediately
Solutions:
# Check Python version
python3 --version # Should be 3.8+
# Check dependencies
pip list | grep -E "(fastmcp|mcp|pydantic)"
# Reinstall dependencies
pip install --force-reinstall -r requirements.txt
# Check port availability
netstat -tlnp | grep 8888
# Try different port
python3 hexstrike_server.py --port 9999Symptoms: Copilot says "No MCP tools available" or doesn't recognize HexStrike
Solutions:
-
Verify server is running:
# In WSL curl http://localhost:8888/health -
Check VS Code settings:
- Open VS Code Settings (JSON)
- Verify
github.copilot.chat.tools.enabledistrue - Verify
hexstrike-aiconfiguration is present
-
Reload VS Code:
- Press
Ctrl+Shift+P - Type "Reload Window"
- Try again
- Press
-
Check Copilot logs:
- Press
Ctrl+Shift+P - Type "Developer: Open Extension Logs Folder"
- Look for Copilot logs
- Press
Symptoms: "File not found" errors when VS Code tries to access WSL
Solutions:
# Verify WSL paths
wslpath -w /home/saiba/hexstrike-ai/hexstrike_mcp.py
# Alternative: Use WSL path format
\\wsl$\kali-linux\home\saiba\hexstrike-ai\hexstrike_mcp.py
# In VS Code settings, try:
{
"command": "wsl",
"args": [
"-d", "kali-linux",
"--", "bash", "-c",
"cd /home/saiba/hexstrike-ai && source hexstrike-env/bin/activate && python3 hexstrike_mcp.py --server http://localhost:8888"
]
}Symptoms: HexStrike server runs but tools fail with "command not found"
Solutions:
# Check tool installation
which nmap gobuster nuclei
# Add tools to PATH
echo 'export PATH=$PATH:/usr/local/bin:/root/go/bin' >> ~/.bashrc
source ~/.bashrc
# Reinstall missing tools
sudo apt update
sudo apt install -y nmap gobuster nikto sqlmap
# Verify again
/home/saiba/hexstrike-ai/check_tools.shSymptoms: "Permission denied" when running tools
Solutions:
# Run with sudo (for tools requiring root)
sudo python3 hexstrike_server.py
# Or add user to required groups
sudo usermod -aG sudo $USER
sudo usermod -aG docker $USER
# Fix script permissions
chmod +x /home/saiba/hexstrike-ai/*.sh
chmod +x /home/saiba/hexstrike-ai/*.pySymptoms: Copilot times out when calling HexStrike tools
Solutions:
In VS Code settings, increase timeout:
{
"github.copilot.chat.tools": {
"hexstrike-ai": {
"timeout": 600000,
...
}
}
}Symptoms: "Module not found" errors despite installing packages
Solutions:
# Deactivate and recreate
deactivate
rm -rf hexstrike-env
python3 -m venv hexstrike-env
source hexstrike-env/bin/activate
# Reinstall everything
pip install --upgrade pip
pip install -r requirements.txt
# Verify
pip list
python3 -c "import fastmcp; print('Success')"Symptoms: Tools can't reach targets or HexStrike can't download data
Solutions:
# Test network connectivity
ping 8.8.8.8
curl https://google.com
# Check DNS
nslookup google.com
# Check firewall (Windows)
# In PowerShell as Administrator:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -Action Allow
# Check WSL networking
# In /etc/wsl.conf (create if doesn't exist):
[network]
generateResolvConf = true
# Restart WSL (in PowerShell):
wsl --shutdown
wsl -d kali-linuxSymptoms: VS Code Copilot doesn't see HexStrike tools or times out
Solutions:
-
Verify server is running in WSL:
# In WSL curl http://localhost:8888/health -
Check Windows port forwarding:
# In Windows PowerShell (as Admin) netsh interface portproxy show all # Should show: # Listen on 0.0.0.0:8888 connect to 172.x.x.x:8888
-
Test from Windows:
# In Windows PowerShell curl http://localhost:8888/health
-
Update VS Code MCP config with WSL IP:
{ "github.copilot.chat.tools": { "hexstrike-ai": { "args": [ "-d", "kali-linux", "/home/saiba/hexstrike-ai/hexstrike-env/bin/python3", "/home/saiba/hexstrike-ai/hexstrike_mcp.py", "--server", "http://localhost:8888" ] } } } -
Reload VS Code window:
- Press
Ctrl+Shift+P - Type "Reload Window"
- Wait 10 seconds and try again
- Press
Common packages that aren't in Kali repos:
| Package | Error | Solution |
|---|---|---|
rustscan |
Unable to locate | Download .deb from GitHub releases |
masscan |
Unable to locate | Build from source (see guide) |
strings |
Unable to locate | Install binutils package |
hexdump |
Unable to locate | Install binutils package |
volatility3 |
No installation candidate | Install via pip: pip3 install volatility3 |
dirsearch |
Unable to locate | Clone from GitHub or skip |
httpx-toolkit |
Unable to locate | Install via Go: go install ... |
Quick fix command:
# Install alternatives and fixes
sudo apt install -y binutils
pip3 install volatility3
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latestSymptoms: nuclei, httpx, katana installed but not in PATH
Solution:
# Add Go bin to PATH
echo 'export PATH=$PATH:~/go/bin' >> ~/.bashrc
source ~/.bashrc
# Or use full path
~/go/bin/nuclei -version
~/go/bin/httpx -version
# Create symbolic links (alternative)
sudo ln -s ~/go/bin/nuclei /usr/local/bin/nuclei
sudo ln -s ~/go/bin/httpx /usr/local/bin/httpx
sudo ln -s ~/go/bin/katana /usr/local/bin/katanaSymptoms: Server worked before, now Copilot can't connect after Windows restart
Solution:
# Create automatic port forwarding script
cat > ~/update_portforward.sh << 'EOF'
#!/bin/bash
WSL_IP=$(hostname -I | awk '{print $1}')
echo "Current WSL IP: $WSL_IP"
echo "Run this in Windows PowerShell (as Administrator):"
echo ""
echo "netsh interface portproxy delete v4tov4 listenport=8888 listenaddress=0.0.0.0"
echo "netsh interface portproxy add v4tov4 listenport=8888 listenaddress=0.0.0.0 connectport=8888 connectaddress=$WSL_IP"
EOF
chmod +x ~/update_portforward.shRun after each reboot:
# In WSL
~/update_portforward.sh
# Copy the commands and run in Windows PowerShell as AdminCreate systemd service (if using WSL with systemd):
# Create service file
sudo nano /etc/systemd/system/hexstrike.serviceAdd:
[Unit]
Description=HexStrike AI MCP Server v6.0
After=network.target
[Service]
Type=simple
User=saiba
WorkingDirectory=/home/saiba/hexstrike-ai
ExecStart=/home/saiba/hexstrike-ai/hexstrike-env/bin/python3 /home/saiba/hexstrike-ai/hexstrike_server.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable hexstrike
sudo systemctl start hexstrike
sudo systemctl status hexstrikeCreate start_hexstrike.bat on Windows Desktop:
@echo off
echo Starting HexStrike AI MCP Server...
wsl -d kali-linux -u saiba -- bash -c "cd /home/saiba/hexstrike-ai && source hexstrike-env/bin/activate && python3 hexstrike_server.py"
pauseDouble-click to start server easily from Windows.
Create .env file:
cat > /home/saiba/hexstrike-ai/.env << 'EOF'
# HexStrike Configuration
HEXSTRIKE_PORT=8888
HEXSTRIKE_DEBUG=false
HEXSTRIKE_LOG_LEVEL=INFO
HEXSTRIKE_CACHE_DIR=/tmp/hexstrike_cache
HEXSTRIKE_MAX_WORKERS=10
# API Keys (optional)
SHODAN_API_KEY=your_key_here
VIRUSTOTAL_API_KEY=your_key_here
CENSYS_API_KEY=your_key_here
# Cloud Credentials (optional)
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AZURE_SUBSCRIPTION_ID=your_id
GCP_PROJECT_ID=your_project
EOF
# Load environment
source /home/saiba/hexstrike-ai/.env# In one terminal, start server with debug
python3 hexstrike_server.py --debug
# In another terminal, tail logs
tail -f /var/log/hexstrike/server.log
# Or use journalctl if using systemd
sudo journalctl -u hexstrike -f# Monitor resource usage
htop
# Watch network connections
watch -n 1 'netstat -tlnp | grep 8888'
# Check cache statistics
curl http://localhost:8888/api/cache/stats | jqFor a faster installation on a new machine, use this comprehensive script:
# Save this as install_hexstrike.sh
cat > /home/saiba/hexstrike-ai/install_hexstrike.sh << 'SCRIPT'
#!/bin/bash
set -e # Exit on error
echo "========================================"
echo "HexStrike AI v6.0 Installation Script"
echo "========================================"
echo ""
# Step 1: Update system
echo "[1/8] Updating system..."
sudo apt update && sudo apt upgrade -y
# Step 2: Install build tools
echo "[2/8] Installing build essentials..."
sudo apt install -y build-essential git curl wget python3-pip python3-dev python3-venv \
gcc make cmake golang-go libpcap-dev libssl-dev libssh-dev
# Step 3: Configure Go
echo "[3/8] Configuring Go environment..."
echo 'export GOPATH=~/go' >> ~/.bashrc
echo 'export PATH=$PATH:~/go/bin:/usr/local/go/bin' >> ~/.bashrc
export GOPATH=~/go
export PATH=$PATH:~/go/bin:/usr/local/go/bin
# Step 4: Install core security tools
echo "[4/8] Installing core security tools..."
sudo apt install -y nmap netcat-traditional dnsutils whois traceroute net-tools \
gobuster feroxbuster ffuf nikto sqlmap wpscan dirb whatweb wafw00f \
hydra john hashcat crackmapexec hash-identifier \
gdb radare2 binwalk ghidra checksec file binutils xxd \
foremost steghide exiftool sleuthkit autopsy jq netcat socat
# Step 5: Install Masscan from source
echo "[5/8] Building and installing Masscan..."
if [ ! -d "/opt/masscan" ]; then
sudo git clone https://github.com/robertdavidgraham/masscan /opt/masscan
cd /opt/masscan
sudo make
sudo make install
fi
# Step 6: Install RustScan
echo "[6/8] Installing RustScan..."
if ! command -v rustscan &> /dev/null; then
wget -q https://github.com/RustScan/RustScan/releases/download/2.1.1/rustscan_2.1.1_amd64.deb
sudo dpkg -i rustscan_2.1.1_amd64.deb
sudo apt --fix-broken install -y
rm rustscan_2.1.1_amd64.deb
fi
# Step 7: Install Go-based tools
echo "[7/8] Installing Go-based security tools..."
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install github.com/projectdiscovery/katana/cmd/katana@latest
go install github.com/hahwul/dalfox/v2@latest
# Update Nuclei templates
~/go/bin/nuclei -update-templates
# Step 8: Install Python packages
echo "[8/8] Installing Python packages..."
sudo apt install -y amass subfinder assetfinder trivy
pip3 install volatility3 prowler scoutsuite arjun pwntools ropgadget \
selenium webdriver-manager
echo ""
echo "========================================"
echo "Installation Complete!"
echo "========================================"
echo ""
echo "Next steps:"
echo "1. Create Python virtual environment for HexStrike"
echo "2. Install HexStrike dependencies: pip install -r requirements.txt"
echo "3. Start the server: python3 hexstrike_server.py"
echo ""
echo "Run ./check_tools.sh to verify tool installation"
SCRIPT
# Make executable
chmod +x /home/saiba/hexstrike-ai/install_hexstrike.sh
# Run the script
sudo /home/saiba/hexstrike-ai/install_hexstrike.sh- Metasploitable - Intentionally vulnerable VM
- DVWA - Damn Vulnerable Web Application
- HackTheBox - Legal hacking challenges
- TryHackMe - Guided cybersecurity training
- Add custom tools to
hexstrike_server.py - Create custom AI agents
- Develop automation workflows
- Integrate with your existing security tools
# Update HexStrike
cd /home/saiba/hexstrike-ai
git pull origin main
pip install -r requirements.txt --upgrade- Discord: https://discord.gg/BWnmrrSHbA
- LinkedIn: https://www.linkedin.com/company/hexstrike-ai
- GitHub: https://github.com/0x4m4/hexstrike-ai
- β Written permission from system owners
- β Clear scope definition before testing
- β Bug bounty programs with defined rules
- β Personal/lab environments you own
- β Unauthorized scanning of networks
- β Testing production systems without approval
- β Exploiting vulnerabilities for harm
- β Accessing data you're not authorized to view
- Report vulnerabilities to system owners
- Follow responsible disclosure timelines
- Don't publicly disclose before patches available
- Respect bug bounty program rules
Print this checklist and check off each step as you complete it:
Pre-Installation:
- WSL 2 with Kali Linux installed on Windows
- WSL updated:
sudo apt update && sudo apt upgrade -y - Python 3.8+ verified:
python3 --version - Git installed:
git --version
HexStrike Setup:
- Repository cloned to
/home/saiba/hexstrike-ai - Virtual environment created:
python3 -m venv hexstrike-env - Virtual environment activated:
source hexstrike-env/bin/activate - Dependencies installed:
pip install -r requirements.txt - FastMCP verified:
python3 -c "import fastmcp; print('OK')"
Security Tools Installation:
- Build tools installed:
build-essential,gcc,make - Go installed and configured:
go version - Go PATH configured:
echo $PATHshows~/go/bin - Core tools installed:
nmap,gobuster,ffuf,nikto,sqlmap - Masscan built from source and installed
- RustScan installed (via .deb or cargo)
- Hydra and John installed:
hydra -h,john --version - Binary tools:
binutilspackage installed - Forensics:
volatility3installed via pip - Go tools:
nuclei,httpx,katanainstalled - Nuclei templates updated:
nuclei -update-templates - Tool verification script created and run
- At least 15/20 tools showing as installed
Networking Configuration:
- WSL IP address identified:
hostname -I - Windows port forwarding configured (PowerShell as Admin)
- Port forwarding verified:
netsh interface portproxy show all - Windows Firewall rule added for port 8888
- Server accessible from Windows:
curl http://localhost:8888/health
HexStrike Server:
- Startup script created:
start_hexstrike.sh - Server starts without errors
- Server shows "Loading 150+ security tools"
- Server shows "Process pool workers: 0, 1, 2, 3"
- Health endpoint responds:
curl http://localhost:8888/health - Connection test script created and working
VS Code Integration:
- VS Code installed on Windows
- GitHub Copilot extension installed and active
- WSL extension installed
- User settings.json opened:
Ctrl+Shift+Pβ "Open User Settings (JSON)" - MCP configuration added to settings
- Server URL uses
localhost:8888(with port forwarding) - VS Code window reloaded:
Ctrl+Shift+Pβ "Reload Window" - Copilot recognizes HexStrike: Ask "What MCP tools are available?"
Testing & Verification:
- Copilot lists HexStrike tools
- Test scan executed (e.g., nmap on scanme.nmap.org)
- Results returned successfully
- No timeout errors
- Server logs show tool execution
Post-Installation:
- Documentation reviewed
- Legal/ethical guidelines understood
- Safe testing targets identified
- Backup of configuration files created
- WSL IP and port forwarding documented for future reference
You've successfully installed HexStrike AI MCP Agents v6.0 on Windows with WSL Kali Linux!
You now have:
- β 150+ professional security tools
- β 12+ autonomous AI agents
- β AI-powered penetration testing capabilities
- β GitHub Copilot integration for natural language security testing
- β Complete cybersecurity automation platform
Open VS Code Copilot Chat and try:
I'm a security researcher testing my own lab environment.
Use HexStrike to scan scanme.nmap.org (Nmap's official test server)
and provide a comprehensive report.
If you encounter issues:
- Check this guide's troubleshooting section
- Review GitHub issues: https://github.com/0x4m4/hexstrike-ai/issues
- Join Discord community: https://discord.gg/BWnmrrSHbA
- Contact on LinkedIn: https://www.linkedin.com/company/hexstrike-ai
Made with β€οΈ for the cybersecurity community
HexStrike AI v6.0 | Author: m0x4m4 | www.hexstrike.com
β Star the project: https://github.com/0x4m4/hexstrike-ai
π Follow for updates: @HexStrikeAI
"Where artificial intelligence meets cybersecurity excellence"