Shell upgrades and background sessions
Sometimes, we don't need to interact with the compromised host on the fly. In such situations, we can instruct Metasploit to background the newly created session as soon as a service is exploited using the exploit -z
switch, as follows:
Figure 12.7 – Automatically putting sessions into the background using the -z switch
Additionally, as we can see that we have a command shell opened, it is always desirable to have better-controlled access, like the one provided by Meterpreter. In such scenarios, we can upgrade the session using the sessions-u
switch followed by the session identifier, as shown in the following screenshot:
Figure 12.8 – Upgrading the shell to Meterpreter using the sessions-u command
Amazing! We just updated our shell to a Meterpreter shell and gained better control of the target. While conducting penetration tests, sometimes having too many shells can be confusing...