dev-resources.site
for different kinds of informations.
CTF Writeup β Fetch the Flag CTF 2023 β Unhackable Andy
Hi All,
It is connected with OSINT at start, and Command Injection at the end. β¨
Description of the challenge: βSomeone might want to let olβ Andy know the old addage β pride goeth before the fall.β β source: https://snyk.ctf.games/challenges β Unhackable Andy
Thatβs all. Now we have to visit some site: http://challenge.ctf.games:30900/
Site is quite simply. There are two options β Home and Login.
Referring to my last notices: CTRL+U & F12 are clear. π
βHomeβ gives the same site of course, βLoginβ gives Login panel. At the main site there is pinned GH GitHub profile of mentioned creator (βUnhackable Andyβ; by the way, text there is quite funny β great job!). Letβs take a look there. https://github.com/UnhackableAndy
There we can see two repos: βmy-awesome-siteβ and βmy-other-awesome-siteβ.
Interesting, right? We even donβt have to fork or clone this β just using features from GitHub β please check Git History.
If you dig deeper there, you will know that mentioned actor made some mistake. We can see this here https://github.com/unhackableandy/my-awesome-site/commit/d4d664824980d04de78b6aa114f3bac6e27d59d8
Image 1 - Fetch the Flag CTF 2023 β Unhackable Andy β GitHub repo
So we can see credentials. Large security issue by Unhackable Andy.
Letβs check this on actorβs site β it works fine, logged in. β
Here, the site is also quite simple. Endpoint /logout works like we suppose (logging out). No more interesting features there.
Image 2 - Fetch the Flag CTF 2023 β Unhackable Andy β site
But we can see that command βshutdown -rβ and btn Submit.
What if we type there something else? Is is protected? Is it safe?
Please use there: ls (https://en.wikipedia.org/wiki/Ls)
Result:
Image 3 - Fetch the Flag CTF 2023 β Unhackable Andy β site β Command Injection
We are so close! * Now please just use βcatβ https://en.wikipedia.org/wiki/Cat_(Unix)
so βcat flag.txtβ:
Result β the flag:
Image 4 - Fetch the Flag CTF 2023 β Unhackable Andy β site β Command Injection
- Funny fact, this flag was achieved in literally the LAST MINUTE before the end. So exciting! π
I hope you enjoy! π
Note: Originally published on Medium
Best wishes,
Featured ones: