top of page
Featured Posts

Picoctf Supercow-40 Write up

  • Jayakrishna Menon V
  • Jul 14, 2015
  • 1 min read

Daedalus Corp. has a special utility for printing .cow files at /home/daedalus/supercow.

Can you figure out how to get it to print out the flag?

Now if you look at the hint, it will tell you to read up on symlinks .

What you need to know is the command 'ln' in linux used to make links between files.

Now login to the server and cd to /home/daedalus. Here there will be 6 files namely flag.txt, hint.cow, secret1.cow, secret2.cow, supercow and supercow.c.

When we read the code of supercow.c, we can see that we need to supply the file flag.txt as command line argument to supercow in order to get the flag. However, we can only supply arguments which end in a '.cow' extension. The solution to this is symbolic links. If you type cd ~/temp, we will be in a folder where we can create files as per our wish (such a folder might exist in almost all similar questions, so keep an eye out for that)

In this folder, use the ln command to create a symbolic link to /home/daedalus/flag.txt. (Remember to use the -s for symbolic)

Then use the mv command to rename the link to something that ends in .cow I'm using flag.cow

You can now cd to /home/daedalus and run the supercow executable file with the argument ~/temp/flag.cow

and you have your flag.

Flag:cows_drive_mooooving_vans

 
 
 

コメント


Check back soon
Once posts are published, you’ll see them here.
Recent Posts
Search By Tags
Connect
  • Google+ Long Shadow
  • Facebook Long Shadow
  • LinkedIn Long Shadow
  • Twitter Long Shadow
bottom of page