<?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 y1s4s on Medium]]></title>
        <description><![CDATA[Stories by y1s4s on Medium]]></description>
        <link>https://medium.com/@y1s4s?source=rss-c8abf030bd9d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LE_qzQSujW3IFP87KL0yXA.jpeg</url>
            <title>Stories by y1s4s on Medium</title>
            <link>https://medium.com/@y1s4s?source=rss-c8abf030bd9d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:42:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@y1s4s/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[Bad login config and DNS spoofing, abusing cronjob vulnerability -Overpass THM-]]></title>
            <link>https://medium.com/@y1s4s/bad-login-config-and-dns-spoofing-abusing-cronjob-vulnerability-overpass-thm-282d55ff48b4?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/282d55ff48b4</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 03:30:48 GMT</pubDate>
            <atom:updated>2024-02-21T03:30:48.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*DRLwgqbZoojY1X01jYl7iQ.png" /></figure><p>What happens when a group of broke Computer Science students try to make a password manager? Let’s find out</p><p>Let’s pwn this machine, but first things first, let’s enumerate ports and services, to do this I ran -allports- which is an nmap alias for scanning all 65535 ports doing a fast stealth scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*1I0N2rFPogdw70ivA0gGSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*bUEkaBMN0mLdwfVofctBfA.png" /></figure><p>2 open ports were found, let’s check the website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CX_hopjHCVQhrzyCx1B3jA.png" /></figure><p>This is actually the website of the password manager mentioned in the description of this machine. There is nothing very interesting so far, we can download a binary to run the password manager but nothing else, let’s run a gobuster search, check for any interesting directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*INSVqJskws2fd2drafdQjg.png" /></figure><p>The most interesting directory so far is /admin, let’s take a look</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*lU2UqNuaX8gLlWiAeRn-KA.png" /></figure><p>The directory seems like a very simple login page, tried SQLi but it wasn’t successful, after some time playing around I finally found something interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*I8E4iUx59cC8ly0aob2Kag.png" /></figure><p>There’s a login.js file that is being called everytime I tried to login, let’s take a look at the code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*8EEsqtUPXTE3k0MxC_zKbA.png" /></figure><p>Although there are some vulnerabilities on this code i.e the like lack of sanitization, the actual vulnerability we’re able to exploit is the wrong handling of errors in the login function. The function is handling the success or error of the authentication based on the response, which we can actually intercept and change. That way the validation where the message has to be different than “Incorrect credentials” will let us log in without actually providing any valid credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*KuL8Pfw3MO1236SbD_kjbA.png" /></figure><p>Just by changing that response and reloading the page, we can authenticate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CbeIrC31vtsuR48suop4Sg.png" /></figure><p>Once authenticated we can see that page, we are provided with an SSH key, we can now authenticate as james. Note: ssh2john is necessary to obtain the passphrase of the id_rsa key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*PRsuntA8D_H5-bNmb7hGLA.png" /></figure><p>We can then authenticate and obtain the first flag user.txt</p><h3><strong>Privilege escalation</strong></h3><p>After some enumeration there was no SUID permission to exploit, also we don’t have the password or permission to run commands as root, however there’s an interesting cronjob worth taking a look at</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jts-9Fk1NFclbz1GyQRaJw.png" /></figure><p>Theres a curl command run as root which is essentially fetching the content of buildscript.sh and piping it to “bash” to execute the script, in other words, the .sh script will be executed on the system, to abuse this script we can do it by spoofing the address of overpass.thm, normally this would require root privileges but in this case /etc/hosts file is writable by others: misconfiguration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*vJTx7QhDbo2dDYZdnz7ZqA.png" /></figure><p>To actually make this work we can create the same folder structure on our local machine, spoof the address to ours, start a listener and create a revshell file to be executed on the system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P10ltoMNPgTIotlbpeJCaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BO6T9is-O16asHUqFkEiYQ.png" /></figure><p>After waiting for the cronjob to actually happen we got a root shell on our listener</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*vsTwsCgT28Qa24BfI7XNPg.png" /></figure><p>And there we go, root access on the target, this was a very interesting machine <a href="https://tryhackme.com/room/overpass">https://tryhackme.com/room/overpass</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=282d55ff48b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XXE Injection and exploiting $PATH hijacking-Mustacchio THM machine-]]></title>
            <link>https://medium.com/@y1s4s/xxe-injection-and-exploiting-path-hijacking-mustacchio-thm-machine-f968459b7a79?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f968459b7a79</guid>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 06:08:31 GMT</pubDate>
            <atom:updated>2024-01-08T06:08:48.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>XXE Injection and exploiting $PATH hijacking -Mustacchio THM machine-</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*sP1q1UYBJRLmHBfkYx52qQ.png" /></figure><p>This time We we’ll be exploring a THM machine Mustacchio <a href="https://tryhackme.com/room/mustacchio">https://tryhackme.com/room/mustacchio</a></p><h3>Enumeration</h3><p>First I started with 2 nmap scans, one to discover open ports and a more intrusive scan on those found ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*I2ilfR3bDSCBU0N3WZiibQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMI8KUat1I91GxXm2G6gmA.png" /></figure><p>I found 2 http-servers, nginx and Apache and SSH on port 22 open as well</p><p>Now let’s check both websites</p><p>There’s a website in port 80 and an login panel on port 8765</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FakTffe2RE4MKvCTSABqww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fr785MLrNGsm13RdhI4qJw.png" /></figure><p>After looking around on both websites and source code, I found nothing, next thing to do, directory enumeration</p><p>On the first website, this was the dirsearch output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LN5C6w5JsRfD-8c4OJsPdw.png" /></figure><p>Inside the custom directory there was a users.bak file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*51SaVKPx6kPLpDJasx_3wQ.png" /></figure><p>Inside the .bak file I found some credentials for the admin, however, the password was a SHA-1 hash that I had to decrypt, crackstation did the work</p><p>Now we can login to the admin panel, and yeah, I tried dirsearch on the admin panel as well, but I didn’t find anything worth showing</p><p>After logging into the admin panel I got the following page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEFt2x4JKrRE3T4dEQ3eNA.png" /></figure><p>And this information on the source code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*8Pzg-CrEC8XgdUn05PvJCA.png" /></figure><p>Theres a message for a user “Barry” and a route to another bak file</p><p>I did a wget to the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9nhflNMaSKr8pQJcBG5AQ.png" /></figure><p>Now that looks like a sample comment, but first let’s intercept the request to the post comment on the admin panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*gcIxHjt9nGrdl6dLIDRoFw.png" /></figure><p>It is actually sending XML data, let’s try the sample comment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLB1siMdZGypbkIlA5JRXw.png" /></figure><p>What I think is that this could be vulnerable to XXE injection, let’s try a common payload to test this out</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*x3smJunEm0_l4yfFAeqYxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7xvx7FQTWoZwiYTycRzuA.png" /></figure><p>It actually is vulnerable, and remember the content on the comment for barry, so let’s try to exfiltrate barry’s ssh key and connect to the target</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*PHKY20Ccy7e4Eb8ChK4orw.png" /></figure><p>Using that payload you can retrieve the ssh key of the user, just copy that to a file, give the required permissions “600” and connect using — ssh -i id_rsa &lt;target ip&gt;, however, the key ask for a passphrase but john will do the work, just use ssh2john to create a file for john the ripper and then use rockyou.txt, that’ll do the work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*vhhDxx6iMRub5FvcBt8aiw.png" /></figure><p>Once logged in, theres the user flag</p><p><strong>Privilege escalation</strong></p><p>Privilege escalation was kind of straight forward, there’s another user “joe”, and on joe’s folder there’s a file called live_log, I used strings on that file and found out that the file is running tail command on /var/log/nginx/access.log, and the SUID bit is set</p><p>Next thing to do is path hijacking, we can create another tail file and place it before the actual tail command, that way the tail command to be executed will be the one created, which I will use to spawn a root shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*r_xZvLkG4bI8XZl8k6Zwcw.png" /></figure><p>And that was it, I was root!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f968459b7a79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analytics HackTheBox Write-up]]></title>
            <link>https://medium.com/@y1s4s/analytics-hackthebox-write-up-3bb132bc460c?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bb132bc460c</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Sun, 22 Oct 2023 20:15:31 GMT</pubDate>
            <atom:updated>2023-10-22T20:15:31.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*eM2HI5WAiFqxR-O5RgKumg.png" /></figure><p>This time I’m going to walk you through “Analytics” a Hack the Box easy linux machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Ndk_FrtekGUrJ5dLc_spmQ.png" /></figure><p>The first thing I found was two open ports on an fast scan, now for a more detailed scan I ran:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*KUFqfEYBpWdBPYFziNDBww.png" /></figure><p>The next thing I did was to run a dirsearch while I looked around the webpage looking for an attack vector, dirsearch was unsuccesful, but I found a login page on the website, so far, that’s the only thing I’ve found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJdP78AhG2lUVBQy5lCaZQ.png" /></figure><p>I tried some to find some common vulnerabilities like SQLi and XSS on the login page but it didn’t work, I looked up Metabase and there’s a CVE associated “CVE-2023–38646”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*rY4WQ6Jf4b9OfUpg82EdxA.png" /></figure><p>I found an exploit for this vulnerability on github “<a href="https://github.com/securezeron/CVE-2023-38646">https://github.com/securezeron/CVE-2023-38646</a>&quot;</p><p>Then I cloned the repo in my machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*dAZNKu0y86DSXkQDUXsPLQ.png" /></figure><p>To run the revshell exploit I ran this command since we have to specify lport, lhost and rhost according to the github’s readme</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3q2vY_fgpHPpvv0Z2tL-HA.png" /></figure><p>However, I got this error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPSlvW0305tX2Hk7DnrcnA.png" /></figure><p>To fix this is necessary to modify the code of the exploit like this:</p><p>Change this line from this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kX3jUPyGlQeUvuvpDNNZ5A.png" /></figure><p>To this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAbcv15xbqdzURJgVMTDYw.png" /></figure><p>What the change in the line does is alter the way the Bash shell processes the command and its associated components. Specifically, the change involves the absence of single quotes in the first line and their use in the second line, leading to differences in variable expansion and whitespace handling.</p><p>I ran the script again and voila! I got a shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*LGnv9ecQ7hEW5G6nT15mgQ.png" /></figure><p>Just by running env on the shell that I got, I found credentials, which I used to connect through ssh on the target machine and found the user flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15K-o8WiEgWmey4qITvZfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*skrzU_jNhNESSXODdx1G2A.png" /></figure><p>Now, privilege escalation, I ran sudo -l but got a message, this user cannot run sudo on the machine, so, next command to use is “uname -a” to display system info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZX83LgqsnHnvo4sAus00JA.png" /></figure><p>We have 22.04.02 ubuntu version, after a google search I found another CVE associated now with this ubuntu version “CVE-2023–2640”, and found the exploit on this repo <a href="https://github.com/g1vi/CVE-2023-2640-CVE-2023-32629">https://github.com/g1vi/CVE-2023-2640-CVE-2023-32629</a>, now same thing, cloned the repo, then cd to the cve folder to start a http server to download the exploit into the target</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkPEBBavhDNXaLHZJGTTBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*QTrfcSF_ROHM2EIxYbS2ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Sku8FlRbCqDY4AvWxTZUA.png" /></figure><p>Next thing is just to chmod of the exploit and run it, root pwned</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMHASzn_WdAl8wgZIgsyGw.png" /></figure><p>You can find me on:</p><p>Linkedin:<a href="https://www.linkedin.com/in/juan-carlos-campos-14a7aa212/">https://www.linkedin.com/in/juan-carlos-campos-14a7aa212/</a></p><p>Github:<a href="https://github.com/yisas93">https://github.com/yisas93</a></p><p>THM:<a href="https://tryhackme.com/p/yisas93">https://tryhackme.com/p/yisas93</a></p><p>HTB:<a href="https://app.hackthebox.com/profile/1317442">https://app.hackthebox.com/profile/1317442</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bb132bc460c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cyborg TryHackme Walkthrough]]></title>
            <link>https://systemweakness.com/cyborg-tryhackme-walkthrough-2fe62b186a37?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fe62b186a37</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[thm-writeup]]></category>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 20:13:17 GMT</pubDate>
            <atom:updated>2023-11-02T18:46:34.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*IH6LXOoVobk1snWtsJrCAg.png" /></figure><p>This is an easy <a href="https://tryhackme.com/room/road">https://tryhackme.com/</a> machine with only five questions, first 3 questions are easy to answer by just running a nmap scan of the target. There are 2 ports open running SSH and HTTP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Muz6ctwAsMwepJjCwO0GOQ.png" /></figure><p>Now looking at the website we found this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4t-fzyQs_lMWYsupOyC9A.png" /></figure><p>Now let’s do more recon, let’s run a dirsearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*Un6-XddA1bMwkRxz0fb5Jw.png" /></figure><p>Here we can see 2 directories, /etc/, and /admin/ let’s see what we can find there</p><p>Looking at admin we can see this page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICvcLI-ZiN1TB7CZparDsg.png" /></figure><p>We can also navigate to the “Admins” path and find this page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i7ZJtNIjsYlqx9_mUiKiXg.png" /></figure><p>That looks like a conversations between admins and a message from alex about not knowing how to set up a proxy, now let’s look at /etc/ to see what else can we find</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*iIjKxeEErGnUER0Uny5MPQ.png" /></figure><p>Theres a squid directory, if we open it we found a passwd file with a hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*kL6FOl73nmK_oU51bKY6dg.png" /></figure><p>Now we can try to crack it using John the ripper</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*fVe0z_5Jug1dNFGqlhk0fA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*76bNvbs_odH2ACfOP8x3Og.png" /></figure><p>And we found a password: squidward</p><p>I tried to see if that was a password for ssh connection but it failed, so, after investigating further the website I found out that we can download a tar file form the dropdown menu on the admin page that we found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*Jt5PTbxkY5_lUjYnu-ia3Q.png" /></figure><p>Now let’s run tar -xvf archive.tar to extract the files and directories of the .tar file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*pf7wp5CAcGLuhdUJMDfxJw.png" /></figure><p>Now we can explore some files, let’s check out README}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*W8ijKt_po8mWoeUExIOxnw.png" /></figure><p>It seems like a Backup Borg repository, we have to install Borg, let’s use “sudo apt install borgbackup -y” to do so</p><p>After that we can list the repository using “borg list home/field/dev/final_archive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*yVCmUsL_onqCtf80aSUytg.png" /></figure><p>this is where the password we found comes into play</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*se6OSWc2vqSwhF6yNH6-mg.png" /></figure><p>Now, in borg we can use the command “mount” to mount a Borg repository as a FUSE (Filesystem in Userspace) virtual file system. This feature allows us to browse the contents of a Borg repository as if it were a regular file system. We need to create a folder to store the repository also</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*5aUwieUkLRvI7ETFm8f38w.png" /></figure><p>Now we can navigate trought the repo like a file system, if we go to documents directory of the alex user, we can find the password for alex</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*hDklDB7dy0AfnbCcyp-zOA.png" /></figure><p>Now we can obtain an ssh shell for the alex user with that credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*7FQaEcWF6N9xHJtGwEPJFg.png" /></figure><p>For the privilege escalation the process is very straight forward, just run “sudo -l” and we can see that alex can run /etc/mp3backups/backup.sh as sudo, so we can echo the shebang into the backup.sh and run it as sudo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*DZnkG5KCSiMcqjpkFlhf-g.png" /></figure><p>And that’s it, we got the root flag! thanks for reading!</p><p>You can find me on:</p><p>Linkedin:<a href="https://www.linkedin.com/in/juan-carlos-campos-14a7aa212/">https://www.linkedin.com/in/juan-carlos-campos-14a7aa212/</a></p><p>Github:<a href="https://github.com/yisas93">https://github.com/yisas93</a></p><p>THM:<a href="https://tryhackme.com/p/yisas93">https://tryhackme.com/p/yisas93</a></p><p>HTB:<a href="https://app.hackthebox.com/profile/1317442">https://app.hackthebox.com/profile/1317442</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fe62b186a37" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/cyborg-tryhackme-walkthrough-2fe62b186a37">Cyborg TryHackme Walkthrough</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Road THM Walkthrough]]></title>
            <link>https://systemweakness.com/road-thm-walkthrough-88c428159f05?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/88c428159f05</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 06:24:57 GMT</pubDate>
            <atom:updated>2023-11-02T18:46:39.459Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a writeup for Road, a medium difficulty machine from tryhackme <a href="https://tryhackme.com/room/road">https://tryhackme.com/room/road</a></p><p>As always I started enumerating the target system using nmap and got the following output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*9XNOeQdqutcKqSd-gz1B3g.png" /></figure><p>Now, since port 80 was open, the first thing I did was check the website at port 80:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ho79Bcn-JPMm7AsfAjSx4Q.png" /></figure><p>Now, I found a couple interesting things, an email address and a login/signup page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*06jF9JlVcaHrLHxIG2u8qA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ar0p1OWNNqRtvjb8hWOAdQ.png" /></figure><p>Now I proceed to create an account with some dummy credentials to see more functionality of the website and try to find an attack vector</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*5RxgbXi1D8iNYvmGLn47MQ.png" /></figure><p>Now after I signed in, I got redirected to this page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QWOWMqETVav-tKEzVukV8A.png" /></figure><p>After some time looking around the website, I found a message on the edit profile options, I also found that most of the links were useless or just reload the page “/#” so to say. The message from the edit profile says that only admin has access to the feature, so we know theres an admin account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zubbAtIvI6zGupoNlyRLQ.png" /></figure><p>Now every link from the user dashboard is useless except for the “ResetUser”, now I can intercept traffic on that one and see what I get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*fCvPGm6zSLIUCh02oYgKew.png" /></figure><p>Now what I see there is that if there is no input validation I now own the admin email, I could just intercept the traffic and change the email to get admin credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*ZKlWTQ-hKFHG0k3ayCGY4g.png" /></figure><p>Got it! I got a 200! Now I can sign in as admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3hix6-N1Tsn113ZGMCiJw.png" /></figure><p>Now let’s thing to try is to upload a php reverse shell using the uploadphoto function of the webpage, to craft the payload I can simply use the php revshell from kali:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*pDJX5h3wy81M9WAQtFlgUA.png" /></figure><p>I created the revshell.php file, it is only necessary to modify the IP and port and set up a netcad listener on our machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7DuhM2HymsYE7mX26G2xg.png" /></figure><p>Now I uploaded the file but nothing happened and also the image wasn’t changed, inspecting the web page I saw a comment on the source code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*YXKz9r8mmqIEd-_zFeVEFA.png" /></figure><p>So I visited that link, but directory listing is disabled</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwBQLIFp9uDrVy1fOEEW8Q.png" /></figure><p>So I have to specify the exact file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Cg3B_ZbhNPWK17uV0yiSg.png" /></figure><p>And I got a shell!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*Pi9_ZhykNoh46CjrlrKZmw.png" /></figure><p>Now that is a www-data shell, we have to upgrade it, for that we go to <a href="https://theirsecurity.com/ctf-cheat-sheet/">https://theirsecurity.com/ctf-cheat-sheet/</a> and look for an exploit to upgrade it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*6faCdyJRzX3OT_wBgBxRAQ.png" /></figure><p>In this case that exploit worked!</p><p>Now to find the user flag it was only necessary to navigate to the webdeveloper user folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*k7TpxlcLH-3dcOTp1FX_WQ.png" /></figure><p>For privilege escalation the solution I found was to use linpeas, for which it’s only necessary to start a web server from our machine to access linpeas from the target</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*QzyaZc1U3flp7Zx9bcnHdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*nm_Bq7IMzGarTYX-ixOZ6A.png" /></figure><p>I had to do it from the /tmp folder, otherwise I got permission denied error. Then I changed permissions to the linpeas.sh file and run it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*HEUzuKjOnivNniWSkNkpUA.png" /></figure><p>In the well known long output from linpeas we can see that there’s a mongoDB in the system, so I’ll try to connect using the “mongo” command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*pkEW9371jUUeabbl5r5JqQ.png" /></figure><p>I was able to connect and look around in the database, till I finally found some gold, plaintext user and password, jackpot!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*_4F8xnXnw7rD2mFAa89NGA.png" /></figure><p>Now I will use those credentials to connect through ssh to the target machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*Z_V6bAX1jFy01sZwnMOShg.png" /><figcaption>we got the shell!!!</figcaption></figure><p>Now for the privilege escalation, this is a very nice trick that I found from “Their security” youtube channel.</p><p>It goes like this, open up a second ssh shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLtrkPZp0l_IGY3GIN4cUQ.png" /></figure><p>Then, on the first machine we run “echo $$” to get the process ID for that ssh session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*qu66Tat5aJtco72hIcahHQ.png" /></figure><p>Now, on the second machine we run “pkttyagent -p &lt;processID&gt;”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*KOSffQdLhokahlCEZfVDlA.png" /></figure><p>We hit enter, and on the first machine we run “pkexec /bin/bash”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*DUX7shtbU3MQMYr1sLhNQw.png" /></figure><p>When we hit enter, we are prompted with the password on the second machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*YY99KeEGJNDXF6kE3Yt47Q.png" /></figure><p>When we type the password and hit enter, we are root on the first machine, And that’s it! We pwned it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*0mBArV4PJMRBlUHvAsUuqA.png" /></figure><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88c428159f05" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/road-thm-walkthrough-88c428159f05">Road THM Walkthrough</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brooklyn Nine Nine Walkthrough THM]]></title>
            <link>https://systemweakness.com/brooklyn-nine-nine-walkthrough-thm-901ee4e5a79e?source=rss-c8abf030bd9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/901ee4e5a79e</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[y1s4s]]></dc:creator>
            <pubDate>Thu, 05 Oct 2023 01:36:58 GMT</pubDate>
            <atom:updated>2023-11-02T18:46:31.753Z</atom:updated>
            <content:encoded><![CDATA[<p>This is another <a href="https://tryhackme.com/room/road">https://tryhackme.com/</a> machine</p><p>By just looking at this machine I see that it has no information whatsoever, so it looks like a black-box pentesting, first things first, let’s run nmap to see what we got</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*DgBUKcU2xqxmjjHW2V4xsA.png" /></figure><p>Just by looking at the output we can see some interesting ports open: 22, 21 and 80, let’s first look at the web page on the 80 port</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzM25N90cVNijTDphg7cXQ.png" /></figure><p>Basically just a picture and nothing else interesting there as for now. Now let’s see the other ports, let’s investigate port 21</p><p>I tried connecting to ftp using admin user just to see what I get, and the error I got says that this FTP server is anonymous only, which means I can connect using the credential anoymous:anonymous</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*-NGkY2_TsYa878gCSC0Iwg.png" /></figure><p>Now let’s connect using those credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*ydvB22ggK3VVYkrC62kFpQ.png" /></figure><p>Login succesful, now let’s see what we got here, using the ls command I can see a very interesting txt file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*sxNg4kvvpsZOAAAVblyUBw.png" /></figure><p>Now let’s download the note_to_jake.txt file to our machine using the get command and open the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I3qUEz-orsBvttrncFXGfQ.png" /></figure><p>Ok we got some intel there, user jake has a weak password, it´ll be easy to crack using a dictionary, let’s use hydra for this one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQTVChtCmktb-U9u6Cd6VQ.png" /></figure><p>The text file was right, pretty easy password, we can use that to connect via ssh to the target machine.</p><p>After getting the shell I navigated looking for the user flag and got it, it is on the user holt directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*XkR2TRTAsZ7i2jbLo1kgvA.png" /></figure><p>Privilege escalation:</p><p>Now let’s run sudo -l to see what privileges and permissions are associated with our account when using sudo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEk2K879llz4xtfvqMtZtw.png" /></figure><p>Now we see that we can run the less commands as sudo, so let’s check gtfobins to exploit that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*Nxz47DKzHsgNRmSfkNOp8w.png" /></figure><p>We got that information, let’s try the first option.</p><p>After trying a few times the three methods I was only able to get a user shell not a root shell, however I found this other way. Just use the command less /root/root.txt and got the flag</p><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901ee4e5a79e" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/brooklyn-nine-nine-walkthrough-thm-901ee4e5a79e">Brooklyn Nine Nine Walkthrough THM</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>