ssh_scan 0.0.9.beta.3 → 0.0.9

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: 7dda36f80759ba5493f757b329c60362b80a583a
4
- data.tar.gz: 29dcc9160d3d3516fdaf355d1b380faa1a6837a7
3
+ metadata.gz: 6ab6ade0f667010fdd604bbf4e0a166319c0e332
4
+ data.tar.gz: a2d102a46eca3c35ae5e9eda0c2d714b5cce415b
5
5
  SHA512:
6
- metadata.gz: 24bad1d5846a9fd9833596cdfa15091f7f62e62221800148023e3e9fc148321e93eab281c6f29748d6b6c46df517dfaeaf97a50b93ddca5ef9818b4745be38e4
7
- data.tar.gz: 7b76d9fd8170ba253a9e7b5547220e0ff28bf779d610f37c0dbc0736b68960efb5dcb6690d0e32d1d39845e54974dae5cdb54a2389a225db3567dd6c34532420
6
+ metadata.gz: 509adb5236bcb0aea6489a266d0c3ef1f9312d6c4b7860156c6174614014288441d73209110fe7ccc8cee6dc26bb1001e0585e1b1340026a8af8ec84e926b659
7
+ data.tar.gz: 3d327bf76e6c9f9211f506bee4ab52cfd28fd0b4560f37578a5bc9d6fea81bda475ac3c3edb3e45c5a2b7c59ce082b58853233399a0a9720074ebf9ece8287b4
data/.travis.yml CHANGED
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
- rvm:
3
- - 2.3.0
4
- - 2.2.0
5
- - 2.1.3
6
- - 2.1.0
7
- - 2.0.0
8
- - ruby-head
2
+ matrix:
3
+ include:
4
+ - rvm: ruby-head
5
+ - rvm: 2.3.0
6
+ - rvm: 2.3.0
7
+ services:
8
+ - docker
9
+ script:
10
+ - docker build -t mozilla/ssh_scan .
11
+ - rvm: 2.2.0
12
+ - rvm: 2.1.3
13
+ - rvm: 2.0.0
data/README.md CHANGED
@@ -50,12 +50,14 @@ bundle install
50
50
 
51
51
  Run `ssh_scan -h` to get this
52
52
 
53
- ssh_scan v0.0.8 (https://github.com/mozilla/ssh_scan)
53
+ ssh_scan v0.0.9 (https://github.com/mozilla/ssh_scan)
54
54
 
55
55
  Usage: ssh_scan [options]
56
- -t, --target [IP/Hostname] IP/Hostname (IPv4/IPv6/FQDNs)
56
+ -t, --target [IP/Range/Hostname] IP/Ranges/Hostname to scan
57
+ -f, --file [FilePath] File Path of the file containing IP/Range/Hostnames to scan
58
+ -o, --output [FilePath] File to write JSON output to
57
59
  -p, --port [PORT] Port (Default: 22)
58
- -P, --policy [FILE] Policy file (Default: Mozilla Modern)
60
+ -P, --policy [FILE] Custom policy file (Default: Mozilla Modern)
59
61
  -u, --unit-test [FILE] Throw appropriate exit codes based on compliance status
60
62
  -v, --version Display just version info
61
63
  -h, --help Show this message
@@ -65,6 +67,8 @@ Run `ssh_scan -h` to get this
65
67
  ssh_scan -t 192.168.1.1
66
68
  ssh_scan -t server.example.com
67
69
  ssh_scan -t ::1
70
+ ssh_scan -f hosts.txt
71
+ ssh_scan -o output.json
68
72
  ssh_scan -t 192.168.1.1 -p 22222
69
73
  ssh_scan -t 192.168.1.1 -P custom_policy.yml
70
74
  ssh_scan -t 192.168.1.1 --unit-test -P custom_policy.yml
data/bin/ssh_scan CHANGED
@@ -18,8 +18,8 @@ opt_parser = OptionParser.new do |opts|
18
18
  opts.banner = "ssh_scan v#{SSHScan::VERSION} (https://github.com/mozilla/ssh_scan)\n\n" +
19
19
  "Usage: ssh_scan [options]"
20
20
 
21
- opts.on("-t", "--target [IP/Hostname]", Array,
22
- "IP/Hostname (IPv4/IPv6/FQDNs)") do |ips|
21
+ opts.on("-t", "--target [IP/Range/Hostname]", Array,
22
+ "IP/Ranges/Hostname to scan") do |ips|
23
23
  ips.each do |ip|
24
24
  if ip.fqdn?
25
25
  options[:targets] += [ip]
@@ -30,13 +30,18 @@ opt_parser = OptionParser.new do |opts|
30
30
  end
31
31
 
32
32
  opts.on("-f", "--file [FilePath]",
33
- "File Path of the file containing IPs") do |file|
34
- txt = open(file)
35
- options[:targets] = txt.read.chomp.split(',')
33
+ "File Path of the file containing IP/Range/Hostnames to scan") do |file|
34
+ unless File.exists?(file)
35
+ puts "\nReason: input file supplied is not a file"
36
+ exit
37
+ end
38
+ File.open(file).each do |line|
39
+ options[:targets] += line.chomp.split(',')
40
+ end
36
41
  end
37
42
 
38
- opts.on("-o", "--outputFile [FilePath]",
39
- "Writing JSON documents to disk") do |file|
43
+ opts.on("-o", "--output [FilePath]",
44
+ "File to write JSON output to") do |file|
40
45
  $stdout.reopen(file, "w")
41
46
  end
42
47
 
@@ -46,7 +51,7 @@ opt_parser = OptionParser.new do |opts|
46
51
  end
47
52
 
48
53
  opts.on("-P", "--policy [FILE]",
49
- "Policy file (Default: Mozilla Modern)") do |policy|
54
+ "Custom policy file (Default: Mozilla Modern)") do |policy|
50
55
  options[:policy] = policy
51
56
  end
52
57
 
@@ -67,8 +72,8 @@ opt_parser = OptionParser.new do |opts|
67
72
  puts "\n ssh_scan -t 192.168.1.1"
68
73
  puts " ssh_scan -t server.example.com"
69
74
  puts " ssh_scan -t ::1"
70
- puts " ssh_scan -f filePath"
71
- puts " ssh_scan -o filePath"
75
+ puts " ssh_scan -f hosts.txt"
76
+ puts " ssh_scan -o output.json"
72
77
  puts " ssh_scan -t 192.168.1.1 -p 22222"
73
78
  puts " ssh_scan -t 192.168.1.1 -P custom_policy.yml"
74
79
  puts " ssh_scan -t 192.168.1.1 --unit-test -P custom_policy.yml"
@@ -1,3 +1,3 @@
1
1
  module SSHScan
2
- VERSION = '0.0.9.beta.3'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssh_scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.beta.3
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Claudius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -164,9 +164,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">"
167
+ - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 1.3.1
169
+ version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
172
  rubygems_version: 2.6.2