CTF TOPIC · 6 FLAGS · 25 MIN
Scripting for CTFs
Script repetitive decoding: shifts, brute-forcing a Caesar, repeating-key XOR.
A little Python turns slow hand-decoding into instant answers. Read bytes or numbers from a file, transform them in a loop, and print the result. Three patterns cover most beginner challenges: apply a per-character shift, brute-force a small keyspace (like all 26 Caesar shifts) and keep the readable candidate, and XOR bytes against a repeating key. Write them on your own machine; the in-browser tools cover the simple cases.
A first example
''.join(chr((n-5)%256) for n in nums) ; for k in range(26): ... ; b ^ key[i%len(key)]First moves
- Read the input from a file
- Write one transformation as a function
- Loop over keys or layers
- Stop when the output starts with flag{
- Print candidates so you can see near misses
The challenges
- Automate the shift · Medium · 30 XP
- Brute every shift · Medium · 30 XP
- Repeating-key XOR · Hard · 40 XP
- Twelve layers · Medium · 30 XP
- Brute a one-byte key · Hard · 40 XP
- Most frequent token · Medium · 30 XP
Find the flags yourself.
Sign in to open the evidence, use the in-browser tools and submit flags. Your progress stays with your account.
Open this topic →