apullo 0.1.4 → 0.1.5
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 +4 -4
- data/lib/apullo/fingerprints/http.rb +4 -2
- data/lib/apullo/fingerprints/ssh.rb +14 -5
- data/lib/apullo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96eb9917a6d5fcef270fe520a2312f7447896b2d1e6f0bfc61f966d554e8f9c6
|
4
|
+
data.tar.gz: ca4807677d7519969aae72fcc647cad01f3799e04cea1d3aee3433efbb4e77bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d32ee78a83177d0dbca9a7d418f5e5e8af4894f516d05ed705a1ab8b082601663353f69e30571663015ddf0fbe9e91b19e6ac0b83431369a7866f51b147b6f7
|
7
|
+
data.tar.gz: 5e846ede99ffd718f5e75944eb1ef79b97be719f6cbbf62a43ebf05891e405142a1781d6676ec7e8fabdfe5d0530b7fddeedf7ef0573ca07165110828644a098
|
@@ -37,7 +37,7 @@ module Apullo
|
|
37
37
|
hash = Hash.new(@peer_cert.to_der)
|
38
38
|
{
|
39
39
|
md5: hash.md5,
|
40
|
-
serial: @peer_cert.serial,
|
40
|
+
serial: @peer_cert.serial.to_i,
|
41
41
|
sha1: hash.sha1,
|
42
42
|
sha256: hash.sha256,
|
43
43
|
}
|
@@ -93,7 +93,9 @@ module Apullo
|
|
93
93
|
href = icon.get("href")
|
94
94
|
return default_favicon_url unless href
|
95
95
|
|
96
|
-
href.start_with?("http://", "https://")
|
96
|
+
return href if href.start_with?("http://", "https://")
|
97
|
+
|
98
|
+
target.url.end_with?("/") ? target.url + href : "#{target.url}/#{href}"
|
97
99
|
end
|
98
100
|
|
99
101
|
def get(path, limit: 3)
|
@@ -6,7 +6,7 @@ module Apullo
|
|
6
6
|
module Fingerprint
|
7
7
|
class SSH < Base
|
8
8
|
DEFAULT_OPTIONS = { "timeout" => 3 }.freeze
|
9
|
-
|
9
|
+
DEFAULT_PORTS = [22, 2222].freeze
|
10
10
|
|
11
11
|
private
|
12
12
|
|
@@ -16,7 +16,7 @@ module Apullo
|
|
16
16
|
|
17
17
|
def pluck_fingerprints
|
18
18
|
result = scan
|
19
|
-
keys = result.dig("keys") ||
|
19
|
+
keys = result.dig("keys") || {}
|
20
20
|
keys.map do |cipher, data|
|
21
21
|
raw = data.dig("raw")
|
22
22
|
fingerprints = data.dig("fingerprints") || []
|
@@ -30,14 +30,23 @@ module Apullo
|
|
30
30
|
end.to_h
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
return
|
33
|
+
def _scan(target, port: 22)
|
34
|
+
return nil unless target.host
|
35
35
|
|
36
36
|
engine = SSHScan::ScanEngine.new
|
37
|
-
dest = "#{target.host}:#{
|
37
|
+
dest = "#{target.host}:#{port}"
|
38
38
|
result = engine.scan_target(dest, DEFAULT_OPTIONS)
|
39
39
|
result.to_hash
|
40
40
|
end
|
41
|
+
|
42
|
+
def scan
|
43
|
+
[target].product(DEFAULT_PORTS).each do |target, port|
|
44
|
+
result = _scan(target, port: port)
|
45
|
+
keys = result.dig("keys") || {}
|
46
|
+
return result unless keys.empty?
|
47
|
+
end
|
48
|
+
{}
|
49
|
+
end
|
41
50
|
end
|
42
51
|
end
|
43
52
|
end
|
data/lib/apullo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apullo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|