hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

Full Version: Metasploit
Partizaan
I have been toying lately with msfconsole v2.4 [77 exploits - 75 payloads
on winbox and on debian. It works fine from msf> and from webinterface.

However if i want to check multiple ip's (!!!) it take ages to set the parameters. Especialy in console.

use bla bla
set PAYLOAD win32_reverse
set RPORT 69
set LHOST me
set LPORT 141
set TARGET 123.123.123.123

always redifine target. not even paste functionality.

I am posting this in beginners section cause i have te feeling i am missing a clue here. Probably something stupid.

I tried with an shellscript to automate but nothing. Somebody told me it could be donne with pearl to automate it in a bit so u can use iplist and so.

Anybody knows a workaround or found a solution to get around this ?

Thx in advanced.
slb33
First thing I see is that set Target shouldn't be an ip.
TARGET is usually a number that tells which operating system or version of software that the exploit is targeting.

at the msf prompt type:

show options

and it will show you most of the items you need to do

RHOST is where you put the ip

I have not been able to automate it myself yet but that could be part of the problem if you are using TARGET as the ip.

btw, which exploit you trying to use this on?
May be more helpful if we could look at the one your using.
Partizaan
@slb33

in http

RHOST Required ADDR The target address
RPORT Required PORT The target port
EXITFUNC Required DATA Exit technique: "process", "thread", "seh"
LHOST Required ADDR Local address to receive connection
LPORT Required PORT Local port to receive connection

Wich is evident.
target = mistake made by me
thx for pointing out


For example u can use:

use exploitname (see show exploit)
set PAYLOAD win32_reverse
set RPORT (depends on exploit)
...
cloud9ine
I would also like any info available about automating the check() function. Even if it's a nudge in the right direction, because I can obviously write the perl code tongue.gif
Partizaan
Whell basicly i guess its easy, thats why i posted it in the beginner section

Al u need as a little shellscript u can echo commands to the bash.

msf>./script.sh

I have been staring at it for i few hours and pffff... blink.gif
RFlash
Well, I think that the right direction is to use the 'Command Line Interface' (the CLI remember me the old Amigas times rolleyes.gif rolleyes.gif )

The .pdf documentation says: 'If you are looking for a way to automate exploit testing, or simply do not want to use an interactive interface, msfcli may be the solution.', and again 'The saved environment will be loaded and used at startup, allowing you to configure convenient default options in the Global environment of msfconsole, save them, and take advantage of them in the msfcli interface.'

You should at least 1 time save (with the 'set' command) your temporary environment in the global environment (RHOST, RPORT, EXITFUNC, TARGET, LHOST, LPORT will be the defaults for that exploit).

The msfcli will be used after that with this sintax (the other parametets are taked from the global environment):
msfcli exploit RHOST=xxx.xxx.xxx.xxx E

Now I don't have any really programming knoweledges (I'm learning too, but dunno if these knoweledges are really necessary in this situation), and I think that you have differents choices:

1. after the cygwin.bat you can write a script in perl that launch the msfcli taking the differents ip as parametres from a file (or directly pasted in the script)

2. on another level you can make a script in dos (.bat ohmy.gif ohmy.gif , yes I know not elegant, but functionally too) that on every line it calls the bash interpreter with the msfcli and its parameters.


Hope that I don't have confused you to much smile.gif smile.gif these are only ideas...
RFlash
Partizaan
QUOTE
1. after the cygwin.bat you can write a script in perl that launch the msfcli taking the differents ip as parametres from a file (or directly pasted in the script)

2. on another level you can make a script in dos (.bat ohmy.gif ohmy.gif , yes I know not elegant, but functionally too) that on every line it calls the bash interpreter with the msfcli and its parameters.


Wel that is a good defenition of what i want to do. And msfcli could be handy in the process. But the question that remains ... how to get started.

thx for the info
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.