Files
agentic-pentest-mcp/setup_implant.sh
T

55 lines
1.6 KiB
Bash
Raw Normal View History

2026-11-08 20:48:26 -07:00
#!/bin/bash
# Agentic Pentest MCP - Implant Setup Script
# Creates a Python virtual environment and installs dependencies for the implant.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV_DIR="$SCRIPT_DIR/.venv"
echo "=== Agentic Pentest MCP Implant Setup ==="
echo ""
# Check for Python 3
if ! command -v python3 &> /dev/null; then
echo "Error: python3 not found. Please install Python 3 first."
exit 1
fi
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2)
echo "Found Python $PYTHON_VERSION"
# Create virtual environment if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
echo ""
echo "Creating virtual environment at .venv/"
# Try to create venv, install python3-venv package if needed (Debian/Ubuntu)
if ! python3 -m venv "$VENV_DIR" 2>/dev/null; then
echo "Trying to install python3-venv package..."
if command -v apt-get &> /dev/null; then
sudo apt-get update && sudo apt-get install -y python3-venv
elif command -v dnf &> /dev/null; then
sudo dnf install -y python3-venv
fi
python3 -m venv "$VENV_DIR"
fi
2026-11-08 20:48:26 -07:00
else
echo "Virtual environment already exists at .venv/"
fi
# Activate and install dependencies
echo ""
echo "Installing dependencies..."
source "$VENV_DIR/bin/activate"
pip install --upgrade pip > /dev/null 2>&1
pip install -r "$SCRIPT_DIR/requirements.txt"
echo ""
echo "=== Implant Setup Complete ==="
echo ""
echo "To start the implant:"
echo " source .venv/bin/activate"
echo " export IMPLANT_API_KEY='your-secret-key'"
echo " export MCP_SERVER_URL='http://<server-ip>:8001'"
echo " python3 implant.py --id <implant-id> --interval 60"