Repository navigation
feat: add interface/source_ip/router_ip config overrides for masscan and nmap - #66
Merged
Spoonman1091 merged 2 commits intoOct 13, 2026
Merged
Conversation
…and nmap On a host with more than one default route (NAT/VPN split-tunnel setups), masscan and nmap's own interface/route auto-detection can fail outright or silently pick the wrong path, scanning from an interface that never reaches the target. These optional config.json knobs pin the interface, source IP, and (masscan-only) router IP explicitly, threaded through every masscan and nmap invocation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ride tests macOS names its loopback interface lo0, not lo, so the valid-interface test cases failed the real socket.if_nametoindex() check on macOS CI. Mock the existence check instead of depending on any specific OS's real interfaces. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
could not determine default interface) or silently pick the wrong path, so a scan goes out an interface that never reaches the target.config.jsonkeys —interface,source_ip,router_ip— that pin masscan's--interface/--source-ip/--router-ipand nmap's-e/-S(with--disable-arp-pingauto-added wheneversource_ipis set) explicitly. No interactive prompt, same posture asscanner_profile/honeypot_active_confirm— absent/empty means today's auto-detect behavior, byte-for-byte.NetworkOverrideis threaded as an explicitnet_override=Noneparameter through all 3 masscan and 9 nmap command-building call sites (the loopback-onlyscanner_profileoverlay-verify probes are deliberately excluded). New_config_network_override()validator exits on an invalid interface name or non-IPv4 address, matching_config_scanner_profile()'s posture.CLAUDE.mddocuments the mechanism and failure mode;config.json.sampledocuments the three fields.Test plan
uv run pytest tests/— 1560 passed, 4 skipped (pre-existing environment skips), 99.97% coveragetests/test_nse_integration.py(real nmap, root) — 23 passed, 3 skipped (pre-existing port-conflict skips)ruff check spoonmap.py tests/— cleanbandit -r spoonmap.py -b .bandit-baseline.json— no new findingsuv lock --check— lock is freshinterface/source_ipwere pinned🤖 Generated with Claude Code