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 -z switch, as follows:
![](https://static.packt-cdn.com/products/9781838822477/graphics/209a37d8-732e-400b-a0a4-89fb83a2c038.png)
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 -u switch, as shown in the following screenshot:
![](https://static.packt-cdn.com/products/9781838822477/graphics/7e06feeb-56fe-4d9e-9847-d6816e729dcc.png)
Amazing! We just updated our shell to a Meterpreter shell and gained better control of the target.