Skip to content

Commit 32cb96f

Browse files
TMHSDigitalclaude
andcommitted
Say takeover hints come from CNAME, NS, SRV or HTTPS (#487)
dns.HintsTakeover accepts CNAME, NS, SRV and HTTPS since #419 and #438, but the -sarif help, the -sarif note, the README, action.yml, the monitoring, ARCHITECTURE and advanced-usage docs, the MCP types schema and a writer comment still said CNAME or NS. ARCHITECTURE's SARIF section also lists dangling-srv now. Flags table regenerated. Fixes #487 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3a07e92 commit 32cb96f

10 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Tools like [puredns](https://github.com/d3mondev/puredns), [shuffledns](https://
8787
| **Resolve** | Worker pool (`-t`) · UDP with TCP fallback, DNS over TLS and DNS over HTTPS · resolver pools with benching, canaries and re-validation (`-r`) · `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT`, `SRV` and `HTTPS` records (`-type`) |
8888
| **Stay polite** | Wire-level rate limit (`-rate`, `-rate-per-resolver`) that adapts under load (`-auto-rate`) · query and time budgets (`-max-queries`, `-max-duration`) · scope exclusions (`-exclude`) · `-dry-run` to see the plan first |
8989
| **Trust the output** | Multi-probe wildcard fingerprinting · per-outcome accounting and a run-quality verdict (`-stats`) · reliability guard · retry of inconclusive names (`-retry-inconclusive`) · resumable runs (`-resume`) |
90-
| **Spot problems** | Dangling CNAME and NS takeover hints, with a provider list you can extend · internal addresses leaked into public DNS · SARIF for GitHub code scanning (`-sarif`) |
90+
| **Spot problems** | Dangling CNAME, NS, SRV and HTTPS takeover hints, with a provider list you can extend · internal addresses leaked into public DNS · SARIF for GitHub code scanning (`-sarif`) |
9191
| **Fit your workflow** | `text`, `json`, streaming `jsonl` and `csv` · pipe-clean stdout (`-silent`) · `-diff` monitoring and a GitHub Action · interactive TUI · Go library · MCP server for AI agents |
9292
| **Teach and test** | `-simulate` with zero network I/O · lab scenarios served by a local DNS server (`-simulate-zone`), with [six guided exercises](docs/labs.md) |
9393

@@ -300,7 +300,7 @@ This table describes `main`, which can be ahead of the latest release: a release
300300
| `-progress` | `true` | Live progress line on stderr. Off by default when stderr is not a terminal; passing `-progress` there prints whole progress lines instead of redrawing one |
301301
| `-log-format <fmt>` | `text` | Diagnostics on stderr: `text`, or `json` for one JSON object per line (`time`, `level`, `kind`, `target`, `message`, and `settings` codes on engine notices). Progress is then an event, only with an explicit `-progress`. Results on stdout are unchanged |
302302
| `-stats <file>` | n/a | Write a JSON run-quality report (outcomes, queries sent, verdict); see [Run-quality report](#run-quality-report) |
303-
| `-sarif <file>` | n/a | Write takeover candidates as SARIF 2.1.0 for GitHub code scanning; needs CNAME or NS in `-type` |
303+
| `-sarif <file>` | n/a | Write takeover candidates as SARIF 2.1.0 for GitHub code scanning; needs CNAME, NS, SRV or HTTPS in `-type` |
304304
| `-takeover-providers <file>` | n/a | Extra takeover-prone services for the `provider:` hint, one `<suffix> <name>` per line (`.example-cdn.net example-cdn`; `#` comments allowed). They are added to the built-in list; an entry for a listed suffix replaces it, and a name of `-` removes the suffix. The longest matching suffix wins. See [Subdomain takeover hints](#subdomain-takeover-hints) |
305305
| `-takeover-providers-only` | `false` | Use only the `-takeover-providers` file, without the built-in list |
306306
| **Monitoring** | | |

‎action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ inputs:
3939
required: false
4040
default: ""
4141
sarif:
42-
description: Write takeover candidates to this SARIF file, for github/codeql-action/upload-sarif. Needs CNAME or NS in -type.
42+
description: Write takeover candidates to this SARIF file, for github/codeql-action/upload-sarif. Needs CNAME, NS, SRV or HTTPS in -type.
4343
required: false
4444
default: ""
4545
max-duration:
@@ -101,7 +101,7 @@ outputs:
101101
previous results to diff against.
102102
value: ${{ steps.scan.outputs.changes }}
103103
takeovers:
104-
description: Takeover candidates among the names found (needs CNAME or NS in -type).
104+
description: Takeover candidates among the names found (needs CNAME, NS, SRV or HTTPS in -type).
105105
value: ${{ steps.scan.outputs.takeovers }}
106106
internal:
107107
description: Names found that answer with an address that is not public.

‎docs/ARCHITECTURE.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ tools/licenses/main.go - THIRD_PARTY_LICENSES for release archives and t
218218
* **Purpose**: Thread-safe output that keeps stdout pipe-clean. Resolved subdomains go to stdout; everything else (progress, verbose diagnostics, notices, errors) goes to stderr.
219219
* **Implementation**:
220220
* `output.Writer` with mutex-protected methods, created with `output.New` (stdout plus an optional file) or `output.NewFile` (file only; used by the TUI so the alt-screen viewport keeps the terminal):
221-
* `Emit` - writes one `output.Result` (the engine's `scan.Result` plus the CLI's `Change`, `PreviousRecords` and `Permutation`; one result type flows from engine to writers). In `text` format it prints `Found: <domain>` on a terminal, or the bare name when stdout is piped (`SetPlain`), and the bare name to the output file; `-show-records` (`SetShowRecords`) appends `TYPE=value` pairs. In `json` format results are streamed as array elements as they arrive, and `Finish` closes the array; `jsonl` streams one object per line; `csv` streams `subdomain,type,value` rows with a header, plus a `simulated` column under `-simulate`, a `takeover_candidate` column when `-type` includes `CNAME` or `NS`, a `change` column with `-diff`, and, last, a `sources` column (each result's sources joined with `;`). The format is selected with `-format text|json|jsonl|csv` (`output.ParseFormat`, default `text`).
221+
* `Emit` - writes one `output.Result` (the engine's `scan.Result` plus the CLI's `Change`, `PreviousRecords` and `Permutation`; one result type flows from engine to writers). In `text` format it prints `Found: <domain>` on a terminal, or the bare name when stdout is piped (`SetPlain`), and the bare name to the output file; `-show-records` (`SetShowRecords`) appends `TYPE=value` pairs. In `json` format results are streamed as array elements as they arrive, and `Finish` closes the array; `jsonl` streams one object per line; `csv` streams `subdomain,type,value` rows with a header, plus a `simulated` column under `-simulate`, a `takeover_candidate` column when `-type` includes `CNAME`, `NS`, `SRV` or `HTTPS`, a `change` column with `-diff`, and, last, a `sources` column (each result's sources joined with `;`). The format is selected with `-format text|json|jsonl|csv` (`output.ParseFormat`, default `text`).
222222
* `Progress` / `ProgressDone` - a carriage-return progress line on stderr, or whole lines when `SetProgressLines` is on.
223223
* `Info` / `Error` - informational and error lines on stderr, cleared around the progress line.
224224
* `Finish` - closes the streamed JSON array, flushes CSV, and returns the first error writing the output file.
@@ -363,7 +363,7 @@ With `-ct`, `ct.Client.Names` makes one HTTPS request per target to crt.sh (no A
363363

364364
### 5.7. SARIF Output
365365

366-
`-sarif <file>` writes the run's takeover candidates (results whose CNAME `dns.TakeoverHint` marked as dangling or pointing at a takeover-prone provider, and names delegated to a name server that does not resolve, `dangling-ns`) as a SARIF 2.1.0 log with `output.WriteSARIF`, atomically, for GitHub code scanning. It needs `CNAME` or `NS` in `-type`. A run with no candidates writes a valid document with no results.
366+
`-sarif <file>` writes the run's takeover candidates (results whose CNAME, or AliasMode HTTPS target, `dns.TakeoverHint` marked as dangling or pointing at a takeover-prone provider, names delegated to a name server that does not resolve, `dangling-ns`, and services whose SRV target does not exist, `dangling-srv`) as a SARIF 2.1.0 log with `output.WriteSARIF`, atomically, for GitHub code scanning. It needs `CNAME`, `NS`, `SRV` or `HTTPS` in `-type`. A run with no candidates writes a valid document with no results.
367367

368368
### 5.8. Configuration Precedence
369369

‎docs/_includes/flags.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
| `-resume <string>` | - | Resume a run that was interrupted, ran out of -max-duration or was aborted, from its state file (no other arguments but the pacing flags -rate, -rate-per-resolver, -t, -timeout, -attempts, -auto-rate, -no-abort and -max-duration) |
4141
| `-retries <int>` | - | Deprecated: use -attempts instead |
4242
| `-retry-inconclusive` | - | After each scan, look up once more (against -dns-server) every name that timed out, was refused or failed; names it resolves are reported, but not expanded by -recursive |
43-
| `-sarif <string>` | - | Write takeover candidates to this file as SARIF 2.1.0, for GitHub code scanning (needs CNAME or NS in -type) |
43+
| `-sarif <string>` | - | Write takeover candidates to this file as SARIF 2.1.0, for GitHub code scanning (needs CNAME, NS, SRV or HTTPS in -type) |
4444
| `-seed <uint>` | - | In simulation mode, seed for reproducible results (0 = random; the seed used is printed) |
4545
| `-seeds <string>` | - | Results file (any -format) whose names also seed -permute; implies -permute |
4646
| `-show-records` | - | In text format, append each result's records (TYPE=value) |

‎docs/monitoring.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
| `token` | `github.token` | Token for downloading the release and the baseline artifact |
129129

130130
Outputs: `verdict`, `resumed`{% include unreleased.html action="resumed" %} (`true` when the run continued a stopped scan), `found` (including `-permute` hits), `added`, `removed`, `changed`{% include unreleased.html action="changed" %} (with `-diff-records`),
131-
`takeovers`{% include unreleased.html action="takeovers" %} (takeover candidates among the names found; needs `CNAME` or `NS` in `-type`),
131+
`takeovers`{% include unreleased.html action="takeovers" %} (takeover candidates among the names found; needs `CNAME`, `NS`, `SRV` or `HTTPS` in `-type`),
132132
`internal`{% include unreleased.html action="internal" %} (names answering with an address that is not public), and the paths `results` (JSONL),
133133
`stats` (the run-quality report) and `changes`{% include unreleased.html action="changes" %} (JSONL, one line per added, removed or
134134
changed name with a `change` field; empty when there were no previous results to

‎examples/advanced_usage.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Streams a header followed by one row per record. The first three columns are alw
288288
| Column | When |
289289
|--------|------|
290290
| `simulated` | `-simulate` (every row is `true`) |
291-
| `takeover_candidate` | `-type` includes `CNAME` or `NS` (see takeover hints in the README) |
291+
| `takeover_candidate` | `-type` includes `CNAME`, `NS`, `SRV` or `HTTPS` (see takeover hints in the README) |
292292
| `change` | `-diff` (`added`, `removed` or, with `-diff-records`, `changed`) |
293293
| `sources` | always, last: what proposed the name, joined with `;` (empty for a `removed` row) |
294294

‎internal/cli/cli.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func parseFlagsWith(args []string, applyDefaults func(*flag.FlagSet) error, stde
266266
fs.BoolVar(&f.retryIncon, "retry-inconclusive", false, "After each scan, look up once more (against -dns-server) every name that timed out, was refused or failed; names it resolves are reported, but not expanded by -recursive")
267267
fs.StringVar(&f.inconFile, "inconclusive", "", "Write the names still without an answer (timeout, refused, other) to this file, one per line, to rescan with -w")
268268
fs.StringVar(&f.statsFile, "stats", "", "Write a JSON run-quality report (outcomes, queries sent, verdict) to this file")
269-
fs.StringVar(&f.sarifFile, "sarif", "", "Write takeover candidates to this file as SARIF 2.1.0, for GitHub code scanning (needs CNAME or NS in -type)")
269+
fs.StringVar(&f.sarifFile, "sarif", "", "Write takeover candidates to this file as SARIF 2.1.0, for GitHub code scanning (needs CNAME, NS, SRV or HTTPS in -type)")
270270
fs.StringVar(&f.exclude, "exclude", "", "Comma-separated out-of-scope names and *.parent patterns; never queried or expanded")
271271
fs.StringVar(&f.excludeFile, "exclude-file", "", "File of out-of-scope names and *.parent patterns, one per line (# comments allowed)")
272272
fs.StringVar(&f.providersFile, "takeover-providers", "", "File of takeover-prone services, one \"<suffix> <name>\" per line (.example-cdn.net example-cdn; # comments allowed; name - removes a suffix), added to the built-in list for takeover hints")

‎internal/cli/mcp_tools.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (r remediation) apply(cfg *subenum.Config) error {
127127
var recordTypeSchema = map[string]any{
128128
"type": "array",
129129
"items": map[string]any{"enum": dns.Types()},
130-
"description": "Record types to look up; default A and AAAA. CNAME and NS add takeover hints.",
130+
"description": "Record types to look up; default A and AAAA. CNAME, NS, SRV and HTTPS add takeover hints.",
131131
}
132132

133133
// labScanArgs are lab_scan's arguments. TestMCPInputSchemasMatchArgs keeps

‎internal/cli/session.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (s *session) configure() (domain string, code int, ok bool) {
340340
return "", exitUsage, false
341341
}
342342
if f.sarifFile != "" && !dns.HintsTakeover(recordTypes) {
343-
out.Info("Note: -sarif lists takeover candidates, which need CNAME (or NS) lookups; add -type A,AAAA,CNAME")
343+
out.Info("Note: -sarif lists takeover candidates, which need CNAME, NS, SRV or HTTPS lookups; add -type A,AAAA,CNAME")
344344
}
345345
if err != nil {
346346
out.Error("%v", err)

‎internal/output/writer.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ func diffPrefix(change string) string {
185185
}
186186

187187
// SetTakeoverColumn adds a takeover_candidate column to CSV output. The CLI
188-
// sets it when CNAME or NS records are requested, the only cases that yield
189-
// hints (see dns.HintsTakeover).
188+
// sets it when CNAME, NS, SRV or HTTPS records are requested, the only cases
189+
// that yield hints (see dns.HintsTakeover).
190190
func (w *Writer) SetTakeoverColumn(on bool) { w.takeoverColumn = on }
191191

192192
// SetSourcesColumn adds a sources column to CSV output, after every other

0 commit comments

Comments
 (0)