Skip to content

fix(enrichers): dnsx stdin input + configurable Scamalytics API host - #200

Merged
dextmorgn merged 1 commit into
reconurge:mainfrom
Topman3579:fix/dnsx-stdin-and-scamalytics-host
Jul 28, 2026
Merged

fix(enrichers): dnsx stdin input + configurable Scamalytics API host#200
dextmorgn merged 1 commit into
reconurge:mainfrom
Topman3579:fix/dnsx-stdin-and-scamalytics-host

Conversation

@Topman3579

Copy link
Copy Markdown
Contributor

Two enrichers return an empty result instead of failing loudly, so the task is reported as succeeded and nothing shows up in the graph.

1. domain_to_dns — dnsx no longer accepts a bare -d

DnsxTool.resolve_domain() builds:

dnsx -d <domain> -a -aaaa -json -silent

Since dnsx 1.2, -d means "bruteforce this domain" and requires a wordlist:

$ docker run --rm projectdiscovery/dnsx -d example.com -a -aaaa -json -silent
[FTL] missing wordlist(w) flag required with domain(d) input
$ echo $?
0

The exit code is 0, so nothing raises — the enricher just returns [] and Celery logs succeeded. From the UI it looks like the domain simply has no DNS records.

Fix: feed the single target on stdin, which is the supported single-target invocation:

sh -c "echo <domain> | dnsx -a -aaaa -json -silent"

DockerTool.launch() gains an optional entrypoint argument so a shell can be placed in front of the image entrypoint. The domain is passed through shlex.quote().

Verified against projectdiscovery/dnsx:latest (v1.2.2):

resolve_domain("<a test domain>") -> ['13.227.138.65', '13.227.138.39', '13.227.138.34', '13.227.138.124']

2. ip_to_fraudscore — Scamalytics API host is per-account

The host is hardcoded:

requests.get(f'https://api12.scamalytics.com/v3/{api_username}/?key={api_key}&ip={ip.address}')

Scamalytics provisions each account on a numbered API node and hands out the full base URL at signup. An account on a different node gets a plain 404 from api12, with the same silent-empty-result outcome. On a live v3 account provisioned on api11:

host result
the account's own node 200 + full JSON
api12 404 Not Found

Fix: read the host from a SCAMLYTICS_API_HOST secret / env var, defaulting to api12 so existing deployments are unchanged.

Notes

  • No behaviour change for anyone already working: the Scamalytics default is preserved, and the dnsx change only alters how the single target is passed.
  • Happy to split this into two PRs, add tests, or make the dnsx change use a different mechanism if you prefer — just say the word.

Two enrichers silently return empty results instead of failing loudly.

1. domain_to_dns
   dnsx >= 1.2 treats -d as "bruteforce this domain" and exits with
   "missing wordlist(w) flag required with domain(d) input" unless -w is
   also given, so `dnsx -d example.com -a -aaaa -json -silent` never
   produces output. The enricher catches nothing (the tool exits 0) and
   returns [], while Celery still reports the task as succeeded.
   Feed the single target on stdin instead, which is the supported
   single-target invocation. DockerTool.launch() gains an optional
   entrypoint override so a shell can be put in front of the image
   entrypoint; the domain is passed through shlex.quote().

2. ip_to_fraudscore
   Scamalytics assigns each account a numbered API node (api11, api12,
   ...) and the host was hardcoded to api12, which returns 404 for every
   account provisioned on a different node. The host is now read from a
   SCAMLYTICS_API_HOST secret/env var, defaulting to the previous api12
   so existing deployments are unaffected.

Verified against dnsx v1.2.2 and a live Scamalytics v3 account.

@dextmorgn dextmorgn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks great @Topman3579, thanks !

@dextmorgn
dextmorgn merged commit 95e0ab9 into reconurge:main Jul 28, 2026
1 check passed
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.

2 participants