一键导入
crypto-attacks
Cryptographic Attacks target implementation flaws and algorithm weaknesses in encryption systems, covering OWASP A04: Cryptographic Failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Cryptographic Attacks target implementation flaws and algorithm weaknesses in encryption systems, covering OWASP A04: Cryptographic Failures.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | crypto-attacks |
| description | Cryptographic Attacks target implementation flaws and algorithm weaknesses in encryption systems, covering OWASP A04: Cryptographic Failures. |
| origin | openclaw |
| version | 0.1.18 |
| compatibility | ["openclaw","claude-code","cursor","windsurf"] |
| allowed-tools | ["Bash","Read","Write","Edit","WebSearch","WebFetch"] |
| metadata | {"domain":"cryptography","tool_count":7,"guide_count":6,"owasp":"A04:2021-Cryptographic Failures"} |
Supplementary Files:
payloads.md— Cryptographic attack payload collection: weak algorithm detection, hash cracking, Padding Oracle, Hash Length Extension, ECB mode, JWT attacks, RSA attacks, SSL/TLS test commandstest-cases.md— Structured test cases: complete test checklist covering cryptographic detection, hash cracking, protocol attacks, JWT attacks, and advanced techniques
Crypto Attacks skill domain covering cryptography operations.
Tools: openssl, sslscan, testssl.sh, hashcat, CyberChef, padbuster, RsaCtfTool
Domain: cryptography
OWASP: A04:2021-Cryptographic Failures
Cryptographic Attacks target implementation flaws and algorithm weaknesses in encryption systems, covering OWASP A04: Cryptographic Failures. Attackers do not break mathematical problems; instead, they exploit engineering implementation errors: weak algorithm remnants (RC4/DES/MD5/SHA1), key management mistakes (hardcoded/reused/non-rotated), encryption mode misuse (ECB/Padding Oracle/IV Reuse), protocol downgrade (SSLv3/TLS 1.0), and missing signature verification (JWT alg:none/Algorithm Confusion).
Core Insight: The mathematical foundations of modern cryptography are robust — attackers almost never "break encryption algorithms" but rather "break how encryption is used." A rule of thumb: if you feel like you are attacking the math, you are probably heading in the wrong direction; instead, look for who wrote the key in the code, which IV is fixed, which service still accepts SSLv3.
Key Attack Surfaces:
| Tool | Purpose | Command Example |
|---|---|---|
| openssl | Certificate analysis, protocol testing, encryption/decryption operations | openssl s_client -connect target:443 -tls1 |
| sslscan | Quick TLS configuration scan, detect supported protocols and cipher suites | sslscan target.com |
| testssl.sh | Comprehensive SSL/TLS security audit, 200+ checks | testssl.sh --full target.com |
| hashcat | Offline hash cracking (including JWT key brute force mode 16500) | hashcat -m 16500 jwt.txt rockyou.txt |
| CyberChef | Encoding/decoding/encryption/hashing online analysis (identify unknown encodings) | Browser tool, drag-and-drop operation |
| padbuster | Automated Padding Oracle attacks | padbuster URL ENC_BLOCK 8 |
Auxiliary tools: hash-identifier (hash type identification), htlea (Hash Length Extension), RsaCtfTool (RSA attack collection), jwt_tool (full JWT testing workflow).
[1] Crypto ID [2] Algorithm Analysis [3] Key/IV Attacks
- Protocol version - Weak algorithm detect - Hardcoded key search
- Cipher suite enum - Block size/mode detect - IV predictability
- Hash type ID - Key length assessment - Key reuse detection
- Token format parse - Padding mode analysis - ECB mode detection
| | |
v v v
[4] Protocol Downgrade [5] Data Decryption [6] Signature Bypass
- TLS version downgrade - Padding Oracle - JWT alg:none
- Cipher suite downgrade - Known plaintext attack - Algorithm Confusion
- Forward secrecy test - Bit flipping attack - Key brute force
- Cert chain validation - Hash extension attack - Replay attacks
The post-quantum transition expands the crypto-attacks attack surface on three new axes that any Distinguished-tier engagement must cover: (a) classical-vs-quantum threat model, (b) hybrid construction correctness, and (c) protocol incompatibilities caused by larger PQ key / signature sizes. The attack chain below operationalizes the HNDL ("Harvest Now, Decrypt Later") adversary and the migration audit.
[PQM-1] Asset Inventory [PQM-2] Algorithm Coverage [PQM-3] Hybrid Construction
- Long-lived keys cataloged - FIPS 203/204/205 support - X25519 + ML-KEM-768 KEM
- HNDL exposure profiled - liboqs / OQS-OpenSSL - Transcript hash binding
- PKI chain depth analyzed - pqm4 (Cortex-M4 targets) - KDF length-prefixing
| | |
v v v
[PQM-4] Protocol Compatibility [PQM-5] Downgrade Analysis [PQM-6] PQC Implementation Audit
- MTU / fragment / EDNS(0) - Stripping PQ group - KyberSlash (barrett div)
- Middlebox cert handling - Hybrid fallback policy - Dilithium verify-before-release
- X.509 alt-signature path - Cipher string hardening - Cross-protocol key reuse
Real research touchpoints: KyberSlash (2021), Injecting Crystals (Manganote et al., 2023), Crystal-Slinger, GROUNDTRUTH (2024), and Shor's algorithm assumptions about ECC/RSA recovery under a cryptographically relevant quantum computer (CRQC). The full attack taxonomy, parameter sizes, and lab procedures live in guides/crypto-attacks-pqc-migration-side-channel.md.
Side-channel analysis (SCA) targets physical and microarchitectural leakage of secret-dependent computation -- the single largest source of real-world breaks of mathematically sound algorithms. Padding Oracle, Heartbleed, and Spectre/Meltdown are all side channels; the same methodology scales to power, EM, timing, and fault channels on cryptographic hardware.
[SCA-1] Channel Selection [SCA-2] Trace Acquisition [SCA-3] Statistical Attack
- Timing (dudect) - ChipWhisperer + STM32F4 - SPA: single-trace op ID
- Power (SPA / DPA / CPA) - Riscure Inspector - DPA: difference-of-means
- Electromagnetic (EMA) - Near-field EM probe + scope - CPA: HW correlation
- Cache-timing (Spectre) - Remote latency measurement - Template: max likelihood
| | |
v v v
[SCA-4] PQC-Specific Attacks [SCA-5] Constant-Time Audit [SCA-6] Fault Injection
- Kyber compress leak - dudect / ctgrind / binsec - Clock / power glitch
- Dilithium z-step - HW-accel (AES-NI, ARMv8) - Verify-before-release bypass
- SPHINCS+ WOTS+ chain - Masking (order-1 minimum) - Fault-tolerant chains
Equipment baseline: ChipWhisperer Husky or Lite + CW308/STM32F4 target for power/EM/glitch; dudect / ctgrind for software constant-time verification; Riscure Inspector for enterprise-grade CPA / template attacks. Deep dive: guides/crypto-attacks-pqc-migration-side-channel.md.
Crypto-agility is the ability to swap cryptographic primitives without code changes or protocol breakage -- the strongest predictor of whether a PQC migration will succeed. The framework below structures the audit; an organization that cannot answer "yes" to every row is non-agile and at risk during any future algorithm transition (PQC today, AES-GCM-SIV tomorrow, whatever comes next).
[CA-1] Algorithm Inventory [CA-2] Pluggable Primitive API [CA-3] Negotiation & Telemetry
- Every long-term key mapped - Algorithm as config string - Negotiated group logged
- Every signature location - Key store holds 5 KB PQ keys - Downgrade detected
- Every TLS / SSH / IPsec - No hardcoded constants - Per-peer algorithm tracked
| | |
v v v
[CA-4] Swap Planning [CA-5] Test Coverage [CA-6] Rollback Readiness
- 12-month / 24-month target - ACVP / CAVP vectors - Atomic rollback to classical
- Hybrid (classical + PQ) - Cross-stack interop tests - Re-key without service outage
- Pure-PQ end state - Side-channel regression - Root of trust migration
Acceptance criterion: a single configuration change in crypto_policy.yaml (e.g., kem_group: x25519_mlkem768) propagates to every endpoint, every library, every certificate, with no source modification -- and the change is observable in production telemetry within 24 hours. Anything less is non-agile.
| Defense Measure | Description | Attack Types Countered |
|---|---|---|
| AES-256-GCM / ChaCha20-Poly1305 | Authenticated encryption (AEAD), ensures both confidentiality and integrity | ECB/CBC mode attacks, Padding Oracle |
| TLS 1.3 Only | Disable old protocols, enforce forward secrecy (PFS) | POODLE/BEAST/protocol downgrade |
| Key Management (KMS/HSM) | Keys never touch source code, hardware-isolated storage | Hardcoded keys, key leakage |
| PBKDF2/bcrypt/argon2id | Slow hashing + salt, increases offline cracking cost | Hash cracking, rainbow tables |
| JWT Security Practices | Algorithm allowlist + short expiration + strong keys + token blacklist | alg:none / Algorithm Confusion |
| Certificate Pinning | Pin expected certificates/public keys, prevent MITM | Forged certificates, MITM |
| Hybrid KEM (X25519 + ML-KEM-768) | Bind classical and PQ shares into transcript hash; secure if either primitive holds | HNDL, PQ-stripping downgrade, single-primitive break |
| Verify-before-release on PQ signatures | Compute signature, verify under public key, retry on mismatch | Dilithium / FN-DSA fault injection (Injecting Crystals) |
| First-order masking + NTT shuffling | Random-share secret-dependent lattice operations | Kyber / Dilithius SPA / DPA / single-trace EM |
| Constant-time coding (verified) | dudect / ctgrind / binsec CI gates; AES-NI / ARMv8 SHA | Timing, cache-timing, KyberSlash-class leaks |
| Crypto-agility policy layer | Algorithms expressed as config (OID / cipher string), not source constants | Migration blockers, future algorithm deprecations |
| X.509 alt-signature (hybrid) | Two signatures (classical + PQ) per certificate with separate OIDs | Transitional PKI trust breakage, slow client rollout |
| Per-protocol KEM key derivation | Domain-separated KDF on the shared secret | Kyber cross-protocol (Bosc et al. 2023) |
Beyond the row-level defenses, four structural mitigations cover the emerging PQ and side-channel surface:
x25519_mlkem768) and MUST reject ClientHello that strips the PQ group. Pure-PQ endpoints are acceptable only after the PQC primitive has accumulated 5+ years of adversarial analysis.dudect / ctgrind / binsec evidence in CI. Side-channel regression tests on cryptographic primitives must run on every commit, not as a release milestone. Hardware acceleration (AES-NI, ARMv8 SHA, dedicated PQ IP) is preferred over constant-time software where available.x25519 to x25519_mlkem768 in one config file; production telemetry reflects the change within 24 hours; no source modification." Organizations that cannot pass this test are non-agile and will not complete the PQC migration before the HNDL window closes.# SSL/TLS protocol scanning
testssl.sh --protocols target.com
sslscan target.com | grep -E "SSLv3|TLS 1.0|TLS 1.1"
# Hash type identification
hash-identifier
# Or: hashcat --identify hash.txt
# Padding Oracle attack
padbuster http://target/page?data=ENC ENC 8 -encoding 0 -plaintext "admin=true"
# ECB mode detection: Submit repeated plaintext, observe ciphertext block repetition
# IV Reuse: Encrypt same plaintext twice, compare ciphertexts
# JWT alg:none bypass
python3 jwt_tool.py <TOKEN> -X a
# JWT Algorithm Confusion (RS256 -> HS256)
python3 jwt_tool.py <TOKEN> -I -at HS256 -pc role -pv admin -k public_key.pem
# JWT key brute force
hashcat -m 16500 jwt_hash.txt /usr/share/wordlists/rockyou.txt
For detailed payloads see
payloads.md, and for the complete test checklist seetest-cases.md.
Automate TLS configuration scanning by running testssl.sh with the --json output flag and piping results into a comparison script that flags deviations from security baselines. Use hashcat in benchmark mode (hashcat -b) to measure GPU cracking throughput before launching long-running cracking jobs. Script Padding Oracle attacks with padbuster's batch mode and custom Python wrappers that automate the byte-by-byte decryption loop with retry logic for network errors.
Cryptographic findings should be mapped to OWASP A04:2021 (Cryptographic Failures) and include the specific misconfiguration discovered (e.g., "TLS 1.0 enabled with CBC cipher suite" rather than "weak encryption"). Document the full attack chain from discovery to impact: how the weak configuration was identified, what data could be decrypted or tampered with, and the estimated effort to exploit. Include specific remediation with library-specific configuration examples (e.g., OpenSSL cipher string, node.js TLS options).
Testing SSL/TLS configurations against production servers is generally permissible but be cautious with aggressive scanning that could trigger DoS conditions. Testing Heartbleed or similar memory-disclosure vulnerabilities on production systems may expose other users' sensitive data — use dedicated test environments when possible. Never store intercepted SSL private keys or decrypted session data beyond what is needed for the engagement report, and always verify that cryptographic testing is included in the scope of authorization.
Cryptographic attack findings feed directly into several adjacent skills. Weak TLS configurations discovered through testssl.sh inform network-pentest MITM attack planning. JWT vulnerabilities (alg:none, key brute force) connect to web-auth-bypass for authentication exploitation. Hash cracking results from hashcat feed into password-attack workflows for credential stuffing. Use burpsuite to intercept and replay JWT tampering payloads against authenticated API endpoints, combining crypto analysis with web application testing.
/jwks.json endpoint, then forged a token signed with HS256 using the public key as the HMAC secret. The server accepted the forged token because it trusted the key without verifying the algorithm, granting admin access.Defenders can detect cryptographic attacks through several indicators: unusual TLS negotiation patterns (downgrade attempts logged by the server), repeated decryption errors in application logs (Padding Oracle attempts), JWT validation failures with algorithm mismatches, and anomalous hash cracking activity (high GPU utilization on compromised machines). Monitor certificate transparency logs for unauthorized certificate issuance. To evade detection during testing: spread JWT brute force attempts across multiple API endpoints, use timing delays in Padding Oracle attacks to avoid triggering rate limits, and test TLS downgrade resistance through a single well-crafted ClientHello rather than a noisy scan. For hash cracking, offload to dedicated GPU rigs outside the target network.
Beyond the core attacks, advanced cryptographic testing includes: RSA key recovery from partial key exposure (known bits of p or q), Bleichenbacher attacks against PKCS#1 v1.5 padding in RSA encryption, BEAST and Lucky13 attacks against TLS CBC cipher suites, hash length extension attacks against SHA-256 and SHA-512 (not just MD5/SHA1), and cryptographic side-channel attacks using timing analysis to extract secrets. For CTF challenges, practice with RsaCtfTool for automated RSA attack selection and CyberChef for rapid encoding/decoding chain prototyping.
| Tool | Best For | Speed | Coverage | Skill Level |
|---|---|---|---|---|
| testssl.sh | Comprehensive TLS auditing | Moderate | Very broad | Beginner |
| sslscan | Quick protocol/cipher check | Fast | Broad | Beginner |
| hashcat | GPU hash/JWT cracking | Very fast | 300+ hash types | Intermediate |
| padbuster | Padding Oracle automation | Slow (network-bound) | Narrow | Intermediate |
| CyberChef | Encoding/decoding analysis | N/A (manual) | Very broad | Beginner |
| RsaCtfTool | RSA attack collection | Variable | RSA-specific | Advanced |
GPU-accelerated cracking with hashcat can achieve billions of MD5 hashes per second on modern hardware, but performance drops dramatically for memory-hard algorithms like bcrypt (thousands per second) and argon2id (hundreds per second). Choose attack modes based on target hash type: dictionary + rules for fast hashes, targeted dictionaries with custom mutations for slow hashes. For TLS scanning, testssl.sh performs 200+ checks but takes 5-10 minutes per host. Prioritize cryptographic remediation by replacing the weakest components first: disable SSLv3 and TLS 1.0/1.1 immediately, migrate from CBC mode to GCM/ChaCha20-Poly1305, enforce TLS 1.3 where possible, and implement proper key management using HSMs or cloud KMS services. For JWT security, enforce algorithm allowlists, use short token lifetimes, and rotate any exposed keys.
Obscurity Is Not Security -- Relying on hidden algorithms, custom encryption, or secret IVs to protect data is the biggest trap. Kerckhoffs' principle: security should depend only on the secrecy of the key, not the secrecy of the algorithm. Homemade encryption algorithms are almost certainly weaker than AES.
First Principles -- Understanding the design principles of cryptographic primitives is more important than memorizing attack steps. Padding Oracle works because the server leaks a 1-bit piece of information: "whether the padding is valid." Understanding this, you can find similar information leaks in any implementation.
Defense in Depth -- Single-layer encryption is not enough. TLS protects transmission + AES-256-GCM protects storage + HMAC protects integrity + HSM protects keys. No single point of failure should lead to total collapse.
Supplementary files for this skill: payloads.md, test-cases.md Related skills: skills/web-auth-bypass/SKILL.md, skills/password-attack/SKILL.md External resources:
guides/cryptographic_failures_complete_guide.md -- Complete OWASP A04 guide with weak algorithm attacks, ECB/Padding Oracle/IV Reuse attacks, JWT tampering, and complete offensive and defensive code for key managementguides/crypto-attacks-pqc-migration-side-channel.md -- Post-Quantum Cryptography migration (NIST FIPS 203/204/205, ML-KEM, ML-DSA, SLH-DSA, FN-DSA), hybrid TLS 1.3, X.509 cert handling, side-channel methodology (SPA / DPA / CPA / EMA / timing / cache-timing), PQC-specific attacks (KyberSlash, Injecting Crystals, SPHINCS+ WOTS+ faults), and end-to-end ChipWhisperer lab on STM32F4CAN/CAN-FD bus analysis, UDS diagnostics, IVI pentest, OBD-II exploitation, key fob replay/relay attacks, GNSS spoofing, EV charging station (ISO 15118), and connected vehicle red team operations.
CSPM/CASB/CNAPP platform bypass and abuse — rule suppression exploitation, IaC state manipulation, CASB proxy evasion, SaaS shadow discovery, Wiz/Prisma/Lacework/Defender coverage gap identification, and tag-tampering attacks against cloud posture management tools.
Industrial fieldbus protocol penetration testing beyond Modbus — Profibus/PROFINET, EtherCAT, DNP3, IEC 61850 (GOOSE/SV/MMS), IEC 60870-5-101/104, Foundation Fieldbus, HART, CC-Link, BACnet deep dive. Covers power utility, process automation, building automation, and automotive fieldbus attack surfaces.
IBM z/OS, RACF (Resource Access Control Facility), CICS, DB2, JES2, TSO/ISPF penetration testing; APF library abuse, dataset access control, SNA/Appc attacks, and legacy mainframe security assessment for financial/government environments.
Secure Access Service Edge (SASE) and Security Service Edge (SSE) platform compromise covering Zscaler (ZIA/ZPA/ZDX/Client Connector), Netskope (Security Cloud, SWG, CASB, Private Access), Palo Alto Prisma Access, Cisco Umbrella, CATO Networks SASE, Cloudflare One (WARP, Gateway, Access), and Microsoft Entra Global Secure Access — including client connector reverse engineering, TLS inspection bypass via certificate pinning and ESNI/ECH, split-tunnel race conditions, BYOD vs managed device bypass, stolen SSO token replay through SSE proxy, anonymizer proxy evasion (Shadowsocks/V2Ray/Obfs4/Trojan), and detection avoidance using Wireshark, Frida, mitmproxy, JA3/JA4 fingerprint spoofing.
Runtime engineering discipline for agent systems — structured JSON memory schemas, memory-driven convergence rules, shared-memory multi-agent coordination via POSIX flock + atomic write + version vector, anti-pattern prevention, and topology selection. Solidifies the engineering patterns of SCEN-007 (shared-memory multi-agent exploit dev) and SCEN-MEMORY-SCHEMA (structured memory foundation) into a reusable knowledge base. Inspired by MopMonk Agent three招 (扫地僧, CyberGym 73.1%, China