<?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 Shubham Gupta on Medium]]></title>
        <description><![CDATA[Stories by Shubham Gupta on Medium]]></description>
        <link>https://medium.com/@shubhamgupta_30502?source=rss-27340335c639------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gpPjuXGdxscpvh-CNy22rQ.jpeg</url>
            <title>Stories by Shubham Gupta on Medium</title>
            <link>https://medium.com/@shubhamgupta_30502?source=rss-27340335c639------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:18:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhamgupta_30502/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[M4tr1x:Exit Denied TRYACKME Walkthrough]]></title>
            <link>https://medium.com/@shubhamgupta_30502/m4tr1x-exit-denied-tryackme-walkthrough-72b2fa639447?source=rss-27340335c639------2</link>
            <guid isPermaLink="false">https://medium.com/p/72b2fa639447</guid>
            <category><![CDATA[info-sec-writeups]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Shubham Gupta]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 18:17:47 GMT</pubDate>
            <atom:updated>2022-06-04T18:17:47.006Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*GfADbmCXuZ7ACMqigsF5uw.png" /></figure><p>Enumeration</p><p>nmap -A -sC -sV &lt;IP&gt;</p><p>There is nothing special except a open port 80 where we’ll start our enumeration</p><p>We got port 80 open and other ports dont have juicy info , so lets dirbuster or dirsearch for searching directories and pages on this machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*GwwGT6fv7yx3Zi7-HIxjPA.png" /></figure><p>Well this machine live up to expectation for ‘exit denied’. I got such huge no. of directories and subdirectories that it is impossible for one to go through each page.</p><p>So, I decided to visit the website first and normally enumerate</p><p><strong>FACT TO REMEMBER: FOLLOW THE WHITE RABBIT</strong></p><p>On enumerating, i reached the page of members where i saw white rabbit and decided to go this way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NC3TIFpjCUGfRdpX8Scjaw.png" /></figure><p>To see Wills post, we should have account on this website. So, let us make a fake account to see the posts and threads by Wills</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLmYQNAAd0zExny5IjRo0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMHUI9JxAwP85HA0qiUJ9A.png" /></figure><p>After entering into Bug Bounty Program link we got a new lead <strong>/bugbountyHQ</strong> from the thread post between bigpaul and Wills</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4GJKeoGIBgdLhzAK2xS-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yJ2P1f3rCP6iTLHuoy8Pg.png" /></figure><p>I thought that this is the DEAD END since we cant input into any field but still i look at the page source and found very interesting redirection to . php page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*vgJcAt_46197id52ZghC5w.png" /></figure><p>Let us see what we get on this page <strong>/reportPanel.php</strong></p><p><strong>Ans To Where did that white rabbit lead you to?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiJzFFvANitEXtZP3VNcDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZPsJ6gmB2ywVbVfMVaChA.png" /></figure><p>Well i was quite aware till now for not skipping page source checking and you know what quite a good decision but on this stage i didn’t know what to do with this info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atdGpx0gnMN38s2VLUSFcQ.png" /><figcaption>We found something hidden on page source</figcaption></figure><p>We found two critical vulnerability and also a hint of passwords used by members of this website</p><p>Copy and paste the passwords into a file called<strong> pass_wordlist.txt</strong></p><p>Move to memberlist.php page and copy all the member names into <strong>user_wordlist.txt</strong></p><p>Now let us go to <strong>login</strong> page and open burp suite and intercept the login request and then send request to intruder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hMjRCx433fHaInJDOVH6Dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSKQf1NNEUa982fU6B4Xkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frXy6BDu--LiwohLCdPJqA.png" /></figure><p>And We got the result, we got password for various moderators. Let us get into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*rIvyERr7tZjNC_4phTybmA.png" /><figcaption>On brute forcing with user_wordlist and pass_wordlist, here are some results</figcaption></figure><p>Lets check ArnoldBagger first</p><p>We got to know something about a plugin whose<strong> version 3</strong> is in development stage and <strong>version 2</strong> is bugy and can be accessed from <strong>/devBuilds .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*ZfyRPM7ik5rXUxY8eG13hQ.png" /></figure><p>Let us download <strong>modManagerv2 and p.txt.gpg</strong></p><p><strong>Ans To What is the name of that interesting plugin? &amp; What is the name of that encrypted file that you found?</strong></p><p>Now I was trying to crack .gpg file with rockyou wordlist but then i saw this question</p><p><strong>Interesting… I believe only the keymaker could help you crack it. Find him. Where did he tell you to go to?</strong></p><p>And I remember i saw this keymaker thing previously</p><p>And so is the answer</p><p><strong>/0100101101100101011110010110110101100001011010110110010101110010</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atdGpx0gnMN38s2VLUSFcQ.png" /></figure><p>I look at the whole thing and don’t know how to crack it but here i get help from friend</p><p><strong>1 4 4 18 5 19 19 — — — A D D R E S S</strong></p><p>and that’s how we can crack the above text too</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJiYtjtTe1NSuKGp3rUSIQ.png" /></figure><p><strong>a permutation of only the English letters will open the locks</strong></p><p>When we go to /0100101101100101011110010110110101100001011010110110010101110010</p><p>we find nothing but what we can see is that there are some English letters appearing between Chinese letters in the matrix animation. Again lets check page source . Yet again, proven right</p><p>6 letters appeared in between Chinese letters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZW9w7XO2EySrqkbVFUZgSQ.png" /><figcaption>These 6 letters are<strong> fxgqov</strong></figcaption></figure><p>We need to find every possible combination for this word fxgqov</p><p>You may ask why? — — Remember this line “a permutation of only the english letters will open the locks”</p><p>Let us write a python program for asking all the combos for this 6 letter word</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*dhcQW2nAQD83wvFACMB8MQ.png" /></figure><p>Output we got from python program is not in the format which we need since we want every word in different line. So, down here is Cpp code to break into new line for each word of sentence. Well i could have written python program correctly but yes every hacker is lazy hi hi hi hi hi…….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qNzZgzupDEWeMk_Y-p7D4Q.png" /><figcaption>……………………………..</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zD39GTA0lKwmmG6MjQkADw.png" /><figcaption>Both above pics mentions the complete C++ code.</figcaption></figure><p>Now copy the output into crack_wordlist.txt</p><p>And you are ready to crack the p.txt.gpg</p><p>We will run john for bruteforcing this wordlist , we will get a password to crack p.txt.gpg and when we see the content of p.txt.gpg, we’ll again get a password for mysql</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*tMVqrMFh_ir6JysxTwQgtQ.png" /></figure><p>We got login keys when we enumerate mysql</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*k62VyNmn_dNg6tTK389w8w.png" /></figure><p><strong>What is the login_key of Ellie?</strong></p><p>I remember that when i was looking at SQL injection aspect in website since website URL had parameter “?uid=”, i also had look at cookie and there is no difference telling that cookie is in format</p><p><strong>cookie = uid_login-key</strong></p><p>You can clearly see that we have been logged in as ArnoldBagger having cookie 11_OoT….</p><p>where 11 is id of ArnoldBagger . You can confirm it by visiting memberlist.php and click on ArnoldBagger name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*e6AvV5DDfiZMfdycNEONIw.png" /><figcaption>This uid appear in url when you will click on ArnoldBagger in memberlist.php</figcaption></figure><p>Now we have login key of BlackCat which is a<strong> Super Moderator</strong>. BlackCat has uid =7 and login key you can see in the picture. So cookie = 7_JY1AV……..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Amji11s0KdUQt-4RcJMpPw.png" /><figcaption>1st image show uid=7 for Blckcat, 2nd image show the cookie of ArnoldBagger since we signed in as ArnoldBagger and 3rd image show all login keys</figcaption></figure><p>Copy the cookie and paste it into Right Click on page &gt; Inspect Element &gt; Storage &gt; Cookies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*1uTLM87ZkRB_q26BvsdXXg.png" /></figure><p>Enter and refresh and you logged in as Blackcat now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jX-8QhmlVEabS-UuXtkZyA.png" /><figcaption>Now we have changed the cookie with uid_login key of blackcat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwWsG4N6yu-tiNeWtW30GQ.png" /><figcaption>We are BlackCat now</figcaption></figure><p>In blackcat account we found some intersting files</p><p>1. DevTools.zip — timeSimulatorclient, ntp_syncer</p><p>2. testing.zip — 2 pictures in which one of them contain shared secrets tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6ptnhdyvj_xsOoQSfjebg.png" /><figcaption>content of testing.zip</figcaption></figure><p>Here blackcat sharing info about an algorithm <strong>SSH-TOTP</strong> which is a <strong>time based otp expires after 60s</strong> and synced with time of 3 countries.</p><p>We are provided with timeSimulatorClient which generates otp by the process as shown in Low level SSH_TOTP diagram where time syncing of 3 countries are send to <strong>multipliction function</strong> and converted to <strong>Computed Time Token CTT</strong> to <strong>xor</strong> with <strong>OTP and Shared Secret Token STT</strong> mentioned in the picture in <strong>testing.zip. </strong>After this there are some hashing process go on and then <strong>genrated otpcode is sent for xor with STT and CTT. </strong>Every 60s SSH-TOTP will change otp and this process will go on till we find one valid otp which will again be able to live for 60sec only</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*CAcBzLu3fEnfHf4Hb-Z8qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpoK0kDplHBTSyuIV4O7cQ.png" /></figure><p>ntp_syncer.py and timeSimulatorclient.py both are just algorithmic code and we have to make script which can send these otp codes from <strong>client machine</strong> to <strong>server machine </strong>for validation as shown in <strong>High Level SSH-TOTP</strong> diagaram and as soon as we got one of the otp we will have 60sec to get the ssh session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*SiGHxf3nW771gl7wyt5kNw.png" /></figure><p>All the above requirement is covered in script given below</p><p>And i find this script online</p><p>This script is not owned by me</p><p><a href="https://github.com/GeardoRanger/M4tr1xBrute">https://github.com/GeardoRanger/M4tr1xBrute</a></p><p>Run this above script with python3 and don’t forget to enter Shared_secret1,2,3 (given in testing.png), RHOST (Machine IP) and user : architect</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*XD9RW0BsMkj5kM6S9VG8Lw.png" /></figure><p>We got the code and now we get the ssh session and <strong>user flag</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*kf9Umd8rV7SOggTweJtqFg.png" /></figure><p>Now we need to escalate privileges</p><p>I was searching for binaries with suid bit set and i find one weird binary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*mymx-yczaxYus8ne9h2BNg.png" /></figure><p>On searching, i find some functionalities of this binary and i tried to exploit it.</p><p>So, what i did is i copied passwd file to this directory, i opened the file using nano and change the passwd of root by adding our own encrypted passwd</p><p>cp /etc/passwd .</p><p>openssl passwd normal</p><p>Using this command ‘openssl passwd normal’ i generated encrypted phrase for normal since normal is going to be my root’s passwd. You can choose your own.</p><p>So, what i did is i copied passwd file to this directory, i opened the file using nano and change the passwd of root by adding our own encrypted passwd</p><p>Change root:x: to root:pl0hcrpfL2So</p><p>And then I uploaded this passwd file to /etc using pandoc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*MGyLB9mqQgKrRdbIxd_EKg.png" /></figure><p>Yoozy , this works and we got the root privileges</p><p>But still we don’t get root passwd</p><p>let us search it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*1ICFoKfqgF_x6KWi5fi1rg.png" /></figure><p>And we got this interesting file in /etc i.e. — -root.py</p><p>i tried to run it but because of its naming we can’t run it . In the end finally found the way to run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DItj2XgtHPO31dXQw1AmmQ.png" /></figure><p>And now we got the <strong>root flag </strong>here</p><p>During enumeration of root flag , i found this file <strong>bigpaul.txt</strong> in same directory i.e. <strong>/etc</strong></p><p>Solve the XORing problem and you will find your pin</p><p><strong>What is the admin’s ACP pin?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FcjlDBzGF-hjqL4aKnswSg.png" /></figure><p>Here we got <strong>password</strong> to administrator too i.e.<strong> bigpaul</strong></p><p>We can find the web flag by logging in but there is one way more by visiting the dir holding datacache of users of this website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*1z7x0RR3BzxUT7L3s2GZKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*eXTm-ZNqppbCgcmF39u0wg.png" /></figure><p>And this conclude this machine.</p><p>This is my first post, I have tried to explain difficult topics. Also to avoid spoon feeding, i didn’t explain ordinary things. Please see all images properly so as to understand what’s happening !!</p><p>Happy Hacking :))</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72b2fa639447" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>