<?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 Z3d~ on Medium]]></title>
        <description><![CDATA[Stories by Z3d~ on Medium]]></description>
        <link>https://medium.com/@r4id3n?source=rss-7b07eeeb1a75------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nbOmF6wRNP5RYqCy__4JHQ.jpeg</url>
            <title>Stories by Z3d~ on Medium</title>
            <link>https://medium.com/@r4id3n?source=rss-7b07eeeb1a75------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:35:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@r4id3n/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[Python Readline Defeat to full data breach (The Python 3.9.6 Story)]]></title>
            <link>https://r4id3n.medium.com/python-readline-defeat-to-full-data-breach-the-python-3-9-6-story-f7f4965011e8?source=rss-7b07eeeb1a75------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7f4965011e8</guid>
            <dc:creator><![CDATA[Z3d~]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 23:20:38 GMT</pubDate>
            <atom:updated>2025-10-28T23:20:38.078Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello folks.</p><p>This is a write-up detailing a critical vulnerability chain (CVSS 9.8) found during a recent private bug bounty program. It reveals how a specific security mechanism, intended to prevent full file dumps, was inverted into the exploit itself, leading to a complete compromise of all financial and internal credentials.</p><p>The program was private, so we will refer to the application domain as (<strong>api.redacted-platform.com</strong>).</p><h3>The Initial Wall: Fingerprinting the Backend Defense</h3><p>We quickly identified a high-volume endpoint responsible for parsing user-uploaded contact data. Initial attempts at classic Local File Inclusion (LFI) were only partially successful; they consistently returned only <strong>the first line</strong> of any target file, failing to dump the full contents. This was the first hint of the security mechanism in place.</p><h3>The Critical Discovery: Python 3.9.6</h3><p>To understand <em>why</em> the file dump was limited to a single line, we needed to know what process was handling the file.</p><ol><li>We noticed the endpoint exhibited <strong>Server-Side Request Forgery (SSRF)</strong> behavior.</li><li>We used an SSRF payload to force the server to call back to our external listener.</li><li>The request captured on our Netcat listener contained the following critical information in the <strong>User-Agent</strong> string: <strong>Python 3.9.6</strong>.</li></ol><p>This discovery was the key. Knowing the backend was running Python 3.9.6, we immediately deduced that the file-reading logic was most likely relying on Python’s internal <strong>readline()</strong> function, or a library function that behaves identically.</p><p>This <strong>readline()</strong> function, which inherently stops reading at a standard newline character (\n), was acting as the primary security barrier. It would only ever dump a single line of file content, making a full file exfiltration (like dumping the entire .env file) impossible.</p><p>We now knew our target: we needed a primitive that could make the Python readline() function ignore its own rules.</p><h3>The Pivot: Null-Byte Confusion and Line Fusion</h3><p>The breakthrough came from analyzing how the application handled the <strong>delimiter</strong> parameter in the CSV upload and how Python processes system pseudo-files.</p><p>We discovered that the application exposed a <strong>destructive filter primitive</strong>: a parameter that removed any specified string from the file’s content <em>before</em> parsing. This filter was supposed to be used for cleaning data, but it was key to our bypass.</p><p>The crucial target was the system pseudo-file <strong>/proc/self/environ</strong>. Unlike normal text files, this file stores all application environment variables separated by <strong>null bytes (</strong><strong>\x00)</strong>, not newlines (\n).</p><h3>The Exploit Primitive: Defeating readline()</h3><ol><li>We set the delimiter parameter to a <strong>random, non-existent string</strong> (e.g., delimiter=asdf123).</li><li>The application received this string and since it didn’t exist in the file content, it simply returned the <strong>raw file content</strong> to the parsing function.</li><li>The raw content, containing all the null-byte separators, was fed directly to the <strong>readline()</strong> function.</li></ol><p>Because <strong>readline()</strong> was hard-coded to stop only at a newline (\n), and only encountered null bytes (\x00) separating the environment variables, it <strong>broke its own security model.</strong> The function ignored the null bytes and <strong>kept reading</strong> the entire contents of the file until it found a physical newline at the very end of the file.</p><p><strong>Result:</strong> The entire file, variables and all, was <strong>fused</strong> into a single, massive string. The security check designed to prevent the full file dump was defeated by its own dependency on the newline character that was absent in /proc/self/environ.</p><h3>Catastrophe Confirmed: Exfiltration of the .env File</h3><p>With the LFI security barrier defeated, we immediately targeted the application’s configuration. This step transitioned the vulnerability from theoretical to a confirmed, catastrophic data breach.</p><ul><li><strong>Target:</strong> [API_ENDPOINT]?file_path=/usr/src/app/.env&amp;delimiter=asdf123</li><li><strong>Proof:</strong> The server dumped the full content of the file, exposing all secrets.</li></ul><p>The confirmed compromise was immediate: all credentials necessary for full system takeover were successfully exfiltrated.</p><p>Stolen Asset</p><p>Value &amp; Impact</p><p><strong>Live Stripe API Key</strong></p><p><strong>Immediate Financial Fraud.</strong> The key (sk_live_...) allows full external control over all customer transactions and subscription data.</p><p><strong>PostgreSQL Credentials</strong></p><p><strong>Total Data Loss.</strong> Full access to the core customer database on the internal IP (10.154.0.3:5432).</p><p><strong>RabbitMQ Credentials</strong></p><p><strong>Supply Chain Compromise.</strong> Access to the internal message queue, allowing interception of all real-time communications, including <strong>One-Time Passwords (OTPs)</strong>.</p><h3>See yu all in the next write-up folks !</h3><p>cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7f4965011e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full Account takeOver throught enabled laravel debug mode]]></title>
            <link>https://r4id3n.medium.com/full-account-takeover-throught-enabled-laravel-debug-mode-54a68156d258?source=rss-7b07eeeb1a75------2</link>
            <guid isPermaLink="false">https://medium.com/p/54a68156d258</guid>
            <dc:creator><![CDATA[Z3d~]]></dc:creator>
            <pubDate>Thu, 04 Mar 2021 20:39:46 GMT</pubDate>
            <atom:updated>2021-03-04T20:39:46.679Z</atom:updated>
            <content:encoded><![CDATA[<p>hey folks</p><p>before 1 month ago i i was hunting on a private bug bounty program on bugcrowd so i will call it (redacted), as usual while doing recon a subdomaine catched my attention , once i visited the subdomaine laravel word in wappalyzer let me think about Debug mode in laravel frameworks …</p><p>first i thinked about what to do to force that debug mode to appear !</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fa5viI92PAF89q%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fa5viI92PAF89q%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMGhhZWI4ZjcwOGl4andycHJkY211YXVsdWdkbmpqOXZibXk1ZzhvYiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2Fa5viI92PAF89q%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="300" frameborder="0" scrolling="no"><a href="https://medium.com/media/46a8a563f1ce9e14a0ffa3b5a4662a93/href">https://medium.com/media/46a8a563f1ce9e14a0ffa3b5a4662a93/href</a></iframe><p>i fired my burp and start abusing requests , after a little time i thinked about manipulating the host header with another host and yeah nothing happened but i’ve redirected to my host ! an idea fired fastly in my head !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*3mCORCfTscGIvE2YhUPY8Q.gif" /></figure><p>i said to myself what if i changed the host header on reset password functionality ! maybe i can manipuate the reset password link ! and whats happened was wow ! not expected !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bthXMMCkSBBC_OtviWniQ.png" /></figure><p>when i changed the host header the laravel error disclosed the reset password link that should be sent to me or anyone !</p><p>now i can reset the password of any user !</p><p>cheers</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54a68156d258" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRF exploitation in Spreedsheet to PDF converter]]></title>
            <link>https://r4id3n.medium.com/ssrf-exploitation-in-spreedsheet-to-pdf-converter-2c7eacdac781?source=rss-7b07eeeb1a75------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c7eacdac781</guid>
            <dc:creator><![CDATA[Z3d~]]></dc:creator>
            <pubDate>Thu, 21 Jan 2021 17:19:12 GMT</pubDate>
            <atom:updated>2021-01-22T22:53:04.507Z</atom:updated>
            <content:encoded><![CDATA[<p>SSRF Exploitation in Libreoffice Spreadsheet File Converter</p><p>hello folks .<br>this is my first writeup about one of my recent finding on a private bug bounty program , i hope you can store a new informations on your mind from this writeup . <br>happy reading</p><p>the program was private so i will call it (penetsting.redacted.com )<br>i’ve start playing around the whole application trying to understand thow things work there , after some minutes i found an html editor under a file upload functionality i tried to bypass the upload protection but unfortunately the files was uploaded to an S3 bucket so there are no chance to shell the server or get a stored XSS, next i tried to figure out how text editor work exactly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zIfVhONGi96Qy7TeLfAVkg.png" /></figure><p>when you create something inside the editor the backend convert the text to PDF and upload it to the s3 bucket in order to make a resume</p><p>i’ve tried to send an html syntax to the converter for get SSRF</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*0tLoH7rkl-ELRTu9doy8Ow.png" /></figure><p>but unfortunately there was a security mechanism convert my &lt;img &gt; tag output to a X image which mean we cannot access to the internal network !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zuJDjihZ4G17mmv0W1wAmw.png" /></figure><p>i’ve tried a lot of encoding mechanism but nothing work !</p><p>after that i tried to figure out which software is respensible about converting editor code to pdf ! so i opened listenner using Netcat on my vps and put my ip&amp;port inside the img tag &lt;img src=”http://myvps:1337”&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*y5Wr3erCkBo0IOCMCp8tjg.png" /></figure><p>and yeah i’ve received a request from the server that leak the name of the software in the User-Agent which is LibreOffice ! <br>after that i used the server ip to find the host and yeah the application was pointed on an aws ec2 instance ! thats nice .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*ce8UZOiVbgDFD6QfVeOMbg.png" /></figure><p>after that i start digging deeper in google to see how things work in LibreOffice and i’ve remember the file upload functionality that allow xlsx upload !</p><p>and as the uploader allows xlsx filess … it convert files to pdf too i thinked about abusing an libreoffice file to get internal network access</p><p>after some digging i found where the text content of the libreoffice document is located <br>The text content of the document is located in content.xml inside the file</p><p>Also in LibreOffice documents , you are able to embed OLE Objects inside of the documents this also support remote objects .</p><p>OLE Objects in LibreOffice work by fetching the contents of the remote URL and displaying the contents inside of a frame throught <strong>x-href</strong>. The OLE objects are embedded in the <strong>content.xml</strong></p><p>Lets manipulate it !</p><p>first we will download and install libbreoffice <br>andd click at Insert -&gt; object -&gt; ole object -&gt; create from file -&gt;Checkbox “link to file”-&gt;enter a url &gt; save the file as odt</p><p>and open the odt fileusing 7zip and open content.xml file using a text editor and modify the file by replacing the url inside xlink:href with an internal network ip and as all we know the application is inside a ec2 instance so will use [169.254.169.254] the EC2 instance local IP address in order to fetch the metadata</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIEgrtqdEhxR-aJu5Zz-ng.png" /></figure><p>save the edited file and rename it to test.odt.xlsx</p><p>after upload the file !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*vmBUlhom3LQ4SlaEu-V9Ow.png" /></figure><p>and yeah i’ve bypasse the security mechanism and get the internal metadata of the ec2 instance wich can lead to A Remote code execution in a few more steps …</p><p>cheers .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c7eacdac781" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>