How hbn1987/6scan works
Project type and purpose
• This is a full‐stack IPv6 scanning framework (“HMap v1.0”) combining:
– High‐performance C++ probing binaries (ping, traceroute, various TGA strategies)
– Python orchestration scripts for seed generation, dispatch, collection, and analysis
– Helper libraries (ipv6toolkit, libcperm) for address manipulation and permutation
• It produces IPv6 hitlists, applies de‐aliasing, runs Internet‐wide scans, and analyzes results.
High‐level component breakdown
A. CLI Probing Engine (C++, under Htrace6/trace6 & parsers/)
– Core binaries:
• 6scan (main.cc) – dispatches to ping6, trace6, target‐generation modules
• HMap‐ping6, HMap‐trace6, multiple UDP/TCP/ICMP prober implementations
– Parsers & utilities: route_path.cc, utils.cc/h – parse and post‐process responses
– Configuration & build: Bazel BUILD files, autoconf/bootstrap, Makefile.am
B. Target Generation Algorithms (TGA) (C++, under strategy/)
– HMap6, 6Scan, 6Hit, 6Tree, 6Gen strategies (strategy/*.cpp/.h)
– Patricia‐tree and JSON reader modules to load seed sets
C. Address manipulation libraries
– ipv6toolkit/tools – raw IPv6 address routines
– libcperm – prefix permutation, Feistel ciphers for randomized probing
D. Python Orchestration & Scheduling
– runner/ – sequential 1Hseed.py, 2Aliasp.py, 3Mseed.py, 4Evalu.py
– scheduling/ – distributed seeds_dispatch.py, ssh_runner.py, data_pullback.py
– reflections/, analysis/ – post‐scan analytics (entropy, geo, ASN stats)
E. External Data & Services
– RIPE, IPv6hitlist APIs for hitlist, alias lists, country/ASN data
– Local disk storage: CSVs, JSON, raw output files under analysis/data and output/
Interactions & data flow
1. Seed collection: runner/1Hseed.py calls 6scan -P to probe the hitlist → raw responses
2. Alias‐prefix extraction: runner/2Aliasp.py loads raw responses → alias list
3. Seedset generation: runner/3Mseed.py merges hitlist + alias list → seed JSON
4. Scanning: CLI engine (6scan) + TGA modules read seed JSON → send probes → dump_result
5. Distributed dispatch: scheduling/seeds_dispatch.py distributes seed JSON to workers
6. Probe execution: scheduling/ssh_runner.py remotely invokes 6scan → writes per‐worker logs
7. Data pullback: scheduling/data_pullback.py collects remote results → central storage
8. Analysis: analysis/*.py loads CSV/JSON → generates statistics, visualizations
Architectural patterns & principles
• Modular CLI binaries (single‐responsibility for ping vs. trace vs. TGA)
• Plugin‐style TGA strategies (strategy/ folder): easily add new scanning heuristics
• Library reuse: ipv6toolkit + libcperm separate address math and crypto/permutation
• Orchestration as code: Python scripts glue together C++ binaries for end‐to‐end flow
• Data‐centric: JSON/CSV seed lists and raw logs are the primary “contracts” between components