#!/usr/bin/env bash set -euo pipefail RESULTS_DIR="${1:-results}" REPORT="combined-report.txt" echo "AutoRecon Combined Report" > "$REPORT" echo "Generated: $(date)" >> "$REPORT" echo "==================================================" >> "$REPORT" echo >> "$REPORT" find "$RESULTS_DIR" -mindepth 1 -maxdepth 1 -type d | sort | while read -r hostdir; do host=$(basename "$hostdir") echo "[*] Processing $host" { echo "==================================================" echo "Host: $host" echo "==================================================" echo echo "Open Ports and Services" echo "-----------------------" # Pull open ports from any nmap output files grep -hE '^[0-9]+/(tcp|udp)[[:space:]]+open' \ "$hostdir"/scans/*nmap*.txt 2>/dev/null || echo "No open ports found" echo echo "Potential Findings" echo "------------------" grep -RniE \ 'vulnerable|warning|critical|high|medium|low|anonymous|default|password|admin|exposed|interesting|CVE-' \ "$hostdir"/scans 2>/dev/null || echo "No obvious findings" echo echo "Web Enumeration" echo "---------------" grep -RniE \ 'http://|https://|/admin|/login|/dashboard|/backup|/api|wordpress|grafana|prometheus|jenkins' \ "$hostdir"/scans 2>/dev/null || echo "No web findings" echo echo "Weak TLS / SSL" echo "--------------" grep -RniE \ 'SSLv2|SSLv3|TLSv1.0|TLSv1.1|weak cipher|self-signed|expired' \ "$hostdir"/scans 2>/dev/null || echo "No TLS findings" echo echo "SMB / Anonymous Access" echo "----------------------" grep -RniE \ 'anonymous|guest|null session|share:' \ "$hostdir"/scans 2>/dev/null || echo "No SMB findings" echo } >> "$REPORT" done echo "[✓] Report written to $REPORT"