diff --git a/documentation/samples/express/discover_rpc.rb b/documentation/samples/express/discover_rpc.rb index 6c0164a612..ab720d1623 100755 --- a/documentation/samples/express/discover_rpc.rb +++ b/documentation/samples/express/discover_rpc.rb @@ -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" diff --git a/documentation/samples/express/nexpose_rpc.rb b/documentation/samples/express/nexpose_rpc.rb new file mode 100755 index 0000000000..3c30d8fa5b --- /dev/null +++ b/documentation/samples/express/nexpose_rpc.rb @@ -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!"