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
Commit 0c4d292
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cli): config file and env defaults, completions, man page
Defaults now come from <user config dir>/subenum/config.json (or
$SUBENUM_CONFIG, a JSON object keyed by flag name) and SUBENUM_<FLAG>
environment variables, with precedence flag > env > config > built-in.
Defaults are applied before parsing without marking flags as given, so
explicit-only checks keep working; an unknown key or bad value exits 2.
-print-config shows every effective setting and its source.
subenum completion bash|zsh|fish|powershell and subenum man generate
completions and a man page from the FlagSet. GoReleaser runs the hidden
generate-assets subcommand and ships them under completions/ and man/
in every archive; the snapshot CI job syntax-checks each script in its
own shell and lints the man page with groff.
A TestMain keeps the package's tests hermetic from a developer's real
config and SUBENUM_* variables.
Fixes#88
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
## [Unreleased]
9
9
10
10
### Added
11
+
- Defaults from a config file and the environment: `config.json` in the user config directory (or `$SUBENUM_CONFIG`) and `SUBENUM_<FLAG>` variables, with precedence flag > env > config > built-in. `-print-config` shows each effective setting and its source. `subenum completion bash|zsh|fish|powershell` and `subenum man` generate shell completions and a man page from the flags, and release archives ship them (#88).
11
12
- A useful default wordlist: `-w` is now optional. Without it, subenum uses an embedded list of the 5,000 most common subdomain labels (SecLists `subdomains-top1million-5000.txt`, MIT; the license notice is kept in `data/subdomains-5k.txt`) and says so on stderr. The README gains a "Choosing a wordlist" section on larger lists and their query cost (#63).
12
13
- Monitoring mode: `-diff previous` compares with an earlier results file (any format) and prints only names added (`+` / `"change": "added"`) or removed (`-` / `"removed"`), with a `change` CSV column; exit code `4` signals changes. The `-o` file keeps the full current results for the next run. Removals are reported only when the run's verdict is `complete`, and never for `-exclude`d names. The run-quality report gains a `diff` object, and `docs/monitoring.md` has a scheduled GitHub Actions workflow that opens an issue for new names (#84).
13
14
- Subdomain takeover hints: results with a CNAME are marked `dangling` (target is NXDOMAIN), `provider:<name>` (target at a takeover-prone service such as S3, GitHub Pages, Heroku or Azure) or `dangling:<name>`. The marker appears in JSON/JSONL (`takeover_candidate`), as a CSV column when CNAME records are requested, in text with `-show-records`, in the TUI, and as a count in the breakdown and report. DNS-only; no HTTP probing (#71).
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -359,6 +359,26 @@ Press `Ctrl+C` at any time to abort. In-flight queries drain, partial results ar
359
359
360
360
With `-dL`, each domain is scanned in turn as an independent scan: `-max-queries`, `-rate` and the reliability guard apply per target. A failed target does not stop the others, but a reliability abort (the resolver looks overloaded) skips the remaining targets unless `-no-abort` is set. A per-target status list is printed at the end.
361
361
362
+
### Defaults, completions and the man page
363
+
364
+
Settings you repeat on every run can live in a config file or the environment. Precedence, highest first: **command-line flag > `SUBENUM_*` environment variable > config file > built-in default.**
- The config file is `config.json` in your user config directory (`~/.config/subenum/` on Linux, `~/Library/Application Support/subenum/` on macOS, `%AppData%\subenum\` on Windows), or the path in `SUBENUM_CONFIG`. Keys are flag names.
371
+
- Each flag also reads `SUBENUM_<FLAG>`, upper-cased with dashes as underscores: `SUBENUM_DNS_SERVER`, `SUBENUM_RATE`, `SUBENUM_T`.
372
+
-`subenum -print-config` shows every effective setting and where it came from (`flag`, `env`, `config` or `default`).
373
+
374
+
Shell completions and a man page are generated from the same flags, and release archives include them under `completions/` and `man/`:
375
+
376
+
```bash
377
+
subenum completion bash > /etc/bash_completion.d/subenum # or zsh, fish, powershell
378
+
subenum completion zsh >"${fpath[1]}/_subenum"
379
+
subenum man > /usr/local/share/man/man1/subenum.1
380
+
```
381
+
362
382
### Choosing a wordlist
363
383
364
384
Results can only be as good as the wordlist. Without `-w`, subenum uses its bundled top-5000 list (`data/subdomains-5k.txt`, from SecLists' `subdomains-top1million-5000.txt`), a good first pass that takes seconds. For deeper coverage:
0 commit comments