Writeup Aria
challenges5_minute

Compiled

room

desc

Strings can only help you so far.

Download the task file and get started. The binary can also be found in the AttackBox inside the /root/Rooms/Compiled/ directory.

Note: The binary will not execute if using the AttackBox. However, you can still solve the challenge.

solution

cd /root/Rooms/Compiled/
file Compiled.Compiled
# Compiled.Compiled: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=06dcfaf13fb76a4b556852c5fbf9725ac21054fd, for GNU/Linux 3.2.0, not stripped

strings Compiled.Compiled
# DoYouEven%sCTF

namun ketika pake string ini tenyata bukan jawabanya, jadi saya coba decompile dengan mennggunakan ghidra

undefined8 main(void)
{
  int iVar1;
  char local_28 [32];

  fwrite("Password: ",1,10,stdout);
  __isoc99_scanf("DoYouEven%sCTF",local_28);
  iVar1 = strcmp(local_28,"__dso_handle");
  if ((-1 < iVar1) && (iVar1 = strcmp(local_28,"__dso_handle"), iVar1 < 1)) {
    printf("Try again!");
    return 0;
  }
  iVar1 = strcmp(local_28,"_init");
  if (iVar1 == 0) {
    printf("Correct!");
  }
  else {
    printf("Try again!");
  }
  return 0;
}

Jika kita analsia dari kode diatas, kita bisa lihat bahwa program meminta input dengan format DoYouEven%sCTF, lalu membandingkan string yang diinputkan dengan __dso_handle dan _init lalu memberikan output Correct! jika inputan sesuai dengan _init

flag

DoYouEven_init

On this page

Compiled