WebsiteTemplate/cheatsheets/dnsrecon.html
2026-01-25 11:33:37 -04:00

221 lines
7.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<link rel="stylesheet" href="../assets/css/style.css">
<link rel="icon" type="image/x-icon" href="../favicon.ico">
<script>
// Apply theme immediately to prevent flash
(function() {
const theme = localStorage.getItem('theme') ||
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
})();
</script>
<title>dnsrecon Cheatsheet - Cheatsheets - Launch Pad</title>
</head>
<body>
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</button>
<br/><br/>
<div class="name">
__ _______________________ _________._________________________
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
\/ \/ \/ \/ \/ \/ \/
</div>
<div class="blog-page-header">
<div class="blog-header-content">
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
</a>
<h1 class="blog-page-title">dnsrecon Cheatsheet</h1>
</div>
</div>
<div class="blog-post-container">
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
<div class="blog-post">
<div class="blog-post-content">
<p><a href="index.html">← Back to cheatsheets</a></p>
<p><a href="../index.html">← Home</a></p>
<hr>
<p>DNSRecon is a powerful DNS enumeration tool written in Python. It performs various DNS record enumeration, zone transfers, subdomain brute forcing, and more.</p>
<hr>
<h2>Basic Usage</h2>
<ul>
<li>dnsrecon -d &lt;domain&gt; - Standard enumeration</li>
</ul>
<ul>
<li>dnsrecon -d &lt;domain&gt; -t std - Standard record enumeration</li>
</ul>
<hr>
<h2>Enumeration Types (-t)</h2>
<ul>
<li>std - Standard record enumeration (SOA, NS, A, AAAA, MX, TXT)</li>
</ul>
<ul>
<li>rvl - Reverse lookup of IP range</li>
</ul>
<ul>
<li>brt - Brute force subdomains and hosts</li>
</ul>
<ul>
<li>srv - SRV record enumeration</li>
</ul>
<ul>
<li>axfr - Zone transfer</li>
</ul>
<ul>
<li>goo - Google search for subdomains</li>
</ul>
<ul>
<li>bing - Bing search for subdomains</li>
</ul>
<ul>
<li>snoop - DNS cache snooping</li>
</ul>
<ul>
<li>tld - TLD expansion</li>
</ul>
<ul>
<li>zonewalk - DNSSEC zone walk</li>
</ul>
<hr>
<h2>Target Options</h2>
<ul>
<li>-d &lt;domain&gt; - Target domain</li>
</ul>
<ul>
<li>-r &lt;range&gt; - IP range for reverse lookup (CIDR or range)</li>
</ul>
<ul>
<li>-n &lt;ns&gt; - Name server to use</li>
</ul>
<ul>
<li>-D &lt;file&gt; - Wordlist for brute force</li>
</ul>
<hr>
<h2>Output Options</h2>
<ul>
<li>-c &lt;file&gt; - CSV output file</li>
</ul>
<ul>
<li>-j &lt;file&gt; - JSON output file</li>
</ul>
<ul>
<li>-x &lt;file&gt; - XML output file</li>
</ul>
<ul>
<li>--db &lt;file&gt; - SQLite database output</li>
</ul>
<hr>
<h2>Performance Options</h2>
<ul>
<li>--threads &lt;num&gt; - Number of threads</li>
</ul>
<ul>
<li>--lifetime &lt;sec&gt; - Query lifetime (timeout)</li>
</ul>
<ul>
<li>--tcp - Use TCP for queries</li>
</ul>
<hr>
<h2>Other Options</h2>
<ul>
<li>-a - Perform AXFR with standard enumeration</li>
</ul>
<ul>
<li>-s - Perform reverse lookup on IP ranges in SPF records</li>
</ul>
<ul>
<li>-g - Perform Google enumeration</li>
</ul>
<ul>
<li>-b - Perform Bing enumeration</li>
</ul>
<ul>
<li>-k - Perform cache snooping</li>
</ul>
<ul>
<li>-w - Perform deep whois lookup</li>
</ul>
<ul>
<li>-z - Perform DNSSEC zone walk</li>
</ul>
<ul>
<li>-v - Verbose output</li>
</ul>
<hr>
<h2>Common Examples</h2>
<h3>Standard Enumeration</h3>
<pre><code>dnsrecon -d example.com</code></pre>
<p>Get all standard DNS records.</p>
<h3>Zone Transfer</h3>
<pre><code>dnsrecon -d example.com -t axfr</code></pre>
<p>Attempt zone transfer.</p>
<h3>Subdomain Brute Force</h3>
<pre><code>dnsrecon -d example.com -t brt -D /usr/share/wordlists/subdomains.txt</code></pre>
<p>Brute force subdomains with wordlist.</p>
<h3>Reverse Lookup</h3>
<pre><code>dnsrecon -r 192.168.1.0/24</code></pre>
<p>Reverse DNS lookup on IP range.</p>
<h3>SRV Record Enumeration</h3>
<pre><code>dnsrecon -d example.com -t srv</code></pre>
<p>Enumerate SRV records.</p>
<h3>Full Enumeration</h3>
<pre><code>dnsrecon -d example.com -a -s -g -w</code></pre>
<p>Standard enum with AXFR, SPF, Google, and Whois.</p>
<h3>DNSSEC Zone Walk</h3>
<pre><code>dnsrecon -d example.com -z</code></pre>
<p>Enumerate via DNSSEC zone walking.</p>
<h3>Save to JSON</h3>
<pre><code>dnsrecon -d example.com -j output.json</code></pre>
<p>Save results to JSON file.</p>
<h3>Custom Name Server</h3>
<pre><code>dnsrecon -d example.com -n 8.8.8.8</code></pre>
<p>Use specific DNS resolver.</p>
<hr>
<h2>Tips</h2>
<ul>
<li>Always try zone transfer (-t axfr) first</li>
</ul>
<ul>
<li>Use -a with standard enum to include AXFR attempt</li>
</ul>
<ul>
<li>Combine with other tools like amass for better coverage</li>
</ul>
<ul>
<li>Save results to JSON for easy parsing</li>
</ul>
<ul>
<li>DNSSEC zone walk can reveal records even when AXFR is blocked</li>
</ul>
<ul>
<li>Use --threads to speed up brute forcing</li>
</ul>
<ul>
<li>Check SRV records for internal services</li>
</ul>
<ul>
<li>Always get authorization before scanning</li>
</ul>
<hr>
<p><a href="index.html">← Back to cheatsheets</a></p>
<p><a href="../index.html">← Home</a></p>
</div>
</div>
</div>
</div>
<script async type="text/javascript" src="../blog/analytics.js"></script>
<script src="../theme.js"></script>
</body>
</html>