Remove old test cases
git-svn-id: file:///home/svn/framework3/trunk@12699 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
f80c66ee8f
commit
046e65fbce
|
@ -2512,163 +2512,5 @@ def self.printXML(object)
|
|||
puts "response is " + object.response_xml.to_s
|
||||
end
|
||||
|
||||
|
||||
|
||||
def self.testa(ip, port, user, passwd)
|
||||
nsc = Connection.new(ip, user, passwd, port)
|
||||
|
||||
nsc.login
|
||||
site_listing = SiteListing.new(nsc)
|
||||
|
||||
site_listing.sites.each do |site|
|
||||
puts "name is #{site.site_name}"
|
||||
puts "id is #{site.id}"
|
||||
end
|
||||
|
||||
=begin
|
||||
## Site Delete ##
|
||||
nsc.login
|
||||
status = deleteSite(nsc, '244', true)
|
||||
puts "status: #{status}"
|
||||
=end
|
||||
=begin
|
||||
nsc.login
|
||||
|
||||
site = Site.new(nsc)
|
||||
site.setSiteConfig("New Site 3", "New Site Description")
|
||||
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
||||
status = site.saveSite()
|
||||
report_config = ReportConfig.new(nsc)
|
||||
report_config.set_template_id("raw-xml")
|
||||
report_config.set_format("xml")
|
||||
report_config.addFilter("SiteFilter",site.site_id)
|
||||
report_config.set_generate_after_scan(1)
|
||||
report_config.set_storeOnServer(1)
|
||||
report_config.saveReport()
|
||||
puts report_config.config_id.to_s
|
||||
|
||||
site.scanSite()
|
||||
|
||||
nsc.logout
|
||||
=end
|
||||
|
||||
=begin
|
||||
nsc.login
|
||||
site = Site.new(nsc)
|
||||
site.setSiteConfig("New Site 3", "New Site Description")
|
||||
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
||||
status = site.saveSite()
|
||||
|
||||
report_config = ReportConfig.new(nsc)
|
||||
report_config.set_template_id("audit-report")
|
||||
report_config.set_format("pdf")
|
||||
report_config.addFilter("SiteFilter",site.site_id)
|
||||
report_config.set_email_As("file")
|
||||
report_config.set_smtp_relay_server("")
|
||||
report_config.set_sender("nexpose@rapid7.com")
|
||||
report_config.addEmailRecipient("jabra@rapid7.com")
|
||||
report_config.set_generate_after_scan(1)
|
||||
report_config.saveReport()
|
||||
|
||||
site.scanSite()
|
||||
=end
|
||||
|
||||
nsc.logout
|
||||
|
||||
=begin
|
||||
vuln_listing = VulnerabilityListing.new(nsc)
|
||||
vuln_listing.vulnerability_summaries.each do |v|
|
||||
puts "vuln id #{v.id}"
|
||||
exit
|
||||
end
|
||||
n.logout
|
||||
=end
|
||||
|
||||
|
||||
=begin
|
||||
nsc.login
|
||||
vuln_id = 'generic-icmp-timestamp'
|
||||
vuln = VulnerabilityDetail.new(n,vuln_id.to_s)
|
||||
puts "#{vuln.id}"
|
||||
puts "#{vuln.title}"
|
||||
puts "#{vuln.pciSeverity}"
|
||||
puts "#{vuln.cvssScore}"
|
||||
puts "#{vuln.cvssVector}"
|
||||
puts "#{vuln.description}"
|
||||
vuln.references.each do |r|
|
||||
puts "source: #{r.source}"
|
||||
puts "reference: #{r.reference}"
|
||||
end
|
||||
puts "#{vuln.solution}"
|
||||
=end
|
||||
|
||||
=begin
|
||||
site = Site.new(n)
|
||||
site.setSiteConfig("New Site Name", "New Site Description")
|
||||
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
||||
#site.site_config.addHost(HostName.new("localhost"))
|
||||
#site.site_config.addHost(IPRange.new("192.168.7.1","192.168.7.20"))
|
||||
#site.site_config.addHost(IPRange.new("10.1.90.130"))
|
||||
status = site.saveSite()
|
||||
|
||||
puts "#{site.site_id}"
|
||||
site.scanSite
|
||||
nsc.logout
|
||||
=end
|
||||
|
||||
=begin
|
||||
site = Site.new(nsc,'263')
|
||||
|
||||
site.printSite()
|
||||
site.getSiteXML()
|
||||
puts "#{site.site_id}"
|
||||
puts "#{site.site_config.description}"
|
||||
puts "#{site.site_config.riskfactor}"
|
||||
nsc.logout
|
||||
=end
|
||||
|
||||
#site.scanSite()
|
||||
=begin
|
||||
site_config = SiteConfig.new()
|
||||
|
||||
|
||||
my_site = site_config.getSiteConfig(n, '244')
|
||||
|
||||
history = SiteScanHistory.new(n, '244')
|
||||
|
||||
devices = SiteDeviceListing.new(n, '244')
|
||||
=end
|
||||
|
||||
=begin
|
||||
site_listing = SiteListing.new(n)
|
||||
|
||||
site_listing.sites.each do |site|
|
||||
puts "name is #{site.site_name}"
|
||||
end
|
||||
=end
|
||||
|
||||
end
|
||||
|
||||
=begin
|
||||
def self.test(url,user,pass)
|
||||
xml = "<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE LoginRequest [
|
||||
<!ELEMENT LoginRequest EMPTY>
|
||||
<!ATTLIST LoginRequest sync-id CDATA '0'>
|
||||
<!ATTLIST LoginRequest user-id CDATA 'user'>
|
||||
<!ATTLIST LoginRequest password CDATA 'pass'>
|
||||
]>
|
||||
<LoginRequest sync-id='0' password='#{pass}' user-id='#{user}'/>"
|
||||
|
||||
r = APIRequest.new(xml, url)
|
||||
r.execute
|
||||
puts r.response_xml
|
||||
end
|
||||
|
||||
# Run the program
|
||||
# Logon, get a session-id, list the sites, then logout.
|
||||
test("http://x.x.x.x:3780", 'nxadmin', 'PASSWORD')
|
||||
=end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue