0

I want to execute commands like screenshot on a regular interval (e.g. each 5min) for each incoming connection to Meterpreter using the reverse_tcp payload until the connection gets closed by the Windows clients.

Is there any straightforward way to realize dynamic handling of incoming connections?

muffel
  • 103
  • 2
  • I am not sure if the meterpreter is being notified by DBUS, but if yes you can use DBUS to execute the command or write your own daemon to sit in the background and check periodically check and execute the command. – mrSotirow May 05 '21 at 18:36

1 Answers1

1

Metasploit scripting supports Ruby, so you could build your workflow around something like...

<ruby>
while true
  run_single("screenshot")  
  run_single("sleep 300s") 
end
</ruby>
Esa Jokinen
  • 16,100
  • 5
  • 50
  • 55