Access

Nmap Scan

$ sudo nmap -sCV -Pn -p- --min-rate 10000 192.168.160.187
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-30 09:40 +08
Nmap scan report for 192.168.160.187
Host is up (0.0097s latency).
Not shown: 65515 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
80/tcp    open  http          Apache httpd 2.4.48 ((Win64) OpenSSL/1.1.1k PHP/8.0.7)
|_http-title: Access The Event
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.48 (Win64) OpenSSL/1.1.1k PHP/8.0.7
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2024-05-30 01:41:10Z)
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: access.offsec0., 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: access.offsec0., 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
9389/tcp  open  mc-nmf        .NET Message Framing
49666/tcp open  msrpc         Microsoft Windows RPC
49668/tcp open  msrpc         Microsoft Windows RPC
49673/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49674/tcp open  msrpc         Microsoft Windows RPC
49677/tcp open  msrpc         Microsoft Windows RPC
49704/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: SERVER; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2024-05-30T01:41:59
|_  start_date: N/A

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 107.48 seconds

Initial Access

Enum4linux

Anonymous

Guest

Port 80

There is a website that is running on port 80.

After enumerating for a while, we can see that when we try to buy tickets we are able to upload an image. So I tried to use some sample image file and random email to purchase the ticket.

After we click Purchase, we can see this message. However this does not give us much information.

Directory Enumeration

However, after running our directory enumeration, we can see 3 different places that we are able to access but the more important ones are forms and uploads.

If we go forms, we can see that this server supports PHP.

If we try to click into it, we are able to see this message.

If we go uploads, we can see that the image file is uploaded here.

If we try to click into it, we are able to see the image.

So we will try to upload php files, however after trying all the extensions we are not able to upload any php files.

.htaccess vulnerability

The .htaccess file has this feature where we are able to execute php files using other extension. Since all the usual extensions are blocked, we shall try this method instead. First we need to create our own .htaccess file.

Next, we will convert our payload to use .dork extension.

In our payload, we will use this

First, we need to upload our own .htaccess file first.

Ensure that the Show Hidden Files checkbox is ticked, if not we are not able to see the .htaccess file.

Next, we will upload the payload.

We will then go the upload folder and should be able to see the revshell.dork. After we clicked it, we should be able to see the reverse shell appearing.

Lateral movement

Kerberoasting

We can see that there are 2 account which can be Kerberoasted.

We will then use Rubeus.exe to get the hashes and transfer them using impacket-smbserver.

After transfering out, we will be cracking the hash and the password is trustno1.

Runas to get reverse shell

We will use this module to make use of the run command.

After tested, this works and so the next step is to run a reverse shell as svc_mssql user.

We will generate the payload using msfvenom and start the python server to transfer our file.

After running it, we are able to get the reverse shell as svc_mssql.

Privilege Escalation

SeManageVolumePrivilege

When enuermating the privileges, we can see that the user has SeManageVolumnPrivilege .

After a bit of googling, we can see that this privilege have some vulnerability which allows us to full the whole Windows Folder.

After running the exploit, we can see that we have modify permissions.

PE using systeminfo (tzres.dll)

So we will overwrite the DLL file used for systeminfo command.

We will then upload it to C:\Windows\System32\wbem. Next, we will just call systeminfo to get our administrator shell.

Last updated