fingerprinter 0.1.8 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fingerprinter.rb +21 -14
- 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: 74fd693d01fe16bf30ca09e3369223b409302c0e940fcfe581067dd2bc0b4814
|
4
|
+
data.tar.gz: 5b7f9bb28cf3435e0ef26af689748912c8b6fe876901eb56d380d1f43eeffde2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9099f2a57dc3731493bb524c71931fb58e853b50bf141a1de2f58e1621b7c7cc3dc3c97791e98256ebd11da78e69575c2a375b0953bd484c542c74814dfb8996
|
7
|
+
data.tar.gz: 2d7e440fb17af756dd80e2ead211f312dda8df9ea0cfb7ba2357371f226b6f1feb5531be67605fcde7655f58096a4daa034bd4ca973ea71c2a1ffe20bc96992e
|
data/lib/fingerprinter.rb
CHANGED
@@ -8,7 +8,8 @@ module Fingerprinter
|
|
8
8
|
Dir[File.join(__dir__, 'fingerprinter', 'core/*.rb')].sort.each { |file| require file }
|
9
9
|
Dir[File.join(__dir__, 'fingerprinter', 'utilities/*.rb')].sort.each { |file| require file }
|
10
10
|
|
11
|
-
EXCLUSIONS = %w[paas.diod.orange.com].freeze
|
11
|
+
EXCLUSIONS = %w[paas.diod.orange.com prod.pc0.dbs.com].freeze
|
12
|
+
SC_EXCLUSIONS = %i[0 418].freeze
|
12
13
|
WILDCARDS = [
|
13
14
|
['Application is not available', 'The application is currently not serving requests at this endpoint']
|
14
15
|
].freeze
|
@@ -36,27 +37,33 @@ module Fingerprinter
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def run(urls)
|
40
|
+
pool = Concurrent::FixedThreadPool.new(ScanOptions.http_concurrency)
|
39
41
|
urls.each do |url|
|
40
42
|
next if EXCLUSIONS.any? { |exclusion| url.match?(exclusion) }
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
pool.post do
|
45
|
+
response = get_response(url)
|
46
|
+
next unless response
|
47
|
+
next if wildcard?(response)
|
45
48
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
49
|
+
url = effective_url(response, url)
|
50
|
+
|
51
|
+
responses = response.redirections
|
52
|
+
responses << response
|
50
53
|
|
51
|
-
|
52
|
-
|
54
|
+
responses.each do |response|
|
55
|
+
doc = Utilities::Parser.doc(response.body)
|
53
56
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
+
results[url] = Concurrent::Array.new
|
58
|
+
data = { response:, doc:, url: }
|
59
|
+
Technologies.subclasses.each { |technology| results[url] << technology.run(data) }
|
60
|
+
end
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
64
|
+
pool.shutdown
|
65
|
+
pool.wait_for_termination
|
66
|
+
|
60
67
|
results.transform_values! { |v| v.compact.uniq }
|
61
68
|
results
|
62
69
|
end
|
@@ -85,7 +92,7 @@ module Fingerprinter
|
|
85
92
|
url = normalize_url(url)
|
86
93
|
return get_response(url)
|
87
94
|
end
|
88
|
-
return if response&.code
|
95
|
+
return if SC_EXCLUSIONS.include?(response&.code)
|
89
96
|
return response if response.redirections.empty? || same_scope?(url, response)
|
90
97
|
|
91
98
|
response.redirections.first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua MARTINELLE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|