Skip to content

Commit e5435fc

Browse files
TMHSDigitalclaude
andcommitted
Look up SRV records with -type SRV (#419)
SRV is a record type like MX and TXT: lookupType asks LookupSRV for the name as given, and each record reads "<priority> <weight> <port> <target>", sorted so the same answer always reads the same. The test DNS server and lab zone files answer SRV, -simulate invents one, and pkg/subenum accepts it. Tests that used SRV as the unsupported type now use CAA. Also drops "unreleased" site tags for type=NS/MX/TXT and o=format:path, which v0.11.0 released; the check only runs once the values list is not empty, which SRV now makes it. Refs #419 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6ce1c47 commit e5435fc

26 files changed

Lines changed: 136 additions & 34 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- `-hosts <file>` looks up a list of full host names, such as another tool's output or an old results file, instead of a wordlist, through the same wildcard filtering, resolver pool, pacing, verdict, `-diff` and output formats (`-` reads stdin). Targets still come from the `<domain>` argument or `-dL`: each looks up only the names under it, the most specific target when targets nest, and names under no target are out of scope, never queried, and counted in one note. It cannot be combined with `-w`, `-recursive` or `-tui` (#351).
1212
- An [output field reference](https://tmhsdigital.github.io/subenum/output.html) lists every JSON, JSONL and CSV result field and every `-stats` report field, with its type, when it is present and its values, and the site serves JSON Schema files for both (`schemas/result.v1.json`, `schemas/stats.v1.json`). A test fails when a field is added, renamed or removed in the code without the schema files (#433).
13+
- `-type SRV` looks up SRV records, written `<priority> <weight> <port> <target>` and sorted, so the same answer always reads the same. They live at service names, so the wordlist names those (`_sip._tcp`, `_autodiscover._tcp`). Lab zone files take `<name> SRV <priority> <weight> <port> <host>`, and `pkg/subenum` accepts `"SRV"` in `Config.Types` (#419).
1314

1415
### Changed
1516
- The `-permute` pass is built in one set instead of three copies, and a target's pass builds at most 1,000,000 candidates (the seeds taken in sorted order, with a note when it stops there). For 50,000 seed names, as a large Certificate Transparency footprint gives, building the pass took about 11 s and 1.8 GB of allocations and now takes under 1 s and 150 MB. The `-dry-run` notes give the pass's bound: up to 93 candidates per name (#400).

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Tools like [puredns](https://github.com/d3mondev/puredns), [shuffledns](https://
8484
| | |
8585
| :--- | :--- |
8686
| **Find names** | Bundled top-5000 wordlist or your own (`-w`, repeatable) · keyless passive sources: Certificate Transparency and the Wayback Machine (`-sources`, `-ct`) · zone transfers and NSEC walkability (`-axfr`) · permutation second pass (`-permute`) · recursive enumeration (`-recursive`, `-depth`) |
87-
| **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` and `TXT` records (`-type`) |
87+
| **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` and `SRV` 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`) |
9090
| **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`) |
@@ -239,7 +239,7 @@ This table describes `main`, which can be ahead of the latest release: a release
239239
| `-w <file>` | bundled top-5000 | Wordlist file, one prefix per line; `#` comments allowed; `-` reads stdin. Repeat it to combine lists (`-w general.txt -w target.txt`); entries found in more than one are scanned once. Omit it to use the built-in list (see [Choosing a wordlist](#choosing-a-wordlist)) |
240240
| `-hosts <file>` | n/a | File of full host names to look up instead of a wordlist, such as another tool's output; `#` comments allowed; `-` reads stdin. Each target looks up only the names under it (the most specific one, when `-dL` targets nest), through the same wildcard filtering, pacing and verdict as a wordlist scan; names under no target are out of scope, never queried, and counted in one note. Cannot be combined with `-w`, `-recursive` or `-tui` |
241241
| `-dL <file>` | n/a | File of apex domains to scan, one per line (`-` reads stdin), instead of a `<domain>` argument. Each domain is an independent scan; results share one output |
242-
| `-type <list>` | `A,AAAA` | Comma-separated record types to look up: `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT`. A name is found when it has a record of any listed type. `CNAME` and `NS` also check for [takeovers](#subdomain-takeover-hints); `MX` values are `<preference> <host>`; a `TXT` value shows a backslash and non-printable bytes as `\DDD` |
242+
| `-type <list>` | `A,AAAA` | Comma-separated record types to look up: `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT`, `SRV`. A name is found when it has a record of any listed type. `CNAME` and `NS` also check for [takeovers](#subdomain-takeover-hints); `MX` values are `<preference> <host>`; a `TXT` value shows a backslash and non-printable bytes as `\DDD`; `SRV` values are `<priority> <weight> <port> <target>`, found at service names such as `_sip._tcp` in the wordlist (Unreleased) |
243243
| `-exclude <list>` | n/a | Comma-separated out-of-scope names: exact (`vpn.example.com`) or `*.parent` (every name below `parent`, not `parent` itself). Excluded names are never queried, probed or expanded, and are counted as `excluded`. A target that is itself out of scope is refused before `-axfr`, `-ct`/`-sources` or the `-dry-run` preflight touch it, and `-axfr` never resolves or contacts an excluded name server |
244244
| `-exclude-file <file>` | n/a | Same patterns, one per line (`#` comments allowed), e.g. a bug-bounty program's out-of-scope list |
245245
| **Finding more names** | | |

‎docs/DEVELOPER_GUIDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,6 @@ The following capabilities are implemented and available today:
381381
382382
See `docs/ROADMAP.md` for the next-pass list. Areas still open:
383383
384-
* **Additional record types**: `Lookup.ResolveTypes` covers A, AAAA, CNAME, NS, MX and TXT; a new type is a case in `lookupType`, an entry in `typeOrder` and `queriesPerType`, and (to test it) an answer builder in `internal/dnsserver` and a record type in `internal/labzone`.
384+
* **Additional record types**: `Lookup.ResolveTypes` covers A, AAAA, CNAME, NS, MX, TXT and SRV; a new type is a case in `lookupType`, an entry in `typeOrder` and `queriesPerType`, and (to test it) an answer builder in `internal/dnsserver` and a record type in `internal/labzone`.
385385
386386
When working on new features, please update the documentation accordingly and add tests to cover the new functionality.

‎docs/ROADMAP.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ surprises:
5757

5858
Constraints to keep in mind when changing the code.
5959

60-
- **The test DNS server (`internal/dnstest`) models A, AAAA, CNAME, NS, MX
61-
and TXT answers,** any RCODE, NODATA with SOA, delays, drops and
60+
- **The test DNS server (`internal/dnstest`) models A, AAAA, CNAME, NS, MX,
61+
TXT and SRV answers,** any RCODE, NODATA with SOA, delays, drops and
6262
truncation (scripted, or when a UDP answer exceeds the query's EDNS
6363
buffer). Other record types and referrals are not modelled; extend
6464
`Reply` in `internal/dnsserver` (which `internal/dnstest` re-exports) before

‎docs/_data/unreleased.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ commands: []
88
flags:
99
- hosts
1010
# new values of a flag that is itself released, as flag=VALUE (#306)
11-
values: []
11+
values:
12+
- type=SRV
1213
# action.yml inputs and outputs
1314
action: []
1415
# pkg/subenum identifiers

‎docs/_includes/flags.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
| `-takeover-providers-only` | - | Use only the -takeover-providers file, not the built-in provider list |
5050
| `-timeout <int>` | 1000 | DNS lookup timeout in milliseconds |
5151
| `-tui` | - | Launch the interactive terminal UI, its form pre-filled from the other flags and the domain argument |
52-
| `-type <string>` | A,AAAA | Comma-separated DNS record types to look up: A, AAAA, CNAME, NS, MX, TXT (CNAME and NS also check for takeovers) |
52+
| `-type <string>` | A,AAAA | Comma-separated DNS record types to look up: A, AAAA, CNAME, NS, MX, TXT, SRV (CNAME and NS also check for takeovers) SRV: {% include unreleased.html value="type=SRV" %} |
5353
| `-v` | - | Enable verbose output |
5454
| `-version` | - | Show version information |
5555
| `-w <file>` | - | Path to a wordlist file (- for stdin); repeat to combine several, deduplicated; omitted: the bundled top-5000 list |

‎docs/cli.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ Settings you repeat on every run can live in the environment or a config file. T
5959

6060
## Output streams
6161

62-
Resolved names go to stdout and nothing else does, so `subenum example.com | httpx` works as expected. Progress, warnings and the per-outcome breakdown go to stderr. `-o` writes the same results to a file in the chosen `-format`; results files are replaced atomically. Repeat `-o` to write several files; a file without a prefix uses `-format`, and a prefix names its own format: `-o text:names.txt -o jsonl:results.jsonl`{% include unreleased.html value="o=format:path" %} writes bare names and JSONL in one run, whatever `-format` stdout uses. [Output fields](output.html) lists every JSON, JSONL and CSV field and the `-stats` report's, with JSON Schema files.
62+
Resolved names go to stdout and nothing else does, so `subenum example.com | httpx` works as expected. Progress, warnings and the per-outcome breakdown go to stderr. `-o` writes the same results to a file in the chosen `-format`; results files are replaced atomically. Repeat `-o` to write several files; a file without a prefix uses `-format`, and a prefix names its own format: `-o text:names.txt -o jsonl:results.jsonl` writes bare names and JSONL in one run, whatever `-format` stdout uses. [Output fields](output.html) lists every JSON, JSONL and CSV field and the `-stats` report's, with JSON Schema files.

‎docs/library.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ for _, r := range results {
3434
}
3535
```
3636

37-
`Takeover` is a lead to check by hand: `dangling`, `provider:<name>` or `dangling:<name>` for a CNAME, or `dangling-ns`{% include unreleased.html value="type=NS" %} for a delegation to a name server that does not resolve. `Internal`{% include unreleased.html library="Internal" %} names the non-public scope (`private`, `loopback`, `link-local`, `cgnat`, `unspecified`) of an address a public name answers with, and is empty when every address is public. `Sources`{% include unreleased.html library="Sources" %} names what proposed the result: `wordlist` for `Words`, and each source in `Config.Sources` that returned it, by its `Name()` method when it has one (`ct`, `wayback`, `axfr` for the built-in ones) or else as `Sources[i]`, its index in `Config.Sources`.
37+
`Takeover` is a lead to check by hand: `dangling`, `provider:<name>` or `dangling:<name>` for a CNAME, or `dangling-ns` for a delegation to a name server that does not resolve. `Internal`{% include unreleased.html library="Internal" %} names the non-public scope (`private`, `loopback`, `link-local`, `cgnat`, `unspecified`) of an address a public name answers with, and is empty when every address is public. `Sources`{% include unreleased.html library="Sources" %} names what proposed the result: `wordlist` for `Words`, and each source in `Config.Sources` that returned it, by its `Name()` method when it has one (`ct`, `wayback`, `axfr` for the built-in ones) or else as `Sources[i]`, its index in `Config.Sources`.
3838

3939
Every zero value in `Config` takes the same default as the CLI, so `Config{Domain: "example.com"}` is a complete configuration that uses the bundled 5,000-word list.
4040

@@ -121,7 +121,7 @@ These queries go to the domain's own name servers, not to `Resolver`, and they a
121121
| `Timeout` | `1s` | Bound on one lookup of one record type. |
122122
| `Attempts` | `1` | Tries per name. Only failures are retried, never NXDOMAIN. |
123123
| `Rate` | unlimited | Queries per second on the wire, counting every type, retry and probe. |
124-
| `Types` | `A`, `AAAA` | Record types: `A`, `AAAA`, `CNAME`, `NS`{% include unreleased.html value="type=NS" %}, `MX`{% include unreleased.html value="type=MX" %} and `TXT`{% include unreleased.html value="type=TXT" %}. `CNAME` and `NS` populate `Result.Takeover`. |
124+
| `Types` | `A`, `AAAA` | Record types: `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT` and `SRV`{% include unreleased.html value="type=SRV" %}. `CNAME` and `NS` populate `Result.Takeover`. |
125125
| `Recursive`, `Depth` | off, `1` | Enumerate again under each name found. |
126126
| `MaxQueries` | unlimited | Cap on candidate names tested. |
127127
| `MaxDuration`{% include unreleased.html library="MaxDuration" %} | unlimited | Time budget from the start of `Run`, not counting the preflight and wildcard probes sent before the first candidate lookup, so `Run` can take longer. Then no new names are tested and the rest are counted in `Stats.Skipped`, with `Stats.Expired` set. |

‎docs/monitoring.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Add `-type A,AAAA,CNAME -sarif takeovers.sarif` to the scan and upload the file
270270
after it, and every dangling or takeover-prone CNAME becomes an alert in the
271271
repository's Security tab, where it can be triaged and dismissed. Alerts are
272272
fingerprinted per name, so a candidate seen every week stays one alert. With
273-
`NS`{% include unreleased.html value="type=NS" %} in the list as well
273+
`NS` in the list as well
274274
(`-type A,AAAA,CNAME,NS`), so does every delegation to a name server that does
275275
not exist (`dangling-ns`); a release that does not have `NS` yet rejects it, so
276276
add it only once the pinned `SUBENUM_VERSION` does. The job needs

‎docs/output.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A test fails when a field is added to the code but not to these files, so they s
3131
| `sources` | array of strings | scan results | What proposed the name, in this order: `wordlist`, `ct`, `wayback`, `axfr`; or `permute` alone for a `-permute` hit. Not on removed names or in `subenum diff` output. |
3232
| `target` | string | scan results | The scanned domain that found the name, which tells `-dL` results with nested targets apart. Not on removed names or in `subenum diff` output. |
3333

34-
A record's `type` is `A`, `AAAA`, `CNAME`, `NS`, `MX` or `TXT`. Its `value` is an address, a host name (`CNAME`, `NS`), `<preference> <host>` (`MX`), or the text (`TXT`), with a backslash and non-printable bytes written as `\DDD`.
34+
A record's `type` is `A`, `AAAA`, `CNAME`, `NS`, `MX`, `TXT` or `SRV`{% include unreleased.html value="type=SRV" %}. Its `value` is an address, a host name (`CNAME`, `NS`), `<preference> <host>` (`MX`), the text (`TXT`), with a backslash and non-printable bytes written as `\DDD`, or `<priority> <weight> <port> <target>` (`SRV`).
3535

3636
## Results: CSV
3737

0 commit comments

Comments
 (0)