Created
October 2, 2014 13:13
-
-
Save brandonprry/c13e77204d9a8389fee4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nexpose' | |
require 'msfrpc-client' | |
nx_host = 'nxhost' | |
nx_port = 3780 | |
nx_user = 'nxadmin' | |
nx_pass = 'nxpassword' | |
msf_host = 'msfprohost' | |
msf_port = 3790 | |
msf_user = 'msfadmin' | |
msf_pass = 'msfpassword' | |
p "Authentication with Nexpose..." | |
nsc = Nexpose::Connection.new(nx_host, nx_user, nx_pass, nx_port) | |
nsc.login | |
opts = { | |
:user => msf_user, | |
:pass => msf_pass, | |
:host => msf_host, | |
:port => msf_port | |
} | |
msfrpc = Msf::RPC::Client.new(opts) | |
sites = nsc.list_sites | |
current_projects = msfrpc.call('pro.workspaces') | |
sites.each do |site| | |
next if current_projects[site.name] | |
p "Adding site: " + site.name | |
opts = { | |
"name" => site.name, | |
} | |
msfrpc.call('pro.project_add', opts) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Y U NO IMPORT SITE DATA! =)