$npx -y skills add SnailSploit/Claude-Red --skill offensive-race-conditionWhen this skill is active: 1. Load and apply the full methodology below as your operational checklist 2. Follow steps in order unless the user specifies otherwise 3. For each technique, consider applicability to the current target/context 4. Track which checklist items have been
| 1 | # SKILL: Race Conditions |
| 2 | |
| 3 | ## Metadata |
| 4 | - **Skill Name**: race-condition |
| 5 | - **Folder**: offensive-race-condition |
| 6 | - **Source**: https://github.com/SnailSploit/offensive-checklist/blob/main/race-condition.md |
| 7 | |
| 8 | ## Description |
| 9 | Race condition (TOCTOU) testing checklist: identifying timing windows, Burp Suite Turbo Intruder, Last-Byte sync technique, rate limit bypass, double-spend attacks, and concurrent request exploitation. Use for web app race condition testing or bug bounty time-of-check-to-time-of-use bugs. |
| 10 | |
| 11 | ## Trigger Phrases |
| 12 | Use this skill when the conversation involves any of: |
| 13 | `race condition, TOCTOU, timing attack, Turbo Intruder, last-byte sync, rate limit bypass, double spend, concurrent request, race window, time of check, time of use` |
| 14 | |
| 15 | ## Instructions for Claude |
| 16 | |
| 17 | When this skill is active: |
| 18 | 1. Load and apply the full methodology below as your operational checklist |
| 19 | 2. Follow steps in order unless the user specifies otherwise |
| 20 | 3. For each technique, consider applicability to the current target/context |
| 21 | 4. Track which checklist items have been completed |
| 22 | 5. Suggest next steps based on findings |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | ## Full Methodology |
| 27 | |
| 28 | # Race Conditions |
| 29 | |
| 30 | ## Shortcut |
| 31 | |
| 32 | - Spot the features prone to race conditions in the target application and copy the corresponding requests. |
| 33 | - Send multiple of these critical requests to the server simultaneously. You should craft requests that should be allowed once but not allowed multiple times. |
| 34 | - Check the results to see if your attack has succeeded. And try to execute the attack multiple times to maximize the chance of success. |
| 35 | - Consider the impact of the race condition you just found. |
| 36 | |
| 37 | ## Mechanisms |
| 38 | |
| 39 | Race conditions occur when the behavior of a system depends on the relative timing or sequence of events that can happen in different orders. In web application security, race conditions happen when multiple concurrent processes or threads access and manipulate the same resource simultaneously without proper synchronization. |
| 40 | |
| 41 | ```mermaid |
| 42 | sequenceDiagram |
| 43 | participant Thread1 as Thread 1 |
| 44 | participant Resource |
| 45 | participant Thread2 as Thread 2 |
| 46 | |
| 47 | Thread1->>Resource: Read value (100) |
| 48 | Thread2->>Resource: Read value (100) |
| 49 | Thread1->>Thread1: Calculate new value (100-10=90) |
| 50 | Thread2->>Thread2: Calculate new value (100-10=90) |
| 51 | Thread1->>Resource: Write new value (90) |
| 52 | Thread2->>Resource: Write new value (90) |
| 53 | Note over Resource: Expected final value: 80<br/>Actual final value: 90 |
| 54 | ``` |
| 55 | |
| 56 | A race condition becomes a security vulnerability when it affects security controls or business logic. The critical types include: |
| 57 | |
| 58 | - Time-of-Check to Time-of-Use (TOCTOU): When a check is performed, but circumstances change before the result of the check is used |
| 59 | - Read-Modify-Write: When multiple processes read, modify, and write back a shared resource without coordination |
| 60 | - Thread Safety Issues: When multithreaded applications improperly handle shared resources |
| 61 | - Resource Allocation Races: Competition for limited resources like database connections or memory |
| 62 | |
| 63 | ```mermaid |
| 64 | graph TD |
| 65 | subgraph "Common Race Condition Types" |
| 66 | A[Race Conditions] --> B[TOCTOU] |
| 67 | A --> C[Read-Modify-Write] |
| 68 | A --> D[Thread Safety Issues] |
| 69 | A --> E[Resource Allocation] |
| 70 | |
| 71 | B --> B1["Check balance, then debit"] |
| 72 | C --> C1["Update counter or balance"] |
| 73 | D --> D1["Shared cache or session data"] |
| 74 | E --> E1["Limited coupon or inventory"] |
| 75 | end |
| 76 | ``` |
| 77 | |
| 78 | Common vulnerable scenarios include: |
| 79 | |
| 80 | - Account Balance Manipulation: Making multiple withdrawals/transfers simultaneously |
| 81 | - Coupon/Promotion Code Reuse: Using a single-use code multiple times |
| 82 | - File Upload Processing: Uploading and accessing temporary files before validation completes |
| 83 | - Registration Processes: Creating multiple accounts with the same unique identifier |
| 84 | - Token Verification: Using authentication tokens multiple times before they're invalidated |
| 85 | |
| 86 | ## Hunt |
| 87 | |
| 88 | ### Identifying Race Condition Vulnerabilities |
| 89 | |
| 90 | #### Target Functionality Selection |
| 91 | |
| 92 | Focus on features handling state changes, limited resources, or critical operations: |
| 93 | |
| 94 | - Financial Transactions: Fund transfers, withdrawals, purchases |
| 95 | - Inventory Systems: Stock allocation, reservation systems |
| 96 | - Coupon/Points Systems: Redeeming coupons, points, or rewards |
| 97 | - Voting/Rating Systems: Likes, upvotes, downvotes, polls |
| 98 | - Membership/Subscription Actions: Inviting users, joining/leaving groups, following/unfollowing users |
| 99 | - Registration Systems: Account creation with unique attributes |
| 100 | - Resource Management: Uploading, processing, or accessing resources |
| 101 | - Rate-Limited Actions: Password resets, login attempts, API endpoints with usage limits |
| 102 | |
| 103 | #### Testing Prerequisites |
| 104 | |
| 105 | 1. Tools for sending parallel requests: |
| 106 | - Burp Suite Turbo Intruder or Repeater (multi-threaded) |
| 107 | - Custom scripts with threading capabilities |
| 108 | - Race condition testing frameworks (e.g., Racepwn) |
| 109 | |
| 110 | 2. Request capturing and analysis capabilities: |
| 111 | - HTTP proxy for intercepting and modifying traffic |
| 112 | - Response analysis tools for |