Sessions

Using Sessions

Listing Active Sessions

msf6 exploit(windows/smb/psexec_psh) > sessions

Interacting with a Session

msf6 exploit(windows/smb/psexec_psh) > sessions -i 1
[*] Starting interaction with 1...

Jobs

If, for example, we are running an active exploit under a specific port and need this port for a different module, we cannot simply terminate the session using [CTRL] + [C]. If we did that, we would see that the port would still be in use, affecting our use of the new module. So instead, we would need to use the jobs command to look at the currently active tasks running in the background and terminate the old ones to free up the port.

msf6 exploit(multi/handler) > jobs -h

Running an Exploit as a Background Job

msf6 exploit(multi/handler) > exploit -j

Listing Running Jobs

msf6 exploit(multi/handler) > jobs -l

Last updated