added a nexpose rpc sample & update the discover sample for 3.5.0

git-svn-id: file:///home/svn/framework3/trunk@11181 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Jonathan Cran 2010-11-30 21:49:27 +00:00
parent 26a9fe6fc7
commit 9f73b7f28c
2 changed files with 41 additions and 6 deletions

View File

@ -1,16 +1,19 @@
#!/usr/bin/env ruby
require '/opt/metasploit-3.4.1/apps/pro/engine/lib/pro/client'
## Note, you may need to change this, depending on the install path of your
## metasploit instance
require '/opt/metasploit-3.5.0/apps/pro/engine/lib/pro/client'
pro = Pro::Client.new() ## this will connect to the rpc service running on localhost:50505
pro.call('db.add_workspace', "hackmiami") ## create a workspace
pro.call('db.set_workspace', "hackmiami") ## set that workspace
pro.call('db.add_workspace', "default") ## create a workspace
pro.call('db.set_workspace', "default") ## set that workspace
conf = {
'workspace' => "hackmiami",
'workspace' => "default",
'username' => "rpc",
"ips" => ['10.0.0.0/24'],
"ips" => ['10.0.0.0/24'],
'DS_BLACKLIST_HOSTS' => "10.0.0.1 10.0.0.2",
'DS_PORTSCAN_SPEED' => "3",
'DS_PORTS_EXTRA' => "",
@ -24,7 +27,8 @@ conf = {
'DS_SMBDomain' => "",
'DS_DRY_RUN' => "false",
'DS_SINGLE_SCAN' => "false",
'DS_FAST_DETECT' => "false"
'DS_FAST_DETECT' => "false",
'DS_CustomNmap' => "--reason"
}
puts "starting discover task"

View File

@ -0,0 +1,31 @@
#!/usr/bin/env ruby
require '/opt/metasploit-3.5.0/apps/pro/engine/lib/pro/client'
pro = Pro::Client.new() ## this will connect to the rpc service running on localhost:50505
pro.call('db.add_workspace', "nexpose_custom_scan") ## create a workspace
pro.call('db.set_workspace', "nexpose_custom_scan") ## set that workspace
conf = {
'workspace' => "default",
'username' => "rpc",
'DS_WHITELIST_HOSTS' => "10.0.0.1",
'DS_BLACKLIST_HOSTS' => "",
'DS_NEXPOSE_HOST' => "localhost",
'DS_NEXPOSE_PORT' => "3780",
'DS_NEXPOSE_USER' => "nxadmin" ,
'DS_SCAN_TEMPLATE' => "custom-nmap-scan-template",
'nexpose_pass' => "password",
'nexpose_credentials' => "",
'DS_NEXPOSE_PURGE_SITE' => "false"
}
puts "starting nexpose task"
ret = pro.start_nexpose(conf)
task_id = ret['task_id']
puts "started nexpose task " + task_id
pro.task_wait(ret['task_id'])
puts "done!"