<?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 0xAstr0x on Medium]]></title>
        <description><![CDATA[Stories by 0xAstr0x on Medium]]></description>
        <link>https://medium.com/@0xAstr0x?source=rss-6c5c6664f58c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aMOYR4zz7z3TV5I9MS2BuA.jpeg</url>
            <title>Stories by 0xAstr0x on Medium</title>
            <link>https://medium.com/@0xAstr0x?source=rss-6c5c6664f58c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:30:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xAstr0x/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[CyberTalent: Game Zone]]></title>
            <link>https://medium.com/@0xAstr0x/cybertalen-game-zone-1959f0878581?source=rss-6c5c6664f58c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1959f0878581</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux-commands]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[0xAstr0x]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 01:06:04 GMT</pubDate>
            <atom:updated>2026-03-05T01:11:30.083Z</atom:updated>
            <content:encoded><![CDATA[<h3>CTF Writeup — Game Zone: PHP Deserialization + Shell Injection RCE</h3><h3>Overview</h3><p>A web application stores a serialized PHP object in a cookie called profile_info. The object contains a active field that holds a Unix timestamp, which the server feeds back into a shell command on every request to display a human-readable date. Because the server trusts its own cookie without sanitization, an attacker can inject arbitrary shell commands into that field and achieve Remote Code Execution.</p><h3>First : Intercept the Request</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6NqF5ClqbAFwf8sFwtEBQ.png" /></figure><p>After logging in, the browser receives a cookie:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*8IUjTpUe_d5nEU7E5Zm6HA.png" /></figure><p>after i decoded the cookie profile_info i got this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sX7gL-MxSTNvjyhUp-0ug.png" /><figcaption>O:4:”User”:3:{<br> s:14:”\0User\0username”; s:16:”Lima Charlie_290&quot;;<br> s:13:”\0User\0isAdmin”; b:0;<br> s:6:”active”; s:11:”1772663714</figcaption></figure><h3>Then : serialized PHP object</h3><p>php uses a process of serialization to manage objects and its values across requests.</p><p>By changing the value of b:0 of the isAdmin object to true ( b:1) nothing happened except the image of hte profile changes but i still cant get the etc/passwd</p><p>BUT,<br>if we look and focus , active object has a value of the timestamp when i logged in so it gets it from the system and saves it to the object value</p><pre>s:6:&quot;active&quot;;             s:11:&quot;1772663714\n&quot;;<br>#But this value of timestamp 1772663714 is unix based style <br>#and its not human readable style</pre><p>So now we know that the takes the value of active from the cookie then uses this command on the shell to convert 1772663714 from unix-based timestamp to human-readable one</p><pre>date -d 1772663714</pre><h3>Last : Flaw &amp; Exploitation</h3><h3>-Server-Side Logic</h3><p>The server create the value of active object on the first log in then saves it in the profile_info cookie so it can reuse to display the timestamp when the user logged in</p><h3>-The Flaw</h3><p>The server reads back active value and concatenates it directly into a shell command — <strong>without any sanitization</strong>. Since the user controls their own cookie, they control the value fed into shell_exec().</p><pre>Normal flow:<br>  shell_exec(&quot;date -d @1772663714&quot;)  →  &quot;Wed Mar  4 22:35:14 UTC 2026&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EKEkLD5bolfoUq7ME1uypA.png" /></figure><p>so now the shell when it will try to run the command on the timestamp it will run on ;cat${IF}/etc/passwd</p><p>After i encode as Base64 it back and resend it as the new profile_info i got the flag :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjxdiNrQM71PJXDFVq1qOg.png" /><figcaption>FLAG{e573e6ffb473997823ff6e25a504a5f143d7b90f}</figcaption></figure><blockquote>Al’hamdu llah 🤲🏽❤️</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1959f0878581" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>