![Mastering Metasploit](https://wfqqreader-1252317822.image.myqcloud.com/cover/870/36699870/b_36699870.jpg)
上QQ阅读APP看书,第一时间看更新
Revising the approach
Throughout this exercise, we performed the following critical steps:
- We started by conducting an Nmap scan on the target IP address, which is 192.168.174.132.
- The Nmap scan revealed that port 80 at 192.168.174.132 is open.
- Next, we did a fingerprint of the application running on port 80 and encountered Apache 2.4.7 running.
- We tried browsing to the HTTP port. However, we couldn't find anything.
- We ran the dir_scanner module to perform a dictionary-based check on the Apache server and found the PhpCollab application directory.
- We found an exploit module for PhpCollab using searchsploit and had to import the third-party exploit into Metasploit.
- Next, we exploited the application and gained limited user access to the target system.
- To improve our access mechanism, we uploaded a backdoored executable and achieved a better level of access to the target.
- To gain root access, we run the exploit suggester module and found that the overlayfs privilege escalation exploit will help us achieve root access to the target.
- We downloaded the overlayfs exploit from https://exploit-db.com/, compiled it, and run it to gain root access to the target.
- Using the same previously generated backdoor, we opened another Meterpreter shell, but this time with root privileges.
![](https://epubservercos.yuewen.com/3A9801/19470393408885606/epubprivate/OEBPS/Images/Chapter_162.jpg?sign=1739345191-oxcErk9b2YrfL1uCMMMR76JNtQzfMybk-0-bbb8554f118c68cc653df22bdc176767)
- We added persistence to the system by using the sshkey_persistence module in Metasploit.
- Running the arp command on the target, we found that there was a separate network connection to the host, which is in the target range of 192.168.116.0/24.
- We added a route to this network by using the autoroute script.
- We scanned the system found from the arp command using the TCP port scanner module in Metasploit.
- We saw that port 80 of the system was open.
- Since we only had access to the target network through Meterpreter, we used the socks4a module in Metasploit for making other tools connect to the target through Meterpreter.
- Running the socks proxy, we configured our browser to utilize the socks4a proxy on port 1080.
- We opened 192.168.116.133 through our browser and saw that it was running the Disk Pulse 9.9.16 web server service.
- We searched Metasploit for Disk Pulse and found that it was vulnerable to an SEH-based buffer overflow vulnerability.
- We exploited the vulnerability and gained the highest level of privileges on the target since the software runs with SYSTEM-level privileges.
![](https://epubservercos.yuewen.com/3A9801/19470393408885606/epubprivate/OEBPS/Images/Chapter_418.jpg?sign=1739345191-4tQHTE5C8h7ynSSLMfL5yiB3FOJlw9au-0-7c00a0284dc0af489e9217f027e6c582)
- We enumerated the list of installed applications and found that WinSCP 5.7 is installed on the system.
- We saw that Metasploit contains an inbuilt module to harvest saved credentials from WinSCP.
- We collected the root credentials from WinSCP and used the ssh_login module to gain a root shell on the target.
![](https://epubservercos.yuewen.com/3A9801/19470393408885606/epubprivate/OEBPS/Images/Chapter_125.jpg?sign=1739345191-xSVvHSjuhFREzAajbkQFCh1TJuEGJP5R-0-b57e45141b600de0aba38c6b95e22601)
- We uploaded another backdoor to gain a Meterpreter shell with root privileges on the target.