Skip to content

Deduplicate findings, add network summary, parallelize analysis#13

Open
moscowchill wants to merge 6 commits into
caster0x00:mainfrom
moscowchill:feature/dedup-summary-parallel
Open

Deduplicate findings, add network summary, parallelize analysis#13
moscowchill wants to merge 6 commits into
caster0x00:mainfrom
moscowchill:feature/dedup-summary-parallel

Conversation

@moscowchill

@moscowchill moscowchill commented Mar 19, 2026

Copy link
Copy Markdown

Reviewed and tested against real-world BYOD WiFi pcaps.

Problem

Running Above against a 259MB pcap produces 3.4MB / 9,238 detections, mostly duplicates (5,869 mDNS, 1,066 LLMNR). The output is unusable for actual security assessments.

Changes

  • Deduplicate all 27 protocol blocks using per-protocol composite keys — each unique finding prints once, packet counts tracked
  • Network intelligence summary at end: host table (IP/MAC/vendor/protocols), VLANs, queried hostnames (LLMNR/NBT-NS), protocol stats, discovered subnets
  • 3-worker multiprocessing for pcap analysis via fork-inherited shared memory
  • Progress bars for loading and analysis phases with rate/ETA
  • --excel report flag to export findings to a multi-sheet xlsx for pentest reporting
  • Fix --input --output (output pcap was never written due to early return)
  • Suppress scapy BGP/runtime warnings
  • Add ruff linter config

Testing

  • Tested with 259MB BYOD WiFi pcapng — output reduced from 9,238 detections to ~90 unique findings
  • Verified --output saves all matched packets (not just unique)
  • Verified --excel produces valid xlsx with 6 sheets
  • Verified live mode (--interface) still prints findings in real-time
  • Verified Ctrl+C prints summary before exit
  • Verified stdout redirect produces clean text (no ANSI garbage)
  • ruff check above/ passes clean

- Deduplicate protocol detections across all 27 protocol blocks using
  per-protocol composite keys so each unique finding prints only once
- Add network intelligence summary printed at end of analysis: discovered
  hosts with MAC/vendor/protocols, VLANs, queried hostnames (LLMNR/NBT-NS),
  protocol detection counts, and subnet grouping
- Parallelize pcap analysis across 3 worker processes using multiprocessing
  with fork-inherited shared packets (zero-copy) and merged results
- Replace per-finding console spam with progress bars for both loading
  (byte-level via PcapReader) and analysis phases, with rate/ETA stats
- Fix --input --output: output file was never written due to early return
- Suppress scapy BGP/runtime warnings by setting log level before imports
Writes a multi-sheet Excel workbook with: unique findings (protocol,
details, attack impact, tools, mitigation), discovered hosts, protocol
stats, VLANs, queried hostnames, and subnets. Uses openpyxl with lazy
import so it's only required when --excel is used.
- Replace slow PcapReader Python loop with rdpcap (C-optimized) run in
  a background thread, showing a spinner while loading
- Strip ANSI color codes when stdout is not a TTY (file redirect) via
  colorama init(strip=True)
- Skip progress bars entirely when output is redirected to a file
Catches real bugs (undefined names, unused imports, dead code) while
ignoring upstream code patterns (bare except for scapy parsing, nested
if for haslayer guards, long lines in protocol blocks).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant