Skillpedia
الأمان5.4k · #14921

hunt-mfa-bypass

ما الذي تفعله

تختبر هذه المهارة المصادقة متعددة العوامل بحثًا عن تجاوزات سير العمل وإعادة استخدام الرموز والفحوص الضعيفة. وهي للاختبار المصرّح به لتسجيل الدخول بعاملين والإجراءات الحساسة في الحساب.

متى تستخدمها

  • ✓عندما يطلب الموقع رمز عامل ثانٍ وتريد التحقق من فرضه على الخادم.
  • ✓عندما يتخطى إجراء حساس، مثل تغيير البريد، خطوة العامل الثاني.
  • ✓عندما قد يعمل رمز لمرة واحدة أكثر من مرة أو يقبل مدخلًا جزئيًا.

رابط المهارة

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-mfa-bypass/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-mfa-bypass/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك التحقق مما إذا كان تطبيقنا يفرض رمز العامل الثاني على كل إجراء حساس، في اختبارنا المصرّح به؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يجرب الوكيل تخطي خطوة العامل الثاني، وإعادة استخدام الرموز، وفحص المدخلات الجزئية، بدءًا بأسرع تجاوزات سير العمل. ولا يبلغ إلا عما يستطيع إثباته.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Autonomous Testing Priority

Try workflow bypasses before brute force — they're faster and more likely to succeed.

Pattern 1 — Skip the MFA step entirely (most automatable):

  1. Login with valid credentials → receive a "pre-MFA" session state
  2. Without completing MFA, directly access a protected resource (/dashboard, /api/me, /account/profile)
  3. If the response returns user data → MFA is enforced only in the UI, not server-side = Critical

Pattern 2 — OTP replay (reuse a consumed code):

  1. Complete a valid MFA flow to get a working OTP
  2. Log out, log in again with the same credentials
  3. Submit the same OTP again
  4. If accepted → OTP is not invalidated after use

Pattern 3 — Submit obviously wrong OTP, observe response: Try submitting 000000 or 123456. If the response is 200 or returns a session token, OTP validation is broken or client-side only.

Pattern 4 — Partial / incremental validation (prefix oracle): If a guessed full code is rejected, test whether the server validates the OTP prefix-by-prefix instead of all-or-nothing. Submit a short partial code and compare responses:

  1. Submit a 1–3 digit value (e.g. otp=1, then otp=12, …) — for a POST verify endpoint the code goes in the request body, not the URL query string, or the server reads an empty value.
  2. If a correct prefix gives a DIFFERENT response than a wrong one (a success/flag, a distinct message, or a different length/timing), the validator leaks correctness one chunk at a time.
  3. Walk the code digit-by-digit: keep the prefix that "responds correct," append 0–9, repeat. This collapses 10^6 brute force to ~10×N guesses (≤60 for a 6-digit code) — very feasible in a bounded test. This is the go-to when there is no leaked code and no skip/replay path. Some apps award success on any correct prefix outright (so a single correct first digit can win — sweep otp=0,1,…,9 before giving up). CRITICAL — stay in ONE session: re-authenticating (POST /…/login again) regenerates the OTP, throwing away your prefix progress. Do the entire sweep against a single established MFA session; never re-login between guesses.

On full brute force: brute-forcing all 10^6 codes is infeasible in a bounded test — but the prefix oracle above (Pattern 4) usually makes it unnecessary. Only attempt full brute force with evidence of no rate limit AND a small key space.

Proof: A session token or protected resource data in the response without completing MFA confirms the bypass.


19. MFA / 2FA BYPASS

Growing bug class — 7 distinct patterns. Pays High/Critical when it enables ATO without prior session.

Pattern 1: No Rate Limit on OTP

# Test with ffuf — all 1M 6-digit codes
ffuf -u "https://target.com/api/verify-otp" \
  -X POST -H "Content-Type: application/json" \
  -H "Cookie: session=YOUR_SESSION" \
  -d '{"otp":"FUZZ"}' \
  -w <(seq -w 000000 999999) \
  -fc 400,429 -t 5
# -t 5 (slow down) — aggressive rates get 429 or ban

Pattern 2: OTP Not Invalidated After Use

1. Login → receive OTP "123456" → enter it → success
2. Logout → login again with same credentials
3. Try OTP "123456" again
4. If accepted → OTP never invalidated = ATO (attacker sniffs OTP once, reuses forever)

Pattern 3: Response Manipulation

1. Enter wrong OTP → capture response in Burp
2. Change {"success":false} → {"success":true} (or 401 → 200)
3. Forward → if app proceeds → client-side only MFA check

Pattern 4: Skip MFA Step (Workflow Bypass)

# After entering password, app sets a "pre-mfa" cookie → redirects to /mfa
# Test: skip /mfa entirely, access /dashboard directly with pre-mfa cookie
# If app grants access without MFA = auth flow bypass = Critical
curl -s -b "session=PRE_MFA_SESSION" https://target.com/dashboard

Pattern 5: Race on MFA Verification

import asyncio, aiohttp

async def verify(session, otp):
    async with session.post("https://target.com/api/mfa/verify",
                            json={"otp": otp}) as r:
        return r.status, await r.text()

async def race():
    cookies = {"session": "YOUR_SESSION"}
    async with aiohttp.ClientSession(cookies=cookies) as s:
        # Fire ~30 concurrent submissions of the SAME OTP to hit the TOCTOU
        # window before the server marks it used. Two requests are NOT enough —
        # they almost always resolve sequentially as "already-used" (false negative).
        # Best done as a single-packet / 20+ HTTP-2-
الأسئلة الشائعة

لماذا تُختبر تجاوزات سير العمل أولًا؟

تقول المهارة إنها أسرع في الاختبار، وغالبًا ما تنجح عندما يوجد الفحص في الواجهة فقط.

هل تغطي تخمين الرموز؟

نعم. تغطي تخمين رموز من ستة أرقام عندما تغيب حدود المعدل.

كم نمطًا تغطي؟

تذكر المهارة سبعة أنماط، منها حالات السباق ومشكلات رموز الاسترداد.

التفاصيل

الوصف الأصلي من المؤلف

Hunt MFA / 2FA bypass — 7 distinct patterns. (1) MFA not enforced on sensitive endpoints (password change, email change accept without MFA challenge), (2) MFA-step skip via direct navigation to post-login URL, (3) MFA-token replay (same code accepted twice), (4) brute-force the 6-digit OTP without rate limit (10^6 attempts at server speed), (5) race condition on OTP validation, (6) recovery-code dump via /api/me, (7) backup factor downgrade (SMS factor with no rate limit). Plus the chain: cookie theft + password oracle + no step-up = ATO without MFA challenge. Detection: trace auth flow in Bur

repo: elementalsouls/Claude-BugHunter

الشعبية

نجوم GitHub
5.4k
الترتيب
#14921
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة