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

269 lines
9.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>
(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>hydra 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">hydra 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>hydra is a fast and flexible brute force authentication tool. It supports parallel attacks on many protocols including SSH, HTTP, FTP, SMB, and more.</p>
<hr>
<h2>Basic Syntax</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; &lt;target&gt; &lt;service&gt; - Basic brute force</li>
</ul>
<ul>
<li>hydra -L &lt;userlist&gt; -p &lt;password&gt; &lt;target&gt; &lt;service&gt; - User enumeration</li>
</ul>
<ul>
<li>hydra -L &lt;userlist&gt; -P &lt;wordlist&gt; &lt;target&gt; &lt;service&gt; - Full brute force</li>
</ul>
<hr>
<h2>Common Options</h2>
<ul>
<li>-l &lt;login&gt; - Single login name</li>
</ul>
<ul>
<li>-L &lt;file&gt; - Login file (one per line)</li>
</ul>
<ul>
<li>-p &lt;password&gt; - Single password</li>
</ul>
<ul>
<li>-P &lt;file&gt; - Password file (one per line)</li>
</ul>
<ul>
<li>-t &lt;tasks&gt; - Number of parallel tasks (default 16)</li>
</ul>
<ul>
<li>-w &lt;timeout&gt; - Wait time between attempts (default 32)</li>
</ul>
<ul>
<li>-f - Exit on first valid login</li>
</ul>
<ul>
<li>-s &lt;port&gt; - Port number (if non-standard)</li>
</ul>
<ul>
<li>-v - Verbose mode</li>
</ul>
<ul>
<li>-V - Show login/password attempts</li>
</ul>
<ul>
<li>-o &lt;file&gt; - Output file for found credentials</li>
</ul>
<hr>
<h2>SSH Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; ssh://&lt;target&gt; - SSH attack</li>
</ul>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; -s 2222 ssh://&lt;target&gt; - Custom SSH port</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt ssh://&lt;target&gt; - Multiple users</li>
</ul>
<hr>
<h2>HTTP/HTTPS Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; http-get://&lt;target&gt;/login - HTTP GET</li>
</ul>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; http-post-form://&lt;target&gt;/login:"user=^USER^&pass=^PASS^":"F=incorrect" - POST form</li>
</ul>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; https://&lt;target&gt;/login - HTTPS</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt http-get://&lt;target&gt;/protected - HTTP basic auth</li>
</ul>
<hr>
<h2>FTP Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; ftp://&lt;target&gt; - FTP attack</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt ftp://&lt;target&gt; - Multiple users</li>
</ul>
<ul>
<li>hydra -l anonymous -P passwords.txt ftp://&lt;target&gt; - Anonymous FTP</li>
</ul>
<hr>
<h2>SMB Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; smb://&lt;target&gt; - SMB attack</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt smb://&lt;target&gt; - Multiple users</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt smb://&lt;target&gt;/share - Specific share</li>
</ul>
<hr>
<h2>RDP Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; rdp://&lt;target&gt; - RDP attack</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt rdp://&lt;target&gt; - Multiple users</li>
</ul>
<hr>
<h2>MySQL Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; mysql://&lt;target&gt; - MySQL attack</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt mysql://&lt;target&gt; - Multiple users</li>
</ul>
<hr>
<h2>PostgreSQL Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; postgresql://&lt;target&gt; - PostgreSQL attack</li>
</ul>
<ul>
<li>hydra -L users.txt -P passwords.txt postgresql://&lt;target&gt; - Multiple users</li>
</ul>
<hr>
<h2>VNC Brute Force</h2>
<ul>
<li>hydra -l &lt;user&gt; -P &lt;wordlist&gt; vnc://&lt;target&gt; - VNC attack</li>
</ul>
<ul>
<li>hydra -p &lt;password&gt; vnc://&lt;target&gt; - Password only (no user)</li>
</ul>
<hr>
<h2>Advanced Options</h2>
<ul>
<li>-e nsr - Try null password, same as login, reversed login</li>
</ul>
<ul>
<li>-e n - Try null password</li>
</ul>
<ul>
<li>-e s - Try same as login</li>
</ul>
<ul>
<li>-e r - Try reversed login</li>
</ul>
<ul>
<li>-M &lt;file&gt; - Target list file</li>
</ul>
<ul>
<li>-C &lt;file&gt; - Colon-separated "login:pass" format</li>
</ul>
<ul>
<li>-S - Use SSL</li>
</ul>
<ul>
<li>-u - Loop around users, not passwords</li>
</ul>
<ul>
<li>-x min:max:charset - Password generation (e.g., -x 6:8:aA1)</li>
</ul>
<hr>
<h2>Common Examples</h2>
<h3>SSH Attack</h3>
<pre><code>hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://192.168.1.100</code></pre>
<h3>HTTP POST Form</h3>
<pre><code>hydra -l admin -P passwords.txt http-post-form://target.com/login.php:"user=^USER^&pass=^PASS^":"Invalid"</code></pre>
<h3>Multiple Users SSH</h3>
<pre><code>hydra -L users.txt -P passwords.txt -t 4 ssh://192.168.1.100</code></pre>
<h3>FTP Attack</h3>
<pre><code>hydra -L users.txt -P passwords.txt ftp://192.168.1.100</code></pre>
<h3>SMB Attack</h3>
<pre><code>hydra -L users.txt -P passwords.txt smb://192.168.1.100</code></pre>
<h3>RDP Attack</h3>
<pre><code>hydra -L users.txt -P passwords.txt rdp://192.168.1.100</code></pre>
<h3>MySQL Attack</h3>
<pre><code>hydra -l root -P passwords.txt mysql://192.168.1.100</code></pre>
<h3>VNC Attack</h3>
<pre><code>hydra -P passwords.txt vnc://192.168.1.100</code></pre>
<h3>Wordlist Generation</h3>
<pre><code>hydra -l admin -x 6:8:aA1 http-get://target.com/protected</code></pre>
<h3>Output to File</h3>
<pre><code>hydra -l admin -P passwords.txt -o results.txt ssh://192.168.1.100</code></pre>
<hr>
<h2>Tips</h2>
<ul>
<li>Use -t to adjust parallel tasks (higher = faster but more detectable)</li>
</ul>
<ul>
<li>Use -f to stop on first valid login</li>
</ul>
<ul>
<li>Use -e nsr to try common weak passwords</li>
</ul>
<ul>
<li>Use -V for verbose output to see attempts</li>
</ul>
<ul>
<li>Always test on authorized systems only</li>
</ul>
<ul>
<li>Lower -t value reduces detection but increases time</li>
</ul>
<ul>
<li>Use -x for password generation when no wordlist available</li>
</ul>
<ul>
<li>Combine -L and -P for comprehensive testing</li>
</ul>
<ul>
<li>Use -o to save results for documentation</li>
</ul>
<ul>
<li>HTTP POST forms require proper syntax: "field=^USER^&field2=^PASS^":"error message"</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>