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 665e33c
Browse filesBrowse the repository at this point in the historyBrowse files
MCP: let a call continue the word list with an offset (#313)
An MCP scan tests at most max_queries names, and a call could not say
where to start, so an agent using the bundled list could only ever test
its first part.
scan and lab_scan accept an integer offset that skips that many words
of the deduplicated list, and the report gives next_offset (with a hint
in the reason) when the query cap left words untested and every
admitted name was tested. Each call still goes through the operator's
query, time and call budgets.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Fixes#313
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
+
-`subenum mcp`: `scan` and `lab_scan` accept an `offset` that skips that many candidates at the start of the word list (after dedupe), and a report whose `max_queries` left words untested carries `next_offset`, named in its `reason`. An agent can now work through the bundled 5,000-label list in several calls instead of testing the same first `-max-queries` names each time; every call stays within `-max-queries`, `-max-duration` and `-max-calls` (#313).
11
12
- The TUI configuration form includes **Auto Rate**, **Max Duration** and **Retry Inconclusive** fields for `-auto-rate`, `-max-duration` and `-retry-inconclusive`. Max Duration accepts a Go duration such as `20m` or `1h30m`; leave it blank for no time limit (#274).
12
13
- `subenum mcp` serves subdomain enumeration to AI agents over the Model Context Protocol (stdio). Tools: `lab_scan`, which scans the compiled-in lab scenarios on a loopback DNS server; `scan`, offered only with `-allow` and refusing any domain outside it; and `explain_stats`, which explains a `-stats` report or `-format jsonl` output. The operator sets the resolver, rate, timeout and budgets (`-dns-server`, `-rate`, `-timeout`, `-max-queries`, `-max-duration`, which cannot be turned off). A call can lower `max_queries`, never raise it; unknown arguments are refused, and calls run one at a time. Each scan returns its results with a verdict (`complete`, `degraded`, `unreliable` or `not_run`), and sends progress notifications about once a second when the call carries a `progressToken` (#267). `-sources ct,wayback` lets `scan` calls seed candidates from passive sources through a `sources` argument; it is off by default, and the report counts each source's names or names its error (#268). `scan` and `lab_scan` accept `retry_inconclusive`, `auto_rate`, `exclude` and `depth` (up to 3), all within the operator's caps, so an agent can act on a verdict that is not complete; the report adds `retried`, `recovered`, `rate_backoffs` and `excluded` (#269). Their report is also declared as an `outputSchema` and sent as `structuredContent`, beside the same JSON as text (#270). `-max-calls` (default 100) caps the `scan` calls one session may make, and a client that stops reading replies ends the session, cancelling queued calls instead of scanning for nobody (#240). A request line over 16 MiB gets a JSON-RPC parse error instead of ending the session, a request reusing the ID of one still running is refused, and a scan cancelled before testing any name reports `not_run` rather than `degraded` (#241). The JSON-RPC layer is a small hand-written `internal/mcp` package, so there is no new dependency (#131). `lab_scan`'s `scenario` argument describes what each lab teaches, taken from the opening comment of its zone file (#275).
13
14
-`-sources ct,wayback` picks keyless passive sources whose names become candidates and `-permute` seeds, each still verified by a lookup. `ct` is crt.sh, as `-ct`, which stays as shorthand. `wayback` is new: the hostnames in the Wayback Machine's index of archived URLs, one HTTPS request per target. The report gains a `sources` entry per source (`names`, or the `error` it hit; `ct_names` and `ct_error` are kept), a failed source is a warning, the resume state keeps each source's names, simulation ignores `-sources` and lab mode refuses it. Sources share one interface in a new `internal/passive` package. `pkg/subenum` gains `Config.Sources`, the `Source` interface, `CertificateTransparency()`, `WaybackMachine()` and `NoticeSource` (#193).
// offsetSchema is the offset argument (#313): with the report's next_offset
362
+
// it lets an agent work through a word list longer than max_queries, one
363
+
// call at a time, each within the operator's caps.
364
+
varoffsetSchema=schemaField{"offset", map[string]any{"type": "integer", "minimum": 0, "description": "Skip this many candidates at the start of the word list (after dedupe); default 0. When max_queries leaves words untested the report gives next_offset: call again with the same words and that offset to test the following ones."}}
365
+
361
366
// remediationProps are the scan settings an agent can change after a verdict
362
367
// that is not complete (#269). None can raise the operator's caps.
{"rate", map[string]any{"type": "integer", "minimum": 0, "maximum": 1000, "description": "Queries per second; 0 or absent is unlimited. Lab traffic stays on this machine."}},
{"words", wordsSchema("Subdomain labels to try; default subenum's bundled list of the most common ones.")},
480
487
{"types", recordTypeSchema},
481
488
{"max_queries", map[string]any{"type": "integer", "minimum": 1, "maximum": cfg.maxQueries, "description": fmt.Sprintf("Most names to test; default and ceiling %d.", cfg.maxQueries)}},
489
+
offsetSchema,
482
490
}
483
491
iflen(cfg.sources) >0 {
484
492
props=append(props, schemaField{"sources", map[string]any{"type": "array", "items": map[string]any{"enum": cfg.sources}, "description": "Passive sources to seed candidates from before the scan; default none. Their names are added to words after dedupe, count against max_queries, and are each verified by a lookup. One HTTPS request per source."}})
report.Reason+=fmt.Sprintf("; call again with offset %d to test the words after these", report.NextOffset)
761
+
}
698
762
returnreport
699
763
}
700
764
@@ -760,6 +824,7 @@ var mcpReportSchema = json.RawMessage(`{
760
824
"wildcard_filtered": {"type": "integer"}
761
825
}},
762
826
"skipped_by_cap": {"type": "integer"},
827
+
"next_offset": {"type": "integer", "description": "max_queries left words untested: call again with the same words and this offset to test the following ones"},
0 commit comments