Hi ๐Ÿ‘‹

Welcome to my collection of write-ups

BuckeyeCTF 2024 Free C Compiler Online

Intro This post covers Free C Compiler Online from BuckeyeCTF 2024. The description of the challenge is as follows: It is free of charge, but is it free of bugs? No, itโ€™s not. Analyzing The Source Code The following is the source code of the application: from flask import ( Flask, json, jsonify, request, render_template, ) from pathlib import Path from uuid import uuid4, UUID import os from werkzeug.exceptions import NotFound, BadRequest, Forbidden import subprocess app = Flask(__name__) storage_path = Path(__file__)....

September 30, 2024 ยท 2 min ยท ShellUnease

PatriotCTF 2024 Abnormal Maybe Illegal

Intro This post covers Abnormal Maybe Illegal from PatriotCTF 2024. The description of the challenge is: We have recently discovered tons of traffic leaving our network. We have reason to believe they are using an abnormal method. Can you figure out what data they are exfiltrating? Furthermore, two additional hints were released throughout the competition: TCP packets are constructed in a way, where certain combinations are possible/(legal) and others should raise alerts/(illegal)...

September 24, 2024 ยท 6 min ยท ShellUnease

CSAW CTF Qualification Round 2024 Literally 1984 & Mystery

Intro This post covers both Literally 1984 and Mystery as theyโ€™re related to each other. The description of Literally 1984 is: An artist by the name of โ€Œ made a cover of a song I liked, but I donโ€™t remember the original composer of that song. Could you help me find the original composer? Flag Format: csawctf{Firstname_Lastname} (replace all spaces with _ ) and the description of Mystery is: Remember the composer from Literally 1984?...

September 7, 2024 ยท 2 min ยท ShellUnease

CSAW CTF Qualification Round 2024 BucketWars

Intro For this challenge weโ€™re only given the link https://bucketwars.ctf.csaw.io and the description: letโ€™s keep our storage simple โ€“ and remember we donโ€™t make mistakes in these parts. Enumerating the Website Upon visiting the website, we notice the current version Version: 5.0.0 and the versions page. When we visit a page that doesnโ€™t exist, it tells us that the 404.jpg is missing from an S3 bucket https://s3.us-east-2.amazonaws.com/bucketwars.ctf.csaw.io. We try accessing index....

September 7, 2024 ยท 2 min ยท ShellUnease

CSAW CTF Qualification Round 2024 Lost Pyramid

Initial Code Analysis First thing that catches our eye is the old version 2.3.0 of PyJWT used in the application. In order to access the flag, we need to view kings_lair.html which requires sending a JWT with specific CURRENT_DATE and ROLE. The scarab room seems vulnerable to SSTI via name POST param. app.route('/scarab_room', methods=['GET', 'POST']) def scarab_room(): try: if request.method == 'POST': name = request.form.get('name') if name: kings_safelist = ['{','}', '๐“น', '๐“†ฃ','๐“€€', '๐“€', '๐“€‚', '๐“€ƒ', '๐“€„', '๐“€…', '๐“€†', '๐“€‡', '๐“€ˆ', '๐“€‰', '๐“€Š', '๐“€', '๐“€‘', '๐“€’', '๐“€“', '๐“€”', '๐“€•', '๐“€–', '๐“€—', '๐“€˜', '๐“€™', '๐“€š', '๐“€›', '๐“€œ', '๐“€', '๐“€ž', '๐“€Ÿ', '๐“€ ', '๐“€ก', '๐“€ข', '๐“€ฃ', '๐“€ค', '๐“€ฅ', '๐“€ฆ', '๐“€ง', '๐“€จ', '๐“€ฉ', '๐“€ช', '๐“€ซ', '๐“€ฌ', '๐“€ญ', '๐“€ฎ', '๐“€ฏ', '๐“€ฐ', '๐“€ฑ', '๐“€ฒ', '๐“€ณ', '๐“€ด', '๐“€ต', '๐“€ถ', '๐“€ท', '๐“€ธ', '๐“€น', '๐“€บ', '๐“€ป'] name = ''....

September 7, 2024 ยท 3 min ยท ShellUnease

CyberSpace CTF 2024 Notekeeper

Source Code Analysis The goal is to access the GET /flag endpoint which calls an executable that prints out the flag. Itโ€™s guarded by 2 checks: if session[:user] == "admin" if req.ip == "127.0.0.1" Thereโ€™s also an interesting POST /download endpoint. It accepts any session but is also guarded by the if req.ip == "127.0.0.1" check. It serves a file based on filename from our request, which leads to LFI....

September 3, 2024 ยท 2 min ยท ShellUnease

CyberSpace CTF 2024 Zip Zone

Initial Inspection After loading the page weโ€™re greeted with an upload form for zip archives. Weโ€™re informed that after uploading we can access the files by appending a filename to a generated UUID. We inspect the code and learn that our uploaded archive will be unzipped using unzip. Zip With a Symlink We can use the zip command to create an archive thatโ€™ll preserve symlinks by using the -y option....

September 3, 2024 ยท 1 min ยท ShellUnease

CyberSpace CTF 2024 Feature Unlocked

Source Code Analysis The aim of the challenge is to call the POST /feature which contains a command injection vulnerability. As we can see, we need a valid signed access_token that contains the string access_granted. Thereโ€™s GET /release endpoint thatโ€™ll do exactly that if we pass the validate_server(...) check. Interestingly, if we set a query param debug=true, we can control the validation server address. The validate_server(validation_server) method does the following:...

September 3, 2024 ยท 2 min ยท ShellUnease

CyberSpace CTF 2024 Quiz

Source Code Analysis At first glance, I thought the intended vulnerability was a race condition. However, upon closer examination I noticed a suspicious unset($_SESSION['username']); in logout.php. The correct answer for each question is random, but itโ€™s generated in advance both at the beginning of the quiz and upon submitting an answer. The if (intval($answer) === $next_correct) {...} is the essential part of the challenge. Regardless if our answer is correct or wrong, itโ€™ll call htmlspecialchars($_SESSION['username']), which will throw an exception if username is unset in the session....

September 3, 2024 ยท 2 min ยท ShellUnease

CrewCTF 2024 Malkonkordo

Source Code Analysis Upon inspecting the code, we find that thereโ€™s /ai/run path that sounds like it could let us execute something. Itโ€™s โ€œguardedโ€ by middleware that inspects whether host in the uri or the request header โ€˜hostโ€™ starts with 127.0.01. Afterwards, the execution is passed to handle_cmd which can execute one of 6 commands. For us, the intereting ones are displaying env vars And running a .bat script with an argument passed by us....

July 29, 2024 ยท 2 min ยท ShellUnease