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 +4 -4
- data/exe/nsc +26 -8
- data/lib/nexpose-security-console/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3dece4aaf7539ef6e8d5893ecfd76964c8d42d
|
4
|
+
data.tar.gz: 6dd239456f28c663e15a71dff87f4f6d926acfea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|