FSIIECTF 2024

Rev/Easy-Crackme

image

Looking at the decompilation in Ghidra, we can just reassemble the flag from local_78 to local_4f but I decided to use angr to solve it.

Angr script
image

🩸 Pwn/Orcwars

image

We are presented with a menu based game where we need to get more troops than the enemy

image

Our total troops must be at least 0x22a to get the flag.

image

The problem lies in the line if ((int)local_34 < (int)(uVar5 * 100)) {. The variable uVar5 is declared as an unsigned integer but is being casted to an integer. Hence, we can give a large number of mercenaries. After multiplying by 100, it should result in a negative number due to how integer works.

image

Enter 1.1 billion

image

Fake flag because the remote server is not active anymore, so I just ran this locally.

🩸 Pwn/Flag-service

image

Another menu type challenge.

Decompiled Code

There is a Use-After-Free (UAF) vulnerability in option 3 when deleting an order. After freeing the chunk, the order variable is not set to NULL so the pointer to the freed chunk is still able to be used. Another thing to keep in mind is that malloc(0x8) and malloc(0x10) will return the same sized chunk because the minimum size for a heap chunk is 0x10 bytes (excluding metadata). Hence, the steps of our attack will be as follows

  • Create an order chunk

  • Delete that order chunk

  • Allocate the name chunk, the contents of this chunk will reflect your order chunk. Hence, just make the price of the flag to become $1

  • Profit

Solve Script
image

🩸 Pwn/BabyROP

image

Classic BOF challenge with no win function, and only puts() imported into the binary.

image

A pop rdi gadget also conveniently placed for us. Our exploit will be split into 2 stages. First we must leak libc, then we should execute a ret2system.

Stage 1 payload

We will overwrite the return address to call puts() and use the GOT address of puts as the argument, then we will loop back to main to trigger BOF again and run our 2nd stage.

image

We have successfully leaked the libc address \xa0\xc5s\x8d\x88\x7f

We can calculate the base of libc with this.

Now, we can search for the address of system() and the string "/bin/sh"

Finally, we can craft our payload to give us RCE.

Solve Script
image

Last updated