Task desc

Similar to the previous task file-run1, we need to download and execute the file, but this time with the parameter


Download and grant rights to execute:

wget https://artifacts.picoctf.net/c/156/run
chmod +x run

I tried decompile this file and my eye caught the following function:

image_2

if ((param_1 < 2) || (2 < param_1))

This condition is true if param_1 (i.e., argc) is not equal to 2. This means that the program expects to be run with exactly one additional argument, besides the name of the program itself.

  • if ./program_name, then argc = 1.
  • if ./program_name arg1, then argc = 2.
  • if ./program_name arg1 arg2, then argc = 3.
  • Therefore, branch else (argc == 2) will be executed when we run the program with one argument.

Identically to the previous task, we display the flag:

./run Hello! | cut -d " " -f4

image_3

picoCTF{F1r57_4rgum3n7_96f2195f}