I’ve decided to fully focus on Rev and Web for CTFs now, as I find Pwning too magical, and not really “useful” to me. Anyhoo, here are some reversing writeups from Angstrom CTF!
Dyn
Running the code, we see that it gets the flag as an input

Stepping through the code, it tries to unwrap
32 characters, which tells us that there are 32 characters between actf{
and }

We put in some jumbled input to see where the program takes us

The code reaches a part where it does a comparison with our jumbled input with a certain strings



We simply map back the jumbled index with our input, and reorder the string it’s checking against to get the correct flag
input_str = list("qwertyuiopasdfghjkl;zxcvbnm,./!@")
jumbled_str = list("ytiuwqrefdhgposaxzvckj;l/.@!nb,m")
jumbled_flag = list("_ynourtsd_tet_eh2_bfiasl7cedbda7")
flag = ""
for c in input_str:
index = jumbled_str.index(c)
flag += jumbled_flag[index]
print(flag)

Imposter
This program tries to allocate way too much memory. We just need to keep that in check and it will print the flag
The two offending instructions are:


We reduce the malloc to a smaller size, and remove the shl [rbp+size], 1]
to shl rax, 0
, which essentially does nothing


However, by doing that, we get a new error realloc(): invalid next size
, which means that the amount of memory rellocated is too small for the new length of the string

So we push the numbers slightly higher to 100h
and we see that some strings are being printed out which roughly resembles the flag



Through trial and error, setting it above 200h
prints out the entire flag

Flatlands
The main parts of the code are
Looping through your input and comparing each character with the string NfTRcD1ontrw}4{mFl_Ad0ua

If the input character does not match the character in the string, this counter is incremented

If the input character matches a character in the string, the counter is compared this value

If the counter is equal, great. If the counter is not equal however, it does a second check with another value further down

In summary, you have to reorder NfTRcD1ontrw}4{mFl_Ad0ua
so that characters are at the right index, and the counter matches the values
Leave a Reply