pwn

Challenges

Index

I literally hand you the flag, just exploit it already!

  • Load up to dogboltarrow-up-right, or objdump

  • We could see this

  • cmp $0x539 compares the user input with 0x539 in hex it is 1337 in decimal

  • je 150e if they're equal — confirmed with decompiler

  • 1337 will triggers a secret fucntion that open flag.txt

  • We go to LABEL_401448

  • Or the menu() to be exact

  • Now, we need option 2 because read_data can read from any memory location without bounds checking

  • The flag address is 0x40a0

  • we also know nums array is at 0x4060

  • Finally the calculation is nums_base + (index * 8)

  • Flag address - nums address = 0x40a0 - 0x4060 = 0x40 = 64 bytes \ 64 bytes ÷ 8 bytes per index = 8

  • Final exploit

  • scriptCTF{4rra4y_00B_unl0ck3d_0aed67c7e137

Index-2

This time, you get the file pointer, not the flag itself.

circle-exclamation

Last updated