smoll but angy

This one wasted challenge aku tak jawab bro aku buatpe man...

This time we are given a 32-bit binary

❯ file smoll-but-angy

smoll-but-angy: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, BuildID[sha1]=a7be88bfc79ba168486dd0ed96ac5bb84fadd3ee, for GNU/Linux 3.2.0, not stripped

Check for protections:

❯ checksec smoll-but-angy

[*] '/home/mfkrypt/bbctf/pwn/angy/smoll-but-angy'
    Arch:       i386-32-little
    RELRO:      Partial RELRO
    Stack:      Canary found
    NX:         NX enabled
    PIE:        No PIE (0x8048000)
    Stripped:   No

Decompiled main()

undefined4 main(void)

{
  char buffer [128];
  
  setbuf((FILE *)stdin,(char *)0x0);
  setbuf((FILE *)stdout,(char *)0x0);
  setbuf((FILE *)stderr,(char *)0x0);
  puts("You dare challenge me?");
  fgets(buffer,2048,(FILE *)stdin);
  puts("Very well, show me what you got!");
  return 0;
}

We can see an obvious Buffer Overflow here:

Now what's funny here is the clue here lies in the description:

tldr: there's a win-like function which is treasure() . Mental note to myself:

circle-info

Read the fucking description

Decompiled treasure():

It prints out the flag for us, so its just a normal ret2win challenge. First need to find the offset using pwndbg

Cool, offset is 136. Now we can build the script.

Flag: bbctf{1_L1k3_wh4t_yO0U_90t_93fe215}

How did I fumbled this 🥀

Last updated