recog 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -0
- data/lib/recog/match_reporter.rb +37 -3
- data/lib/recog/matcher.rb +5 -10
- data/lib/recog/version.rb +1 -1
- data/recog/bin/recog_match +20 -6
- data/recog/xml/favicons.xml +17 -3
- data/recog/xml/html_title.xml +25 -0
- data/recog/xml/http_cookies.xml +9 -7
- data/recog/xml/imap_banners.xml +8 -8
- data/recog/xml/pop_banners.xml +8 -8
- data/recog/xml/x509_issuers.xml +8 -0
- data/recog/xml/x509_subjects.xml +29 -0
- data/spec/lib/recog/match_reporter_spec.rb +22 -8
- data.tar.gz.sig +0 -0
- metadata +91 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb6f2415bc93d48b60c359793b6aee1e30e513b16a35de7c7bda4373a99cb996
|
4
|
+
data.tar.gz: 106fdf45bfe575ad27e6d9bc71ef2192967d573d00e7eda9a51c1ac50a40b964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd7943c87258799dde4b700bc0a121f5f6973e371f9904d5442e2fd3b4615bc4012b97f66426a7f7a628409c94515f2490273eb83a6cce4d57ad2071b8df58ff
|
7
|
+
data.tar.gz: d8ccfa23a65f4aa5c2d1638647042c6e47e8e9c2ce409a3fb01bf825fd28341c133948b6fff2a3e0dddb7d978460e45a113b883b774ae62cd84b0ce378fb8fe7
|
checksums.yaml.gz.sig
ADDED
data/lib/recog/match_reporter.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
1
3
|
module Recog
|
2
4
|
class MatchReporter
|
3
5
|
attr_reader :formatter
|
@@ -24,14 +26,46 @@ class MatchReporter
|
|
24
26
|
@line_count += 1
|
25
27
|
end
|
26
28
|
|
27
|
-
def match(
|
29
|
+
def match(match_data)
|
28
30
|
@match_count += 1
|
29
|
-
|
31
|
+
if @options.json_format
|
32
|
+
# remove data field from all matches and promote to a top-level field
|
33
|
+
data_field = match_data[0]["data"]
|
34
|
+
match_data.each { |h| h.delete("data") }
|
35
|
+
new_object = {
|
36
|
+
'data' => data_field,
|
37
|
+
}
|
38
|
+
|
39
|
+
if @options.multi_match
|
40
|
+
new_object['matches'] = match_data
|
41
|
+
else
|
42
|
+
new_object['match'] = match_data[0]
|
43
|
+
end
|
44
|
+
msg = new_object.to_json
|
45
|
+
else
|
46
|
+
match_prefix = match_data.size > 1 ? 'MATCHES' : 'MATCH'
|
47
|
+
msg = "#{match_prefix}: #{match_data.map(&:inspect).join(',')}"
|
48
|
+
end
|
49
|
+
formatter.success_message("#{msg}")
|
30
50
|
end
|
31
51
|
|
32
52
|
def failure(text)
|
33
53
|
@fail_count += 1
|
34
|
-
|
54
|
+
if @options.json_format
|
55
|
+
new_object = {
|
56
|
+
'data' => text,
|
57
|
+
'match_failure' => true
|
58
|
+
}
|
59
|
+
if @options.multi_match
|
60
|
+
new_object['matches'] = nil
|
61
|
+
else
|
62
|
+
new_object['match'] = nil
|
63
|
+
end
|
64
|
+
msg = new_object.to_json
|
65
|
+
else
|
66
|
+
msg = "FAIL: #{text}"
|
67
|
+
end
|
68
|
+
formatter.failure_message("#{msg}")
|
35
69
|
end
|
36
70
|
|
37
71
|
def print_summary
|
data/lib/recog/matcher.rb
CHANGED
@@ -29,26 +29,21 @@ class Matcher
|
|
29
29
|
line = line.to_s.unpack("C*").pack("C*").strip.gsub(/\\[rn]/, '')
|
30
30
|
found_extractions = false
|
31
31
|
|
32
|
-
|
32
|
+
extraction_data = []
|
33
33
|
fingerprints.each do |fp|
|
34
34
|
extractions = fp.match(line)
|
35
35
|
if extractions
|
36
36
|
found_extractions = true
|
37
37
|
extractions['data'] = line
|
38
|
-
|
39
|
-
|
40
|
-
else
|
41
|
-
reporter.match "MATCH: #{extractions.inspect}"
|
42
|
-
break
|
43
|
-
end
|
38
|
+
extraction_data << extractions
|
39
|
+
break unless multi_match
|
44
40
|
end
|
45
41
|
end
|
46
42
|
|
47
43
|
if found_extractions
|
48
|
-
|
49
|
-
reporter.match "#{match_prefix}: #{all_extractions.map(&:inspect).join(',')}" if multi_match
|
44
|
+
reporter.match extraction_data
|
50
45
|
else
|
51
|
-
reporter.failure
|
46
|
+
reporter.failure line
|
52
47
|
end
|
53
48
|
|
54
49
|
if reporter.stop?
|
data/lib/recog/version.rb
CHANGED
data/recog/bin/recog_match
CHANGED
@@ -5,7 +5,7 @@ require 'ostruct'
|
|
5
5
|
require 'recog'
|
6
6
|
require 'recog/matcher_factory'
|
7
7
|
|
8
|
-
options = OpenStruct.new(color: false, detail: false, fail_fast: false, multi_match: false)
|
8
|
+
options = OpenStruct.new(color: false, detail: false, json_format: false, fail_fast: false, multi_match: false)
|
9
9
|
|
10
10
|
option_parser = OptionParser.new do |opts|
|
11
11
|
opts.banner = "Usage: #{$0} [options] XML_FINGERPRINT_FILE [BANNERS_FILE]"
|
@@ -13,12 +13,18 @@ option_parser = OptionParser.new do |opts|
|
|
13
13
|
opts.separator ""
|
14
14
|
opts.separator "Options"
|
15
15
|
|
16
|
-
opts.on("-f", "--format FORMATTER",
|
16
|
+
opts.on("-f", "--format FORMATTER", [:summary, :detail, :json],
|
17
17
|
"Choose a formatter.",
|
18
18
|
" [s]ummary (default - failure/match msgs)",
|
19
|
-
" [d]etail (msgs with total counts)"
|
20
|
-
|
19
|
+
" [d]etail (msgs with total counts)",
|
20
|
+
" [j]son (JSON failure/match msgs)") do |format|
|
21
|
+
if format == :summary
|
22
|
+
options.detail = false
|
23
|
+
options.json_format = false
|
24
|
+
elsif format == :detail
|
21
25
|
options.detail = true
|
26
|
+
elsif format == :json
|
27
|
+
options.json_format = true
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
@@ -41,9 +47,17 @@ option_parser = OptionParser.new do |opts|
|
|
41
47
|
exit
|
42
48
|
end
|
43
49
|
end
|
44
|
-
option_parser.parse!(ARGV)
|
45
50
|
|
46
|
-
|
51
|
+
|
52
|
+
begin
|
53
|
+
option_parser.parse!(ARGV)
|
54
|
+
rescue OptionParser::ParseError => e
|
55
|
+
puts e.message
|
56
|
+
puts option_parser
|
57
|
+
exit(1)
|
58
|
+
end
|
59
|
+
|
60
|
+
if ARGV.count < 1 || ARGV.count > 2
|
47
61
|
puts option_parser
|
48
62
|
exit(1)
|
49
63
|
end
|
data/recog/xml/favicons.xml
CHANGED
@@ -779,13 +779,19 @@
|
|
779
779
|
</fingerprint>
|
780
780
|
|
781
781
|
<fingerprint pattern="^97c6417ed01bdc0ae3ef32ae4894fd03|e2f298e9811cd34a08bf5bb69e2d1d6a$">
|
782
|
-
<description>Jupyter
|
782
|
+
<description>Jupyter Products</description>
|
783
783
|
<example>97c6417ed01bdc0ae3ef32ae4894fd03</example>
|
784
784
|
<example>e2f298e9811cd34a08bf5bb69e2d1d6a</example>
|
785
785
|
<param pos="0" name="service.vendor" value="Jupyter"/>
|
786
|
-
<param pos="0" name="service.product" value="Notebook"/>
|
787
786
|
<param pos="0" name="service.certainty" value="0.5"/>
|
788
|
-
|
787
|
+
</fingerprint>
|
788
|
+
|
789
|
+
<fingerprint pattern="^7102bb857703a0fece6d039a6777fc3f$">
|
790
|
+
<description>Jupyter BinderHub</description>
|
791
|
+
<example>7102bb857703a0fece6d039a6777fc3f</example>
|
792
|
+
<param pos="0" name="service.vendor" value="Jupyter"/>
|
793
|
+
<param pos="0" name="service.product" value="BinderHub"/>
|
794
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:jupyter:binderhub:-"/>
|
789
795
|
</fingerprint>
|
790
796
|
|
791
797
|
<fingerprint pattern="^36b3ef286fa4befbb797a0966b456479$">
|
@@ -2092,4 +2098,12 @@
|
|
2092
2098
|
<param pos="0" name="service.cpe23" value="cpe:/a:dotcms:dotcms:-"/>
|
2093
2099
|
</fingerprint>
|
2094
2100
|
|
2101
|
+
<fingerprint pattern="^8c7d1c14e4b9c42f07bd6b800d93b806$">
|
2102
|
+
<description>Zimbra Collaboration</description>
|
2103
|
+
<example>8c7d1c14e4b9c42f07bd6b800d93b806</example>
|
2104
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
2105
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
2106
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:-"/>
|
2107
|
+
</fingerprint>
|
2108
|
+
|
2095
2109
|
</fingerprints>
|
data/recog/xml/html_title.xml
CHANGED
@@ -2449,6 +2449,22 @@
|
|
2449
2449
|
<param pos="0" name="service.cpe23" value="cpe:/a:jupyter:notebook:-"/>
|
2450
2450
|
</fingerprint>
|
2451
2451
|
|
2452
|
+
<fingerprint pattern="^Jupyter Server$">
|
2453
|
+
<description>Jupyter Server - backend to Jupyter web applications</description>
|
2454
|
+
<example>Jupyter Server</example>
|
2455
|
+
<param pos="0" name="service.vendor" value="Jupyter"/>
|
2456
|
+
<param pos="0" name="service.product" value="Jupyter Server"/>
|
2457
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:jupyter:jupyter_server:-"/>
|
2458
|
+
</fingerprint>
|
2459
|
+
|
2460
|
+
<fingerprint pattern="^JupyterHub$">
|
2461
|
+
<description>JupyterHub - Multi-user server for Jupyter notebooks</description>
|
2462
|
+
<example>JupyterHub</example>
|
2463
|
+
<param pos="0" name="service.vendor" value="Jupyter"/>
|
2464
|
+
<param pos="0" name="service.product" value="JupyterHub"/>
|
2465
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:jupyter:jupyterhub:-"/>
|
2466
|
+
</fingerprint>
|
2467
|
+
|
2452
2468
|
<fingerprint pattern="^Redirect to userimage: /control/userimage\.html$">
|
2453
2469
|
<description>Mobotix Network Camera</description>
|
2454
2470
|
<example>Redirect to userimage: /control/userimage.html</example>
|
@@ -3885,6 +3901,15 @@
|
|
3885
3901
|
<param pos="0" name="service.cpe23" value="cpe:/a:dotcms:dotcms:-"/>
|
3886
3902
|
</fingerprint>
|
3887
3903
|
|
3904
|
+
<fingerprint pattern="^Zimbra (?:Web Client Sign In|Administration)$">
|
3905
|
+
<description>Zimbra Collaboration</description>
|
3906
|
+
<example>Zimbra Web Client Sign In</example>
|
3907
|
+
<example>Zimbra Administration</example>
|
3908
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
3909
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
3910
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:-"/>
|
3911
|
+
</fingerprint>
|
3912
|
+
|
3888
3913
|
<!-- Specific Eltex fingerprints to enable CPE generation -->
|
3889
3914
|
|
3890
3915
|
<fingerprint pattern="^Eltex - NTP-RG-1402G$">
|
data/recog/xml/http_cookies.xml
CHANGED
@@ -609,14 +609,16 @@
|
|
609
609
|
<param pos="0" name="service.product" value="WebTrends"/>
|
610
610
|
</fingerprint>
|
611
611
|
|
612
|
-
<fingerprint pattern="^(
|
613
|
-
<description>Zimbra</description>
|
614
|
-
<example cookie="ZM_TEST">ZM_TEST=true;Secure</example>
|
615
|
-
<example cookie="ZM_LOGIN_CSRF">ZM_LOGIN_CSRF=38ef0bea-a4c3-4f41-9ac3-73d7622f3131;Secure;HttpOnly</example>
|
612
|
+
<fingerprint pattern="^(ZM_(?:TEST|LOGIN_CSRF)|ZA_(?:SKIN|TEST))=">
|
613
|
+
<description>Zimbra Collaboration</description>
|
614
|
+
<example cookie="ZM_TEST">ZM_TEST=true; Secure</example>
|
615
|
+
<example cookie="ZM_LOGIN_CSRF">ZM_LOGIN_CSRF=38ef0bea-a4c3-4f41-9ac3-73d7622f3131; Secure; HttpOnly</example>
|
616
|
+
<example cookie="ZA_SKIN">ZA_SKIN=serenity</example>
|
617
|
+
<example cookie="ZA_TEST">ZA_TEST=true; Secure</example>
|
616
618
|
<param pos="1" name="cookie"/>
|
617
|
-
<param pos="0" name="service.vendor" value="
|
618
|
-
<param pos="0" name="service.product" value="
|
619
|
-
<param pos="0" name="service.cpe23" value="cpe:/a:
|
619
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
620
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
621
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:-"/>
|
620
622
|
</fingerprint>
|
621
623
|
|
622
624
|
<fingerprint pattern="^_ZopeId=">
|
data/recog/xml/imap_banners.xml
CHANGED
@@ -178,21 +178,21 @@
|
|
178
178
|
</fingerprint>
|
179
179
|
|
180
180
|
<fingerprint pattern="^(\S{1,512}) Zimbra IMAP4rev1 server ready\.?$">
|
181
|
-
<description>
|
181
|
+
<description>Zimbra Collaboration IMAP</description>
|
182
182
|
<example host.name="foo.bar">foo.bar Zimbra IMAP4rev1 server ready</example>
|
183
|
-
<param pos="0" name="service.vendor" value="
|
184
|
-
<param pos="0" name="service.product" value="
|
185
|
-
<param pos="0" name="service.cpe23" value="cpe:/a:
|
183
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
184
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
185
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:-"/>
|
186
186
|
<param pos="1" name="host.name"/>
|
187
187
|
</fingerprint>
|
188
188
|
|
189
189
|
<fingerprint pattern="^(\S{1,512}) Zimbra (\S+) IMAP4rev1 server ready\.?$">
|
190
|
-
<description>
|
190
|
+
<description>Zimbra Collaboration IMAP with service version</description>
|
191
191
|
<example host.name="foo.bar" service.version="7.0.0_GA_3079">foo.bar Zimbra 7.0.0_GA_3079 IMAP4rev1 server ready</example>
|
192
|
-
<param pos="0" name="service.vendor" value="
|
193
|
-
<param pos="0" name="service.product" value="
|
192
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
193
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
194
194
|
<param pos="2" name="service.version"/>
|
195
|
-
<param pos="0" name="service.cpe23" value="cpe:/a:
|
195
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:{service.version}"/>
|
196
196
|
<param pos="1" name="host.name"/>
|
197
197
|
</fingerprint>
|
198
198
|
|
data/recog/xml/pop_banners.xml
CHANGED
@@ -230,21 +230,21 @@
|
|
230
230
|
</fingerprint>
|
231
231
|
|
232
232
|
<fingerprint pattern="^(\S{1,512}) Zimbra POP3 server ready\.?$">
|
233
|
-
<description>
|
233
|
+
<description>Zimbra Collaboration POP</description>
|
234
234
|
<example host.name="foo.bar">foo.bar Zimbra POP3 server ready</example>
|
235
|
-
<param pos="0" name="service.vendor" value="
|
236
|
-
<param pos="0" name="service.product" value="
|
237
|
-
<param pos="0" name="service.cpe23" value="cpe:/a:
|
235
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
236
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
237
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:-"/>
|
238
238
|
<param pos="1" name="host.name"/>
|
239
239
|
</fingerprint>
|
240
240
|
|
241
241
|
<fingerprint pattern="^(\S{1,512}) Zimbra (\S+) POP3 server ready\.?$">
|
242
|
-
<description>
|
242
|
+
<description>Zimbra Collaboration POP with version</description>
|
243
243
|
<example host.name="foo.bar" service.version="7.0.0_GA_3079">foo.bar Zimbra 7.0.0_GA_3079 POP3 server ready</example>
|
244
|
-
<param pos="0" name="service.vendor" value="
|
245
|
-
<param pos="0" name="service.product" value="
|
244
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
245
|
+
<param pos="0" name="service.product" value="Collaboration"/>
|
246
246
|
<param pos="2" name="service.version"/>
|
247
|
-
<param pos="0" name="service.cpe23" value="cpe:/a:
|
247
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration:{service.version}"/>
|
248
248
|
<param pos="1" name="host.name"/>
|
249
249
|
</fingerprint>
|
250
250
|
|
data/recog/xml/x509_issuers.xml
CHANGED
@@ -405,4 +405,12 @@
|
|
405
405
|
<param pos="0" name="os.product" value="Proxmox"/>
|
406
406
|
</fingerprint>
|
407
407
|
|
408
|
+
<fingerprint pattern="^CN=minikubeCA$">
|
409
|
+
<description>Kubernetes minikube</description>
|
410
|
+
<example>CN=minikubeCA</example>
|
411
|
+
<param pos="0" name="service.vendor" value="Kubernetes"/>
|
412
|
+
<param pos="0" name="service.product" value="minikube"/>
|
413
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:kubernetes:minikube:-"/>
|
414
|
+
</fingerprint>
|
415
|
+
|
408
416
|
</fingerprints>
|
data/recog/xml/x509_subjects.xml
CHANGED
@@ -1755,4 +1755,33 @@
|
|
1755
1755
|
<param pos="0" name="os.product" value="Proxmox"/>
|
1756
1756
|
</fingerprint>
|
1757
1757
|
|
1758
|
+
<fingerprint pattern="^CN=(\S{1,512}),OU=Endpoint Health,O=Duo Security\\, Inc.,L=Ann Arbor,ST=Michigan,C=US(?:,\S+)?$">
|
1759
|
+
<description>Duo Device Health</description>
|
1760
|
+
<example host.name="127.0.0.1">CN=127.0.0.1,OU=Endpoint Health,O=Duo Security\, Inc.,L=Ann Arbor,ST=Michigan,C=US,1.2.840.113549.1.9.1=#0c1e656e64706f696e746865616c74684064756f73656375726974792e636f6d</example>
|
1761
|
+
<param pos="0" name="service.vendor" value="Duo"/>
|
1762
|
+
<param pos="0" name="service.product" value="Duo Device Health"/>
|
1763
|
+
<param pos="1" name="host.name"/>
|
1764
|
+
</fingerprint>
|
1765
|
+
|
1766
|
+
<fingerprint pattern="^CN=(\S{1,512}),OU=Mac Certifier,O=Duo Security\\, Inc.,L=Ann Arbor,ST=Michigan,C=US(?:,\S+)?$">
|
1767
|
+
<description>Duo Certifier</description>
|
1768
|
+
<example host.name="localhost">CN=localhost,OU=Mac Certifier,O=Duo Security\, Inc.,L=Ann Arbor,ST=Michigan,C=US,1.2.840.113549.1.9.1=#0c18656e64706f696e744064756f73656375726974792e636f6d</example>
|
1769
|
+
<param pos="0" name="service.vendor" value="Duo"/>
|
1770
|
+
<param pos="0" name="service.product" value="Duo Certifier"/>
|
1771
|
+
<param pos="0" name="os.vendor" value="Apple"/>
|
1772
|
+
<param pos="0" name="os.family" value="Mac OS"/>
|
1773
|
+
<param pos="0" name="os.product" value="Mac OS"/>
|
1774
|
+
<param pos="0" name="os.cpe23" value="cpe:/o:apple:macos:-"/>
|
1775
|
+
<param pos="1" name="host.name"/>
|
1776
|
+
</fingerprint>
|
1777
|
+
|
1778
|
+
<fingerprint pattern="^CN=(\S{1,512}),OU=Zimbra Collaboration Server$">
|
1779
|
+
<description>Zimbra Collaboration Server</description>
|
1780
|
+
<example host.name="foo.bar">CN=foo.bar,OU=Zimbra Collaboration Server</example>
|
1781
|
+
<param pos="0" name="service.vendor" value="Zimbra"/>
|
1782
|
+
<param pos="0" name="service.product" value="Collaboration Server"/>
|
1783
|
+
<param pos="0" name="service.cpe23" value="cpe:/a:zimbra:collaboration_server:-"/>
|
1784
|
+
<param pos="1" name="host.name"/>
|
1785
|
+
</fingerprint>
|
1786
|
+
|
1758
1787
|
</fingerprints>
|
@@ -1,31 +1,31 @@
|
|
1
1
|
require 'recog/match_reporter'
|
2
2
|
|
3
3
|
describe Recog::MatchReporter do
|
4
|
-
let(:options) { double(detail: false, quiet: false)
|
4
|
+
let(:options) { double(detail: false, json_format: false, quiet: false, multi_match: false) }
|
5
5
|
let(:formatter) { double('formatter').as_null_object }
|
6
6
|
subject { Recog::MatchReporter.new(options, formatter) }
|
7
7
|
|
8
8
|
def run_report
|
9
9
|
subject.report do
|
10
10
|
subject.increment_line_count
|
11
|
-
subject.match 'a match'
|
11
|
+
subject.match [{'data' => 'a match'}]
|
12
12
|
subject.failure 'a failure'
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
describe "#report" do
|
17
17
|
it "prints matches" do
|
18
|
-
expect(formatter).to receive(:success_message).with('a match')
|
18
|
+
expect(formatter).to receive(:success_message).with('MATCH: {"data"=>"a match"}')
|
19
19
|
run_report
|
20
20
|
end
|
21
21
|
|
22
22
|
it "prints failures" do
|
23
|
-
expect(formatter).to receive(:failure_message).with('a failure')
|
23
|
+
expect(formatter).to receive(:failure_message).with('FAIL: a failure')
|
24
24
|
run_report
|
25
25
|
end
|
26
26
|
|
27
27
|
context "with detail" do
|
28
|
-
subject { Recog::MatchReporter.new(double(detail: true, quiet: false), formatter) }
|
28
|
+
subject { Recog::MatchReporter.new(double(detail: true, json_format: false, quiet: false, multi_match: false), formatter) }
|
29
29
|
|
30
30
|
it "prints the lines processed" do
|
31
31
|
expect(formatter).to receive(:status_message).with("\nProcessed 1 lines")
|
@@ -37,11 +37,25 @@ describe Recog::MatchReporter do
|
|
37
37
|
run_report
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
context "with JSON" do
|
42
|
+
subject { Recog::MatchReporter.new(double(detail: false, json_format: true, quiet: false, multi_match: false), formatter) }
|
43
|
+
|
44
|
+
it "prints matches" do
|
45
|
+
expect(formatter).to receive(:success_message).with('{"data":"a match","match":{}}')
|
46
|
+
run_report
|
47
|
+
end
|
48
|
+
|
49
|
+
it "prints failures" do
|
50
|
+
expect(formatter).to receive(:failure_message).with('{"data":"a failure","match_failure":true,"match":null}')
|
51
|
+
run_report
|
52
|
+
end
|
53
|
+
end
|
40
54
|
end
|
41
55
|
|
42
56
|
describe "#print_summary" do
|
43
57
|
context "with all matches" do
|
44
|
-
before { subject.match 'match' }
|
58
|
+
before { subject.match ['match'] }
|
45
59
|
|
46
60
|
it "prints a successful summary" do
|
47
61
|
msg = "SUMMARY: 1 matches and 0 failures"
|
@@ -64,7 +78,7 @@ describe Recog::MatchReporter do
|
|
64
78
|
describe "#stop?" do
|
65
79
|
context "with a failure limit" do
|
66
80
|
|
67
|
-
let(:options) { double(fail_fast: true, stop_after: 3, detail: false) }
|
81
|
+
let(:options) { double(fail_fast: true, stop_after: 3, detail: false, json_format: false, multi_match: false) }
|
68
82
|
before do
|
69
83
|
subject.failure 'first'
|
70
84
|
subject.failure 'second'
|
@@ -81,7 +95,7 @@ describe Recog::MatchReporter do
|
|
81
95
|
end
|
82
96
|
|
83
97
|
context "with no failure limit" do
|
84
|
-
let(:options) { double(fail_fast: false, detail: false) }
|
98
|
+
let(:options) { double(fail_fast: false, detail: false, json_format: false, multi_match: false) }
|
85
99
|
|
86
100
|
it "return false" do
|
87
101
|
expect(subject.stop?).to be false
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: recog/bin
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
|
14
|
+
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
15
|
+
d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
|
16
|
+
b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG
|
17
|
+
EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
|
18
|
+
cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi
|
19
|
+
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c
|
20
|
+
JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKIS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oDGG
|
83
|
+
L2h0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9zaGEyLWFzc3VyZWQtY3MtZzEuY3Js
|
84
|
+
MEwGA1UdIARFMEMwNwYJYIZIAYb9bAMBMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8v
|
85
|
+
d3d3LmRpZ2ljZXJ0LmNvbS9DUFMwCAYGZ4EMAQQBMIGEBggrBgEFBQcBAQR4MHYw
|
86
|
+
JAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBOBggrBgEFBQcw
|
87
|
+
AoZCaHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0U0hBMkFzc3Vy
|
88
|
+
ZWRJRENvZGVTaWduaW5nQ0EuY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEL
|
89
|
+
BQADggEBAN+GL5/myPWg7oH4mVrG7/OhXF1MoYQF0ddaNiqaweEHMuKJBQCVZRbL
|
90
|
+
37HojoKXXv2yyRJBCeTB+ojrxX+5PdLVZa0ss7toWzJ2A1poPXZ1eZvm5xeFD32z
|
91
|
+
YQaTmmNWNI3PCDTyJ2PXUc+bDiNNwcZ7yc5o78UNRvp9Jxghya17Q76c9Ov9wvnv
|
92
|
+
dxxQKWGOQy0m4fBrkyjAyH9Djjn81RbQrqYgPuhd5nD0HjN3VUQLhQbIJrk9TVs0
|
93
|
+
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
94
|
+
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
95
|
+
-----END CERTIFICATE-----
|
96
|
+
date: 2022-08-24 00:00:00.000000000 Z
|
12
97
|
dependencies:
|
13
98
|
- !ruby/object:Gem::Dependency
|
14
99
|
name: rspec
|
@@ -200,7 +285,7 @@ files:
|
|
200
285
|
homepage: https://www.github.com/rapid7/recog-ruby
|
201
286
|
licenses: []
|
202
287
|
metadata: {}
|
203
|
-
post_install_message:
|
288
|
+
post_install_message:
|
204
289
|
rdoc_options: []
|
205
290
|
require_paths:
|
206
291
|
- lib
|
@@ -216,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
301
|
version: '0'
|
217
302
|
requirements: []
|
218
303
|
rubygems_version: 3.1.6
|
219
|
-
signing_key:
|
304
|
+
signing_key:
|
220
305
|
specification_version: 4
|
221
306
|
summary: Network service fingerprint database, classes, and utilities
|
222
307
|
test_files:
|
metadata.gz.sig
ADDED
Binary file
|