Skip to content

fd

  1. ls -la and file commands tell us there are three files:
  2. An executable fd
  3. A C file: fd.c
  4. An inaccessible file: flag
  5. cat fd.c : observing the source code tells us that the program accepts one cmd arg which, after being subtracted by 0x1234, is supposed to be the file descriptor of a file whose first 32 bytes are read, which upon matching a particular string (also specified in the source) will reveal the contents of flag.
  6. File descriptors:
  7. stdin : 0
  8. stdout : 1
  9. stderr : 2
  10. Run ./fd 4660 , type LETMEWIN and press ENTER.