DNS Toolkit Cheat Blatt¶
Überblick¶
DNSx ist ein schnelles und vielseitiges DNS-Toolkit, das von Project Discovery entwickelt wurde und mehrere DNS-Sonden mithilfe der retryabledns-Bibliothek ausführen kann. Es ist entworfen, um verschiedene DNS-Abfragen mit einem Fokus auf Geschwindigkeit und Zuverlässigkeit durchzuführen. DNSx kann mehrere DNS-Record-Typen behandeln und unterstützt benutzerdefinierte Resolver, so dass es ein vielseitiges Werkzeug für DNS-Rekonnaissance und Aufzählung.
Was DNSx von anderen DNS-Tools unterscheidet, ist seine Fähigkeit, große Anzahl von Domains effizient und seine Integrationsfähigkeit mit anderen Sicherheitstools zu verarbeiten. Es kann Wildcard-DNS-Aufzeichnungen filtern, DNS-Gleiten ausführen und wertvolle Informationen aus DNS-Antworten extrahieren. DNSx wird häufig in der Aufklärungsphase von Sicherheitsbewertungen verwendet, um Informationen über Zieldomänen und ihre Infrastruktur zu sammeln.
DNSx unterstützt verschiedene Eingabeformate und lässt sich leicht mit anderen Tools in einer Pipeline integrieren, was es zu einer wesentlichen Komponente in vielen Sicherheitstest-Workflows macht. Seine Fähigkeit, Ergebnisse basierend auf verschiedenen Kriterien zu filtern, hilft Sicherheitsexperten, sich auf die wichtigsten Ziele zu konzentrieren.
Installation¶
Verwenden Sie Go¶
```bash
Install using Go (requires Go 1.20 or later)¶
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
Verify installation¶
dnsx -version ```_
Verwendung von Docker¶
```bash
Pull the latest Docker image¶
docker pull projectdiscovery/dnsx:latest
Run DNSx using Docker¶
docker run -it projectdiscovery/dnsx:latest -h ```_
Verwendung von Homebrew (macOS)¶
```bash
Install using Homebrew¶
brew install dnsx
Verify installation¶
dnsx -version ```_
Verwendung von PDTM (Projekt Discovery Tools Manager)¶
```bash
Install PDTM first if not already installed¶
go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest
Install DNSx using PDTM¶
pdtm -i dnsx
Verify installation¶
dnsx -version ```_
Auf Kali Linux¶
```bash
Install using apt¶
sudo apt install dnsx
Verify installation¶
dnsx -version ```_
Basisnutzung¶
DNS Lookups¶
```bash
Perform A record lookup for a single domain¶
dnsx -d example.com -a
Perform A record lookup for multiple domains¶
dnsx -d example.com,hackerone.com -a
Perform A record lookup from a list of domains¶
dnsx -l domains.txt -a
Perform A record lookup from STDIN¶
cat domains.txt|dnsx -a ```_
Aufzeichnungsarten¶
```bash
Query A records (IPv4 addresses)¶
dnsx -l domains.txt -a
Query AAAA records (IPv6 addresses)¶
dnsx -l domains.txt -aaaa
Query CNAME records (Canonical names)¶
dnsx -l domains.txt -cname
Query NS records (Name servers)¶
dnsx -l domains.txt -ns
Query TXT records (Text records)¶
dnsx -l domains.txt -txt
Query MX records (Mail exchange servers)¶
dnsx -l domains.txt -mx
Query SOA records (Start of authority)¶
dnsx -l domains.txt -soa
Query PTR records (Pointer records)¶
dnsx -l domains.txt -ptr
Query multiple record types¶
dnsx -l domains.txt -a -cname -ns ```_
Ausgabeoptionen¶
```bash
Save results to a file¶
dnsx -l domains.txt -a -o results.txt
Output in JSON format¶
dnsx -l domains.txt -a -json -o results.json
Output in CSV format¶
dnsx -l domains.txt -a -csv -o results.csv
Silent mode (only results)¶
dnsx -l domains.txt -a -silent ```_
Erweiterte Nutzung¶
Resolver Konfiguration¶
```bash
Use specific DNS resolvers¶
dnsx -l domains.txt -a -resolver 1.1.1.1,8.8.8.8
Use resolvers from a file¶
dnsx -l domains.txt -a -resolver-file resolvers.txt
Use system resolvers¶
dnsx -l domains.txt -a -system-resolver ```_
Antwort Filtern¶
```bash
Filter by response containing specific string¶
dnsx -l domains.txt -a -resp-only -resp "1.2.3.4"
Filter by response matching regex¶
dnsx -l domains.txt -a -resp-only -resp-regex "^1.2.[0-9]+.[0-9]+$" ```_
Wildcard Filtern¶
```bash
Enable wildcard filtering¶
dnsx -l domains.txt -a -wildcard
Set wildcard threshold¶
dnsx -l domains.txt -a -wildcard-threshold 5 ```_
DNS Walking¶
```bash
Enable DNS walking¶
dnsx -l domains.txt -a -walk
Set DNS walking threads¶
dnsx -l domains.txt -a -walk -walk-threads 20 ```_
Leistungsoptimierung¶
Concurrency und Rate Limiting¶
```bash
Set concurrency (default: 100)¶
dnsx -l domains.txt -a -c 200
Set rate limit¶
dnsx -l domains.txt -a -rate-limit 100
Set retries¶
dnsx -l domains.txt -a -retries 3 ```_
Timeout Optionen¶
```bash
Set timeout for DNS queries (milliseconds)¶
dnsx -l domains.txt -a -timeout 5000 ```_
Optimierung für große Scans¶
```bash
Use stream mode for large inputs¶
dnsx -l large-domains.txt -a -stream
Increase concurrency for faster scanning¶
dnsx -l domains.txt -a -c 500 ```_
Integration mit anderen Tools¶
Pipeline mit Subfinder¶
```bash
Find subdomains and resolve them¶
subfinder -d example.com -silent|dnsx -a -silent
Find subdomains and check for specific record types¶
subfinder -d example.com -silent|dnsx -a -cname -silent ```_
Pipeline mit HTTPX¶
```bash
Resolve domains and probe for HTTP services¶
dnsx -l domains.txt -a -silent|httpx -silent
Resolve domains, filter by IP, and probe for HTTP services¶
dnsx -l domains.txt -a -silent -resp "1.2.3.4"|httpx -silent ```_
Pipeline mit Naabu¶
```bash
Resolve domains and scan for open ports¶
dnsx -l domains.txt -a -silent|naabu -silent
Resolve domains, filter by IP, and scan for open ports¶
dnsx -l domains.txt -a -silent -resp "1.2.3.4"|naabu -silent ```_
Produktionsanpassung¶
Zollausgabe Format¶
```bash
Output only domain and IP¶
dnsx -l domains.txt -a -resp-only
Output with additional information¶
dnsx -l domains.txt -a -json
Count unique IPs¶
dnsx -l domains.txt -a -resp-only|sort -u|wc -l
Sort output by IP¶
dnsx -l domains.txt -a -resp-only|sort -t ' ' -k2 ```_
Filterausgang¶
```bash
Filter by IP¶
dnsx -l domains.txt -a -resp-only|grep "1.2.3.4"
Filter by domain¶
dnsx -l domains.txt -a -resp-only|grep "example.com"
Find unique IPs¶
dnsx -l domains.txt -a -resp-only|awk '\\{print $2\\}'|sort -u ```_
Erweiterte Filterung¶
IP Filtern¶
```bash
Filter by specific IP¶
dnsx -l domains.txt -a -resp-only -resp "1.2.3.4"
Filter by IP range¶
dnsx -l domains.txt -a -resp-only -resp-regex "^1.2.3.[0-9]+$" ```_
Domain Filtern¶
```bash
Filter by domain pattern¶
dnsx -l domains.txt -a -resp-only|grep "api"
Filter by specific TLD¶
dnsx -l domains.txt -a -resp-only|grep ".com$" ```_
KN-Code Filtern¶
```bash
Find domains with specific CNAME¶
dnsx -l domains.txt -cname -resp-only -resp "cdn.example.com"
Find domains with CNAME pointing to specific services¶
dnsx -l domains.txt -cname -resp-only -resp-regex "amazonaws.com$" ```_
Verschiedenes Eigenschaften¶
Zurück DNS Lookup¶
```bash
Perform reverse DNS lookup¶
dnsx -l ips.txt -ptr
Perform reverse DNS lookup with response filtering¶
dnsx -l ips.txt -ptr -resp-only -resp "example.com" ```_
DNS Tranchen¶
```bash
Perform DNS trace¶
dnsx -d example.com -trace
Perform DNS trace with specific resolver¶
dnsx -d example.com -trace -resolver 1.1.1.1 ```_
Gesundheitscheck¶
```bash
Check resolver health¶
dnsx -hc -resolver 1.1.1.1,8.8.8.8
Check resolver health with timeout¶
dnsx -hc -resolver 1.1.1.1,8.8.8.8 -timeout 5000 ```_
Fehlerbehebung¶
Gemeinsame Themen¶
- **Resolverfragen* ```bash # Try different resolvers dnsx -l domains.txt -a -resolver 1.1.1.1,8.8.8.8
# Check resolver health dnsx -hc -resolver 1.1.1.1,8.8.8.8 ```_
- ** Timeout Issues* ```bash # Increase timeout dnsx -l domains.txt -a -timeout 10000
# Increase retries dnsx -l domains.txt -a -retries 5 ```_
- Beschränkung ```bash # Reduce concurrency dnsx -l domains.txt -a -c 50
# Set rate limit dnsx -l domains.txt -a -rate-limit 50 ```_
- **Memory Issues*
bash # Use stream mode for large inputs dnsx -l large-domains.txt -a -stream
_
Debugging¶
```bash
Enable verbose mode¶
dnsx -l domains.txt -a -v
Show debug information¶
dnsx -l domains.txt -a -debug
Show statistics¶
dnsx -l domains.txt -a -stats ```_
Konfiguration¶
Datei konfigurieren¶
DNSx verwendet eine Konfigurationsdatei unter $HOME/.config/dnsx/config.yaml
_. Sie können verschiedene Einstellungen in dieser Datei anpassen:
```yaml
Example configuration file¶
concurrency: 100 rate-limit: 100 retries: 3 timeout: 5000 resolvers: - 1.1.1.1 - 8.8.8.8 ```_
Umweltvariablen¶
```bash
Set DNSx configuration via environment variables¶
export DNSX_CONCURRENCY=100 export DNSX_RATE_LIMIT=100 export DNSX_RETRIES=3 export DNSX_TIMEOUT=5000 export DNSX_RESOLVERS=1.1.1.1,8.8.8.8 ```_
Sachgebiet¶
Kommandozeilenoptionen¶
Flag | Description |
---|---|
-d, -domain |
Target domain to query |
-l, -list |
File containing list of domains to query |
-a |
Query A records |
-aaaa |
Query AAAA records |
-cname |
Query CNAME records |
-ns |
Query NS records |
-txt |
Query TXT records |
-mx |
Query MX records |
-soa |
Query SOA records |
-ptr |
Query PTR records |
-o, -output |
File to write output to |
-json |
Write output in JSON format |
-csv |
Write output in CSV format |
-silent |
Show only results in output |
-v, -verbose |
Show verbose output |
-resolver |
DNS resolvers to use |
-resolver-file |
File containing DNS resolvers |
-system-resolver |
Use system resolvers |
-resp-only |
Show only response in output |
-resp |
Filter response containing string |
-resp-regex |
Filter response matching regex |
-wildcard |
Enable wildcard filtering |
-wildcard-threshold |
Wildcard filtering threshold |
-walk |
Enable DNS walking |
-walk-threads |
Number of DNS walking threads |
-c, -concurrency |
Number of concurrent queries |
-rate-limit |
Maximum number of queries per second |
-retries |
Number of retries for failed queries |
-timeout |
Timeout for DNS queries in milliseconds |
-stream |
Stream mode for large inputs |
-hc |
Check resolver health |
-trace |
Perform DNS trace |
-version |
Show DNSx version |
Aufzeichnungsarten¶
Type | Description |
---|---|
A |
IPv4 address records |
AAAA |
IPv6 address records |
CNAME |
Canonical name records |
NS |
Name server records |
TXT |
Text records |
MX |
Mail exchange records |
SOA |
Start of authority records |
PTR |
Pointer records |
Ressourcen¶
- [offizielle Dokumentation](LINK_3_
- [GitHub Repository](LINK_3_
- [Project Discovery Discord](LINK_3_
--
*Dieses Betrugsblatt bietet eine umfassende Referenz für die Verwendung von DNSx, von grundlegenden DNS-Abfragen bis hin zur erweiterten Filterung und Integration mit anderen Tools. Für die aktuellsten Informationen finden Sie immer die offizielle Dokumentation. *