mirror of
https://github.com/mblanke/StrikePackageGPT.git
synced 2026-03-01 14:20:21 -05:00
V2.1: Network Map integration, Scan History, OS detection improvements
- Added nmap wrapper to auto-send scan results to Dashboard - Network Map now displays hosts from terminal scans - Scan History tab shows all scans (GUI and terminal) - Load previous scans to Network Map feature - Improved OS detection from nmap output (parses OS details, smb-os-discovery) - Added determine_os_type() with OUI/MAC vendor lookup - Static network map layout (no more jumpy D3 force simulation) - Fixed docker-compose for Ollama connectivity (host.docker.internal) - Added test_services.sh for comprehensive testing
This commit is contained in:
@@ -3,12 +3,48 @@
|
||||
# Enable command logging by default for all bash sessions
|
||||
echo 'source /usr/local/bin/command_logger.sh' >> /root/.bashrc
|
||||
echo 'export COMMAND_LOG_DIR=/workspace/.command_history' >> /root/.bashrc
|
||||
echo 'export DASHBOARD_URL=http://strikepackage-dashboard:8080' >> /root/.bashrc
|
||||
|
||||
# Create convenience aliases for captured execution
|
||||
cat >> /root/.bashrc << 'ALIASES'
|
||||
# Convenience alias to run commands with automatic capture
|
||||
alias run='capture'
|
||||
|
||||
# Wrap nmap to automatically send results to network map
|
||||
nmap_wrapper() {
|
||||
local output
|
||||
local exit_code
|
||||
|
||||
# Run nmap and capture output
|
||||
output=$(/usr/bin/nmap "$@" 2>&1)
|
||||
exit_code=$?
|
||||
|
||||
# Display output
|
||||
echo "$output"
|
||||
|
||||
# If successful, send to dashboard network map
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "" >&2
|
||||
echo "[StrikePackageGPT] Sending nmap results to Network Map..." >&2
|
||||
|
||||
# Send to dashboard
|
||||
response=$(curl -s -X POST "${DASHBOARD_URL:-http://strikepackage-dashboard:8080}/api/network/nmap-results" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg output "$output" --arg source "terminal" '{output: $output, source: $source}')" 2>/dev/null)
|
||||
|
||||
added=$(echo "$response" | jq -r '.added // 0' 2>/dev/null)
|
||||
updated=$(echo "$response" | jq -r '.updated // 0' 2>/dev/null)
|
||||
total=$(echo "$response" | jq -r '.total // 0' 2>/dev/null)
|
||||
|
||||
if [ "$added" != "null" ] 2>/dev/null; then
|
||||
echo "[StrikePackageGPT] Network Map: $added added, $updated updated (total: $total hosts)" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
return $exit_code
|
||||
}
|
||||
alias nmap='nmap_wrapper'
|
||||
|
||||
# Helper function to show recent commands
|
||||
recent_commands() {
|
||||
echo "Recent commands logged:"
|
||||
@@ -18,36 +54,42 @@ recent_commands() {
|
||||
done
|
||||
}
|
||||
alias recent='recent_commands'
|
||||
|
||||
# Show network map hosts
|
||||
show_hosts() {
|
||||
echo "Network Map Hosts:"
|
||||
curl -s "${DASHBOARD_URL:-http://strikepackage-dashboard:8080}/api/network/hosts" | jq -r '.hosts[] | "\(.ip)\t\(.hostname // "-")\t\(.os // "-")\tPorts: \(.ports | length)"' 2>/dev/null || echo "No hosts found"
|
||||
}
|
||||
alias hosts='show_hosts'
|
||||
|
||||
# Clear network map
|
||||
clear_hosts() {
|
||||
curl -s -X DELETE "${DASHBOARD_URL:-http://strikepackage-dashboard:8080}/api/network/hosts" | jq .
|
||||
echo "Network map cleared"
|
||||
}
|
||||
ALIASES
|
||||
|
||||
echo "=================================================="
|
||||
echo " StrikePackageGPT - Kali Container"
|
||||
echo " Security Tools Ready + Command Capture Enabled"
|
||||
echo " Security Tools Ready + Network Map Integration"
|
||||
echo "=================================================="
|
||||
echo ""
|
||||
echo "Available tools:"
|
||||
echo " - nmap, masscan (port scanning)"
|
||||
echo " - amass, theharvester (reconnaissance)"
|
||||
echo " - nikto, gobuster (web testing)"
|
||||
echo " - sqlmap (SQL injection)"
|
||||
echo " - hydra (brute force)"
|
||||
echo " - metasploit (exploitation)"
|
||||
echo " - searchsploit (exploit database)"
|
||||
echo " - aircrack-ng, wifite (wireless)"
|
||||
echo " - john, hashcat (password cracking)"
|
||||
echo " - and 600+ more Kali tools"
|
||||
echo ""
|
||||
echo "🔄 BIDIRECTIONAL CAPTURE ENABLED 🔄"
|
||||
echo "🗺️ NETWORK MAP INTEGRATION ENABLED 🗺️"
|
||||
echo ""
|
||||
echo "Commands you run here will be captured and visible in:"
|
||||
echo " • Dashboard history"
|
||||
echo " • API scan results"
|
||||
echo " • Network visualization"
|
||||
echo "nmap scans automatically appear in the Dashboard Network Map!"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo " • Run commands normally: nmap -sV 192.168.1.1"
|
||||
echo " • Use 'capture' prefix for explicit capture: capture nmap -sV 192.168.1.1"
|
||||
echo " • View recent: recent"
|
||||
echo "Commands:"
|
||||
echo " • nmap -sV 192.168.1.1 - Scan and auto-add to map"
|
||||
echo " • hosts - Show network map hosts"
|
||||
echo " • clear_hosts - Clear network map"
|
||||
echo " • recent - Show recent commands"
|
||||
echo ""
|
||||
echo "Container is ready for security testing."
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user