From 4e83728b457db1626a8e6d69fbf90c0399d174ed Mon Sep 17 00:00:00 2001 From: creinky Date: Sun, 8 Nov 2026 22:01:48 -0700 Subject: [PATCH] Clean up README with quick start guides and troubleshooting --- .README.md.kate-swp | Bin 0 -> 5464 bytes README.md | 74 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 .README.md.kate-swp diff --git a/.README.md.kate-swp b/.README.md.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..230ca8488bcecfe7fd3113dd35d963bc3c517403 GIT binary patch literal 5464 zcmZ9PM^}|s7=`Z_yI2v#?zLb=R1~pG2PrlXyGR#BL_o1cjj?2qaaJ0dE4f00Ivedfw=%R{USgOJP+7NvDtvlz)V01Fdd+#p9LHvG8M2Mm<&)q zPXg4>L_j0O9tWtkM*$T?9tNm^v4HJFMgx@SNPq@69B_hSLjfAXV89w80|DoO2LZ~U zKR`pc7oZI829#0fPQV%9cEA?kR)ALFWU>9)O;bcH5krM%0pW1++XFPX zZ2^_k*&3k1Z3$4FO#v$@wjn?hzdk^VRUXhmv9bWI_PT&tBBcSXz}kRy!0Lcsft3MT zk`)1}QxecZvE>2U*UKE1IxKNm9H6Eb2CSyFAHGAj=z8JHFUVKq3-THHg#3(rM1Dd( zAn%cP$dAZdok$0A5ot%- zkXEDxX-1lmMx+6$M=l`ek#opdW~viEpi+=hSVTOkt4`qq#8MdR3QhE z1IT`4AF>zOgH$5BkzL46WCxN*wje!uf>lBpSAQ{EdHVJJL^rH!4DI&&$IEw3*dnk zJvj;hDsonJk}p5!{fN1D1^?=JaJFi8-3tWMa;3Hk+73?dfsiv!N8{I`ICv zE3&2(Uj^5s;gH|r6jr*0(H3Wmd&iqw1CORSmsB>LxD>YfTyNQv6zA^q;g-X5DbB5# zJxyEzTl-wG+2a)72-|dXA7{@~d^2p*$K~zQ$IYHir1D(*9>){1*D0QdZMk;9w*0t@ z=Y#e5eBetS$F#hE9L>j%-TCt3h2Gx&dG#?)Z~q`{^N-7V`&e)`oW_Sg`}hvSHb0no zR+Y-*^xj_$Z0panz_&AR1}|R=cc=DvZTNPrgRi7GPZO_y3by&@9pm})$npKd3n+V$ z+T(fT<#{`Kc^+0i-g?;f8&5JHZzF8Sw+XiSZHBFW3vBb%3S0fQdF9(-yPY_vzP=ss zR2m;oQ(wO>*!t^+tv_D8eqMMEd%nDtJ$@Co+moBu+wYlIz8ALfb6sbHDc?TW&KK`_ zZ|^2-*B$=}_7Kw)>}lUik;}$`8Oc{z2ICAA+sFVc7Qj z2yEB$C~W(E46bhJDgIwm=t@&k_;c?2tl?LDik=3$r@{JLWW{$pte6!n(~7KMxjoEqX4g`eUsgXK!E(t5Zn5tl1jzH%iSk6g*vU5WZ~C7Um~ zlI52#lquc{l$R^n{Ou%e_2o*Ik6g*d=dMJ1a;0zqSgvI2DOa-fmn(%!P~Ke$mMev; z!*V6-U#?{N$(3w9 zU#?{H@2*67xst7iT*=l`u4MVim27{=m25rg$)~{FzO)ZFB&2wK+MTLxtx>w@5!9Ba zS$2)YEjxLdjaHs!qm`#weR-OVMxIt!?P9jH*N&0VIk0Sea%Og5Vq(OWK*nWB$hd3} zGA>KPjf-~OxL`Lfm}H6Xc<>LtSB$z3gd-!OWP93xNM8dxGY~8mrat4 W%lembS$!Fo)t7PEeDyP)e9QkA*Wb1P literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 250bd75..466c6b7 100644 --- a/README.md +++ b/README.md @@ -40,18 +40,55 @@ This works through NAT/firewalls because the implant only makes outbound connect - Executes nmap scans, shell commands, Impacket tools, etc. locally - Reports results back to MCP server -## Setup +## Quick Start + +### Server Setup (One Command) ```bash -# Install dependencies -pip install -r requirements.txt +# Clone the repo and run the setup script +git clone https://github.com/creinky/agentic-pentest-mcp.git +cd agentic-pentest-mcp +./setup.sh +``` -# Start MCP server +The setup script will: +- Check for Python 3 installation +- Create a virtual environment (installing `python3-venv` if needed) +- Install all dependencies from `requirements.txt` + +After setup, start the server: +```bash +source .venv/bin/activate +export MCP_API_KEY="your-secret-key" # Optional but recommended python server.py --http 8000 +``` -# Start implant (on target network) +### Implant Setup (One Command) + +On your target machine (requires Python 3 and internet access): + +```bash +# Download the installer script +curl -O https://raw.githubusercontent.com/creinky/agentic-pentest-mcp/main/install_implant_service.sh +chmod +x install_implant_service.sh +./install_implant_service.sh +``` + +The installer will: +- Prompt for your MCP server IP, port (default 8001), and API key +- Test connectivity to the MCP server +- Check which pentest tools are installed on the implant +- Install a systemd service that auto-starts on boot with a 30-second beacon interval + +### Manual Implant Setup (Alternative) + +If you prefer not to use the installer: + +```bash +# On target machine export MCP_SERVER_URL="http://:8001" -python implant.py --id test-implant --interval 30 +export IMPLANT_API_KEY="your-secret-key" # Must match server's MCP_API_KEY +python implant.py --id my-implant --interval 30 ``` ## Available Tools @@ -98,15 +135,13 @@ pct create local:vztmpl/ubuntu-24.04-standard_24.04-1_amd64.tar.gz \ pct push agentic-pentest-mcp/ /opt/agentic-pentest-mcp/ pct enter cd /opt/agentic-pentest-mcp -apt update && apt install -y python3 python3-venv nmap -python3 -m venv .venv -source .venv/bin/activate -pip install -r requirements.txt +./setup.sh ``` ### Configure and Start ```bash -# Run server (listens on :8000 for MCP, :8001 for implant beacons) +source .venv/bin/activate +export MCP_API_KEY="your-secret-key" python server.py --http 8000 & ``` @@ -116,6 +151,7 @@ Create a systemd service or add to `/etc/rc.local`: #!/bin/bash cd /opt/agentic-pentest-mcp source .venv/bin/activate +export MCP_API_KEY="your-secret-key" python server.py --http 8000 & ``` @@ -130,7 +166,21 @@ curl http://localhost:8000/mcp ## Security Considerations -- **Optional API key authentication**: Set the `IMPLANT_API_KEY` environment variable on both server and implant to require an `X-API-Key` header on all beacon traffic. Without it, any host can register as an implant. +- **API key authentication**: Set `MCP_API_KEY` on the server and pass the same key to implants via `IMPLANT_API_KEY` environment variable or `--api-key` CLI argument. Without it, any host can register as an implant. - `run_command` tool is powerful; consider restricting in production - Use HTTPS transport for remote deployments - Implant IDs are auto-generated truncated UUIDs by default (8 hex chars), suitable for multi-implant environments + +## Troubleshooting + +### Implant gets 401 Unauthorized +Ensure the API key matches on both ends: +- Server: `export MCP_API_KEY="your-key"` +- Implant: `--api-key your-key` or `export IMPLANT_API_KEY="your-key"` + +### Implant can't reach server +Verify network connectivity and that port 8001 is open on the server. The implant only makes outbound connections, so no inbound ports are needed on the target network. + +### Service doesn't start after reboot +Check systemd service status: `systemctl status mcp-implant` +View logs: `journalctl -u mcp-implant` \ No newline at end of file