fix: keep wildcard answers out of cloud targets, capture border group - #151
Merged
Conversation
Two gaps in the cloud-matching path, which is the half of this tool that has no commodity equivalent. Wildcard resolutions were fed to the cloud matcher with no indication of what they were. A catch-all address belongs to the hosting platform and is in active use, so it is the opposite of a claimable target — yet a single wildcarded zone in cloud space emitted one record per enumerated subdomain, each a different line and so none deduplicated. On a large enumeration that buries the real findings under the platform's own addresses. The wildcard verdict now travels with the cloud match. Those records are written with a WILDCARD| prefix, consistent with the resolution output, and the summary reports them separately rather than counting them as targets. They are marked rather than dropped: no judgement about what is worth pursuing belongs in this tool. Second, AWS publishes network_border_group and it was being discarded. It is the boundary an Elastic IP is actually allocated and advertised from, which is exactly the scope a consumer of this output would work within. It usually mirrors the region but diverges for Local Zones and Wavelength, which is where knowing it matters. Records now carry it; GCP and Azure publish no equivalent and it reads unknown. Verified live against a wildcarded zone inside AWS space. That run also showed the limit of the approach: where a catch-all is served by a large rotating fleet, a probe sees only part of the rotation, so a later name resolving elsewhere in that fleet is not recognised. One of two fabricated names was marked and one was not. Documented in the README and AGENTS.md as best-effort rather than left to be discovered — a match is good evidence, a miss is not evidence of absence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two gaps in the cloud-matching path — the half of this tool that has no commodity equivalent.
1. Wildcard answers were counted as cloud targets
perform_csp_checksran with no idea whether the resolution had come from a zone wildcard. A catch-all address belongs to the hosting platform and is in active use, so it is the opposite of a claimable target — yet a single wildcarded zone sitting in cloud space emitted one record per enumerated subdomain, each a distinct line and therefore none deduplicated. On a real enumeration that buries the findings under the platform1s own addresses.The wildcard verdict now travels with the cloud match. Those records get a
WILDCARD|prefix, consistent with the resolution output, and the summary reports them separately instead of counting them as targets:They are marked, not dropped — no judgement about what is worth pursuing belongs in this tool.
2. AWS network border group was being discarded
It is the boundary an Elastic IP is actually allocated and advertised from, which is exactly the scope a consumer of this output would operate within. It usually mirrors the region but diverges for Local Zones and Wavelength, which is where knowing it matters.
GCP and Azure publish no equivalent; it reads
unknownfor them, rather than being inferred from the region.Verified live, including what it does not do
Run against a wildcarded zone inside AWS space. It worked — and exposed the limit of the approach, which is worth stating plainly rather than leaving to be discovered:
Both names are fabricated. Where a catch-all is served by a large rotating fleet, two probes observe only part of the rotation, so a later name landing elsewhere in that fleet is not recognised. A match is good evidence; a miss is not evidence of absence. Documented in the README and
AGENTS.md.A zone-level semantic — marking every resolution in a zone known to answer for anything, rather than testing each address against a sampled set — would be more robust, and arguably more honest given DNS cannot discriminate within such a zone anyway. That is an open design decision and deliberately not slipped in here.
Compatibility
csp_matches_*.txtgains a seventh field and an optional line prefix. Breaking for anything parsing the six-field form shipped in the previous PR.255 passed, ruff clean. New tests cover the marking, the unmarked default for existing callers, and the summary excluding wildcard records from target counts.