Devel
Reconnaissance:
WAPPALYZER
Web frameworks
Microsoft ASP.NET
Web servers
IIS 7.5
Operating systems
Windows Server
Enumeration:
FTP: TCP 21
The FTP server seems to be in the same root as the HTTP server. Why is that interesting? Well, if I upload a reverse shell in the FTP server, I might be able to run it through the web server. Not much to enumerate beyond what was in the nmap script results. I can log in with username “anonymous” and an empty password. No real files of interest.
Alright! This confirms that if we upload a file in the ftp server, and call it in the browser it will get executed by the web server. Our nmap scan showed that the web server is Microsoft IIS version 7.5. IIS web server generally either executes ASP or ASPX (ASP.NET). Since the version is 7.5, further googling tells us that it likely supports ASPX. Seeing that this server is running ASP.NET means I will likely need a .aspx webshell when I get to that.
Website: TCP 80
The page is just the default IIS page: http://10.10.10.5/
Foothold: Shell as web
MSFvenom
Let’s use MSFvenom to generate our reverse shell. MSFvenom is a framework that is largely used for payload generation. To display the format of payloads it supports, run the following command.
The output shows that aspx is one of the options. Similarly, you can check the payload options with the following command. Since the machine we’re working with is Windows, we filter out the results to only show us Windows payloads.
We’ll go with the general reverse shell since Meterpreter is not allowed in the OSCP. Run the following MSFvenom command to generate the aspx payload.
Then, we’ll upload the generated payload on the FTP server and confirm that it has been uploaded.
Start a netcat listener on the attack machine to receive the reverse shell when it’s executed.
In the web browser load the reverse-shell.aspx file we uploaded in the FTP server.
Go back to your listener to see if the shell connected back. Perfect! We have a shell and it’s running as iis apppool\web. Change the directory to the Users directory where the flags are stored.
Try to access the babis and Administrator user directories.
We don’t have permission, so let’s learn more about the operating system to see if we can escalate privileges.
We’re on a Microsoft Windows 7 build 7600 system. It’s fairly old and does not seem to have been updated, so it’s probably vulnerable to a bunch of exploits.
Privilege Escalation:
Let’s use google to look for exploits. The first two exploits displayed allow us to escalate privileges. The second exploit (MS11–046), has documentation on how to compile the source code, so we’ll go with that one.
Get the EDB-ID from the web page, so that we can use it to find the exploit in searchsploit. Update searchsploit to ensure you have all the latest vulnerabilities.
Use the -m flag to look for the exploit 40564 and copy it to the current directory.
Now, we need to compile the exploit. The compilation instructions are in th
If you don’t have mingw-w64 installed, install it.
Compile it using the listed command.
Alright, we have a compiled exploit. Now what is left is to transfer the exploit to the target (Devel) machine. Start up a server on the attack (Kali) machine.
Netcat doesn’t seem to be installed on Windows, but powershell is. So, we’ll use it to transfer the file from our server to a directory we can write to.
The file is now in the Downloads directory. Execute it and check if the exploit worked and escalated our privileges.
We have system! Navigate to the user.txt file and output its content to get the user flag.
Do the same thing for the root flag.
Last updated