nexposecli 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be9b6f684b98cae117aac8175e12d9d02b9ed15d
4
- data.tar.gz: dbddae5be4eb50490d9a8c30cd89b5443c4f714b
3
+ metadata.gz: ad30c161fe18e33d006805ab2fd8b867193c66c0
4
+ data.tar.gz: 83dbf41047f73649c8691f40f466c88d5afeddc8
5
5
  SHA512:
6
- metadata.gz: 0914c383059ce8761118e926fe35aba88341bb5a771a3d8eb041a8a6692a326efd59fbdd6b678353623e3f3bf2f36237e5add34f068944cade5984a6a8a1b055
7
- data.tar.gz: ad4de24aa058f00344fc674190b02372782824829ee46700e4f5ed21375dfe4ddc6db637a0971f40bcfe6beadea2f5053b8149d7ef55fd4fcabed8356d15cab4
6
+ metadata.gz: 19090599907ccf39f21852f5195eb19558b6c455739267ac30e703b961fe83fa893dd9b6f0b97c5f014caacf4703dd591778ddf436ede6513c973495386fd068
7
+ data.tar.gz: 85a62596f894dc4687100e2fd038842564c6e9fd039868e5de9dea264f8032e184fd96eddc5d2d887fed90e9c49d4f04a1ca019424b848588a2e50341fa3adc6
data/bin/nexposecli CHANGED
@@ -35,6 +35,7 @@ require 'pp'
35
35
 
36
36
  ##############################################################################
37
37
  # Set default var values
38
+ $nopasswd = false
38
39
  $nxport = 3780
39
40
  $debug = false
40
41
  $filteradd = false
@@ -51,6 +52,7 @@ uf_scanners = ''
51
52
  @logfile = "nexposecli" + Time.now.strftime("%Y%m") + ".log"
52
53
  @evm_reqid = SecureRandom.hex
53
54
  @nsc_server = "<server>"
55
+ @nsc_port = "<port>"
54
56
  @nsc_user = "<user>"
55
57
  @nsc_passwd = "<pass>"
56
58
  @nsc_sites = Hash.new
@@ -108,8 +110,16 @@ def read_config(conf)
108
110
  config = YAML.load_file(conf)
109
111
 
110
112
  @nsc_server = config["config"]["server"]
113
+ @nsc_port = config["config"]["port"]
114
+ if @nsc_port.nil?
115
+ @nsc_port = $nxport
116
+ end
111
117
  @nsc_user = config["config"]["user"]
112
118
  @nsc_passwd = config["config"]["password"]
119
+ if @nsc_passwd.nil?
120
+ puts "A console password was not provided via config file.\nWhat password shall I use?"
121
+ @nsc_passwd = STDIN.noecho(&:gets).chomp
122
+ end
113
123
  @nsc_sites = config["sites"]
114
124
  if config["config"].key?("ldapserver")
115
125
  @ldapserver = config["config"]["ldapserver"]
@@ -329,8 +339,9 @@ uputs("CLI", "Checking for the requested action")
329
339
  @action |= 128 if args.copy
330
340
  @action |= 256 if args.download
331
341
  @action |= 512 if args.status
342
+ @action |= 1024 if args.exception
332
343
  uputs("ACTION", "The requested action value is: #{@action.to_s}")
333
- raise "You can only submit one action per task, see --help (action submitted: #{@action.to_s})" unless [1,2,4,8,16,32,64,128,256,512].include?(@action)
344
+ raise "You can only submit one action per task, see --help (action submitted: #{@action.to_s})" unless [1,2,4,8,16,32,64,128,256,512,1024].include?(@action)
334
345
 
335
346
  uputs("TARGET", "Checking for the requested target")
336
347
  @target = 0
@@ -379,9 +390,9 @@ end
379
390
  uputs("CONNECT", "Attempting connection to NSC: #{@nsc_server.to_s} with user: #{@nsc_user.to_s}")
380
391
  begin
381
392
  if $multitenant
382
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, $nxport, args.silo.to_s)
393
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s, args.silo.to_s)
383
394
  else
384
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s)
395
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s)
385
396
  end
386
397
  rescue SystemCallError => e
387
398
  # EJG add conditional api error handling...
@@ -797,9 +808,9 @@ when 8 # TARGET SCAN
797
808
  uputs("CONNECT", "Attempting connection to NSC: #{@nsc_server.to_s} with user: #{@nsc_user.to_s}")
798
809
  begin
799
810
  if $multitenant
800
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, $nxport, args.silo.to_s)
811
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s, args.silo.to_s)
801
812
  else
802
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s)
813
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s)
803
814
  end
804
815
  @nsc.login
805
816
  rescue SystemCallError => e
@@ -887,9 +898,9 @@ when 8 # TARGET SCAN
887
898
  uputs("CONNECT", "Attempting connection to NSC: #{@nsc_server.to_s} with user: #{@nsc_user.to_s}")
888
899
  begin
889
900
  if $multitenant
890
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, $nxport, args.silo.to_s)
901
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s, args.silo.to_s)
891
902
  else
892
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s)
903
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s)
893
904
  end
894
905
  @nsc.login
895
906
  rescue SystemCallError => e
@@ -991,9 +1002,9 @@ when 8 # TARGET SCAN
991
1002
  uputs("CONNECT", "Attempting connection to NSC: #{@nsc_server.to_s} with user: #{@nsc_user.to_s}")
992
1003
  begin
993
1004
  if $multitenant
994
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, $nxport, args.silo.to_s)
1005
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s, args.silo.to_s)
995
1006
  else
996
- @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s)
1007
+ @nsc = Nexpose::Connection.new( @nsc_server.to_s, @nsc_user.to_s, @nsc_passwd.to_s, @nsc_port.to_s)
997
1008
  end
998
1009
  @nsc.login
999
1010
  rescue SystemCallError => e
@@ -36,6 +36,10 @@ module Nexposecli
36
36
  short : c
37
37
  desc : The create action is used for new objects
38
38
 
39
+ - name : exception
40
+ short : x
41
+ desc : The exception action is used for vuln objects
42
+
39
43
  - name : copy
40
44
  desc : The copy action is used to copy of objects of the same type
41
45
 
@@ -1,3 +1,3 @@
1
1
  module Nexposecli
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexposecli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Gomez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-29 00:00:00.000000000 Z
12
+ date: 2017-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nexpose