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__)....
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)...
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?...
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....
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 = ''....
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....
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....
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:...
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....
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....