Grep is Your Friend: 40

This is the Next problem in the picoctf . Here is the question

After plugging the robot into the computer, the robot asks for the name of a file containing the string “SECRET AUTH CODE". You can find it using the command-line interface in /problems/grep.tar or by downloading all of the files.

You can download all from the link given above also i have kept a copy of the download in my google drive and you can get it from here

If you look at the hint you will be directed to this link http://www.davidbaumgold.com/tutorials/command-line/

And as the question say what we need to do is to grep the folder for the string “SECRET AUTH CODE”

this can be done by typing the following code in the terminal

grep -r ‘SECRET AUTH CODE’

The command grep searches for a piece of text in the given file. If you check the manual page of the grep ( which can be done by typing man grep in the terminal) it is described as print lines matching a pattern. One can play with grep by using all the flags in it. (Flags means the various options available for the given command)

-r here means to search the whole directory recursively in the given directory.

go to the directory (folder) and just give the command given above. You get the following output

fHYYpdrfeOCHyQicfe96xfw==:SECRET AUTH CODES

As per the question we need the filename which contains the line ‘SECRET AUTH CODES’ And hence the answer is

Ans:’fHYYpdrfeOCHyQicfe96xfw==’

And carry on with the challenges

 

Advertisements

4 thoughts on “Grep is Your Friend: 40”

  1. Hi there, good work on the write up. I found that you need to copy the grep folder into your users directory within the shell system that picoctf provides. this can be done by typing pwd and finding your folder, example: /home_users/user1234
    then use cp grep.tar /home_users/user1234 within the /problems/ folder.
    you can then continue to use grep without getting a permission denied error.

    Like

    1. I Personally like to work on my own machine instead of the shell by the picoCTF(As the shell gets struck after some time) So I didn’t mention it. Good that you are making some useful comments on the blog.Thank You for commenting. Don’t forget to like and follow my blog.Feel free to share them with your friends

      Like

  2. I am confused. Is the shell or terminal the command line interface link they gave? Because when I click on the link, it says shell login and when i press enter, I cant type anything in the password.

    Like

    1. In linux when you type the password nothing is visible to you on the screen not even the asterisk ‘*’ just type the password and press enter, you will be able to login, if you still have doubts ask tylerni7 or c0mrad3 in the chat 🙂

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s