ssh_scan 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/fingerprints.yml +4 -4
- data/lib/ssh_scan/client.rb +11 -0
- data/lib/ssh_scan/result.rb +4 -0
- data/lib/ssh_scan/scan_engine.rb +7 -2
- data/lib/ssh_scan/target_parser.rb +5 -1
- data/lib/ssh_scan/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1066cba29c8d997c6924ebc2155fa4ecc91d382c
|
4
|
+
data.tar.gz: 10880af54befeb4d528e91e15e17d9827578734b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 698760530885d0c3288f426d9aa97eb2d84462d636c2509acacdbaaa2e24d9c4c53869abc7cb93d741b9dc16f29df6e18426909e0bc91a6fb70c3387b2a2a3ab
|
7
|
+
data.tar.gz: 683e352aec4ce7c2d7fc90ac56fbb050324017d4b155e690ea5ff92445e34eaba460c31cda5b487cda48a2e1f33b8122af2e6dfac30e65caf4ae147180878a6e
|
data/data/fingerprints.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
-
|
4
|
-
-
|
5
|
-
-
|
2
|
+
45.55.203.36:
|
3
|
+
- 1b:21:eb:44:cd:3c:17:63:fa:6c:b2:58:11:ce:98:f4
|
4
|
+
- 88:74:a1:9e:b9:38:a0:a8:ac:2d:bd:82:eb:09:a0:49:84:dc:b8:c6
|
5
|
+
- 93:6c:b4:26:21:a8:ff:50:e9:e0:37:7b:2c:71:ea:e2:7e:6f:30:60:2e:8e:d2:b6:d7:8d:0a:78:a5:da:2c:76
|
data/lib/ssh_scan/client.rb
CHANGED
data/lib/ssh_scan/result.rb
CHANGED
data/lib/ssh_scan/scan_engine.rb
CHANGED
@@ -36,9 +36,10 @@ module SSHScan
|
|
36
36
|
client = SSHScan::Client.new(
|
37
37
|
target.resolve_fqdn_as_ipv4.to_s, port, timeout
|
38
38
|
)
|
39
|
-
client.connect
|
39
|
+
client.connect
|
40
40
|
result.set_client_attributes(client)
|
41
41
|
kex_result = client.get_kex_result()
|
42
|
+
client.close
|
42
43
|
result.set_kex_result(kex_result) unless kex_result.nil?
|
43
44
|
result.error = client.error if client.error?
|
44
45
|
# If it does resolve as IPv6, we're try IPv6
|
@@ -46,20 +47,23 @@ module SSHScan
|
|
46
47
|
client = SSHScan::Client.new(
|
47
48
|
target.resolve_fqdn_as_ipv6.to_s, port, timeout
|
48
49
|
)
|
49
|
-
client.connect
|
50
|
+
client.connect
|
50
51
|
result.set_client_attributes(client)
|
51
52
|
kex_result = client.get_kex_result()
|
53
|
+
client.close
|
52
54
|
result.set_kex_result(kex_result) unless kex_result.nil?
|
53
55
|
result.error = client.error if client.error?
|
54
56
|
|
55
57
|
# If resolves as IPv6, but somehow we get an client error, fall-back to IPv4
|
56
58
|
if result.error?
|
59
|
+
result.unset_error
|
57
60
|
client = SSHScan::Client.new(
|
58
61
|
target.resolve_fqdn_as_ipv4.to_s, port, timeout
|
59
62
|
)
|
60
63
|
client.connect()
|
61
64
|
result.set_client_attributes(client)
|
62
65
|
kex_result = client.get_kex_result()
|
66
|
+
client.close
|
63
67
|
result.set_kex_result(kex_result) unless kex_result.nil?
|
64
68
|
result.error = client.error if client.error?
|
65
69
|
end
|
@@ -69,6 +73,7 @@ module SSHScan
|
|
69
73
|
client.connect()
|
70
74
|
result.set_client_attributes(client)
|
71
75
|
kex_result = client.get_kex_result()
|
76
|
+
client.close
|
72
77
|
|
73
78
|
unless kex_result.nil?
|
74
79
|
result.set_kex_result(kex_result)
|
@@ -28,7 +28,11 @@ module SSHScan
|
|
28
28
|
end
|
29
29
|
return ip_array
|
30
30
|
elsif ip.include? "/"
|
31
|
-
|
31
|
+
begin
|
32
|
+
cidr = NetAddr::CIDR.create(ip)
|
33
|
+
rescue
|
34
|
+
raise ArgumentError, "Invalid target: #{ip}"
|
35
|
+
end
|
32
36
|
ip_array = cidr.enumerate
|
33
37
|
ip_array.delete(cidr.network)
|
34
38
|
ip_array.delete(cidr.last)
|
data/lib/ssh_scan/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.24
|
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-06-
|
15
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bindata
|