AuthBy

Nmap Scan

$ nmap -sC -sV -Pn -p- -oN nmap 192.168.213.46          
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-30 22:28 +08
Stats: 0:01:03 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 44.85% done; ETC: 22:30 (0:01:17 remaining)
Stats: 0:01:41 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 74.60% done; ETC: 22:30 (0:00:34 remaining)
Nmap scan report for 192.168.213.46
Host is up (0.0098s latency).
Not shown: 65531 filtered tcp ports (no-response)
PORT     STATE SERVICE            VERSION
21/tcp   open  ftp                zFTPServer 6.0 build 2011-10-17
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| total 9680
| ----------   1 root     root      5610496 Oct 18  2011 zFTPServer.exe
| ----------   1 root     root           25 Feb 10  2011 UninstallService.bat
| ----------   1 root     root      4284928 Oct 18  2011 Uninstall.exe
| ----------   1 root     root           17 Aug 13  2011 StopService.bat
| ----------   1 root     root           18 Aug 13  2011 StartService.bat
| ----------   1 root     root         8736 Nov 09  2011 Settings.ini
| dr-xr-xr-x   1 root     root          512 May 30 21:28 log
| ----------   1 root     root         2275 Aug 08  2011 LICENSE.htm
| ----------   1 root     root           23 Feb 10  2011 InstallService.bat
| dr-xr-xr-x   1 root     root          512 Nov 08  2011 extensions
| dr-xr-xr-x   1 root     root          512 Nov 08  2011 certificates
|_dr-xr-xr-x   1 root     root          512 Mar 23 13:28 accounts
242/tcp  open  http               Apache httpd 2.2.21 ((Win32) PHP/5.3.8)
| http-auth: 
| HTTP/1.1 401 Authorization Required\x0D
|_  Basic realm=Qui e nuce nuculeum esse volt, frangit nucem!
|_http-server-header: Apache/2.2.21 (Win32) PHP/5.3.8
|_http-title: 401 Authorization Required
3145/tcp open  zftp-admin         zFTPServer admin
3389/tcp open  ssl/ms-wbt-server?
|_ssl-date: 2024-05-30T14:30:30+00:00; -9s from scanner time.
| ssl-cert: Subject: commonName=LIVDA
| Not valid before: 2024-03-22T06:28:30
|_Not valid after:  2024-09-21T06:28:30
| rdp-ntlm-info: 
|   Target_Name: LIVDA
|   NetBIOS_Domain_Name: LIVDA
|   NetBIOS_Computer_Name: LIVDA
|   DNS_Domain_Name: LIVDA
|   DNS_Computer_Name: LIVDA
|   Product_Version: 6.0.6001
|_  System_Time: 2024-05-30T14:30:25+00:00
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: mean: -9s, deviation: 0s, median: -9s

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

Initial Access

Port 21

When we login using the anonymous account, we are able to see all these files.

When we go into the accounts folder, we are able see that there are 3 users there.

So what if we use admin:admin to login into the ftp service. Sure enough, it works.

However, when we login using admin, it gives us a different directory.

When we look at the content of .htpasswd, we are able to see the username offsec with the password hash of $apr1$oRfRsc/K$UpYpplHDlaemqseM39Ugg0

Further research on the hash, shows that it is a Apache $apr1$ MD5 hash.

We will first create the file with the hash inside first.

Then we will try to crack it to get the password.

Now we know the account for offsec is elite.

After that we can log in to the website.

Reverse shell using webshell

Let us try if we are able to upload any random stuff into the ftp using the admin account, sure enough we are able to do it.

So the next step, we will upload a PHP webshell to call back to our local machine.

This will be the payload we will be using:

We will then upload it using the admin account using ftp.

We will then go to that webpage to trigger the webshell.

Privilege Escalation

MS11-046

If we look at the system information, we can see the OS that the target machine is on.

If we search online, we are able to find the vulnerability for this server.

We can just follow what they mention there to privilege escalate to administrator.

First we need to create the exe file

Then we could just upload using ftp with the admin account.

Finally we just run the exploit, we are able to get administrator shell.

Last updated