Collaborative Development
Name: Collaborative Development Description: My team has been working very hard on new features for our flag printing program! I wonder how they'll work together? You can download the challenge files here: challenge.zip Author: Jeffery John Tags: Easy, General Skills, picoCTF 2024, browser_webshell_solvable, git Challenge from: picoCTF 2024 Files: challenge.zip Hints: 1. git branch -a will let you see available branches 2. How can file 'diffs' be brought to the main branch? Don't forget to git config! 3. Merge conflicts can be tricky! Try a text editor like nano, emacs, or vim.
Theory
According to the description, to get the flag we have to look through different branches of the git provided, because the flag printing program was divided in three. I'd guess that we'll just grab the code from the program and join it and run it on my machine, or something like that idk. So we'll use the command git branch -a to look at all the branches available, and then use git checkout to look through that branch and get the divided code:
git branch -a git checkout 'Aa'
Solution
First we need to download the repository and unzip it:
shukularuni-picoctf@webshell:~$ wget https://artifacts.picoctf.net/c_titan/69/challenge.zip --2025-04-10 21:18:12-- https://artifacts.picoctf.net/c_titan/69/challenge.zip Resolving artifacts.picoctf.net (artifacts.picoctf.net)... 3.160.22.92, 3.160.22.43, 3.160.22.16, ... Connecting to artifacts.picoctf.net (artifacts.picoctf.net)|3.160.22.92|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 24642 (24K) [application/octet-stream] Saving to: 'challenge.zip' challenge.zip 100%[=================================================================================================================================================================>] 24.06K --.-KB/s in 0.01s 2025-04-10 21:18:12 (2.26 MB/s) - 'challenge.zip' saved [24642/24642] shukularuni-picoctf@webshell:~$ unzip challenge.zip shukularuni-picoctf@webshell:~$ cd drop-in shukularuni-picoctf@webshell:~/drop-in$ ls flag.py shukularuni-picoctf@webshell:~/drop-in$ cat flag.py print("Printing the flag...")
It looks like there is a python program that prints a flag, but there isn't anything in there, let's look at the branches:
shukularuni-picoctf@webshell:~/drop-in$ git branch -a feature/part-1 feature/part-2 feature/part-3 * main (END) shukularuni-picoctf@webshell:~/drop-in$ git checkout 'feature/part-1' Switched to branch 'feature/part-1' shukularuni-picoctf@webshell:~/drop-in$ ls flag.py shukularuni-picoctf@webshell:~/drop-in$ cat flag.py print("Printing the flag...") print("picoCTF{t3@mw0rk_", end='')
So it looks like that is a third of the flag, let's look at the other two branches:
shukularuni-picoctf@webshell:~/drop-in$ git checkout 'feature/part-2' Switched to branch 'feature/part-2' shukularuni-picoctf@webshell:~/drop-in$ cat flag.py print("Printing the flag...") print("m@k3s_th3_dr3@m_", end='')shukularuni-picoctf@webshell:~/drop-in$ shukularuni-picoctf@webshell:~/drop-in$ git checkout 'feature/part-3' Switched to branch 'feature/part-3' shukularuni-picoctf@webshell:~/drop-in$ cat flag.py print("Printing the flag...") print("w0rk_e4b79efb}")
We just need to join the three parts:
picoCTF{t3@mw0rk_m@k3s_th3_dr3@m_w0rk_e4b79efb}
There we go! That's the flag.
I rated this level as "good"! :3
https://play.picoctf.org/practice/challenge/410