intrigue-ident 0.2 → 0.3
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/ident.rb +29 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66afd013738adb7a0175316a0bdef2ac0d11fc3488d164ad7d8631e19cf2b5e6
|
4
|
+
data.tar.gz: c9900036e79f6117bd9f5cfab4b03fe3d13bcdae1e83b4c66e1f6dc8e0339abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 163cbcb90bdc8389695a33c912c8eefeb02779db28a238a630c8a2bd3b04042eeb06a7ef926d84ee845578d23d239a825322be88614b4539333c19d88adf80c8
|
7
|
+
data.tar.gz: b9ecad141c070afee07cee67a8597832ab3aaed97f0116a1253357af497aa3624b6f8997200be11e19e305f8519254fb3aaf0db14ee52a31d0539df143aa00e8
|
data/ident.rb
CHANGED
@@ -11,7 +11,7 @@ Dir["#{check_folder}/*.rb"].each { |file| require_relative file }
|
|
11
11
|
module Intrigue
|
12
12
|
module Ident
|
13
13
|
|
14
|
-
VERSION=0.
|
14
|
+
VERSION=0.3
|
15
15
|
|
16
16
|
def generate_requests_and_check(url)
|
17
17
|
|
@@ -51,6 +51,33 @@ module Intrigue
|
|
51
51
|
results.compact
|
52
52
|
end
|
53
53
|
|
54
|
+
def check_intrigue_uri(intrigue_uri_data)
|
55
|
+
|
56
|
+
results = []
|
57
|
+
|
58
|
+
# gather all fingeprints for each product
|
59
|
+
# this will look like an array of checks, each with a uri and a SET of checks
|
60
|
+
generated_checks = Intrigue::Ident::CheckFactory.all.map{|x| x.new.generate_checks(url) }.flatten
|
61
|
+
|
62
|
+
# group by the uris, with the associated checks
|
63
|
+
# TODO - this only currently supports the first path of the group!!!!
|
64
|
+
grouped_generated_checks = generated_checks.group_by{|x| x[:paths].first }
|
65
|
+
|
66
|
+
# call the check on each uri
|
67
|
+
grouped_generated_checks.each do |ggc|
|
68
|
+
|
69
|
+
target_url = ggc.first
|
70
|
+
|
71
|
+
# call each check, collecting the product if it's a match
|
72
|
+
ggc.last.each do |check|
|
73
|
+
results << _match_uri(check, intrigue_uri_data)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Return all matches, minus the nils (non-matches)
|
78
|
+
results.compact
|
79
|
+
end
|
80
|
+
|
54
81
|
private
|
55
82
|
|
56
83
|
def _construct_match_response(check, data)
|
@@ -63,7 +90,7 @@ module Intrigue
|
|
63
90
|
}
|
64
91
|
end
|
65
92
|
|
66
|
-
def
|
93
|
+
def match_uri(check,data)
|
67
94
|
|
68
95
|
# data[:body] => page body
|
69
96
|
# data[:headers] => block of text with headers, one per line
|