Metasploit
Metasploit is a powerful penetration testing and hacking framework designed to secure networks, services, and applications by identifying and exploiting vulnerabilities
Metasploit can be used in countless ways. These are just a few things I found interesting and helpful along the way.
Upgrade Powershell to Metrepreter
If you are able to land a standard powershell connection from the victim machine, you can upgrade the shell to a meterpreter shell.
This payload generates an encoded x86-64 reverse TCP meterpreter payload.
After creating this payload, download it to the machine using the same method in the previous step:
Before running this program, ensure the handler is set up in Metasploit:
Once this is running, enter this command to start the reverse shell
SMTP
Simple Mail Transfer protocol
Poorly configured or vulnerable mail servers can often provide an initial foothold into a network, but prior to launching an attack, we want to fingerprint the server to make our targeting as precise as possible. We're going to use the "smtp_version" module in MetaSploit to do this. As its name implies, it will scan a range of IP addresses and determine the version of any mail servers it encounters.
Search "smtp_version"
- auxiliary/scanner/smtp/smtp_version
- Set RHOSTS
- Exploit
Search "smtp_enum"
- auxiliary/scanner/smtp/smtp_enum
- Set USER_FILE /usr/share/wordlists/SecLists/Usernames/top-usernames-shortlist.txt
- Set RHOSTS
- Exploit
Windows Escalation Technique
SeDebugPrivilege / SeImpersonatePrivilege
If these two privileges(SeDebugPrivilege, SeImpersonatePrivilege) are enabled, wec can use the incognito module in metasploit to exploit this vulnerability.
You may need to use the load incognito command if the previous command doesn't work.
Check which tokens are available:
Use this command to impersonate the Administrator's token if it is available:
Even though you have a higher privileged token, you may not have the permissions of a privileged user (this is due to the way Windows handles permissions - it uses the Primary Token of the process and not the impersonated token to determine what the process can or cannot do)
The safest process to pick is the services.exe process. First, use the ps command to view processes and find the PID of the services.exe process.
Migrate to this process using the command