Post-exploitation modules can be run on compromised targets to enumerate targets, escalate privileges, gather credentials, pivot into target networks, and much more. Post modules replaced Meterpreter scripts that are obsolete and no longer supported.
With more than 300 post modules, Metasploit has become one of the most complete post tools in the world, and thanks to the community, it is growing at a fast pace.
Let's have a look at some post-exploitation modules and how to use them. In this recipe, we will use the Windows Powershell Execution Post Module to execute PowerShell scripts in a Meterpreter session.
First, we need to get a session on the Metasploitable 3 target machine; for that we can use the Microsoft Windows Authenticated User Code Execution exploit module, then load the Windows Powershell Execution Post Module, set the Meterpreter session, and specify the PowerShell commands we want to execute in this example $Host:
Successful...