jebidiah-anthony

write-ups and what not

Shared (110 pts)


PART 1 : CHALLENGE DESCRIPTION

You are asked to investigate a case where the execution of an exe file on Linux fails. Download the attached document and find a flag.

flag format: Flag{single-byte alphanumeric characters/symbols}

PART 2 : GIVEN FILES

[>] Shared_04dca129c011213979aded2e7bef71d3.zip

  • libflag.so
  • main.exe

PART 3 : GETTING THE FLAG

$ file main.exe

  main.exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=572e5a45a57b8e8de469cfe301e7d653fb4a6565, not stripped

The binary included in the zip archive is an ELF file and running the binary in a Linux terminal outputs:

$ chmod +x ./main.exe

$ ./main.exe

  ./main.exe: error while loading shared libraries: libflag.so: cannot open shared object file: No such file or directory

$ ldd ./main.exe

  	linux-vdso.so.1 (0x00007ffc60b4c000)
  	libflag.so => not found
  	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff7683e1000)
      	/lib64/ld-linux-x86-64.so.2 (0x00007ff7685be000)

Running ./main.exe regularly and through ldd returns that libflag.so could not be found.

Export the current working directory or where the libflag.so file is saved to the environment variable, LD_LIBRARY_PATH, to force load the shared object file to the binary.

$ export LD_LIBRARY_PATH=$(pwd)

$ ./main.exe

  flag{specify_the_library}


FLAG : flag{specify_the_library}