Skip to content

feat: [dnstwist] add domain permutation enrichment - #1068

Open
adulau wants to merge 2 commits into
mainfrom
codex/enrich-dnstwist
Open

adulau wants to merge 2 commits into
mainfrom
codex/enrich-dnstwist

Conversation

@adulau

@adulau adulau commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Analysts can generate domain permutations locally or explicitly enable DNS resolution. An isolated subprocess preserves mutation algorithms, bounds runtime and avoids changing server arguments. Generated candidates retain to_ids=false and source references. Install the optional dnstwist engine in the module server environment as documented.

Includes a usage guide and focused adapter tests.

Validation: 14 passed, 1 warning in 0.64s with pytest -q tests/test_dnstwist.py; flake8 passed for the module. The combined enrichment regression check passed 389 tests.

Local generation was also exercised with the installed DNSTwist engine.

Authenticated provider API validation remains pending. Tests use sanitized fixtures; no provider credentials are included.

Review updates: Retain valid results when DNS failure sentinels are returned, and preserve domain identity with non-transitional IDNA normalization.

Updated validation: 16 passed, 1 warning in 0.64s; module lint passed. Combined regression validation passed 409 tests.

@adulau
adulau marked this pull request as ready for review October 29, 2026 22:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:13:21.637110Z 4e70036 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-29T22:14:23.305939Z 4e70036 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e700367d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

obj.add_attribute("text", value=json.dumps({"fuzzer": row.get("fuzzer"), "dns_checked": resolve}), to_ids=False)
for key in ("dns_a", "dns_aaaa"):
for address in row.get(key, [])[:limit]:
obj.add_attribute("ip", value=str(ipaddress.ip_address(address)), to_ids=False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ignore DNSTwist's DNS failure sentinels

When resolve=true and any selected permutation receives a DNS SERVFAIL, DNSTwist deliberately returns "!ServFail" in dns_a or dns_aaaa (upstream resolver behavior). Passing that sentinel to ipaddress.ip_address() raises ValueError, so the handler discards every otherwise valid result and returns the generic error response. Skip or separately annotate these sentinel values rather than parsing them as addresses.

Useful? React with 👍 / 👎.

if kind in ("ip-src", "ip-dst"):
return str(ipaddress.ip_address(value))
if kind in ("domain", "hostname"):
value = value.rstrip(".").encode("idna").decode("ascii").lower()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve IDNA2008 domain identity

For Unicode domains containing characters whose IDNA2003 and IDNA2008 mappings differ, this silently scans a different domain; for example, faß.de becomes fass.de here instead of the IDNA2008 xn--fa-hia.de. DNSTwist uses the third-party idna.encode() implementation itself (upstream parsing), so normalize with the same non-transitional IDNA behavior before invoking it to avoid generating permutations for an unrelated domain.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant