Metasploit mailing list archives

how to quit a shell gracefully?


From: lkiiski at niksula.hut.fi (Lauri Kiiski)
Date: Tue, 12 May 2009 13:22:45 +0300

Jun Koi wrote:
hi,

i am still learning how to use metasploit, so sorry for the stupid
question here.

i can exploit a remote Windows box, and now open a reverse shell
(CMD.exe). however, i dont know how to quit the shell without crashing
the remote process.

i tried "exit" command, but then metasploit seems to hang.
then i tried "Ctrl+C", and asked to abort the session. then the remote
process crashed.

i am sure there is a better way to do this without crashing the
target. please anybody help?

my case:
- remote machine: Windows XP
- metasploit runs on Linux
- payload: windows/shell/reverse_nonx_tcp

Ctrl+Z backgrounds the session. Then you can use sessions -l to list and 
session -i number to return to the session.


Current thread: