PicoCTF2023 writeups

Published in 03-22, 2023

Web Exploitation

Findme : 100 points

challenge

  • After you login using the credentials provided in the description, you need to intercept the request using Burp

findme2

  • You will be redirected to a page with an id that contains the first half of the flag encoded with base64

findme3

  • The response contains the second half of the flag encoded with base64

  • FLAG : findme4

MatchTheRegex : 100 points

challenge

  • The website contains a box where you can submit inputs

regex2

  • You will find the answer in the source code.

regex3

  • If you submit this input, the page will load a popup windows with the flag

regex4

SOAP : 100 points

challenge

  • After you read the description you realise it’s a LFI, let’s check the website

soap2

  • If you click on Details and intercept the request, you will notice that the website is using XML so the first idea came to my mind is XXE vulnerability.

soap3

  • Let’s read the /etc/passwd file

soap4

Java Code Analysis!?! : 300 points

challenge

  • Let’s login

java2

  • If you check the local storage you will find a token-payload and auth-token

java3

  • You can decode the auth-token using https://jwt.io

java4

  • So You need to change 3 values

  • You can find the secret key here

java5

  • I found this but i think they made a mistake because the role Admin with id=4 didn’t work. the id should be equal to 0

java6

java7

  • After you change the tokens, you need to refresh the page and NOW you are admin

java8

  • Go to the admin panel

java9

  • Change the role of User to Admin

java10

  • Now try to login as User and check the flag book

java11

General Skills

Chrono : 100 points:

challenge

  • We know that the /etc/crontab file contains the automated tasks

chrono2

Money-ware : 100 points

challenge

  • From the description, we know that the 1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX is the bitcoin wallet’s address
  • After a quick research on google, i found this article that talks about the attack

money-ware2

  • The article mentions the name of the malware

money-ware3

Permissions : 100 points

challenge

  • After you login via ssh, you should become root to read files in the root directory
  • Let’s check the sudo permissions

permissions2

  • Let’s visit https://gtfobins.github.io to see what we can do if we are allowed to run Vi as superuser by sudo

permissions3

  • After we execute the command, we are now root

permission

Repetitions : 100 points

challenge

  • Let’s check the content of the file

repetitions2

  • Obviously it’s base64 encoding, we can use https://gchq.github.io/CyberChef/ to decode the file

repetitions3

  • The file was encoded 6 times

Useless : 100 points

challenge

  • Let’s read the content of this executable

useless2

  • As you can see we have a manual option, so let’s read the manual of this executable

useless3

Specialer : 300 points

challenge

  • The first thing to do is to try to understand the system and see what commands you can use

  • I noticed that i can use cd command, so i kept using tab to complete the command and i was able to know that there is a user called ctf-player

specialer2

  • Let’s see what folders we have using the same trick

specialer3

  • The ala folder contains 2 files, i was able to read the files using :
bash -v [filename]

specialer4

Forensics

Hideme : 100 points

challenge

  • The file is a PNG image

hideme2

  • The binwalk tool identified a zip archive that contains a folder called secret

hideme3

  • Let’s display the PNG image

hideme

PcapPoisoning : 100 points

challenge

  • Open trace.pcap with wireshark then ctrl+F and search for pico

pcappoisoning2

who is it : 100 points

challenge

  • You can use Thunderbird to open the email

whoisit2

  • If you check the source code, you can see the designated permitted sender ip address whoisit3

  • A quick lookup for the ip address and you will find the name of the person

whoisit4 whoisit5

FindAndOpen : 200 points

challenge

  • Open the dump.pcap with Wireshark, the packet #48 has a unique size

findandopen2

  • Obviously it’s base64 encoding, so let’s decode it

findandopen3

  • Well that’s the first part of the flag, since we have a zip file protected with a password let’s try to unzip the file using the first part of the flag as the password

findandopen4

MSB : 200 points

challenge

  • From the description you can tell that maybe the data is hidden in the most significant bit of the RGB pixels values

  • I found this python code that can extract data from the image https://github.com/Pulho/sigBits

python3 sigBits.py -t=msb Ninja-and-Prince-Genji-Ukiyoe-Utagawa-Kunisada.flag.png 

msb3

  • This will generate a file called outputSB.txt, open the file with a text editor and search for pico

msb4