Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.so

# Virtual environments
venv/
env/
hexstrike-env/
hexstrike_env/
.venv/

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*.orig

# OS files
.DS_Store
Thumbs.db
desktop.ini

# Logs and local output
*.log
logs/
*.tmp
tmp/

# Python packaging / build
build/
dist/
*.egg-info/

# Tool outputs and cache
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
coverage.xml

# Docker artifacts
.docker/

# Security tool outputs (generic)
output/
results/
reports/

43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Use Kali Linux as the base image
FROM kalilinux/kali-rolling

# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Update and install Python, pip, and the security tools
RUN apt-get update && apt-get install -y --no-install-recommends \
# --- ADDED FOR COMPILING PYTHON PACKAGES ---
build-essential \
python3-dev \
# -------------------------------------------
python3 python3-pip python3-venv \
git curl wget sudo gnupg2 ca-certificates \
# Network & Recon
nmap masscan amass subfinder nuclei dnsenum \
# Web App Security
gobuster dirb ffuf nikto sqlmap wpscan \
# Password & Auth
hydra john hashcat \
# Binary Analysis
gdb binwalk \
# Browser requirements
chromium chromium-driver \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /app

# Copy the repository files into the container
COPY . .

# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt --break-system-packages

# Create a symlink for chromium so the AI agent finds it
RUN ln -s /usr/bin/chromium /usr/bin/google-chrome

# Expose the MCP server port
EXPOSE 8888

# Command to run the server
CMD ["python3", "hexstrike_server.py", "--port", "8888"]
Binary file added __pycache__/hexstrike_mcp.cpython-312.pyc
Binary file not shown.
Binary file added __pycache__/hexstrike_server.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion hexstrike-ai-mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"alwaysAllow": []
}
}
}
}
12 changes: 8 additions & 4 deletions hexstrike_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9698,6 +9698,7 @@ def intelligent_smart_scan():
"execution_summary": {},
"combined_output": ""
}
combined_output_parts = []

def execute_single_tool(tool_name, target, profile):
"""Execute a single tool and return results"""
Expand Down Expand Up @@ -9736,8 +9737,9 @@ def execute_single_tool(tool_name, target, profile):
if result.get('success') and result.get('stdout'):
# Simple vulnerability detection based on common patterns
output = result.get('stdout', '')
output_lower = output.lower()
vuln_indicators = ['CRITICAL', 'HIGH', 'MEDIUM', 'VULNERABILITY', 'EXPLOIT', 'SQL injection', 'XSS', 'CSRF']
vuln_count = sum(1 for indicator in vuln_indicators if indicator.lower() in output.lower())
vuln_count = sum(1 for indicator in vuln_indicators if indicator.lower() in output_lower)

return {
"tool": tool_name,
Expand Down Expand Up @@ -9791,9 +9793,11 @@ def execute_single_tool(tool_name, target, profile):

# Combine outputs
if tool_result.get("stdout"):
scan_results["combined_output"] += f"\n=== {tool_result['tool'].upper()} OUTPUT ===\n"
scan_results["combined_output"] += tool_result["stdout"]
scan_results["combined_output"] += "\n" + "="*50 + "\n"
combined_output_parts.append(f"\n=== {tool_result['tool'].upper()} OUTPUT ===\n")
combined_output_parts.append(tool_result["stdout"])
combined_output_parts.append("\n" + "="*50 + "\n")

scan_results["combined_output"] = "".join(combined_output_parts)

# Create execution summary
successful_tools = [t for t in scan_results["tools_executed"] if t.get("success")]
Expand Down