Post

PicoCTF Mini 2022 Writeup

Codebook

Question

Screen Shot 2022-01-11 at 11 10 21 pm

Solution

They required us to put these two files into a same directory, so I created a new directory called codebook and changed to this directory

Screen Shot 2022-01-12 at 1 02 43 am

Then I downloaded those two files using wget

Screen Shot 2022-01-12 at 1 05 44 am Screen Shot 2022-01-12 at 1 06 00 am

Then I ran the Python script code.py, which then gave the flag

Screen Shot 2022-01-12 at 1 07 36 am

Flag

picoCTF{c0d3b00k_455157_8100c7c1}

Glitch Cat

Question

Screen Shot 2022-01-12 at 2 16 04 am

Solution

Use nc to see what happen on nc saturn.picoctf.net 52026

Screen Shot 2022-01-12 at 2 19 07 am

These “chr(0x62)” looks like they are in hexademical, so I use this website to convert those hex to ASCII, which gives the rest of the flag

Screen Shot 2022-01-12 at 2 30 05 am

Flag

picoCTF{gl17ch_m3_n07_becf3861}

HashingJobApp

Question

Screen Shot 2022-01-12 at 2 48 05 am

Solution

Use nc to see what happen on nc saturn.picoctf.net 65352

Screen Shot 2022-01-12 at 2 49 49 am

It requires us to md5 hash the text “babies”, so I use this website called CyberChef(https://gchq.github.io/CyberChef/), which give this result

Screen Shot 2022-01-12 at 2 52 46 am

8374d0764f1466e601c624254222ad53

Lets input this and see what happens

Screen Shot 2022-01-12 at 2 53 56 am So it seems like there is a timeout mechanic and it will random the text that is required to be hashed, :) so lets do everything above quickly and see if we can get the flag.

Do everything above for a second time, but quickly and see what happens

Screen Shot 2022-01-12 at 2 57 26 am

Interestingly, it requires us to do the md5 hash function for 3 times quickly before getting the flag

Flag

picoCTF{4ppl1c4710n_r3c31v3d_674c1de2}

PW-Crack-1

Question

Screen Shot 2022-01-12 at 2 01 18 am

Solution

Use mkdir to create a directory and change to this directory to later download those two file using wget, to the same directory as required

Screen Shot 2022-01-12 at 2 04 24 am

Screen Shot 2022-01-12 at 2 04 51 am Screen Shot 2022-01-12 at 2 05 14 am

Screen Shot 2022-01-12 at 2 06 26 am

Using nano to read that password checker file in Python

Screen Shot 2022-01-12 at 2 08 49 am

It seems that if we input “691d” then we can get the flag

Screen Shot 2022-01-12 at 2 08 26 am

Then run this Python script to see if this is true

Screen Shot 2022-01-12 at 2 09 50 am

Flag

picoCTF{545h_r1ng1ng_56891419}

PW-Crack-2

Question

Screen Shot 2022-01-12 at 2 33 06 am

Solution

Use mkdir to create a directory and change to this directory to later download those two file using wget, to the same directory as required

Screen Shot 2022-01-12 at 2 35 40 am

Screen Shot 2022-01-12 at 2 36 39 am

Screen Shot 2022-01-12 at 2 36 48 am

Screen Shot 2022-01-12 at 2 38 20 am

Use nano to read that password checker file in Python

Screen Shot 2022-01-12 at 2 39 04 am

These “chr(0x34), etc” looks like they are in hexademical, so I use this website to convert those hex to ASCII, which gives the password to get the flag.

Screen Shot 2022-01-12 at 2 40 48 am

Screen Shot 2022-01-12 at 2 41 43 am

The password to get the flag is 4ec9, run level2.py to get the flag

Screen Shot 2022-01-12 at 2 43 32 am

Flag

picoCTF{tr45h_51ng1ng_9701e681}

PW-Crack-3

Question

Screen Shot 2022-01-12 at 3 11 08 pm

Solution

Simply try all 7 given password to see which is correct

Screen Shot 2022-01-12 at 3 11 19 pm

Flag

picoCTF{m45h_fl1ng1ng_6f98a49f}

PW-Crack-4

Question

Screen Shot 2022-01-12 at 3 28 16 pm

Solution

Looking at source code, it looked the same as the PW Crack 3’s source code, the only difference was they gave us 100 strings to check which one is correct instead of 7

Screen Shot 2022-01-12 at 3 33 46 pm

So now trying to input each of those strings will not be feasible. thus I edited the source code so that it will automatically try every input for us when the level4.py script run, this used a for loop to do that

Screen Shot 2022-01-12 at 4 19 13 pm Screen Shot 2022-01-12 at 4 21 25 pm

Flag

picoCTF{fl45h_5pr1ng1ng_89490f2d}

PW-Crack-5

Question

Screen Shot 2022-01-12 at 4 22 44 pm

Solution

Looking at source code, it looked the same as the PW Crack 4’s source code, the only difference was they gave us a txt file, which has a lot of strings, to check which one is correct instead of 100

Screen Shot 2022-01-12 at 3 33 46 pm

So now besides using a for loop to automatically try every input for us when the level4.py script run, we also need to edit the code so that it will open and read that txt file appropriately, that is using open() to access these strings and strip() to trim the whitespace from them if any.

Screen Shot 2022-01-12 at 4 36 10 pm Screen Shot 2022-01-12 at 4 38 17 pm

Flag

picoCTF{h45h_sl1ng1ng_2f021ce9}

Serpentine

Question

Screen Shot 2022-01-12 at 3 02 01 am

Solution

Use wget to get this Python script

Screen Shot 2022-01-12 at 3 09 11 am

When I tried to run this Python script, it recommended me to check the source code

Screen Shot 2022-01-12 at 3 10 13 am

Take a look at the source code, this part in the code looks like it can give us the flag, basically the flag is the result of the XOR operation between the variable “flag_enc” and the string “enkidu”.

Screen Shot 2022-01-12 at 3 12 44 am

Flag

picoCTF{}

convertme.py

Question

Screen Shot 2022-01-11 at 9 31 07 pm

Solution

Use wget to get the given Python script

Screen Shot 2022-01-11 at 10 02 44 pm

Then it should stored at the directory you are at, use “ls” to check

Screen Shot 2022-01-11 at 10 03 27 pm

Run the Python file to see what it requires

Screen Shot 2022-01-11 at 10 04 14 pm

It requires us to convert a number from decimal base to binary base, so I use this website called CyberChef(https://gchq.github.io/CyberChef/) to help me do this

Screen Shot 2022-01-11 at 10 43 09 pm

Now I know the answer of this Python script, lets input this and take the flag :)

Screen Shot 2022-01-11 at 10 44 57 pm

Flag

picoCTF{4ll_y0ur_b4535_e2a58836}

NOTE

I strongly recommend everyone new to CTF to use CyberChef as it is easy to use and it has graphical interface. In the beginning I think this will be helpful, along the way you can find some nice software on github that can be used inside Kali Linux or something like that. I found this websire while participating in MetaCTF, which is my first CTF and also my first ever documenting a writeup for a CTF.

fixme1.py

Question

Screen Shot 2022-01-12 at 1 36 25 am

Solution

Download the file and use Visual Studio Code that has installed Python Extension to open the file

Screen Shot 2022-01-12 at 1 39 16 am

The syntax error in this Python script is indentation

Screen Shot 2022-01-12 at 1 40 50 am

The fix is going to be remove that indent/space and there should be no syntax error

Screen Shot 2022-01-12 at 1 41 59 am

Then run this Python script to see what happen next

Screen Shot 2022-01-12 at 1 43 33 am

Flag

picoCTF{1nd3nt1ty_cr1515_09ee727a}

fixme2.py

Question

Screen Shot 2022-01-12 at 1 48 17 am

Solution

Download the file and use Visual Studio Code that has installed Python Extension to open the file

Screen Shot 2022-01-12 at 1 48 57 am

The syntax error in this Python script is using operator in python

Screen Shot 2022-01-12 at 1 51 13 am

The fix is using “==” instead of “=” as “==” is an equality operator which would give us true or false based on the condition, while “=” is an assignment operator that is used when we want to assign a value to a variable

Screen Shot 2022-01-12 at 1 53 32 am

Then run this Python script to see what happen next

Screen Shot 2022-01-12 at 1 56 35 am

Flag

picoCTF{3qu4l1ty_n0t_4551gnm3nt_4863e11b}

ncme

Question

Screen Shot 2022-01-12 at 4 43 28 pm

Solution

Simply do as what the description said

Screen Shot 2022-01-12 at 4 43 54 pm

Flag

picoCTF{s4n1ty_c4t}

runme.py

Question

Screen Shot 2022-01-12 at 4 41 01 pm

Solution

Simply do as what the description says

Screen Shot 2022-01-12 at 4 41 39 pm Screen Shot 2022-01-12 at 4 42 06 pm

Flag

picoCTF{run_s4n1ty_run}

This post is licensed under CC BY 4.0 by the author.