Debug Mode and Log Analysis
Advanced debugging techniques for troubleshooting Pentora.
Enable Debug Logging
pentora scan --targets 192.168.1.100 --log-level debug
Verbose Modes
# Level 1: Verbose
pentora scan --targets 192.168.1.100 -v
# Level 2: Very verbose (trace)
pentora scan --targets 192.168.1.100 -vv
# Level 3: Maximum verbosity
pentora scan --targets 192.168.1.100 -vvv
Log to File
pentora scan --targets 192.168.1.100 --log-level debug 2> debug.log
JSON Logging
Structured logs for parsing:
pentora scan --targets 192.168.1.100 --log-format json | jq
Analyzing Logs
Search for Errors
grep ERROR debug.log
Filter by Component
jq 'select(.component == "orchestrator")' debug.json
Timeline of Events
jq -r '.timestamp + " " + .message' debug.json | sort
Dry Run
Validate without executing:
pentora scan --targets 192.168.1.100 --dry-run
DAG Validation
pentora dag validate custom-scan.yaml
Trace Execution
Follow execution flow:
pentora scan --targets 192.168.1.100 --trace
Network Debugging
Capture Packets
sudo tcpdump -i eth0 -w capture.pcap &
pentora scan --targets 192.168.1.100
sudo killall tcpdump
Analyze with Wireshark
wireshark capture.pcap
Module Debugging
Enable module-specific logging:
logging:
  modules:
    discovery: debug
    scanner: trace
    fingerprint: debug
Stack Traces
Enable panic stack traces:
export GOTRACEBACK=all
pentora scan --targets 192.168.1.100
Profiling (Development)
CPU profiling:
pentora scan --targets 192.168.1.100 --cpuprofile cpu.prof
go tool pprof cpu.prof
Memory profiling:
pentora scan --targets 192.168.1.100 --memprofile mem.prof
go tool pprof mem.prof
See Common Issues for specific problems.