Manage metasploit listeners with Tmux

In order to have listeners always ready on the C&C and have access easily through SSH we will use Tmux.
Tmux is a powerful alternative to the Screen command, included in multiple Linux distributions like Kali.

– Detachable from the console.
– Always up.
– Logging all the connection.

Create a script called

As you can see here we create a new detached session, then we check if there is another active session, if there is no we create another loggin file.

Finally execute this script to add the script to the Cron job scheduler

If for any reason it dies, the Cron job will trigger another one automatically and another logging file.

Just with we don’t need to worry about it, as it will always be a listener active.


Listing all the Tmux sessions:

Attaching to a session (“windows” is how we named the session before):

Detach from the session:

Leave a Reply

Your email address will not be published. Required fields are marked *