Metasploit mailing list archives

question about run_exploit_using_base.rb


From: mtaba1979 at gmail.com (M.Tabatabai)
Date: Tue, 8 Jul 2008 12:53:01 +0200

Hi all,
I wanted to test the above mentioned script which is available in sample
Folder: /documentation/samples/framework

<code>
        if (session)
                output.print_status("Session #{session.sid} created,
interacting...")
                output.print_line

                session.init_ui(input, output)

                session.interact
        else
                output.print_line("Exploit completed, no session was created.")
        end
</code>

First I noticed that INTERACT method is not working, after checking
the documentation and replacing
the INTERACT method with _INTERACT method it worked and I can run it
and having my meterpreter shell.
(in my case I was testing with meterpreter payload)

The problem is that after running each command I lose my session. No
matter which command.
After running commands in meterpreter my session would break and I
need to rerun the script.
I have to mention that if I launch the exploit and payload directly
from msfconsole I have
No problem on the same test target.
What am I doing wrong? how can I have a permanent session till I run
exit command?
Thank you guys in advance!


Regards,
mt



Current thread: