<?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 Kaushik Roy on Medium]]></title>
        <description><![CDATA[Stories by Kaushik Roy on Medium]]></description>
        <link>https://medium.com/@meraid.kr?source=rss-c7dd2ba13916------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BM4FcDn0sC1Mtrf2.</url>
            <title>Stories by Kaushik Roy on Medium</title>
            <link>https://medium.com/@meraid.kr?source=rss-c7dd2ba13916------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:34:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meraid.kr/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[How I solved HackerOne h1–212 CTF]]></title>
            <link>https://medium.com/@meraid.kr/how-i-solved-hackerone-h1-212-ctf-e6d7171a55e6?source=rss-c7dd2ba13916------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6d7171a55e6</guid>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[hackerone]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[h1-212]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Kaushik Roy]]></dc:creator>
            <pubDate>Mon, 25 Dec 2017 13:16:36 GMT</pubDate>
            <atom:updated>2018-06-11T17:47:07.839Z</atom:updated>
            <content:encoded><![CDATA[<p>I started the CTF very very late after it was launched. Just 3 days before the deadline I started it. I already knew that it would be very tough and I am not that good to solve it,at least not in last 3 days.:P</p><p>I opened the IP, <a href="http://104.236.20.43/flag">http://104.236.20.43/</a> got an Apache default Page. First, I tried bruteforce with dirb and dirbuster. Didn’t found anything. So I changed the wordlist further and tried again. I was sure I would get something different in the response so that I could start the CTF. Simultaneously, searched the source code of the page, in case something is hidden.Found nothing not a single thing.<br>At this time solving the CTF was not my intent, not even close and I just wanted to learn something new. I was just fiddling around.</p><h3>Challenge 1 : Where to Start</h3><p>After few hours I saw @jobertabma post that bruteforce is not the key. So It means something different. I was thinking hard. I thought to recon the IP little bit more. It was hosted on Digital Ocean and SSH was open. Tried SSH , searched for exploit. I knew that exploit and all those things won’t be<br>there in this CTF as it will require creative thinking because it’s HackerOne.<br>Then I did reverse domain i.e. The domain hosted in this site. i.e tequilawolf.codedecode.com.br. Little Excited that at least found something to START After that I tried subdomain enumeration and here and there. Found<br>nothing. I was like what am I missing. Nothing was coming to my mind. I thought I wont be able to do this, this is really tough for me. Bye☺</p><p>Then going through twitter again saw some old twitter post of Jobert’s about Virtual Hosts.I changed my mind and put it in different direction. Started searching the Internet for all the recon things. Saw all the tools in Jobert’s github repo. Only one and only tool was matching the recon category. Virtual-host-discovery. It stuck inmy mind. As nothing else was there. Only vhost enumeration was getting into my mind. I downloaded and tried but all false<br>positive. I tried to find this with other tools. No help!!! Upon searching the other vhost scripts, I started reading all about vhost more. Same Ip based or Different IP based. How to access different vhost residing on the same server(single IP). I didn’t knew much about this topic earlier so was<br>reading more.</p><p>I read that if one IP contains more than one virtual Host/domains then virtual hosts can be accessed by sending the correct host name in the HOST header. Yups…. Got something to try. I used tequilawolf.codedecode.com.br in the HOST header and started playing with this. Tried many different things including admin also. But same Apache page. Everytime. Ohhhh God….!!</p><p>Still I was not fully sure that if I am going in the right direction. And I was not sure that I was able to solve the CTF as till now I have not got a single sign that I am on the right track. I though lets keep trying, in this way I will learn few things. I checked few of the responses (apache page) that if some code is different in that. All were same. Again tried to find the subdomians of this domain and use it in Host header. Found nothing. I left the CTF. My mind was not working. Don’t know if I was doing was right not.Few hours later I again saw the h1 challenge page and read it twice.It just came into my mind. admin portal and acme.org. I thought acme.org is just to create the story. It has nothing to do with the challenge. Still I googled acme.org and admin.acme.org. Nothing was there with these websites.</p><p>It just came into my mind to put acme.org in HOST header. I did. Same apache page. Then I tried admin.acme.org.<br>Got response ..!! with No body. I saw like ….!! What…..!!! Ohh yeah..!!<br>I got more confident as soon as I Saw the <strong>Set-Cookie:admin=no</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*gyOmuHWPnVf-0wRG3iljkw.png" /></figure><p>— — — — — — — -First Challenging Step Accomplished — — — — — — — — —</p><p>Now I started feeling like to solve the thing and let’s see how far can I get.<br>Immediately in the request I entered Cookie:admin=yes. In the response got 405 Method not allowed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZQuL9ToUSpqynwnt4fKFA.png" /></figure><p>Tried every HTTP Methods and stopped in POST. Got unique response 406 Not Acceptable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHJJKb3MoGv3uGDBYO_Asw.png" /></figure><h3><strong>Challenging Step 2 : Not Acceptable</strong></h3><p>Searched the whole Internet again why this occurs. Read stackoverflow, rfc,etc etc<br>From here<br><a href="https://tools.ietf.org/html/rfc7231#page-60">https://tools.ietf.org/html/rfc7231#page-60</a><br><a href="https://tools.ietf.org/html/rfc7231#section-5.3">https://tools.ietf.org/html/rfc7231#section-5.3</a><br>I got to know that these four Headers are responsible for this. We need to play with these.<br>| Header Field Name | Defined in… |<br>+ — — — — — — — — — -+ — — — — — — — — -+<br>| Content-Type | Section 3.1.1.5 |<br>| Content-Encoding | Section 3.1.2.2 |<br>| Content-Language | Section 3.1.3.2 |<br>| Content-Location | Section 3.1.4.2 |</p><p>I tried every possible combination , everything. Everything…!!!! Got nothing in response, running out of ideas. Out of frustration I tried Content-Type: application/json as it is mostly commonly used now in modern web applications and I have seen it many many times.<br>Gottaaaaaaacha….!!!!! \o/\o/\o/<br>Error Code —&gt;418 I’m a teapot <br>Body —&gt;{“error”:{“body”:”unable to decode”}}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*viBJ2Gh1ifhAGneGiIICeg.jpeg" /></figure><h3><strong>Challenging Step 3: Analyze .! what is happening ! Maybe SSRF</strong></h3><p>Searched the Error 418. Found nothing special. Knew that it’s the Body I need to concentrate on :P Started playing with the body.<br>Copied the {“error”:{“body”:”unable to decode”}} in the request body and forwarded. Got {“error”:{“domain”:”required”}} in response. Then I got that error is error. We need to send the payload in this format.{“domain”:”required”}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrpK3uwZQMoecvFHmsFAnw.jpeg" /></figure><p>Oppsss did I said payload. #XSS guys :P Played with many things:-<br>Got these responses when I tried and kept on proceeding further:-<br>{“domain”:”google.com”} — &gt;{“error”:{“domain”:”incorrect value, .com domain expected”}}</p><p>{“domain”:”<a href="http://www.google.com/">www.google.com</a>&quot;} →{“error”:{“domain”:”incorrect value, sub domain should contain 212&quot;}}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXi6HJB63FDglpFDpEID3w.jpeg" /></figure><blockquote>{“domain”:”212.google.com”} —&gt; {“next”:”\/read.php?id=0&quot;}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*ZERvfCeo_QYPBXA28L0Gvw.jpeg" /></figure><p>Then immediately made GET request to /read.php?id=0 <br>Got {“data”:””} in response body. But didn’t know what is this data. I forgot to<br>mention that when I saw domain in the POST request’s response I started having a feeling of SSRF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*9HChIi0dADV-eB7JsjveuQ.jpeg" /></figure><p>Then went to previous POST request and again made some requests……!!<br>{“domain”:”<a href="http://212.google.com/">http://212.google.com</a>&quot;} —&gt; {“next”:”\/read.php?id=1&quot;}<br>{“domain”:”<a href="http://212.google.com/">http://212.google.com</a>&quot;} —&gt; {“next”:”\/read.php?id=2&quot;}</p><p>I was like what is this ?id= . why its keep changing. And then made GET request to /read.php?id=1 or /read.php?id=2</p><p>Got same {“data”:””} in response body. No change. Nothing.</p><p>I went through many theories and it took me few hours to think of what may be happening. I thought that 212.google.com is not real i.e. it does not actually exists. So maybe it’s not fetching it.<br>I tried to use localhost/127.0.0.1. My mind was saying that SSRF and localhost or something. Bug Bounty mind :P. <br>But not able to put localhost as 212 and .org was the constraints.<br>Next did google dorking and found few sites with 212 as subdomain.<br>I tried these payloads……..!!</p><blockquote>{“domain”:”212.boebike.com”} — — -&gt;&gt; {“next”:”\/read.php?id=8&quot;}</blockquote><p>And then made GET request to /read.php?id=8. <br><strong>Woooooohooooooooo…..!!!</strong></p><p>Got {“data”:”encoded data”} in the response.<br>Obviously, sent to Burp decoder and decoded with based 64. Understood that it’s the response page of the website 212.boebike.com.<br><strong>SSRF Confirmed</strong><br> — — — — — — —Third Challenging Step Accomplished — — — — — — — —</p><p>So it was confirmed that it is SSRF. Now I have to get inside the server and make request there.<br><strong>Localhost on my Mind :P</strong><br>But two restrictions were there ……!!<br>1. 212 subdomian<br>2. .org should be there.</p><p>Searched on how to bypass SSRF protection, read few hackerone reports for few hours found nothing. Or nothing worked.<br>Then I stopped searching further and started thinking how bypasses works. The thing was 212 and .org has to be there as the parser/server is checking for it. So it has to be there. In between this I have to enter my target thing (localhost). So that server make a different request to localhost not<br>212.localhost.org. I thought I need to break it. … hmmmm.. Break…. It…!! Started putting all the special characters here and there. Everything I was putting the domain url to see some changes.</p><p>I tried CRLF. <strong>\n\r</strong></p><blockquote>{“domain”:”212.\n\rlocalhost.com”} {“next”:”\/read.php?id=60&quot;}</blockquote><p>OOoppppppsssss…!! Something is different. I forwarded the request again and again…</p><blockquote>{“domain”:”212.\n\rlocalhost.com”} {“next”:”\/read.php?id=62&quot;}<br>{“domain”:”212.\n\rlocalhost.com”} {“next”:”\/read.php?id=64&quot;}</blockquote><p>Then I got an idea. I understood…..!! It is breaking i.e making two different request.</p><p>I tried this<br>{“domain”:”212.\nlocalhost\n.com”} {“next”:”\/read.php?id=110&quot;}<br>According to my thinking:-<br>The first request go to 212. id=108<br>The second request goes to localhost id=109<br>and the third request goes to .com id=110</p><p>So I needed to see second request.<br>I made the GET request to /read.php?id=110. Got the response , decoded and it was apache default page.</p><p>I was able to make request to server’s internal pages.</p><p><strong>Wohoooooooooooooooooooooooooooooooo</strong>………….!!!!!!!!<br>I thought Flag should be here. But more to go. :P. But It was a realllyyyy satisfying feeling. Really. I can’t believe I made it this far. Btw my mind was not working. And it was few hours left to close the CTF. But I really didn’t care now. Personally It has rewarded me more. Leave it….!!<br>I enumerated many directories like localhost/flag etc. Got nothing. Same page that I was getting via accessing the IPs. Started enumerating ports…. 80, 8080, 1234, 4444<br>Got some internal feeling to try this port and tried 1337. Thought may be something will be there may be. So there was a chance. Got response …. !! Hmm, where would it be? I knew that I am very very close. Yeah…!! That feeling. :P . Something is there nearby. Started enumerating many other Ports. Tried 1337. And<br>then thought to combine the two things i.e /flag and 1337. Then tried {“domain”:”212.\nlocalhost/flag:1337\n.com”}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ioBH-bxrUrR0-m__MrwCA.jpeg" /></figure><p><strong>Boom</strong>…!!!!!!!!!!!!!!!!!!</p><p>Decoded the data. Found the Flag..!!! \o/\o/\o/</p><p>Thanks Hackerone for this really awesome Challenge.It was a roller coaster ride. Adrenaline rush on/off. Learnt a bunch of new stuffs. Thanks again.:P</p><p>Then the Mail from Jobert Abma :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*2LT4QRpHKFdrYAAO7sx_Hg.jpeg" /></figure><p>To readers -Comments are welcome. And I know I am not good in writing blogs/writeups . _/\_</p><p>twitter -&gt; @<a href="https://twitter.com/A7la100n">A7la100n</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6d7171a55e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>