{"@attributes":{"version":"2.0"},"channel":{"title":"razvan.sh","link":"https:\/\/razvan.sh\/","description":"Recent content on razvan.sh","generator":"Hugo","language":"en","lastBuildDate":"Sat, 28 Feb 2026 12:00:00 +0200","item":[{"title":"Arbitrary-Write-to-RCE Chain in glibc's Thread Descriptor","link":"https:\/\/razvan.sh\/posts\/glibc-thread-descriptor\/","pubDate":"Sat, 28 Feb 2026 12:00:00 +0200","guid":"https:\/\/razvan.sh\/posts\/glibc-thread-descriptor\/","description":"<h2 id=\"introduction\">Introduction<\/h2>\n<p>This post describes an arbitrary write to RCE chain I found in glibc\u2019s per-thread descriptor (<code>struct pthread<\/code>) in TLS on x86_64.<\/p>\n<p>On modern glibc versions (2.36+), the relevant fields are conveniently adjacent, allowing a single write to forge a cleanup node and achieve RCE. On older versions, the <code>canceltype<\/code> field is located far away, usually necessitating two separate writes.<\/p>\n<h2 id=\"background\">Background<\/h2>\n<p>glibc stores per-thread cancellation and cleanup state in <code>struct pthread<\/code>. The cancellation-unwind path in <code>unwind_stop<\/code> eventually executes:<\/p>"},{"title":"rweb @ QnQSec CTF 2025","link":"https:\/\/razvan.sh\/posts\/rweb-qnqsec\/","pubDate":"Sat, 18 Oct 2025 12:00:00 +0300","guid":"https:\/\/razvan.sh\/posts\/rweb-qnqsec\/","description":"<h2 id=\"challenge-details\">Challenge details<\/h2>\n<p>So you like web and reverse, can you try this one yet<\/p>\n<p><strong>Author:<\/strong> byamb4<\/p>\n<p><a href=\"https:\/\/razvan.sh\/posts-files\/rweb-qnqsec\/challenge\">challenge<\/a>\n<\/p>\n<h2 id=\"introduction\">Introduction<\/h2>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#e6edf3;background-color:#0d1117;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-sh\" data-lang=\"sh\"><span style=\"display:flex;\"><span>challenge: Mach-O 64-bit x86_64 executable, flags:&lt;|DYLDLINK|PIE&gt;<\/span><\/span><\/code><\/pre><\/div>\n<p>The challenge binary is a GoLang Mach-O executable compiled for x86_64 architecture. The challenge also provides an IP address and port where an HTTP server is running.<\/p>\n<h2 id=\"reversing-the-binary\">Reversing the Binary<\/h2>\n<p>Most of the significant code is located in the <code>main.main.func1<\/code> function. Reversing the binary reveals that the server listens on port 8080 and exposes a single endpoint: <code>\/search<\/code>.<\/p>"},{"title":"UAF in Linux Kernel Module - baby-kernel @ UIUCTF 2025","link":"https:\/\/razvan.sh\/posts\/baby-kernel-uiuctf\/","pubDate":"Mon, 28 Jul 2025 12:00:00 +0300","guid":"https:\/\/razvan.sh\/posts\/baby-kernel-uiuctf\/","description":"<h2 id=\"challenge-details\">Challenge details<\/h2>\n<p><a href=\"https:\/\/razvan.sh\/posts-files\/baby-kernel-uiuctf\/handout.tar.zst\">handout.tar.zst<\/a>\n<\/p>\n<h2 id=\"introduction\">Introduction<\/h2>\n<p>The challenge features a vulnerable kernel module <code>vuln.ko<\/code> in a QEMU VM with Linux kernel <a href=\"https:\/\/elixir.bootlin.com\/linux\/v6.6.16\/source\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"v6.6.16 (opens in a new tab)\">v6.6.16<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n. It exposes <code>\/dev\/vuln<\/code> with ioctl commands for allocating, freeing, reading, and writing a global kernel buffer. The main vulnerability is a UAF, as the buffer pointer remains dangling after free without nullification:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#e6edf3;background-color:#0d1117;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-c\" data-lang=\"c\"><span style=\"display:flex;\"><span><span style=\"color:#ff7b72\">case<\/span> <span style=\"color:#79c0ff;font-weight:bold\">FREE<\/span>: {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#ff7b72\">if<\/span> (<span style=\"color:#ff7b72;font-weight:bold\">!<\/span>buf) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#ff7b72\">return<\/span> <span style=\"color:#ff7b72;font-weight:bold\">-<\/span>EFAULT;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#d2a8ff;font-weight:bold\">kfree<\/span>(buf);\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#ff7b72\">break<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ff7b72\">case<\/span> <span style=\"color:#79c0ff;font-weight:bold\">USE_READ<\/span>: {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#ff7b72\">if<\/span> (<span style=\"color:#ff7b72;font-weight:bold\">!<\/span>buf) {\n<\/span><\/span><span style=\"display:flex;\"><span>        <span style=\"color:#ff7b72\">return<\/span> <span style=\"color:#ff7b72;font-weight:bold\">-<\/span>EFAULT;\n<\/span><\/span><span style=\"display:flex;\"><span>    }\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#ff7b72\">return<\/span> <span style=\"color:#d2a8ff;font-weight:bold\">copy_to_user<\/span>((<span style=\"color:#ff7b72\">char<\/span><span style=\"color:#ff7b72;font-weight:bold\">*<\/span>)arg, buf, size);\n<\/span><\/span><span style=\"display:flex;\"><span>}<\/span><\/span><\/code><\/pre><\/div>\n<p>KASLR, SMEP &amp; SMAP are enabled.<\/p>"},{"title":"FSOP in Cosmopolitan - cosmofile @ L3akCTF 2025","link":"https:\/\/razvan.sh\/posts\/cosmofile-l3ak\/","pubDate":"Sun, 13 Jul 2025 12:00:00 +0300","guid":"https:\/\/razvan.sh\/posts\/cosmofile-l3ak\/","description":"<h2 id=\"challenge-details\">Challenge details<\/h2>\n<p>Have you ever read files? Hopefully, this will teach you how to read them. Go read the code, the Dockerfile, the fake flag, and the secrets of the universe&hellip;and the real flag, of course.<\/p>\n<p><a href=\"https:\/\/razvan.sh\/posts-files\/cosmofile-l3akctf\/cosmofile.zip\">cosmofile.zip<\/a>\n<\/p>\n<h2 id=\"introduction\">Introduction<\/h2>\n<p>This challenge features a binary compiled with <a href=\"https:\/\/github.com\/jart\/cosmopolitan\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Cosmopolitan Libc (opens in a new tab)\">Cosmopolitan Libc<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n - a build system that creates &ldquo;Actually Portable Executable&rdquo; binaries. There are no protections enabled except for NX.<\/p>"},{"title":"Allocating inside tcache_perthread_struct - limit @ smileyCTF 2025","link":"https:\/\/razvan.sh\/posts\/limit-smileyctf\/","pubDate":"Tue, 24 Jun 2025 12:00:00 +0300","guid":"https:\/\/razvan.sh\/posts\/limit-smileyctf\/","description":"<h2 id=\"challenge-details\">Challenge details<\/h2>\n<p>I heard you could malloc into scary places, so im adding a check to prevent that from ever happening!<\/p>\n<p><a href=\"https:\/\/razvan.sh\/posts-files\/limit-smileyctf\/limit.tar.gz\">limit.tar.gz<\/a>\n<\/p>\n<h2 id=\"introduction\">Introduction<\/h2>\n<p>This challenge implements a heap note system with malloc\/free\/print\/write operations on <code>glibc 2.39<\/code>. A limit check preventing chunks above the heap boundary via <code>sbrk(0)<\/code> is present upon allocation:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#e6edf3;background-color:#0d1117;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-c\" data-lang=\"c\"><span style=\"display:flex;\"><span>chunks[idx] <span style=\"color:#ff7b72;font-weight:bold\">=<\/span> <span style=\"color:#d2a8ff;font-weight:bold\">malloc<\/span>(sz);\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#ff7b72\">if<\/span> (chunks[idx] <span style=\"color:#ff7b72;font-weight:bold\">&gt;<\/span> limit) {\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#d2a8ff;font-weight:bold\">puts<\/span>(<span style=\"color:#a5d6ff\">&#34;hey where do you think ur going&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#8b949e;font-style:italic\">\/\/ if (malloc_usable_size(chunks[idx])) free(chunks[idx])\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>    chunks[idx] <span style=\"color:#ff7b72;font-weight:bold\">=<\/span> <span style=\"color:#a5d6ff\">0<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>    <span style=\"color:#ff7b72\">break<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#8b949e;font-style:italic\">\/\/ this will be abused later\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#8b949e;font-style:italic\">\/\/ chunks are still allocated even if above limit, only operations are blocked\n<\/span><\/span><\/span><\/code><\/pre><\/div>\n<p>The main vulnerability is an off by null bug in the write function, overflowing a null byte into the next chunk:<\/p>"},{"title":"Achievements","link":"https:\/\/razvan.sh\/achievements\/","pubDate":"Mon, 01 Jan 0001 00:00:00 +0000","guid":"https:\/\/razvan.sh\/achievements\/","description":"<h2 id=\"2026\">2026<\/h2>\n<ul>\n<li><span class=\"gold-effect\">\ud83c\udfc5 Gold medal at the International Cybersecurity Olympiad (ICO 2026), 6th place<\/span>\n <a href=\"https:\/\/ico-official.net\/stats\/2026\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"[Standings] (opens in a new tab)\">[Standings]<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n<\/li>\n<li>Team Romania at the European Cybersecurity Challenge (ECSC) 2026, 18th place<\/li>\n<li>\ud83e\udd47 1st place (10th grade) at the <a href=\"https:\/\/osc.rocsc.ro\/\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Romanian Cybersecurity Olympiad (OSC) (opens in a new tab)\">Romanian Cybersecurity Olympiad (OSC)<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n national and regional stages<\/li>\n<li>\ud83e\udd49 3rd place at DefCamp CTF Finals 2026<\/li>\n<li>Bronze medal &amp; honorable mention at the Romanian Applied Informatics Olympiad (Acadnet) national stage, Computers section<\/li>\n<li>Bronze medal at the Romanian National AI Olympiad (ONIA), national stage<\/li>\n<li>Bronze medal at the Romanian Olympiad in AI (ROAI), national stage<\/li>\n<li>\ud83e\udd47 1st place at Unbreakable Romania Teams 2026 (Qualifiers and Finals)<\/li>\n<li>NASA Letter of Recognition for responsibly disclosing Critical\/High vulnerabilities<\/li>\n<\/ul>\n<h2 id=\"2025\">2025<\/h2>\n<ul>\n<li>\ud83e\udd47 1st place (9th grade) at the <a href=\"https:\/\/osc.rocsc.ro\/\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Romanian Cybersecurity Olympiad (OSC) (opens in a new tab)\">Romanian Cybersecurity Olympiad (OSC)<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n national and regional stages<\/li>\n<li>6th place at DefCamp CTF Finals 2025<\/li>\n<li>5th place (junior) at the <a href=\"https:\/\/rocsc.ro\/\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"ROCSC (opens in a new tab)\">ROCSC<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n Finals<\/li>\n<li>\ud83c\udfc6 Top 3 at: <a href=\"https:\/\/ctftime.org\/event\/2822\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"TFC CTF (opens in a new tab)\">TFC CTF<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n, <a href=\"https:\/\/ctftime.org\/event\/2901\" class=\"external-link\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"NullCTF (opens in a new tab)\">NullCTF<svg class=\"external-link-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M6.5 3H3v10h10V9.5M9 3h4v4M13 3 7 9\" \/><\/svg><\/a>\n, L3akCTF (team valgrind), Chronos Security CTF (\ud83e\udd47), Electron CTF, ACS Keysight CTF, and DCS BCC2025 CTF<\/li>\n<li>4th place (high school) at the Unbreakable Romania Teams Finals; \ud83e\udd48 2nd Teams Qualifiers, 6th Individual<\/li>\n<\/ul>"}]}}