nexpose-security-console 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 181c4068218db8ee7e68b19859ce77dfbfd30012
4
- data.tar.gz: 5244169f444338a5efc07b84a8f3326c57120126
3
+ metadata.gz: de3dece4aaf7539ef6e8d5893ecfd76964c8d42d
4
+ data.tar.gz: 6dd239456f28c663e15a71dff87f4f6d926acfea
5
5
  SHA512:
6
- metadata.gz: b56359f3a851fc9f6d29e2a0c4b6fc7e2adb15bdedfde01074fc3434448501fc3226913f581f4cf08b7fc4fbf402ca8127b8fd326b150dfc1f329a1e7f93f493
7
- data.tar.gz: 9bd932bb4910c3110380ae5a7534513dbf587e887c852bacd1811e886a210b4a43b13863bb7572e453ff2edb1522adafdf47f6ec606a5fc2a04f0ccdde4317b7
6
+ metadata.gz: 1a201a462e102f62da9ab57b197a54f2df7b7e16e2e46ef1ecbef4ccc563ee767e8db65f2d1d7fda5e2c9480732853f9396b00b6153535b4ff83018ded86004e
7
+ data.tar.gz: 20e49ac6019a219f4e13c5d0c0e9922809660b1b2fec1d2dc0583e2bde3141b73f079cdf5f8bceed2873f0588c300530d6a92d0361f1aa8ea45a06f3a51745eb
data/exe/nsc CHANGED
@@ -45,7 +45,7 @@ command [:connect, :login] do |c|
45
45
  server = options[:server]
46
46
  port = options[:port]
47
47
 
48
- nsc = NexposeSecurityConsole.connection
48
+ nsc = NexposeSecurityConsole.connection()
49
49
  puts "Success" if nsc.login
50
50
  nsc.logout
51
51
  end
@@ -61,20 +61,37 @@ end
61
61
  # end
62
62
  # c.default_command :list
63
63
  # end
64
+ #
65
+ #
66
+
67
+
68
+ # TODO
69
+ # IDEA
70
+ # It will be nice
71
+ # Nexpose can lazy load the filtered assets
64
72
 
65
73
  desc 'Bulk delete assets with unknown OS'
66
74
  command :bulk_delete do |c|
67
75
  c.action do |global_options, options, args|
76
+ puts 'Logging in ...'
68
77
  nsc = NexposeSecurityConsole.login
69
78
  nsc.login
79
+ puts 'I am in'
70
80
  puts 'Retrieving all assets with unknown OS'
71
- puts 'This may take a while. Be patient ...'
72
-
73
- dag = nsc.asset_groups.find {|group| group.name == 'Unknown OS' }
74
- group = Nexpose::AssetGroup.load(nsc, dag.id)
75
- total = group.assets.count
81
+ puts 'This may take a while. Get some coffee. Be patient ...'
82
+
83
+ # dag = nsc.asset_groups.find {|group| group.name == 'Unknown OS' }
84
+ # group = Nexpose::AssetGroup.load(nsc, dag.id)
85
+ # total = group.assets.count
86
+ # bar = ProgressBar.new(total, :counter, :percentage, :eta)
87
+ # group.assets.each_with_index do |a,i|
88
+ # nsc.delete_asset(a.id)
89
+ # bar.increment!
90
+ # end
91
+ assets = nsc.filter( Nexpose::Search::Field::OS, Nexpose::Search::Operator::IS_EMPTY )
92
+ total = assets.count
76
93
  bar = ProgressBar.new(total, :counter, :percentage, :eta)
77
- group.assets.each_with_index do |a,i|
94
+ assets.each_with_index do |a,i|
78
95
  nsc.delete_asset(a.id)
79
96
  bar.increment!
80
97
  end
@@ -89,7 +106,7 @@ long_desc <<-DESC
89
106
  I used it to delete 100_000 assets in less than 30 minutes
90
107
  compared to the days required when using the normal Nexpose API.
91
108
 
92
- NOTE: This command is very dependent on the web interface
109
+ NOTE: This command is very dependent on the web interface .
93
110
  It may break after Nexpose GUI changes.
94
111
 
95
112
  DESC
@@ -124,6 +141,7 @@ command :web_delete do |c|
124
141
  exit(-1)
125
142
  end
126
143
  end
144
+ puts page.title
127
145
  within "#groupSynopsisTable" do
128
146
  click_link( asset_group_name)
129
147
  puts page.title
@@ -1,3 +1,3 @@
1
1
  module NexposeSecurityConsole
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose-security-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kyony