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

222 lines
7.5 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>subfinder 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">subfinder 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>Subfinder is a fast passive subdomain enumeration tool by ProjectDiscovery. It uses passive sources to discover subdomains without sending any traffic to the target.</p>
<hr>
<h2>Basic Usage</h2>
<ul>
<li>subfinder -d &lt;domain&gt; - Basic subdomain enumeration</li>
</ul>
<ul>
<li>subfinder -dL domains.txt - Enumerate from domain list</li>
</ul>
<hr>
<h2>Input Options</h2>
<ul>
<li>-d, -domain - Target domain</li>
</ul>
<ul>
<li>-dL, -list - File containing list of domains</li>
</ul>
<hr>
<h2>Output Options</h2>
<ul>
<li>-o, -output - Output file</li>
</ul>
<ul>
<li>-oJ, -json - JSON output</li>
</ul>
<ul>
<li>-oD, -output-dir - Directory for output files</li>
</ul>
<ul>
<li>-cs, -collect-sources - Include source info in output</li>
</ul>
<ul>
<li>-oI, -ip - Include IP addresses in output</li>
</ul>
<hr>
<h2>Configuration</h2>
<ul>
<li>-config - Config file path</li>
</ul>
<ul>
<li>-pc, -provider-config - Provider config file</li>
</ul>
<ul>
<li>-r, -resolver - Comma separated resolvers</li>
</ul>
<ul>
<li>-rL, -resolver-list - File containing resolvers</li>
</ul>
<ul>
<li>-active - Verify subdomains via DNS resolution</li>
</ul>
<hr>
<h2>Source Options</h2>
<ul>
<li>-s, -sources - Specific sources to use (comma separated)</li>
</ul>
<ul>
<li>-recursive - Use recursive sources only</li>
</ul>
<ul>
<li>-all - Use all sources</li>
</ul>
<ul>
<li>-es, -exclude-sources - Exclude specific sources</li>
</ul>
<ul>
<li>-ls, -list-sources - List all available sources</li>
</ul>
<hr>
<h2>Rate Limiting</h2>
<ul>
<li>-t, -threads - Concurrent threads (default 10)</li>
</ul>
<ul>
<li>-rl, -rate-limit - Max requests per second</li>
</ul>
<ul>
<li>-timeout - Timeout in seconds (default 30)</li>
</ul>
<hr>
<h2>Other Options</h2>
<ul>
<li>-silent - Only show subdomains in output</li>
</ul>
<ul>
<li>-v, -verbose - Verbose output</li>
</ul>
<ul>
<li>-version - Show version</li>
</ul>
<ul>
<li>-nc, -no-color - Disable color output</li>
</ul>
<hr>
<h2>Configuration File</h2>
<h3>Location</h3>
<ul>
<li>~/.config/subfinder/provider-config.yaml - API keys config</li>
</ul>
<h3>Example Config</h3>
<pre><code>securitytrails:
- your_api_key_here
shodan:
- your_api_key_here
virustotal:
- your_api_key_here
chaos:
- your_api_key_here
github:
- your_github_token</code></pre>
<hr>
<h2>Common Examples</h2>
<h3>Basic Scan</h3>
<pre><code>subfinder -d example.com</code></pre>
<p>Quick passive subdomain enumeration.</p>
<h3>Save to File</h3>
<pre><code>subfinder -d example.com -o subdomains.txt</code></pre>
<p>Save results to file.</p>
<h3>JSON Output with Sources</h3>
<pre><code>subfinder -d example.com -oJ -cs -o results.json</code></pre>
<p>JSON output with source information.</p>
<h3>Silent Mode for Piping</h3>
<pre><code>subfinder -d example.com -silent | httpx</code></pre>
<p>Pipe to httpx for live domain checking.</p>
<h3>Multiple Domains</h3>
<pre><code>subfinder -dL domains.txt -o all_subs.txt</code></pre>
<p>Enumerate multiple domains from file.</p>
<h3>With IP Resolution</h3>
<pre><code>subfinder -d example.com -oI -o subs_with_ips.txt</code></pre>
<p>Include IP addresses in output.</p>
<h3>Specific Sources</h3>
<pre><code>subfinder -d example.com -s shodan,virustotal,securitytrails</code></pre>
<p>Use only specific sources.</p>
<h3>Active Verification</h3>
<pre><code>subfinder -d example.com -active</code></pre>
<p>Verify subdomains via DNS resolution.</p>
<hr>
<h2>Tips</h2>
<ul>
<li>Configure API keys for significantly better results</li>
</ul>
<ul>
<li>Use -silent for clean output suitable for piping</li>
</ul>
<ul>
<li>Combine with httpx for live domain verification</li>
</ul>
<ul>
<li>Use -all to enable all sources (slower but thorough)</li>
</ul>
<ul>
<li>Fast and lightweight compared to amass</li>
</ul>
<ul>
<li>Great for quick reconnaissance before deeper scanning</li>
</ul>
<ul>
<li>Passive only - won't trigger IDS/IPS</li>
</ul>
<ul>
<li>Part of ProjectDiscovery toolkit - integrates well with nuclei, httpx</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>