picoCTF General Skills Guide

here's how to solve First Grep

Back to the General Skills Guides

First Grep

Name: First Grep
Description: Can you find the flag in file? This would be really tedious to look through manually, something tells me there is a better way.
Author: Alex Fulton/Danny Tunitis
Tags: Easy, General Skills, picoCTF 2019
Challenge from: picoCTF 2019
Files: file
Hints:
1. grep tutorial

Theory

According to the description, to get the flag we have to download a big file, and search for the flag, not literally search for it, but use commands like grep to find the exact thing. So yeah, let's see that file.

Solution

Now download the file:

shukularuni-picoctf@webshell:~$ wget https://jupiter.challenges.picoctf.org/static/515f19f3612bfd97cd3f0c0ba32bd864/file
--2025-04-18 11:51:13--  https://jupiter.challenges.picoctf.org/static/515f19f3612bfd97cd3f0c0ba32bd864/file
Resolving jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.net)... 3.131.60.8, ...
Connecting to jupiter.challenges.picoctf.org (jupiter.challenges.picoctf.net)|3.131.60.8|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14551 (14K) [application/octet-stream]
Saving to: 'file'

file                                                                100%[=================================================================================================================================================================>]   14.21K  --.-KB/s    in 0s    

2025-04-18 11:51:13 (313 MB/s) - 'file' saved [14551/14551]

The file seems to be pretty big, so I'm not gonna print the content of the file, as it will fill up my shell, and that never looks pretty. So let's just go with grep, we'll search for the format of the flag that all pico flags have, and then search it in the file:

shukularuni-picoctf@webshell:~$ grep "picoCTF{" file
picoCTF{grep_is_good_to_find_things_5af9d829}

There we go! That's the flag.

I rated this level as "good"! :3


https://play.picoctf.org/practice/challenge/85