Skip to content

fix(commands): detect DNS lookups that carry data out (#143) - #151

Merged
batrapulkit merged 3 commits into
batrapulkit:mainfrom
SankalpPandey-56:fix/dns-exfiltration-command-reader
Oct 29, 2026
Merged

batrapulkit merged 3 commits into
batrapulkit:mainfrom
SankalpPandey-56:fix/dns-exfiltration-command-reader

Conversation

@SankalpPandey-56

Copy link
Copy Markdown
Contributor

Fixes #143

What changed

Commands performing DNS queries (ping, nslookup, dig, host, Resolve-DnsName) that carry data out inside the target hostname (such as in CVE-2025-55284) previously classified as other and ran without approval.

They now classify as irreversible with the plain-English reason "sends data out inside a DNS name", waiting for teammate approval.

  • Inspects DNS query CLIs (ping, ping6, nslookup, dig, host, resolve-dnsname).
  • Detects substitutions ($(...), backticks, $VAR, $env:..., ${...}) in DNS arguments.
  • Detects encoded payload labels (20+ hex or base64 characters) within target domain names (e.g. c2stLWFudC1hcGkwMy14eXo.attacker.example).
  • Adds ping, ping6, nslookup, dig, host, and resolve-dnsname to KNOWN programs.
  • Ensures everyday lookups (ping google.com, ping -c 3 192.168.1.1, dig github.com, nslookup api.openai.com) remain unflagged in test_no_false_alarm and test_everyday_work_is_not_held.

How I checked it

  • pytest -q passes (1,420 passed)
  • pytest tests/test_commands.py passes (386 passed)
  • python tests/e2e_business_scenario.py passes (18/18 passed)
  • Verified squidbrake explain outputs irreversible: sends data out inside a DNS name (exit 1) on suspicious lookups and other (exit 0) on everyday lookups

SankalpPandey-56 and others added 3 commits October 28, 2026 18:26
- Check DNS-querying tools (ping, nslookup, dig, host, Resolve-DnsName) for command/variable substitutions ($(...), backticks, $VAR, $env:...) or encoded payload labels (20+ chars of hex/base64).
- Classify suspicious lookups as irreversible with plain-English explanation: 'sends data out inside a DNS name'.
- Add ping, ping6, nslookup, dig, host, and resolve-dnsname to KNOWN programs.
- Keep standard developer DNS lookups (e.g. ping google.com, ping -c 3 192.168.1.1, dig github.com, nslookup api.openai.com) unflagged in test_no_false_alarm.
- Add test coverage in tests/test_commands.py for CVE-2025-55284 DNS exfiltration patterns.
…a long ordinary hostname isn't held)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eck)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@batrapulkit
batrapulkit merged commit e82d56c into batrapulkit:main Oct 29, 2026
12 checks passed
@batrapulkit batrapulkit added the hacktoberfest-accepted Accepted Hacktoberfest pull request label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accepted Hacktoberfest pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command reader: DNS lookups that carry data out (ping/nslookup/dig with $(...) or encoded hostnames)

2 participants