ssh_scan 0.0.17.pre → 0.0.17

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: 377880ac09b5bd925aeb32066409dd9e4c8edc7e
4
- data.tar.gz: c3b70dcfae67ffd84ddf0d028c67486bbf71256e
3
+ metadata.gz: a10a01b406a2be15ea25dbfa12ea545d7de0c0e6
4
+ data.tar.gz: 298d66db95a37923769f05632c54b1878a56abb8
5
5
  SHA512:
6
- metadata.gz: 16055032c71dda26d38356da8622cd827fd6fd5dd6409325b6f66af1d38c80dff0a80e86f0416807da6663e0d2dfe7472c2f78db178a766434517e46121d67f0
7
- data.tar.gz: 913c4870b8768f85c7ada637c76060ddc045dc64e53ef1dc8d52d717a3743b52b93793d518b55b8f55056b9eafc8501443d6514cf6c63567f9c850a4a12a348d
6
+ metadata.gz: 524e92a2fdce37132604360047d13bcec2d014cb45bf96b5807e27366b70966382a9f38067063edd39bd1300c44e7fa0364a9b50d72b97a692886120bf6cd261
7
+ data.tar.gz: d3995af1afc70d679b62b2de3d6bb7f05ef3b9e4712bf4304cdfc49d1b234e1e842cf6bc1bf7540536a5b88f3cadd32d5980e571cb9487d1971c7c97de51bfc6
data/bin/ssh_scan CHANGED
@@ -12,7 +12,7 @@ require 'logger'
12
12
  #Default options
13
13
  options = {
14
14
  "sockets" => [],
15
- "policy" => File.join(Dir.pwd, '/config/policies/mozilla_modern.yml'),
15
+ "policy" => File.join(File.dirname(__FILE__),"../config/policies/mozilla_modern.yml"),
16
16
  "unit_test" => false,
17
17
  "timeout" => 2,
18
18
  "threads" => 5,
@@ -227,7 +227,7 @@ end
227
227
 
228
228
  unless File.exist?(options["policy"])
229
229
  puts opt_parser.help
230
- puts "\nReason: policy file supplied is not a file"
230
+ puts "\nReason: policy file supplied is not a file #{options["policy"]}"
231
231
  exit 1
232
232
  end
233
233
 
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Mozilla Intermediate
3
+ ssh_version: 2.0
4
+ auth_methods:
5
+ - publickey
6
+ kex:
7
+ - diffie-hellman-group-exchange-sha256
8
+ encryption:
9
+ - aes256-ctr
10
+ - aes192-ctr
11
+ - aes128-ctr
12
+ macs:
13
+ - hmac-sha2-512
14
+ - hmac-sha2-256
15
+ compression:
16
+ - none
17
+ - zlib@openssh.com
18
+ references:
19
+ - https://wiki.mozilla.org/Security/Guidelines/OpenSSH
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Mozilla Modern
3
+ ssh_version: 2.0
4
+ auth_methods:
5
+ - publickey
6
+ kex:
7
+ - curve25519-sha256@libssh.org
8
+ - ecdh-sha2-nistp521
9
+ - ecdh-sha2-nistp384
10
+ - ecdh-sha2-nistp256
11
+ - diffie-hellman-group-exchange-sha256
12
+ encryption:
13
+ - chacha20-poly1305@openssh.com
14
+ - aes256-gcm@openssh.com
15
+ - aes128-gcm@openssh.com
16
+ - aes256-ctr
17
+ - aes192-ctr
18
+ - aes128-ctr
19
+ macs:
20
+ - hmac-sha2-512-etm@openssh.com
21
+ - hmac-sha2-256-etm@openssh.com
22
+ - umac-128-etm@openssh.com
23
+ - hmac-sha2-512
24
+ - hmac-sha2-256
25
+ - umac-128@openssh.com
26
+ compression:
27
+ - none
28
+ - zlib@openssh.com
29
+ references:
30
+ - https://wiki.mozilla.org/Security/Guidelines/OpenSSH
@@ -0,0 +1,22 @@
1
+ # The location of the API server
2
+ server: 127.0.0.1
3
+
4
+ # The port of the API server
5
+ port: 8000
6
+
7
+ # Scheme (http/https)
8
+ # http - useful for development
9
+ # https - recommended for production
10
+ scheme: http
11
+
12
+ # SSL/TLS verify - has no effect is scheme is not set to https
13
+ # false - don't verify SSL/TLS (useful for development)
14
+ # true - verify SSL/TLS (recommended for production)
15
+ verify: false
16
+
17
+ # Where to send worker logs to (default: STDOUT)
18
+ #logger: ./bin/ssh_scan_worker.log
19
+
20
+ # Authentication - if using authentication on the API, you'll
21
+ # need to have an auth token with matches in the API configuration
22
+ # auth_token: INSERT_WORKER_TOKEN
@@ -47,7 +47,7 @@ module SSHScan
47
47
  client = SSHScan::Client.new(target, port, timeout)
48
48
  client.connect()
49
49
  result = client.get_kex_result()
50
- result[:hostname] = ""
50
+ result[:hostname] = target.resolve_ptr
51
51
  return result if result.include?(:error)
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module SSHScan
2
- VERSION = '0.0.17.pre'
2
+ VERSION = '0.0.17'
3
3
  end
data/lib/string_ext.rb CHANGED
@@ -55,7 +55,18 @@ class String
55
55
  end
56
56
 
57
57
  def resolve_fqdn
58
- @fqdn ||= TCPSocket.gethostbyname(self)[3]
58
+ TCPSocket.gethostbyname(self)[3]
59
+ end
60
+
61
+ def resolve_ptr(timeout = 3)
62
+ begin
63
+ Timeout::timeout(timeout) {
64
+ reversed_dns = Resolv.new.getname(self)
65
+ return reversed_dns
66
+ }
67
+ rescue Timeout::Error,Resolv::ResolvError
68
+ return ""
69
+ end
59
70
  end
60
71
 
61
72
  def fqdn?
data/ssh_scan.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.platform = Gem::Platform::RUBY
12
12
  s.files = Dir.glob("lib/**/*") +
13
13
  Dir.glob("bin/**/*") +
14
+ Dir.glob("config/**/*") +
14
15
  Dir.glob("policies/**/*") +
15
16
  [".gitignore",
16
17
  ".rspec",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssh_scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17.pre
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Claudius
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-03-02 00:00:00.000000000 Z
15
+ date: 2017-03-17 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bindata
@@ -145,6 +145,9 @@ files:
145
145
  - bin/ssh_scan
146
146
  - bin/ssh_scan_worker
147
147
  - bin/ssh_scan_worker_example_config.yml
148
+ - config/policies/mozilla_intermediate.yml
149
+ - config/policies/mozilla_modern.yml
150
+ - config/worker/config.yml
148
151
  - lib/ssh_scan.rb
149
152
  - lib/ssh_scan/banner.rb
150
153
  - lib/ssh_scan/client.rb
@@ -210,9 +213,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
213
  version: '0'
211
214
  required_rubygems_version: !ruby/object:Gem::Requirement
212
215
  requirements:
213
- - - ">"
216
+ - - ">="
214
217
  - !ruby/object:Gem::Version
215
- version: 1.3.1
218
+ version: '0'
216
219
  requirements: []
217
220
  rubyforge_project:
218
221
  rubygems_version: 2.6.2