beep

Binary Exploitation / Pwn

triangle-exclamation

Kenneth verkar ha problem med kommunikationen till andra system han tagit över. Harriet har nämligen hittat något slags litet testprogram vars syfte verkar vara att testa att en anslutning fungerar.

Testprogrammet verkar vara ganska minimalt, men även små program kan innehålla buggar...

Anslut till undutmaning-beep.chals.io:443 och testa anslutningen du också.

chevron-rightVisa gratis tips/ledtrådhashtag

Harriet tror att det finns en buffer overflow i koden. Pröva att undersöka programmet med t.ex. Ghidra och gdb för att se ifall du kan knäcka buggen!

chevron-rightVisa gratis tips/ledtrådhashtag

setup()-funktionen kan ignoreras då den endast sätter en timer på utmaningen samt stänger av buffering på stdin/stdout/stderr.

file-download
16KB

A simple integer variable overwrite challenge, looking into the Ghidra disassembly, the code looked like this:

undefined8 main(void)

{
  undefined local_78 [108];
  int local_c;
  
  setup();
  printf("* beeeeeeeeeeeeeeeeeeeeeeeeeeep *\n> ");
  read(0,local_78,0x108);
  if (local_c == 0x539) {
    system("cat flag");
  }
  return 0;
}

Simple goal, I had to overwrite the compared variable with 0x539, and guess what it translates to 1337.

Pretty much, the solution required me to find the offset to the comparison instruction using cyclic offsets, so here was the final solver script:

Here is an example of the challenge being solved locally (ignore it saying picoCTF that's just my template fake flag☺️):

Last updated