You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flags placed after the domain are silently ignored (scan runs with defaults, exit 0) #29
Go's flag package stops parsing at the first non-flag argument. Any flag placed after the domain is silently ignored, and the scan runs with defaults and exits 0. Putting flags after the target is a very common habit for users coming from other recon tools. Live-scan settings such as -rate, -max-queries, -dns-server, -o, or -simulate can be silently dropped. A user who wrote example.com -simulate gets a live scan.
Evidence
$ subenum -simulate -hit-rate 100 -w examples/sample_wordlist.txt example.com -t 0
... scan runs normally ...
exit=0 # -t 0 should have been rejected by validateFlags
main.go:113flag.Parse()
main.go:118 checks only flag.NArg() == 0
main.go:157domain := flag.Arg(0): anything in flag.Args()[1:] is discarded without a warning.
The main package has 4.6% test coverage, so run() flag handling is effectively untested.
Suggested approach
Choose one:
Strict: if flag.NArg() > 1, print the usage line and the ignored arguments, then exit 2.
Permissive: re-parse flag.Args()[1:] with the same FlagSet so flags work in either position, and still reject stray positionals.
Either way, exit with code 2 for usage errors, matching the flag convention.
Done when
subenum -w wl.txt example.com -t 0 either errors out or honours -t 0 and fails validation. It never runs silently with defaults.
A main_test.go table test covers flags before and after the domain, plus stray extra positionals.
Activity