PicoCTF2018 - Miscellaneous - grep2
Objective:
This one is a little bit harder. Can you find the flag in /problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files on the shell server? Remember, grep is your friend.
Solution:
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742$ ls -l
cool so there is a folder name files lets see what's inside
cd files
ok more folders let's check one out
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ cd files0
ok so it has a bunch of files in it
Our goal is to find the flag inside one of these files inside one of these folders
Let's use Grep to find out which file contains the string 'pico'
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ grep -rl 'pico'
okay it looks like file23 in the files5 folder has that string lets cat and grep and for the flag
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ cat ./files5/file23 | grep 'pico'
Objective:
This one is a little bit harder. Can you find the flag in /problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files on the shell server? Remember, grep is your friend.
Solution:
@pico-2018-shell:~$ cd /problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742$ ls -l
total 4
drwxr-xr-x 12 root root 4096 Mar 25 19:18 files
cool so there is a folder name files lets see what's inside
cd files
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ ls -l
total 40
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files0
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files1
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files2
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files3
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files4
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files5
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files6
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files7
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files8
drwxr-xr-x 2 root root 4096 Mar 25 19:18 files9
ok more folders let's check one out
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ cd files0
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files/files0$ ls
file0 file10 file12 file14 file16 file18 file2 file21 file23 file25 file27 file29 file4 file6 file8
file1 file11 file13 file15 file17 file19 file20 file22 file24 file26 file28 file3 file5 file7 file9
ok so it has a bunch of files in it
Our goal is to find the flag inside one of these files inside one of these folders
Let's use Grep to find out which file contains the string 'pico'
@pico-2018-shell:/problems/grep-2_0_783d3e2c8ea2ebd3799ca6a5d28fc742/files$ grep -rl 'pico'
files5/file23
okay it looks like file23 in the files5 folder has that string lets cat and grep and for the flag
Comments
Post a Comment