feat(task): add dig DNS lookup utility
Adds dig as a new DNS reconnaissance task supporting standard queries, custom resolvers, and zone transfers.
Implementation
- New task:
secator/tasks/dig.pyextendingReconDns - Record types: A, AAAA, MX, NS, TXT, CNAME, SOA, AXFR, etc.
- Options:
--record-type/-rt: DNS record type (default: A)--resolver/-r: Custom DNS server--short: Brief output mode--trace: Full delegation path
- Outputs: Record, Subdomain, and IP objects parsed from dig responses
Usage
# Basic A record query
secator x dig example.com
# MX records with custom resolver
secator x dig example.com -rt MX -r 8.8.8.8
# Zone transfer attempt
secator x dig domain.com -rt AXFR -r ns.domain.com
# Trace delegation path
secator x dig example.com --trace
Parser
Handles multiple dig output formats: standard (with TTL), simplified (without TTL), and short form. Extracts domain information to create Subdomain objects, IP addresses from A/AAAA records to create IP objects, and all records as Record objects with TTL and class metadata. TXT records are parsed with quotes stripped for cleaner output.
Testing
- Test fixture:
tests/fixtures/dig_output.txtwith realistic dig output samples - Test inputs: Added to
tests/integration/inputs.py - Expected outputs: Defined in
tests/integration/outputs.pywith Record, Subdomain, and IP objects - ✅ All linting checks pass (flake8)
- ✅ Security scan passes (0 vulnerabilities)
- ✅ Fixture parsing validated
[!WARNING]
Original prompt
This section details on the original issue you should resolve
<filter_complete></filter_complete>
dig </issue_description>
## Comments on the Issue (you are @copilot in this section)
<comments>
</comments>
- Fixes freelabz/secator#766
Original prompt
This section details on the original issue you should resolve
<issue_title>feat(task): add support for dig</issue_title> <issue_description>dig can be helpful to find host records like:
dig <record_type> <host> @<resolver>If record type is empty then it will default to A records. If resolver is empty then it will default to the host's DNS server.
Dig can also help find subdomains using zone transfers like:
dig axfr <domain> @<ip></issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes freelabz/secator#766
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
Comment @coderabbitai help to get the list of available commands and usage tips.
@copilot You were rate-limited. Please finish your work grom where you left off
@copilot You were rate-limited. Please finish your work grom where you left off
Added all requested test components in commit 00243af:
- Test fixture:
tests/fixtures/dig_output.txtwith realistic dig output - Input configuration:
tests/integration/inputs.py - Expected outputs:
tests/integration/outputs.pywith Record, Subdomain, and IP objects
Also improved TXT record parsing to strip surrounding quotes for cleaner output.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
publicsuffix.org
- Triggering command:
/usr/bin/python3 python3(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)