nexpose 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nexpose.rb +2 -160
- metadata +5 -5
data/lib/nexpose.rb
CHANGED
@@ -193,7 +193,7 @@ class APIRequest
|
|
193
193
|
end
|
194
194
|
|
195
195
|
if ! (@success or @error)
|
196
|
-
@error = "NeXpose service returned an unrecognized response: #{
|
196
|
+
@error = "NeXpose service returned an unrecognized response: #{@raw_response_data.inspect}"
|
197
197
|
end
|
198
198
|
|
199
199
|
@sid
|
@@ -469,7 +469,7 @@ module NexposeAPI
|
|
469
469
|
# TODO: Needs to be expanded to included details
|
470
470
|
#-----------------------------------------------------------------------
|
471
471
|
def site_scan_history(site_id)
|
472
|
-
r
|
472
|
+
r = execute(make_xml('SiteScanHistoryRequest', {'site-id' => site_id.to_s}))
|
473
473
|
|
474
474
|
if (r.success)
|
475
475
|
res = []
|
@@ -2512,163 +2512,5 @@ def self.printXML(object)
|
|
2512
2512
|
puts "response is " + object.response_xml.to_s
|
2513
2513
|
end
|
2514
2514
|
|
2515
|
-
|
2516
|
-
|
2517
|
-
def self.testa(ip, port, user, passwd)
|
2518
|
-
nsc = Connection.new(ip, user, passwd, port)
|
2519
|
-
|
2520
|
-
nsc.login
|
2521
|
-
site_listing = SiteListing.new(nsc)
|
2522
|
-
|
2523
|
-
site_listing.sites.each do |site|
|
2524
|
-
puts "name is #{site.site_name}"
|
2525
|
-
puts "id is #{site.id}"
|
2526
|
-
end
|
2527
|
-
|
2528
|
-
=begin
|
2529
|
-
## Site Delete ##
|
2530
|
-
nsc.login
|
2531
|
-
status = deleteSite(nsc, '244', true)
|
2532
|
-
puts "status: #{status}"
|
2533
|
-
=end
|
2534
|
-
=begin
|
2535
|
-
nsc.login
|
2536
|
-
|
2537
|
-
site = Site.new(nsc)
|
2538
|
-
site.setSiteConfig("New Site 3", "New Site Description")
|
2539
|
-
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
2540
|
-
status = site.saveSite()
|
2541
|
-
report_config = ReportConfig.new(nsc)
|
2542
|
-
report_config.set_template_id("raw-xml")
|
2543
|
-
report_config.set_format("xml")
|
2544
|
-
report_config.addFilter("SiteFilter",site.site_id)
|
2545
|
-
report_config.set_generate_after_scan(1)
|
2546
|
-
report_config.set_storeOnServer(1)
|
2547
|
-
report_config.saveReport()
|
2548
|
-
puts report_config.config_id.to_s
|
2549
|
-
|
2550
|
-
site.scanSite()
|
2551
|
-
|
2552
|
-
nsc.logout
|
2553
|
-
=end
|
2554
|
-
|
2555
|
-
=begin
|
2556
|
-
nsc.login
|
2557
|
-
site = Site.new(nsc)
|
2558
|
-
site.setSiteConfig("New Site 3", "New Site Description")
|
2559
|
-
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
2560
|
-
status = site.saveSite()
|
2561
|
-
|
2562
|
-
report_config = ReportConfig.new(nsc)
|
2563
|
-
report_config.set_template_id("audit-report")
|
2564
|
-
report_config.set_format("pdf")
|
2565
|
-
report_config.addFilter("SiteFilter",site.site_id)
|
2566
|
-
report_config.set_email_As("file")
|
2567
|
-
report_config.set_smtp_relay_server("")
|
2568
|
-
report_config.set_sender("nexpose@rapid7.com")
|
2569
|
-
report_config.addEmailRecipient("jabra@rapid7.com")
|
2570
|
-
report_config.set_generate_after_scan(1)
|
2571
|
-
report_config.saveReport()
|
2572
|
-
|
2573
|
-
site.scanSite()
|
2574
|
-
=end
|
2575
|
-
|
2576
|
-
nsc.logout
|
2577
|
-
|
2578
|
-
=begin
|
2579
|
-
vuln_listing = VulnerabilityListing.new(nsc)
|
2580
|
-
vuln_listing.vulnerability_summaries.each do |v|
|
2581
|
-
puts "vuln id #{v.id}"
|
2582
|
-
exit
|
2583
|
-
end
|
2584
|
-
n.logout
|
2585
|
-
=end
|
2586
|
-
|
2587
|
-
|
2588
|
-
=begin
|
2589
|
-
nsc.login
|
2590
|
-
vuln_id = 'generic-icmp-timestamp'
|
2591
|
-
vuln = VulnerabilityDetail.new(n,vuln_id.to_s)
|
2592
|
-
puts "#{vuln.id}"
|
2593
|
-
puts "#{vuln.title}"
|
2594
|
-
puts "#{vuln.pciSeverity}"
|
2595
|
-
puts "#{vuln.cvssScore}"
|
2596
|
-
puts "#{vuln.cvssVector}"
|
2597
|
-
puts "#{vuln.description}"
|
2598
|
-
vuln.references.each do |r|
|
2599
|
-
puts "source: #{r.source}"
|
2600
|
-
puts "reference: #{r.reference}"
|
2601
|
-
end
|
2602
|
-
puts "#{vuln.solution}"
|
2603
|
-
=end
|
2604
|
-
|
2605
|
-
=begin
|
2606
|
-
site = Site.new(n)
|
2607
|
-
site.setSiteConfig("New Site Name", "New Site Description")
|
2608
|
-
site.site_config.addHost(IPRange.new("10.1.90.86"))
|
2609
|
-
#site.site_config.addHost(HostName.new("localhost"))
|
2610
|
-
#site.site_config.addHost(IPRange.new("192.168.7.1","192.168.7.20"))
|
2611
|
-
#site.site_config.addHost(IPRange.new("10.1.90.130"))
|
2612
|
-
status = site.saveSite()
|
2613
|
-
|
2614
|
-
puts "#{site.site_id}"
|
2615
|
-
site.scanSite
|
2616
|
-
nsc.logout
|
2617
|
-
=end
|
2618
|
-
|
2619
|
-
=begin
|
2620
|
-
site = Site.new(nsc,'263')
|
2621
|
-
|
2622
|
-
site.printSite()
|
2623
|
-
site.getSiteXML()
|
2624
|
-
puts "#{site.site_id}"
|
2625
|
-
puts "#{site.site_config.description}"
|
2626
|
-
puts "#{site.site_config.riskfactor}"
|
2627
|
-
nsc.logout
|
2628
|
-
=end
|
2629
|
-
|
2630
|
-
#site.scanSite()
|
2631
|
-
=begin
|
2632
|
-
site_config = SiteConfig.new()
|
2633
|
-
|
2634
|
-
|
2635
|
-
my_site = site_config.getSiteConfig(n, '244')
|
2636
|
-
|
2637
|
-
history = SiteScanHistory.new(n, '244')
|
2638
|
-
|
2639
|
-
devices = SiteDeviceListing.new(n, '244')
|
2640
|
-
=end
|
2641
|
-
|
2642
|
-
=begin
|
2643
|
-
site_listing = SiteListing.new(n)
|
2644
|
-
|
2645
|
-
site_listing.sites.each do |site|
|
2646
|
-
puts "name is #{site.site_name}"
|
2647
|
-
end
|
2648
|
-
=end
|
2649
|
-
|
2650
|
-
end
|
2651
|
-
|
2652
|
-
=begin
|
2653
|
-
def self.test(url,user,pass)
|
2654
|
-
xml = "<?xml version='1.0' encoding='UTF-8'?>
|
2655
|
-
<!DOCTYPE LoginRequest [
|
2656
|
-
<!ELEMENT LoginRequest EMPTY>
|
2657
|
-
<!ATTLIST LoginRequest sync-id CDATA '0'>
|
2658
|
-
<!ATTLIST LoginRequest user-id CDATA 'user'>
|
2659
|
-
<!ATTLIST LoginRequest password CDATA 'pass'>
|
2660
|
-
]>
|
2661
|
-
<LoginRequest sync-id='0' password='#{pass}' user-id='#{user}'/>"
|
2662
|
-
|
2663
|
-
r = APIRequest.new(xml, url)
|
2664
|
-
r.execute
|
2665
|
-
puts r.response_xml
|
2666
|
-
end
|
2667
|
-
|
2668
|
-
# Run the program
|
2669
|
-
# Logon, get a session-id, list the sites, then logout.
|
2670
|
-
test("http://x.x.x.x:3780", 'nxadmin', 'PASSWORD')
|
2671
|
-
=end
|
2672
|
-
|
2673
2515
|
end
|
2674
2516
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexpose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- HD Moore
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-06-06 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: 0.0.32
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
|
-
description: This gem provides a Ruby API to the NeXpose vulnerability management product by Rapid7. This version is based on Metasploit SVN revision
|
38
|
+
description: This gem provides a Ruby API to the NeXpose vulnerability management product by Rapid7. This version is based on Metasploit SVN revision 12878
|
39
39
|
email:
|
40
40
|
- hdm@metasploit.com
|
41
41
|
- chris.lee@rapid7.com
|