Skip to main content

Enumeration

Run Nmap Scan

View Website

Untitled Untitled

Directory Bruteforcing (Run Gobuster)

View Certificate to Enumerate Hosts

Untitled The certificate belongs to love.htb and staging.love.htb

Add hosts to the /etc/hosts

View staging.love.htb

Untitled

Enumerating staging.love.htb

Routing to the Demo (/beta.php)

Untitled

Scanning our reverse shell hosted by attacking machine. (Failed)

Untitled I expected to execute the file, but instead it cat our reverse shell

Scanning localhost:80

Untitled Here it displays the voting system login menu. We can try different ports to find hidden websites!

Finding the Credentials (Scanning localhost:5000)

Untitled The website displays the admin credentials!!

Logging in to /admin

Untitled

Exploitation

Searching for Voting System Exploit

Script Error

Exploit not working

The script just ends without exploiting

Finding the Problem

Here we see the link is not correct. If we look above, the link is in http://love.htb/admin/*.php format. Hence we need to remove the /votesystem directory

Editted Exploit Code

Reference

Voting System 1.0 - File Upload RCE (Authenticated Remote Code Execution)

Listen to Reverse Shell and Exploit

Privilege Escalation

Using Privilege Escalation Script to Find Exploit

Executing winPEAS

If we want to exploit AlwaysInstallElevated, Both HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Installer and HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer should be set to True

Generating Reverse Shell to exploit AlwaysInstallElevated policy

You can use the AlwaysInstallElevated policy to install a Windows Installer package with elevated (system) privileges. - Microsoft
Here we are going to make a installer package to install(execute) our reverse shell in privileged mode

Listen to Reverse Shell and Exploit

Let’s execute our reverse shell msi file