saml
यह क्या करती है
यह स्किल SAML single sign-on पर हमलों को समझाती है, जिनमें XML signature wrapping शामिल है। यह कंपनी के लॉगिन सेटअप की समीक्षा करने वाले सुरक्षा परीक्षकों के लिए है।
कब इस्तेमाल करें
- ✓जब कोई साइट कंपनी लॉगिन के लिए SAML single sign-on इस्तेमाल करती है और आप उसे टेस्ट करना चाहते हैं।
- ✓जब समीक्षा के लिए SAML जवाब या metadata फ़ाइल उपलब्ध हो।
- ✓जब सुरक्षा समीक्षा पूछती है कि लॉगिन assertions के साइनेचर सही जाँचे जाते हैं या नहीं।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/saml/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप जाँच सकते हैं कि हमारा कंपनी SAML लॉगिन बदला हुआ लॉगिन संदेश स्वीकार करता है या नहीं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट SAML संदेश डिकोड करता है, फिर परखता है कि सर्वर साइनेचर और डुप्लिकेट assertions कैसे संभालता है, ताकि देखा जा सके कि वह संदेश के गलत हिस्से पर भरोसा तो नहीं करता।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
SAML Attack Playbook
SAML is XML-based SSO used heavily in enterprise. Signatures protect assertions but XML's structural flexibility creates many opportunities to confuse signature validators.
1. Capture the flow
# Identify SAML in recon — look for:
# - /SAML/login, /sso/saml, /saml2/login
# - Form param "SAMLRequest" or "SAMLResponse" (base64 + deflate)
# - SP metadata: /SAML/metadata, /sp/metadata.xml
# - IdP metadata: /idp/metadata.xml
# Decode a SAML message in Burp via the SAML Raider plugin
# Or manually
echo "$SAMLResponse_base64" | base64 -d | xmllint --format -
2. XML Signature Wrapping (XSW) attacks
The classic SAML bug class. 8 canonical variants. SAML Raider implements all of them.
XSW1: Wrap signed Assertion inside Response, add evil assertion
<Response>
<ds:Signature>...</ds:Signature> <!-- signs the inner Assertion -->
<Assertion id="evil">
<Subject>attacker</Subject>
<AttributeStatement>...</AttributeStatement>
</Assertion>
<!-- original signed assertion moved into a deeper child or as sibling of evil -->
<Assertion id="orig">
<Subject>victim</Subject>
...
</Assertion>
</Response>
Parser-checks-signature on orig (still valid). App-reads-claims from
evil (first assertion). Bypass complete.
XSW2-8
Vary which element is signed, what gets added where, what gets renamed. Run all 8 via SAML Raider's automated XSW tester.
3. Comment injection
SAML libraries that strip XML comments BEFORE signature validation but the application reads the un-stripped version (or vice versa):
<Subject>victim@target.com<!-- foo -->.evil.com</Subject>
Some parsers see victim@target.com; others see victim@target.com.evil.com.
Famous: Cisco DUO + others in 2018 (CVE-2018-0489).
4. Signature stripping
Just delete the <ds:Signature> element. Some servers fail to enforce
signature presence.
5. Self-signed assertion (when allowed by misconfig)
Some SPs accept assertions from any IdP listed in their trust store. If the trust store is overly broad, attacker stands up own IdP, generates own cert, IdP signs assertion claiming victim identity.
6. Bypass via SAMLResponse to SAMLRequest confusion
Both are base64'd + deflated XML. Some endpoints handle either. Sending an unsigned SAMLResponse when the endpoint expects a SAMLRequest may bypass auth.
7. Attribute injection via metadata
If SP fetches IdP metadata at runtime from a URL (not pinned), attacker who can poison/spoof that URL injects malicious metadata claiming attacker's IdP signs as victim's IdP.
8. Replay
Many SAML implementations don't track assertion IDs. Capture a victim's
SAML response, replay it later. Mitigation: assertions have NotOnOrAfter
- unique
ID; SPs should track recently-used IDs in a cache.
9. KeyInfo / certificate confusion
<ds:KeyInfo> can carry the cert inline. Attacker:
- Sends own cert in KeyInfo
- Signs assertion w/ corresponding private key
- Server validates against the cert in KeyInfo (instead of its trust store)
10. Tools
- SAML Raider (Burp plugin) — XSW1-8 automation, signature operations, message editing. Essential.
samltool.com— XML pretty-print + base64 decodesamlxss— quick XSS payload tester in SAML attributes- Python
saml2— manual crafting via lxml
11. PoC pattern
- Capture victim's SAMLResponse in Burp
- Decode, identify Subject + AttributeStatement
- Launch SAML Raider → "XSW Test" → cycle through all 8 variants, observe response
- Any variant that returns logged-in-as-target = bug
- If XSW fails, try comment injection: inject
<!-- foo -->in claim values - If still fails, try signature stripping (delete
<ds:Signature>) - Document the modified SAMLResponse + the resulting authenticated session as PoC
12. Severity calibration
| Bug | Typical |
|---|---|
| XSW variant accepted → arbitrary user impersonation | Critical 9.8 (most enterprise SSO bounty) |
| Comment injection accepted | Critical 9.8 |
| Signature stripping accepted | Critical 9.8 |
| KeyInfo cert trust | Critical 9.8 |
| Replay window > 5 min | High 7-8 |
| Self-IdP misconfig | Critical 9.8 |
13. Defender remediation
- Use a battle-tested library (PySAML2, opensaml-cpp, OneLogin's SAML libs)
- Pin trusted IdPs by cert fingerprint, not URL
- Cache assertion IDs and reject replays
- Validate signature BEFORE comment-stripping (or after, but consistently)
- Reject responses w/o `ds:Signature
अक्सर पूछे जाने वाले सवाल
XML signature wrapping क्या है?
यह एक चाल है जिसमें संदेश का मान्य साइन किया हिस्सा मान्य रहता है, जबकि ऐप उसकी जगह एक नकली हिस्सा पढ़ लेता है।
कौन-सा टूल बताया गया है?
SAML Raider, जो आम wrapping रूपों को लागू करता है।
क्या signature stripping कवर है?
हाँ, यह हमले के प्रकारों में signature stripping और assertion forgery को कवर करती है।
जानकारी
लेखक का मूल विवरण
SAML 2.0 attacks — XSW (XML Signature Wrapping) variants 1-8, comment injection, signature stripping, assertion forgery, IdP metadata abuse.
लोकप्रियता
- GitHub स्टार
- 6.5k
- रैंकिंग में स्थान
- #14078
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।