Files
metasploit-gs/documentation/samples/express/nexpose_rpc.rb
T
Jonathan Cran 9f73b7f28c 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
2010-11-30 21:49:27 +00:00

32 lines
917 B
Ruby
Executable File

#!/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!"