2_0_50727
iis server - iis7
ftp annon login successful
nmap scan
Nmap scan
Nmap all port scan revealed only two ports to be open 21 and 80. Then I proceeded with script and version scans.
FTP
FTP anonymous login was successful (uid: anonymous - pass: anonymous)
There were no interesting files in it.
But ftp ‘s root folder is same as web server’s
Let us try if we can upload files
ftp> ls
229 Entering Extended Passive Mode (|||49158|)
125 Data connection already open; Transfer starting.
03-18-17 02:06AM <DIR> aspnet_client
08-16-23 05:52AM 34 flag.txt
03-17-17 05:37PM 689 iisstart.htm
03-17-17 05:37PM 184946 welcome.png
226 Transfer complete.
Success.
We can upload an aspx shell and execute via web server as the iis server 7.5 supports it
Browse to the location
We get a reverse shell
System enumeration
Hotfix - NA means this windows machine has never been updated
Hunt for exploits
We have an unpatched win 7 build 7600
On googleing we get https://www.exploit-db.com/exploits/40564 which has instructions to compile the exploit.
It is a priv esc exploit.
searchsploit -u
to update searchsploit
use searchsploit -m 40564
to copy the exploit
Compile the .c file using the instructions in the exploit
i686-w64-mingw32-gcc 40564.c -o 40564.exe -lws2_32
As there is no python, wget or netcat. We can transfer file using powershell
Run the exploit form downloads folder and we get root