Crypto CTF Workflow
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Triage checklist
- ์ด๋ค ๊ฒ์ด ์๋์ง ํ์ : ์ธ์ฝ๋ฉ vs ์ํธํ vs ํด์ vs ์๋ช vs MAC.
- ์ด๋ค ํญ๋ชฉ์ด ์ ์ด๋๋์ง ํ๋จ: plaintext/ciphertext, IV/nonce, key, oracle (padding/error/timing), partial leakage.
- ๋ถ๋ฅ: symmetric (AES/CTR/GCM), public-key (RSA/ECC), hash/MAC (SHA/MD5/HMAC), classical (Vigenere/XOR).
- ๊ฐ๋ฅ์ฑ์ด ๋์ ๊ฒ์ฌ๋ถํฐ ๋จผ์ ์ ์ฉ: decode layers, known-plaintext XOR, nonce reuse, mode misuse, oracle behavior.
- ํ์ํ ๊ฒฝ์ฐ์๋ง ๊ณ ๊ธ ๊ธฐ๋ฒ์ผ๋ก ํ๋: lattices (LLL/Coppersmith), SMT/Z3, side-channels.
Online resources & utilities
์ด ๋ฆฌ์์ค๋ค์ ์๋ณ ๋ฐ ๋ ์ด์ด ๋ฒ๊ธฐ๊ธฐ(layer peeling)๋ฅผ ํ๊ฑฐ๋ ๊ฐ์ค์ ๋น ๋ฅด๊ฒ ๊ฒ์ฆํ ๋ ์ ์ฉํ๋ค.
Hash lookups
- ํด์๋ฅผ Google์ ๊ฒ์ํด ๋ณด๋ผ (์์ธ๋ก ํจ๊ณผ์ ์).
- https://crackstation.net/
- https://md5decrypt.net/
- https://hashes.org/search.php
- https://www.onlinehashcrack.com/
- https://gpuhash.me/
- http://hashtoolkit.com/reverse-hash
Identification helpers
- CyberChef (Magic, decode, convert): https://gchq.github.io/CyberChef/
- dCode (ciphers/encodings playground): https://www.dcode.fr/tools-list
- Boxentriq (substitution solvers): https://www.boxentriq.com/code-breaking
Practice platforms / references
- CryptoHack (hands-on crypto challenges): https://cryptohack.org/
- Cryptopals (classic modern crypto pitfalls): https://cryptopals.com/
Automated decoding
- Ciphey: https://github.com/Ciphey/Ciphey
- python-codext (tries many bases/encodings): https://github.com/dhondta/python-codext
Encodings & classical ciphers
Technique
๋ง์ CTF crypto ๋ฌธ์ ๋ base encoding + simple substitution + compression ๊ฐ์ ๋ ์ด์ดํ ๋ณํ์ด๋ค. ๋ชฉํ๋ ๋ ์ด์ด๋ฅผ ์๋ณํ๊ณ ์์ ํ๊ฒ ๋ฒ๊ธฐ๋ ๊ฒ์ด๋ค.
Encodings: try many bases
๋ ์ด์ด ์ธ์ฝ๋ฉ์ด ์์ฌ๋๋ฉด (base64 โ base32 โ โฆ) ๋ค์์ ์๋ํ๋ผ:
- CyberChef โMagicโ
codext(python-codext):codext <string>
Common tells:
- Base64:
A-Za-z0-9+/=(ํจ๋ฉ=๊ฐ ํํจ) - Base32:
A-Z2-7=(์ข ์ข ๋ง์=ํจ๋ฉ) - Ascii85/Base85: ๊ตฌ๋์ ์ด ๋นฝ๋นฝํจ; ๋๋๋ก
<~ ~>๋ก ๊ฐ์ธ์ง
Substitution / monoalphabetic
- Boxentriq cryptogram solver: https://www.boxentriq.com/code-breaking/cryptogram
- quipqiup: https://quipqiup.com/
Caesar / ROT / Atbash
- Nayuki auto breaker: https://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript
- Atbash: http://rumkin.com/tools/cipher/atbash.php
Vigenรจre
Bacon cipher
์ข ์ข 5๋นํธ ๋๋ 5๊ธ์ ๊ทธ๋ฃน์ผ๋ก ๋ํ๋๋ค:
00111 01101 01010 00000 ...
AABBB ABBAB ABABA AAAAA ...
Morse
.... --- .-.. -.-. .- .-. .- -.-. --- .-.. .-
Runes
Runes๋ ์์ฃผ ์นํ ์ํ๋ฒณ์ ๋๋ค; โfuthark cipherโ๋ฅผ ๊ฒ์ํ๊ณ ๋งคํ ํ ์ด๋ธ์ ์๋ํด๋ณด์ธ์.
์ฑ๋ฆฐ์ง์์์ ์์ถ
Technique
์์ถ์ ์ถ๊ฐ ๋ ์ด์ด๋ก ์์ฃผ ๋ฑ์ฅํฉ๋๋ค (zlib/deflate/gzip/xz/zstd), ๋๋ก๋ ์ค์ฒฉ๋๊ธฐ๋ ํฉ๋๋ค. ์ถ๋ ฅ์ด ๊ฑฐ์ ํ์ฑ๋์ง๋ง ์๋ง์ผ๋ก ๋ณด์ธ๋ค๋ฉด ์์ถ์ ์์ฌํ์ธ์.
Quick identification
file <blob>- ๋งค์ง ๋ฐ์ดํธ๋ฅผ ์ฐพ์๋ณด์ธ์:
- gzip:
1f 8b - zlib: often
78 01/9c/da - zip:
50 4b 03 04 - bzip2:
42 5a 68(BZh) - xz:
fd 37 7a 58 5a 00 - zstd:
28 b5 2f fd
Raw DEFLATE
CyberChef has Raw Deflate/Raw Inflate, which is often the fastest path when the blob looks compressed but zlib fails.
์ ์ฉํ CLI
python3 - <<'PY'
import sys, zlib
data = sys.stdin.buffer.read()
for wbits in [zlib.MAX_WBITS, -zlib.MAX_WBITS]:
try:
print(zlib.decompress(data, wbits=wbits)[:200])
except Exception:
pass
PY
์ผ๋ฐ์ ์ธ CTF crypto ๊ตฌ์ฑ
๊ธฐ๋ฒ
์ด๊ฒ๋ค์ ํ์ค์ ์ธ ๊ฐ๋ฐ์ ์ค์์ด๊ฑฐ๋ ์๋ชป ์ฌ์ฉ๋ ์ผ๋ฐ์ ์ธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๊ธฐ ๋๋ฌธ์ ์์ฃผ ๋ฑ์ฅํฉ๋๋ค. ๋ชฉํ๋ ๋ณดํต ์ด๋ฅผ ์๋ณํ๊ณ ์๋ ค์ง ์ถ์ถ ๋๋ ์ฌ๊ตฌ์ฑ ์ํฌํ๋ก์ฐ๋ฅผ ์ ์ฉํ๋ ๊ฒ์ ๋๋ค.
Fernet
์ผ๋ฐ์ ์ธ ํํธ: ๋ ๊ฐ์ Base64 ๋ฌธ์์ด (token + key).
- Decoder/notes: https://asecuritysite.com/encryption/ferdecode
- In Python:
from cryptography.fernet import Fernet
Shamir Secret Sharing
์ฌ๋ฌ shares๊ฐ ๋ณด์ด๊ณ ์๊ณ๊ฐ t๊ฐ ์ธ๊ธ๋์ด ์๋ค๋ฉด, ์ด๋ Shamir์ผ ๊ฐ๋ฅ์ฑ์ด ๋์ต๋๋ค.
- Online reconstructor (handy for CTFs): http://christian.gen.co/secrets/
OpenSSL salted formats
CTF์์๋ ๋๋๋ก openssl enc ์ถ๋ ฅ(ํค๋๊ฐ ์ข
์ข
Salted__๋ก ์์)์ ์ ๊ณตํฉ๋๋ค.
Bruteforce helpers:
์ผ๋ฐ ๋๊ตฌ ๋ชจ์
- RsaCtfTool: https://github.com/Ganapati/RsaCtfTool
- featherduster: https://github.com/nccgroup/featherduster
- cryptovenom: https://github.com/lockedbyte/cryptovenom
๊ถ์ฅ ๋ก์ปฌ ์ค์
์ค์ฉ์ ์ธ CTF ์คํ:
- Python +
pycryptodomefor symmetric primitives and fast prototyping - SageMath for modular arithmetic, CRT, lattices, and RSA/ECC work
- Z3 for constraint-based challenges (when the crypto reduces to constraints)
๊ถ์ฅ Python ํจํค์ง:
pip install pycryptodome gmpy2 sympy pwntools z3-solver
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


