Online Attacks
Module 12, Section 2 — Attacking live authentication services by sending credentials over the network and observing responses.
Table of Contents
- Attack Classification: Online vs Offline
- Brute Force Attacks
- Dictionary Attacks
- Credential Stuffing
- Hybrid Attacks
- Smart Brute Force
- OSCP Exam Tips
1. Attack Classification: Online vs Offline
1.1 What Is an Online Attack?
An online attack targets a live, running authentication service. The attacker submits username/password pairs directly to the service (SSH, FTP, HTTP login, RDP, etc.) and observes the response to determine whether each guess was correct.
The key distinction: the target system performs the hash comparison itself. The attacker never sees the hash — only the binary outcome (accepted / rejected).
1.2 Online vs Offline: A Detailed Comparison
| Characteristic | Online Attack | Offline Attack |
|---|---|---|
| Target | Live authentication service (SSH, RDP, web login, etc.) | Captured hash file (NTLM, Kerberos TGT, shadow file, etc.) |
| Speed | Slow — limited by network latency, server processing, and rate limiting. Typically 1–100 guesses/second per account. | Extremely fast — limited only by GPU/CPU throughput. Modern GPUs achieve 10,000–100,000+ guesses/second per hash. |
| Detection risk | High — every attempt generates authentication logs. IDS/IPS, SIEM, and account lockout policies will trigger. | Low to none — no network traffic to the target. The attack runs entirely on the attacker’s machine. |
| Rate limiting | Almost always present. Web apps use CAPTCHAs, IP bans, and throttling. SSH uses MaxAuthTries. Windows enforces lockout thresholds. |
Not applicable — no live service to enforce limits. |
| Account lockout | Real risk — Windows locks after 5–10 failed attempts by default. Linux PAM can be configured similarly. Requires careful pacing or account rotation. | Not applicable — no account state is touched. |
| Tools | Hydra, Medusa, Ncrack, Patator, Burp Suite Intruder | Hashcat, John the Ripper, Hashcat Online |
| Prerequisites | Network access to the service, valid username(s) | Extracted hash file, knowledge of hash type |
| Best for | Services where you cannot extract hashes (web apps, SSH, RDP, FTP) | When you have dumped hashes (NTDS.dit, /etc/shadow, Kerberos tickets) |
1.3 When to Choose Online vs Offline
Choose Online Attacks when:
- You cannot extract hashes from the target (no local access, no dump capability).
- The service only accepts online authentication (web portal, API endpoint).
- You have a small number of high-value accounts to target and can work stealthily.
- Password spraying is viable (one password across many accounts to avoid per-account lockout).
Choose Offline Attacks when:
- You have extracted a hash (via Mimikatz, NTDS.dit dump, /etc/shadow read, Kerberoasting, etc.).
- You need maximum speed and can afford to run GPU-accelerated cracking.
- The hash type is well-supported by Hashcat or John.
- There is zero detection risk on the target side.
Key Insight: In the OSCP exam, you will encounter both scenarios. Web apps and SSH services require online attacks. Windows domain environments often give you offline hash-cracking opportunities after privilege escalation.
2. Brute Force Attacks
2.1 Definition and Mechanics
A brute force attack systematically tries every possible combination of characters from a defined character set, up to a specified length. It is the most exhaustive — and most guaranteed — approach: if the password exists within the search space, brute force will find it.
The attack proceeds in lexicographic order:
Charset: [a, b, c]
Length 1: a, b, c
Length 2: aa, ab, ac, ba, bb, bc, ca, cb, cc
Length 3: aaa, aab, aac, aba, abb, abc, ...
2.2 Search Space Mathematics
The total number of combinations for a password of length L using a character set of size C is:
Search Space = C^L
For passwords of length 1 through L, the cumulative search space is:
Total = C^1 + C^2 + C^3 + ... + C^L = C * (C^L - 1) / (C - 1)
Common Character Sets
| Character Set | Size (C) | Contents |
|---|---|---|
| Lowercase only | 26 | a–z |
| Uppercase only | 26 | A–Z |
| Digits only | 10 | 0–9 |
| Alphanumeric | 62 | a–z, A–Z, 0–9 |
| Alphanumeric + common symbols | 70 | a–z, A–Z, 0–9, !@#$%^&*() |
| Full printable ASCII | 95 | All printable characters (0x21–0x7E) |
Detailed Search Space Calculations
| Password Length | Charset | C | Combinations (C^L) | Time at 10 guesses/s | Time at 100 guesses/s | Time at 1,000 guesses/s |
|---|---|---|---|---|---|---|
| 4 | lowercase | 26 | 456,976 | 46 seconds | 4.6 seconds | 0.5 seconds |
| 5 | lowercase | 26 | 11,881,376 | 3.3 hours | 20 minutes | 2 minutes |
| 6 | lowercase | 26 | 308,915,776 | 3.6 days | 14 hours | 85 minutes |
| 7 | lowercase | 26 | 8,031,810,176 | 25 years | 2.5 years | 254 days |
| 8 | lowercase | 26 | 208,827,064,576 | 662 years | 66 years | 6.6 years |
| 8 | alphanumeric | 62 | 218,340,105,584,896 | 693K years | 69K years | 6.9K years |
| 8 | full ASCII | 95 | 6,382,396,603,125,000 | 20.2B years | 2.0B years | 202M years |
| 6 | alphanumeric | 62 | 56,800,235,584 | 180 years | 18 years | 1.8 years |
| 6 | full ASCII | 95 | 735,091,890,625 | 2,329 years | 233 years | 23 years |
Time Estimation Formula
Time (seconds) = (C^L) / (guesses_per_second)
Time (hours) = (C^L) / (guesses_per_second * 3600)
Time (days) = (C^L) / (guesses_per_second * 86400)
Time (years) = (C^L) / (guesses_per_second * 31,536,000)
Example calculation: An 8-character alphanumeric password at 50 guesses/second (typical online rate):
Search space = 62^8 = 218,340,105,584,896
Time = 218,340,105,584,896 / (50 * 31,536,000) = 138,386 years
On average, you find the password at 50% of the search space, so divide by 2 for expected time. But in the worst case, you traverse the entire space.
2.3 Why Brute Force Is Rarely Practical Online
- Network speed limits: Each guess requires a full network round-trip. Even at 100ms latency, that’s only 10 guesses/second.
- Rate limiting: Most services throttle after 5–10 failed attempts per minute.
- Account lockout: Windows defaults to locking after 5–10 failures. Many web apps lock for 15–30 minutes.
- Exponential growth: Adding just one character multiplies the search space by the charset size.
2.4 When Brute Force IS Viable Online
| Scenario | Why It Works |
|---|---|
| PIN codes (4 digits) | Only 10,000 combinations. At 10/s = 1,000 seconds = 17 minutes. |
| Short passwords (≤5 chars) with restricted charset | Small search space. |
| No rate limiting or lockout | Unlimited attempts allowed. |
| Offline hash cracking | GPU achieves millions of guesses/sec. Brute force becomes practical for ≤8 char passwords. |
2.5 Practical Brute Force with Hydra
# Basic brute force against SSH (using a mask for 4-digit PIN)
hydra -l username -P /path/to/wordlist ssh://10.10.10.10 -t 4 -v
# Brute force with a custom character set using mask (via hcmask or custom wordlist)
# First generate a wordlist for all 4-digit combinations
crunch 4 4 0123456789 -o /tmp/pins.txt
hydra -l admin -P /tmp/pins.txt ssh://10.10.10.10 -t 4 -f -vV
# Brute force FTP with both username and password lists
hydra -L users.txt -P passwords.txt ftp://10.10.10.10 -t 8 -v
# HTTP POST form brute force
hydra -l admin -P wordlist.txt 10.10.10.10 http-post-form "/login.php:user=^USER^&pass=^PASS^:F=invalid" -vV
3. Dictionary Attacks
3.1 Definition and Rationale
A dictionary attack tries passwords from a pre-compiled wordlist rather than exhaustively enumerating all combinations. This approach exploits a fundamental truth about human behavior:
People are terrible at creating random passwords.
Real-world passwords cluster around dictionary words, names, places, pop culture references, and predictable modifications of simple words. A well-curated wordlist of 10,000 entries often cracks more passwords than a brute force of billions of random combinations.
3.2 Password Psychology
Understanding how humans choose passwords is essential for building effective wordlists:
| Pattern | Example | Frequency |
|---|---|---|
| Dictionary words | password, dragon, monkey |
Very common |
| Personal info | john1990, fluffy2000 |
Common |
| Keyboard walks | qwerty, asdfgh, zxcvbn |
Common |
| Leet speak substitutions | p@ssw0rd, h@ck3r |
Very common |
| Capitalization patterns | Password, PASSWORD |
Very common |
| Number appending | password1, password123 |
Extremely common |
| Special char appending | password!, password@ |
Common |
| Date-based | password2024, admin2025 |
Common |
| Company/brand names | huawei123, google2024 |
Context-dependent |
| Repeated characters | aaaaaa, 111111 |
Common in weak policies |
3.3 The rockyou.txt Wordlist
rockyou.txt is the most famous and widely used password wordlist in penetration testing.
| Property | Detail |
|---|---|
| Origin | Leaked from the RockYou.com social networking site breach in 2009 |
| Size | ~14,344,392 unique passwords (original); ~33M in updated versions |
| Format | One password per line, UTF-8 encoded |
| Default location (Kali) | /usr/share/wordlists/rockyou.txt |
| Compression | Often distributed as rockyou.txt.gz (must be unzipped before use) |
| Top 10 passwords | 123456, password, 12345678, qwerty, 123456789, 12345, 1234, 111111, 1234567890, password1 |
Important: rockyou.txt is compressed by default on Kali. You must decompress it:
cd /usr/share/wordlists
gunzip rockyou.txt.gz
# Or create a symlink if you don't want to modify the original
ln -s /usr/share/wordlists/rockyou.txt.gz rockyou.txt
rockyou.txt statistics (from analysis):
- ~40% of passwords are 8 characters or fewer
- ~70% contain only lowercase letters and digits
- ~15% contain special characters
- The top 1,000 passwords account for a significant portion of real-world matches
3.4 SecLists
SecLists (by Daniel Miessler) is a comprehensive collection of wordlists for various attack types:
/usr/share/wordlists/SecLists/
├── Passwords/
│ ├── 1-million-password-list-top-10000.txt # Top 10K most common
│ ├── Best1MasterList.txt # Curated master list
│ ├── CommonPasswords.txt # Frequently used passwords
│ ├── Credentials/ # username:password pairs
│ └── ...
├── Discovery/ # For web discovery
├── Fuzzing/ # For input fuzzing
└── ...
Key SecLists files for password attacks:
| File | Size | Best For |
|---|---|---|
1-million-password-list-top-10000.txt |
10,000 | Quick first-pass attack, online use |
1-million-password-list-top-100.txt |
100 | Ultra-quick check against weakest passwords |
Best1MasterList.txt |
~22K | Balanced coverage, good for online |
CommonPasswords.txt |
~20K | General-purpose dictionary |
cirt-default-passwords |
Various | Default credential attacks |
3.5 Default Credentials
Many services ship with default usernames and passwords that users never change:
| Service | Default Username | Default Password |
|---|---|---|
| Tomcat | tomcat |
tomcat, admin, s3cret |
| Jenkins | admin |
auto-generated (first launch) |
| WordPress | admin |
admin, password, wordpress |
| Cisco routers | admin |
admin, cisco, password |
| SNMP | — | public, private, community |
| MySQL | root |
(empty), root, password |
| FTP | anonymous |
(empty), anonymous |
Default credential wordlists:
# Common default credential lists on Kali
/usr/share/wordlists/SecLists/Passwords/darkweb2017-top10000.txt
/usr/share/seclists/Passwords/Default-Credentials/
3.6 Dictionary Attack Success Rates
Research and real-world penetration testing data show:
| Wordlist Size | Estimated Crack Rate (general passwords) |
|---|---|
| Top 100 passwords | ~15–20% |
| Top 1,000 passwords | ~30–40% |
| Top 10,000 passwords | ~45–55% |
| rockyou.txt (14M) | ~60–75% (without rules) |
| rockyou.txt + rules | ~80–90% |
| Custom + intelligence + rules | ~90%+ |
Takeaway: A dictionary attack with a good wordlist beats brute force for almost all real-world passwords. Always start with dictionary before brute force.
3.7 Practical Dictionary Attack Examples
# SSH dictionary attack with hydra
hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://10.10.10.10 -t 4 -vV -f
# HTTP form login
hydra -l admin -P /usr/share/wordlists/SecLists/Passwords/1-million-password-list-top-10000.txt \
10.10.10.10 http-post-form "/login.php:user=^USER^&pass=^PASS^:login_failed" -vV
# FTP with both user and password lists
hydra -L /usr/share/wordlists/SecLists/Usernames/top-short-usernames.txt \
-P /usr/share/wordlists/rockyou.txt ftp://10.10.10.10 -t 8 -v
# RDP dictionary attack
hydra -l administrator -P /usr/share/wordlists/rockyou.txt rdp://10.10.10.10 -t 4 -v
# Medusa alternative (often faster for some protocols)
medusa -h 10.10.10.10 -u admin -P /usr/share/wordlists/rockyou.txt -M ssh -t 5
4. Credential Stuffing
4.1 Definition and Mechanism
Credential stuffing is a specialized form of online attack that uses known valid username:password pairs harvested from previous data breaches. The core assumption is password reuse — users who reused their SiteA password on SiteB will have a valid account on SiteB.
Unlike dictionary attacks (which guess passwords for a specific target), credential stuffing uses credentials that are already known to work on some system.
4.2 Password Reuse Statistics
| Statistic | Value | Source |
|---|---|---|
| Users who reuse passwords across sites | ~50–65% | Multiple studies |
| Users who reuse the same password everywhere | ~15% | Nordpass 2024 |
| Average number of sites per password | 4–7 | Various |
| Accounts compromised via credential stuffing (monthly, industry-wide) | Millions | Identity Theft Resource Center |
4.3 Credential Stuffing vs Dictionary Attack
| Aspect | Dictionary Attack | Credential Stuffing |
|---|---|---|
| Input | Password wordlist (no usernames) | username:password pairs from breaches |
| Assumption | Target uses a common password | Target reused a password from a breached site |
| Password quality | May be simple or complex | Already passed complexity requirements on the original site |
| Account validity | Username may or may not exist | Username is known to exist (from the breach) |
| Lockout risk | Higher (many failures per account) | Lower (one attempt per account, many accounts) |
| Scale | Single target, many passwords | Many targets, one password each |
| Detection | Easy (burst of failures on one account) | Harder (distributed across many accounts) |
4.4 Credential Stuffing Workflow
Step 1: Acquire breach data
└─ Sources: Have I Been Pwned, breach compilation dumps, dark web markets
└─ Format: username:password or email:password pairs
Step 2: Normalize and deduplicate
└─ Remove duplicates
└─ Filter for target domain (e.g., @target.com emails)
└─ Sort by recency (newer breaches = more likely reused)
Step 3: Set up infrastructure
└─ Proxy rotation (residential proxies preferred)
└─ User-agent rotation
└─ Rate limiting (stay under detection thresholds)
Step 4: Execute attack
└─ Submit each credential pair once
└─ Parse response for success indicators
└─ Log valid credentials
Step 5: Post-exploitation
└─ Access compromised accounts
└─ Extract additional data
└─ Attempt privilege escalation within the account
4.5 Automation and Evasion
Credential stuffing at scale requires:
| Technique | Purpose |
|---|---|
| Proxy rotation | Avoid IP-based rate limiting and bans. Residential proxies appear as legitimate users. |
| User-agent rotation | Avoid browser fingerprinting. Rotate between Chrome, Firefox, Safari strings. |
| Request throttling | Space requests to mimic human behavior (random delays between 2–10 seconds). |
| CAPTCHA solving | Use third-party solving services or OCR for basic CAPTCHAs. |
| Session management | Handle cookies, CSRF tokens, and multi-step login flows. |
4.6 Practical Considerations for OSCP
In the OSCP exam context, credential stuffing is less common than dictionary attacks, but the concept applies when:
- You find a breach file or credential dump during enumeration.
- You discover that multiple services share the same user base.
- You extract credentials from one system and reuse them on another (lateral movement via credential reuse).
# Using hydra with a credential file (username:password format)
hydra -C breached_credentials.txt ssh://10.10.10.10 -t 4 -vV
# Using medusa with credential pairs
medusa -h 10.10.10.10 -C breached_credentials.txt -M ssh -t 5
# Burp Suite: Import credential pairs into Intruder's Cluster Bomb or Pitchfork attack
# Pitchfork mode pairs each username with each password positionally
5. Hybrid Attacks
5.1 Definition
A hybrid attack combines two or more attack methodologies to generate a richer candidate set than either approach alone. The most common hybrid is dictionary + mask (also called dictionary + rule), where each dictionary word is combined with a pattern of characters.
5.2 Common Modification Patterns
Humans don’t use raw dictionary words as passwords. They modify them predictably:
| Pattern | Rule | Example |
|---|---|---|
| Append digits | word + ?d?d |
password → password12 |
| Append digits (4) | word + ?d?d?d?d |
password → password2024 |
| Capitalize first | Capitalize position 0 | password → Password |
| Capitalize all | toupper() | password → PASSWORD |
| Leet speak | a→@, e→3, i→1, o→0, s→$ | password → p@ssw0rd |
| Append special char | word + [!@#$] |
password → password! |
| Prepend digits | ?d?d + word |
password → 99password |
| Sandwich | ?d?d + word + ?d?d |
password → 12password34 |
| Year append | word + [2020-2026] |
admin → admin2024 |
| Double word | word + word |
pass → passpass |
5.3 Hashcat Hybrid Modes
Hashcat provides two dedicated hybrid attack modes:
| Mode | Notation | Description | Example |
|---|---|---|---|
| Mode 6 | dictionary + mask |
Appends a mask pattern to each dictionary word | password + ?d?d?d?d → password1234, password0000, etc. |
| Mode 7 | mask + dictionary |
Prepends a mask pattern to each dictionary word | ?d?d?d?d + password → 1234password, 0000password, etc. |
Mode 6 — Dictionary + Mask:
# Try each word in rockyou.txt followed by 4 digits
hashcat -m 1000 -a 6 hashes.txt /usr/share/wordlists/rockyou.txt ?d?d?d?d -O
# Try each word followed by 2 digits and 1 special character
hashcat -m 1000 -a 6 hashes.txt /usr/share/wordlists/rockyou.txt ?d?d?s -O
# Common pattern: word + year
hashcat -m 1000 -a 6 hashes.txt /usr/share/wordlists/rockyou.txt ?d?d?d?d -O --stdout | head
# Output: password2024, admin2024, letmein2024, ...
Mode 7 — Mask + Dictionary:
# Try 4 digits prepended to each dictionary word
hashcat -m 1000 -a 7 hashes.txt /usr/share/wordlists/rockyou.txt ?d?d?d?d -O
# Useful for passwords like "1234password", "0001admin"
5.4 Rule-Based Attacks (Hashcat Rules)
Hashcat rules provide a powerful, programmable way to mutate dictionary words:
# Apply built-in rules to rockyou.txt
hashcat -m 1000 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt \
-r /usr/share/hashcat/rules/best64.rule -O
# best64.rule contains 64 carefully crafted rules covering the most common
# password modification patterns. It's the go-to first rule file.
Common Hashcat rule operators:
| Operator | Action | Example |
|---|---|---|
c |
Capitalize first char | password → Password |
l |
Lowercase all | PASSWORD → password |
u |
Uppercase all | password → PASSWORD |
d |
Duplicate entire word | pass → passpass |
r |
Reverse the word | password → drowssap |
$123 |
Append “123” | password → password123 |
p1,2 |
Swap positions 1 and 2 | abc → bac |
s1,@ |
Substitute position 1 with “@” | password → p@ssword |
o@ |
Prepend “@” | password → @password |
Writing custom rules:
# custom.rule — Common OSCP password patterns
c # Capitalize first letter
$2024 # Append current year
c$! # Capitalize + append !
$123 # Append 123
c$123 # Capitalize + append 123
$@ # Append @
c$@ # Capitalize + append @
hashcat -m 1000 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt \
-r custom.rule -O
5.5 Hybrid Attack Search Space
A hybrid attack multiplies the dictionary size by the mask combinations:
Dictionary size: 10,000 words
Mask: ?d?d?d?d (4 digits) = 10,000 combinations
Total candidates: 10,000 × 10,000 = 100,000,000 (100 million)
This is far more efficient than pure brute force of the same password length, because you’re only brute-forcing the modification pattern, not the entire password.
6. Smart Brute Force
6.1 Definition
Smart brute force (also called incremental or Markov-based brute force) uses heuristics and statistical models to prioritize password candidates that are more likely to be correct, rather than trying combinations in pure lexicographic order.
6.2 Markov Chain-Based Approach
A Markov chain models the probability of the next character based on the current (or previous) character(s). For example:
- After
p, the most likely next characters in English passwords area,e,o,s,r. - After
pa, the most likely next character iss(as in “password”, “pass”, “past”). - After
pass, the most likely next character isw(as in “password”).
John the Ripper’s incremental mode uses precomputed Markov chain tables to generate passwords in order of estimated likelihood rather than alphabetical order.
6.3 John the Ripper Incremental Modes
John’s john.conf defines several incremental character sets:
| Mode | Charset | Description | Best For |
|---|---|---|---|
alpha |
All printable ASCII | Full range brute force, prioritized by frequency | General purpose |
alnum |
A-Z, a-z, 0-9 | Alphanumeric passwords only | When you know no special chars |
numeric |
0-9 only | PINs, numeric passwords | Short numeric passwords |
all |
Full ASCII (0x00–0xFF) | Maximum coverage | Last resort |
Configuration in john.conf:
[Incremental:alpha]
File = $JOHN/alpha.charsets
MinLen = 1
MaxLen = 8
Recycle = false
KeyboardRate = 9
Running incremental attacks:
# Incremental alpha mode (smart brute force with all printable ASCII)
john --incremental=alpha --format=NT hashes.txt
# Incremental alphanumeric only
john --incremental=alnum --format=NT hashes.txt
# Incremental numeric only (for PINs)
john --incremental=numeric --format=NT hashes.txt
# Limit max length to speed up
john --incremental=alpha --max-length=6 --format=NT hashes.txt
6.4 Frequency Analysis
Smart brute force also leverages character frequency analysis:
| Rank | Most Common Characters (English passwords) |
|---|---|
| 1–5 | e, a, o, i, n |
| 6–10 | t, r, s, l, c |
| 11–15 | m, d, w, h, g |
| Digits | 1, 2, 3, 0, 4 |
A smart brute forcer tries eaoin before xyzpq because the former is statistically more likely to appear in real passwords.
6.5 Context-Aware Password Generation
The most effective smart attacks incorporate target-specific intelligence:
| Intelligence Source | Generated Candidates |
|---|---|
| Company name | CompanyName123, CompanyName2024, Company! |
| Username | username123, Username!, user1234 |
| Domain name | domain123, Domain2024 |
| Industry terms | sales123, finance!, engineer2024 |
| Seasonal | Summer2024, Christmas!, Holiday123 |
| Common substitutions | p@ssw0rd, adm1n, r0ot |
Practical example — generating a custom wordlist:
# Company is "AcmeCorp", target user is "jsmith"
cat > /tmp/custom_wordlist.txt << 'EOF'
AcmeCorp
AcmeCorp123
AcmeCorp2024
AcmeCorp!
acmecorp
acmecorp123
jsmith
jsmith123
jsmith2024
Jsmith
Jsmith123
jsmith!
Welcome1
Welcome2024
P@ssw0rd
P@ssw0rd1
Admin123
Admin2024
EOF
# Use the custom wordlist
hydra -l jsmith -P /tmp/custom_wordlist.txt ssh://10.10.10.10 -t 4 -vV -f
6.6 Adaptive Brute Force
Some advanced tools learn from failed attempts and adjust their strategy:
- If passwords with numbers succeed more often, increase number-heavy candidates.
- If the target enforces minimum length 8, skip all shorter candidates.
- If the target rejects special characters, remove them from the charset.
While not always available in standard tools, the principle applies: use every piece of information you gather to narrow the search space.
7. OSCP Exam Tips
7.1 Online Attack Strategy for the Exam
┌─────────────────────────────────────────────────────────┐
│ OSCP Online Attack Decision Tree │
├─────────────────────────────────────────────────────────┤
│ │
│ 1. Can you extract a hash? │
│ ├─ YES → Offline attack (Hashcat/John) — PREFERRED │
│ └─ NO → Continue to online attacks │
│ │
│ 2. What service is exposed? │
│ ├─ SSH → hydra / Medusa │
│ ├─ FTP → hydra / Medusa │
│ ├─ HTTP form → hydra / Burp Intruder │
│ ├─ RDP → hydra / Crrelief │
│ └─ SMB → hydra / Crackmapexec │
│ │
│ 3. What wordlist to use? │
│ ├─ First pass: Top 100–1000 passwords │
│ ├─ Second pass: rockyou.txt │
│ ├─ Third pass: rockyou.txt + rules │
│ └─ Custom: intelligence-driven wordlist │
│ │
│ 4. Avoid lockout! │
│ ├─ Use -t (threads) wisely — start low (2-4) │
│ ├─ Use -f to stop on first success │
│ ├─ Monitor for lockout messages │
│ └─ Consider password spraying if many accounts │
│ │
└─────────────────────────────────────────────────────────┘
7.2 Common Exam Scenarios
Scenario 1: SSH with weak password
# Quick check with top passwords first
hydra -l <username> -P /usr/share/wordlists/SecLists/Passwords/1-million-password-list-top-1000.txt \
ssh://10.10.10.X -t 4 -f -v
# If that fails, escalate to rockyou.txt
hydra -l <username> -P /usr/share/wordlists/rockyou.txt \
ssh://10.10.10.X -t 4 -f -vV
Scenario 2: Web login form
# First, identify the failure message using Burp Repeater
# Then craft the hydra command with the correct failure string
hydra -l admin -P /usr/share/wordlists/rockyou.txt 10.10.10.X \
http-post-form "/login.php:username=^USER^&password=^PASS^:Invalid credentials" \
-t 4 -f -vV
# If the form uses CSRF tokens, use Burp Intruder instead
# Burp → Intruder → Sniper mode → Cluster bomb for user+pass
Scenario 3: FTP anonymous access
# Always check anonymous FTP first — no wordlist needed!
ftp 10.10.10.X
# Username: anonymous
# Password: (empty or "anonymous")
# If anonymous works, look for interesting files
ls -la
get <interesting_file>
Scenario 4: Default credentials
# Many OSCP machines use default credentials on services
# Common defaults to try manually first:
# admin:admin, admin:password, root:toor, admin:admin123
# tomcat:tomcat, nagios:nagios, postfix:postfix
# Use default credential wordlists for automation
hydra -L /usr/share/wordlists/SecLists/Passwords/Default-Credentials/web-default-account-names-and-passwords.lst \
-P /usr/share/wordlists/SecLists/Passwords/Default-Credentials/web-default-account-names-and-passwords.lst \
10.10.10.X http-post-form "/login:user=^USER^&pass=^PASS^:F=failed" -v
7.3 Hydra Cheat Sheet
# Syntax
hydra [-o LOG] [-t TASKS] [-T THREADS] [-s PORT] [-l LOGIN | -L FILE] \
[-p PASS | -P FILE] [-c TIME] [-M FILE [-t TASKS]] [-e nsr] \
[-o FILE] [-f] [-v | -V | -d] [-f] [-w TIME] [-u] [-x MIN:MAX:CHARSET] \
[service://server[:PORT][/CREDENTIALS]] [OPTS]
# Key flags
-t TASKS # Tasks per target (default 16, reduce to 4 for stealth)
-l LOGIN # Single login name
-L FILE # Login list file
-p PASS # Single password
-P FILE # Password list file
-C FILE # Credential pairs (user:pass per line)
-s PORT # Non-default port
-f # Stop on first success
-e ns # "n" = null password, "s" = use login as password
-vV # Verbose + show login:pass tries
-w TIME # Max wait time between attempts in seconds
-u # Loop around passes, trying each login (user-mode)
-m HTTP_OPTS # HTTP options (for POST data, headers, etc.)
-f # Exit when a login/pass pair is found
# Service modules (common ones)
ssh:// # SSH
ftp:// # FTP
http-post-form # HTTP POST form
http-get # HTTP GET
rdp:// # RDP
smb:// # SMB
mssql:// # Microsoft SQL Server
postgres:// # PostgreSQL
telnet:// # Telnet
7.4 Critical Reminders
- Always decompress rockyou.txt before use:
gunzip /usr/share/wordlists/rockyou.txt.gz - Start small — try top 100, then top 1000, then top 10000, then full rockyou.txt
- Use
-fflag to stop on first success — saves time and avoids lockout - Reduce threads (
-t 4or even-t 2) to avoid triggering lockouts - Check for null passwords (
-e n) and username-as-password (-e s) — common OSCP trick - Always try default credentials manually before launching automated attacks
- Note the failure string for HTTP forms — an incorrect failure string means hydra can’t detect success
- Use
crunchto generate custom wordlists when you know the password pattern - Burp Intruder is your friend for complex web forms that hydra can’t handle
- Document your wordlist choices in your report — examiners want to see methodology
7.5 Wordlist Generation with Crunch
# Generate all 4-digit PINs
crunch 4 4 0123456789 -o /tmp/pins.txt
# Generate 6-8 char lowercase passwords
crunch 6 8 abcdefghijklmnopqrstuvwxyz -o /tmp/lower.txt
# Generate passwords with specific pattern: 3 letters + 3 digits
crunch 6 6 -t abc@@@ -o /tmp/pattern.txt
# @ = digits, a = lowercase, A = uppercase, ^ = symbols
# Generate with character set
crunch 5 5 0123456789abcdefghijklmnopqrstuvwxyz -o /tmp/alnum5.txt
# Pipe directly to hydra (no file needed for small lists)
crunch 4 4 0123456789 | hydra -l admin -P - ssh://10.10.10.X -t 4 -f -v
Summary
| Attack Type | Best When | Speed | Detection Risk |
|---|---|---|---|
| Brute Force | Short passwords, known charset, offline | Slow online, fast offline | High online, none offline |
| Dictionary | Real-world passwords, first pass | Fast | Medium |
| Credential Stuffing | Breach data available, password reuse likely | Fast | Low (distributed) |
| Hybrid | Dictionary words with predictable modifications | Medium | Medium |
| Smart Brute Force | No wordlist match, but password has patterns | Medium | High |
The golden rule: Always start with the simplest, fastest approach (dictionary with top passwords) and escalate complexity only when needed. In the OSCP exam, most passwords are cracked with rockyou.txt or a small custom wordlist — save brute force for when everything else fails.