Uploaded July 2025 | Updated November 2026, 1 hour ago
HackTheBox ran a Bug Bounty themed CTF, HackTheSystem June 27-29 2025. These challenges are all based on real bug bounty reports. In this challenge, I'll look at reports claimed against Uber and Glovo involving Flask Jinja server side template injections, and exploit a similar vulnerability on the challenge.
HackerOne report #1: hackerone.com/reports/125980
HackerOne report #2: hackerone.com/reports/1104349
Flask Tutorial: pythonbasics.org/flask-tutorial-templates
☕ Buy Me A Coffee: buymeacoffee.com/0xdf
[00:00] Introduction
[00:30] Challenge introduction
[00:58] HackerOne reports
[02:10] Flask background
[05:05] Manual website enum
[07:12] Strategy
[08:00] Identifying SSTI
[09:11] Identifying tech stack (Jinja)
[11:33] Getting RCE and flag
[13:46] Conclusion
#bugbounty #ctf #hackthebox #python #flask #ssti #jinja
HackTheBox ran a Bug Bounty themed CTF, HackTheSystem June 27-29 2025. These challenges are all based on real bug bounty reports. In this challenge, I'll look at reports claimed against Uber and Glovo involving Flask Jinja server side template injections, and exploit a similar vulnerability on the challenge.
HackerOne report #1: hackerone.com/reports/125980
HackerOne report #2: hackerone.com/reports/1104349
Flask Tutorial: pythonbasics.org/flask-tutorial-templates
☕ Buy Me A Coffee: buymeacoffee.com/0xdf
[00:00] Introduction
[00:30] Challenge introduction
[00:58] HackerOne reports
[02:10] Flask background
[05:05] Manual website enum
[07:12] Strategy
[08:00] Identifying SSTI
[09:11] Identifying tech stack (Jinja)
[11:33] Getting RCE and flag
[13:46] Conclusion
#bugbounty #ctf #hackthebox #python #flask #ssti #jinja
![Gameover(lay) Exploit Explained
The Gameover(lay) (CVE-2023-2640 / CVE-2023-32629) vulnerability was a big deal in late July 2023. The POC is super short, and yet complex. Well walk through the lines one by one, and understand what its doing and how it provides a low privilege user root access by abusing the OverlayFS and how it manages file attributes (like capabilities) when syncing between upper and lower.
Exploit: unshare -rm sh -c mkdir l u w m && cp /u*/b*/p*3 l/; setcap cap_setuid+eip l/python3;mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*; && u/python3 -c import os;os.setuid(0);os.system(rm -rf l m u w; id)
HackTheBox Analytics Blog post: https://0xdf.gitlab.io/2024/03/23/htb-analytics.html
HackTheBox Analytics: https://www.hackthebox.com/machines/analytics
OverlayFS explained post from Julia Evans: https://jvns.ca/blog/2019/11/18/how-containers-work overlayfs/
Exploit Tweet from @liadeliyahu: https://twitter.com/liadeliyahu/status/1684841527959273472
CVE-2023-2640: https://www.cvedetails.com/cve/CVE-2023-2640/
CVE-2023-32629: https://www.cvedetails.com/cve/CVE-2023-32629/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:47] Show exploit
[01:23] unshare / namespaces
[02:54] Setup files within namespace
[04:39] mount OverlayFS
[05:56] Using touch to get files into upper
[06:20] Exit namespace and escalate
[07:36] Revisiting exploit
[08:41] Conclusion
#pentest #ctf #bugbounty #gameoverlay #linux #privesc Gameover(lay) Exploit Explained](https://i.ytimg.com/vi/nlYNuUKiGr0/mqdefault.jpg)
![Gift Shop [AOC2025 Day 2]
Advent of Code 2025 Day 2 offers input with a bunch of number ranges. Ill parse those, and then loop through each, check for any invalid numbers and summing them up for a result. In part 1, a range is invalid if the entire number is made up of the same number twice. For part 2, I need to check if the number is made up of a number repeated two or more times. So for part 1, 123123 is invalid. For part 2, 123123 is still invalid (123 twice), but so is 123123123 (123 three times). Ill show two ways in part 1, using just a string check and with regex, and then adapt the regex function to solve part 2 very quickly. Then Claude solves and implements the non-regex solution.
Solutions Repo: https://gitlab.com/0xdf/aoc2025
VSCode Debug Setup: https://www.youtube.com/watch?v=cNhtk2Ob4B8
Claude: https://claude.ai/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:22] Pulling / examining input
[01:57] Parsing ranges
[03:16] Checking validity
[04:33] Solving part 1
[05:28] Rechecking validity with regex
[07:27] Part 2 introduction
[07:55] New is_invalid function for part2
[08:55] Solving part 2
[09:26] Talking through non-regex solution
[09:59] Solving with Claude
[11:30] Comparing solutions
[12:05] Conclusion
#AdventOfCode #claude Gift Shop [AOC2025 Day 2]](https://i.ytimg.com/vi/p89Nsj9BB7Q/mqdefault.jpg)
![Crossed Wires [Day 24 - Advent of Code 2024 - Python]
For day 24, Im given a series of wires connecting to OR, AND, and XOR gates, and some initial values. Part 1 is very easy to recursively trace back from the given endpoints to find their values. In part 2, I have to swap four pairs of gate outputs to make it so that the result is the binary value representing the addition of two 45-bit binary inputs. This is very challenging, and involves some exploration.
2024 AOC repo: https://gitlab.com/0xdf/aoc2024/
2024 AOC Intro video: https://www.youtube.com/watch?v=4XKZZrhhiQE
VSCode Debug video: https://www.youtube.com/watch?v=cNhtk2Ob4B8
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Part1 introduction
[02:20] Part 1 code review
[05:28] Solving part 1
[06:05] Part 2 challenge
[06:51] Changes to Connection class
[08:05] run_wire2 with given inits
[09:17] Finding broken bits
[12:05] Running to find failures
[12:51] Getting wires involved in a bit
[15:16] Looking for patterns
[16:35] Function to fix machine
[20:55] Solving part 2
[21:11] Conclusion
#adventofcode #python Crossed Wires [Day 24 - Advent of Code 2024 - Python]](https://i.ytimg.com/vi/pH5MRTC4MLY/mqdefault.jpg)
![Exploiting CVE-2023-40028 [LinkVortex - HackTheBox]
Well walk through CVE-2023-40028, an authenticated file read vulnerability in the Ghost blogging platform. Ill start with the Nist page and get the link to the commit in GitHub where the vulnerability is patched. From there, Ill look at the regression test and use that to understand where the exploit happens using a symlink in a zip archive. Ill manually generate a zip and use it to read /etc/passwd. Then Ill generate a Python script that reads files automatically.
Full LinkVortex solution: https://0xdf.gitlab.io/2025/04/17/htb-linkvortex.html
Zipping Video: https://www.youtube.com/watch?v=NPlkZVm-C7M
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:19] CVE Background
[02:06] GitHub commit
[04:51] symlinks.zip
[05:40] Manual create zip
[07:13] Ghost admin API docs
[08:00] Posting file
[11:33] Reading results
[12:07] Python strategy
[13:31] Processing inputs (part 1)
[14:14] Zip creation research
[15:33] Creating random filename
[16:53] Creating zip with symlink
[20:24] Processing inputs (part 2)
[21:55] Logging in
[22:30] Post and read file
[23:59] Running script
[25:00] Improving script for not found and access denied
[26:22] Conclusion
#HackTheBox #ctf #python #zip Exploiting CVE-2023-40028 [LinkVortex - HackTheBox]](https://i.ytimg.com/vi/pLgjI7gVwLc/mqdefault.jpg)
![Day 9 - Explosions in Cyberspace [Revival of Code 2023 - Advent of Code 2016]
Python Discord is doing an event called Revival of Code, where we work through the 2016 Advent of Code, one challenge every two days. The day 9 challenge, Explosions in Cyberspace, Im given a string where I need to find markers of the pattern `(AxB)`, and use that to read the next A characters and repeat it B times. In part one, Ill take markers inside the next A characters as just text. In part two, Ill have to recursively expand those first.
Repo for Advent of Code 2016 Solutions: https://gitlab.com/0xdf/aoc2016
Intro video for this event: https://www.youtube.com/watch?v=qEPpsS0StQI
Configuring VSCode to debug PyTest: https://www.youtube.com/watch?v=zL2YTdIj3R8
Real Python post with templates: https://realpython.com/python-advent-of-code/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:14] Challenge Part 1
[01:20] genday.sh / input
[02:06] Part 1 tests
[03:27] Parsing into deque
[03:57] Part 1 solve
[07:16] Part 1 tests solve, submitting solution
[07:47] Challenge Part 2
[09:06] Tests for Part 2
[10:16] Refactoring part 1 into decompress
[11:30] Adding part 2
[16:20] Debugging issues
[16:50] Tests pass, part 2 doesnt return
[18:32] Debugging issues related to passing data twice
[19:45] Identified issue
[21:25] Fixing tests after refactor
[22:08] Conclusion
#ctf #adventofcode #revivalofcode #python Day 9 - Explosions in Cyberspace [Revival of Code 2023 - Advent of Code 2016]](https://i.ytimg.com/vi/pQBoZGrTfLg/mqdefault.jpg)
![Tracing Automations in HackTheBox Mailroom [Beyond Root]
In Mailroom from HackTheBox, Ill need to trace another process where the user is opening their KeePass database and I can get the password as they type it in. There were some issues that came up, and I wanted to look at how that automation is handled on the box once I had a root shell.
Mailroom Blog Post: https://0xdf.gitlab.io/2023/08/19/htb-mailroom.html
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:37] Showing solution as matthew
[04:44] Looking at crons
[05:47] matthew_kpcli.py
[08:56] Conclusion
#pentest #ctf #bugbounty Tracing Automations in HackTheBox Mailroom [Beyond Root]](https://i.ytimg.com/vi/pQrjQLktqss/mqdefault.jpg)
![Christmas Tree Farm [AOC2025 Day 12]
Advent of Code 2025 Day 12 provides a challenge that on its face I think is nearly impossibe, figuring out if I can place a lot of specific shapes into a space by rotating them and flipping them. So I go looking for tricks, and find that over half of the scenarios dont have space for the presents regardless of shape. The remaining scenarios have presents that fill up less than 3/4 of the space. And that works as a pass to solve the challenge. Claude gets really stuck trying to solve the example, which doesnt have the same data pattern as my input, and tries a bunch of things that never work, though it does call out the correct answer several times without knowing its the answer.
Solutions Repo: https://gitlab.com/0xdf/aoc2025
VSCode Debug Setup: https://www.youtube.com/watch?v=cNhtk2Ob4B8
Claude: https://claude.ai/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:29] Pulling / examining input
[02:46] Initial input parsing
[03:23] Parsing gifts
[05:16] Looping over tree lines
[06:39] Exploring data
[10:50] Solving part 1
[11:53] Solving with Claude
[16:34] Cutting Claude off
[17:25] Conclusion
#AdventOfCode #claude Christmas Tree Farm [AOC2025 Day 12]](https://i.ytimg.com/vi/pX7pszKHfYw/mqdefault.jpg)
![Simple Use After Free Exploitation [Hackvent 2022 - Day 21]
Day 21 for Hackvent gives a server with a simple text based menu, as well as the binary. Looking at the binary, theres some heap use, and a relatively obvious use after free risk. To exploit that, Ill need a memory leak, which is a bit harder to find. Putting that all together, Im able to call the present function, which gives a shell.
Hackvent 2022 writeup: https://0xdf.gitlab.io/hackvent2022/hard
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
#hackvent
[00:00] Introduction / overview
[01:35] Opening in Ghidra
[02:25] Checksec to see protections
[02:55] Looking at binary in Ghidra
[03:14] init in Ghidra
[03:26] menu in Ghidra
[04:08] steal in Ghidra
[04:40] tell_deed in Ghidra
[06:04] naughty in Ghidra
[06:59] present in Ghidra
[07:22] Strategy
[08:00] Memory leak in naughty
[09:19] Using gdb to test use after free
[10:53] Testing memory leak using gdb
[15:52] Input to get to index 4
[17:02] Verifying in gdb
[18:24] Building exploit script
[18:55] Leaking address to defeat PIE
[24:54] Freeing workshop
[25:20] Put malicious payload into heap buffer
[27:07] Trigger payload and get shell
[27:33] Running, get shell Simple Use After Free Exploitation [Hackvent 2022 - Day 21]](https://i.ytimg.com/vi/pniG3nzVMqE/mqdefault.jpg)
![Factory [AOC2025 Day 10]
Advent of Code 2025 Day 10 has some buttons that each control one or more outputs. In part 1, they toggle on and off a light, and Ill have to find the minimum number of button pushes to get a desired light configuration. In part 2, they add power to a circuit on each push, so Ill have to solve linear equations to get a minimum number of pushes.
Solutions Repo: https://gitlab.com/0xdf/aoc2025
VSCode Debug Setup: https://www.youtube.com/watch?v=cNhtk2Ob4B8
Claude: https://claude.ai/
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:46] Pulling / examining input
[02:29] Strategy
[02:58] Processing lines
[09:30] Function to find min pushes
[11:11] Debugging counting error
[12:07] Solving part 1
[12:21] Part 2 introduction
[13:10] Reparsing lines
[16:59] Starting z3 solver
[17:38] Strategy overview
[18:39] Setting constraints
[23:08] Checking / parsing z3 result
[25:33] Solving part 2
[26:00] Solving with Claude
[30:45] Interupting to tell Claude how to use packages
[31:57] Analysis of Claudes solution
[33:20] Conclusion
#AdventOfCode #claude Factory [AOC2025 Day 10]](https://i.ytimg.com/vi/ppQuB--h4MU/mqdefault.jpg)
![Introduction [Revival of Code 2023 - Advent of Code 2016]
Python Discord is doing an event called Revival of Code, where we work through the 2016 Advent of Code, one challenge every two days. In this video, Ill cover all the intro stuff for this year, including how Im going to approach is using a test-driven strategy, using templates inspired by a Real Python article. Ill show my script for generating the stub solution and test files, as well as getting the puzzle input. And Ill show how I plan to use PyTest to drive the solutions.
Real Python post: https://realpython.com/python-advent-of-code/
Repo for Advent of Code 2016 Solutions: https://gitlab.com/0xdf/aoc2016
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[01:04] Real Python article
[02:24] genday.sh script
[07:04] Running genday.sh
[07:33] Solution stub
[09:40] Tests stub and PyTest
[13:38] Conclusion
#ctf #adventofcode #revivalofcode #python Introduction [Revival of Code 2023 - Advent of Code 2016]](https://i.ytimg.com/vi/qEPpsS0StQI/mqdefault.jpg)
![QuickScan [HackTheBox Cyber Apocalypse CTF 2024]
QuickScan is a challenge from the 2024 HackTheBox Syber Apocalypse CTF. Im given ELF binaries as a base64 encoded string. Each one loads 24 bytes onto the stack and exits. I need to get that value and return it 129 times in less than 2 minutes to get the flag. Ill do some basic reverse engineering in gdb and Ghidra, and then use Python and PwnTools to interact with the server, get the bianry, decode it, locate the buffer, read it, and send it back.
Final Script: https://gitlab.com/0xdf/ctfscripts/-/tree/master/htb-quickscan
☕ Buy Me A Coffee: https://www.buymeacoffee.com/0xdf
[00:00] Introduction
[00:57] Challenge introduction
[01:32] Interacting with server
[02:05] Strategy
[02:44] Saving binaries
[03:24] Reversing warmup
[10:30] Reversing elf1
[11:13] Setting up Python program to get bytes
[12:30] Connecting and reading base64 string
[15:18] Saving ELF to file
[16:21] Calculating addresses
[20:17] Getting values as hex string
[21:00] Sending result to server
[21:18] Making function to loop over
[24:12] Solving challenge!
[24:31] Conclusion
#HackTheBox #ctf #reverse-engineering #python #pwntools QuickScan [HackTheBox Cyber Apocalypse CTF 2024]](https://i.ytimg.com/vi/qN4mcemE6mA/mqdefault.jpg)