卸載 WSL 里的 Ubuntu
wsl --unregister Ubuntu
查看當前已安裝的發行版
wsl --list --verbose
下載kali-linux
wsl --install -d kali-linux
Kali 服務端安裝
sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-venv python3-pip git -y
克隆源碼 & 創建虛擬環境
git clone https://github.com/0x4m4/hexstrike-ai.git
cd hexstrike-ai# 創建虛擬環境(避免依賴沖突)
python3 -m venv hexstrike-env
source hexstrike-env/bin/activate
安裝依賴
pip install -r requirements.txt
啟動服務端
python3 hexstrike_server.py
WSL 啟動 HexStrike AI 服務端(虛擬環境版)
# 1. 進入 WSL Kali
wsl -d kali-linux# 2. 切換到項目目錄
cd /home/xiepu/HexStrike/hexstrike-ai/# 3. 激活虛擬環境
source /home/xiepu/HexStrike/hexstrike-ai/hexstrike-env/bin/activate# 4. 啟動服務端
python3 /home/xiepu/HexStrike/hexstrike-ai/hexstrike_server.py
cursor配置
點擊右上角的設置----->mcp
mcp.json
最穩的寫法(直接用你的用戶名 + bash + 激活 venv)
{"mcpServers": {"hexstrike-ai": {"command": "wsl","args": ["-d", "kali-linux","-u", "xiepu","bash","-lc","source /home/xiepu/HexStrike/hexstrike-ai/hexstrike-env/bin/activate && python3 /home/xiepu/HexStrike/hexstrike-ai/hexstrike_mcp.py --server http://172.22.105.88:8888"],"description": "HexStrike AI v6.0 - WSL venv mode (bash)","timeout": 300,"alwaysAllow": []}}
}
檢測MCP是否能連通
在 Windows PowerShell:
Test-NetConnection -ComputerName 172.22.105.88 -Port 8888
TcpTestSucceeded: True → 網絡通了