recog 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recog/version.rb +1 -1
- data/spec/lib/fingerprint_self_test_spec.rb +15 -4
- data/xml/ntp_banners.xml +11 -11
- data/xml/smb_native_os.xml +10 -10
- data/xml/snmp_sysdescr.xml +0 -10
- 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: 7190197345bed621faf776482bf3ca8ca6cb210b
|
4
|
+
data.tar.gz: b57dc8676f172febcfa71c665ac577466b0e6a00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dcbd96cbeade329a7e83ff5491235a09184a264cc2aa9d6214882ef6c56a269428cc08622cc20dacafe1c2969d72edfd5b14b9928e21a0c4da23d3f347a1e8e
|
7
|
+
data.tar.gz: 1a2f1daceec5aea2f18f0f34726ebeab296cc7622115a77ac4067fccf00fe3ccd9c8792f4b7c312ddecb6859e66e7f0449bffeb6a42758d64cc0d47a630afb3a
|
data/lib/recog/version.rb
CHANGED
@@ -12,7 +12,8 @@ describe Recog::DB do
|
|
12
12
|
expect(db.match_key).not_to be_empty
|
13
13
|
end
|
14
14
|
|
15
|
-
db.fingerprints.
|
15
|
+
db.fingerprints.each_index do |i|
|
16
|
+
fp = db.fingerprints[i]
|
16
17
|
|
17
18
|
context "#{fp.regex}" do
|
18
19
|
|
@@ -37,12 +38,22 @@ describe Recog::DB do
|
|
37
38
|
# end
|
38
39
|
|
39
40
|
fp.tests.each do |example|
|
40
|
-
it "
|
41
|
+
it "Example '#{example.content}' matches this regex" do
|
41
42
|
match = fp.match(example.content)
|
42
|
-
expect(match).to_not be_nil
|
43
|
+
expect(match).to_not be_nil, 'Regex did not match'
|
43
44
|
# test any extractions specified in the example
|
44
45
|
example.attributes.each_pair do |k,v|
|
45
|
-
expect(match[k]).to eq(v)
|
46
|
+
expect(match[k]).to eq(v), "Regex didn't extracted expected value for fingerprint attribute #{k}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
it "Example '#{example.content}' matches this regex first" do
|
51
|
+
db.fingerprints.slice(0, i).each_index do |previous_i|
|
52
|
+
prev_fp = db.fingerprints[previous_i]
|
53
|
+
prev_fp.tests.each do |prev_example|
|
54
|
+
match = prev_fp.match(example.content)
|
55
|
+
expect(match).to be_nil, "Matched regex ##{previous_i} (#{db.fingerprints[previous_i].regex}) rather than ##{i} (#{db.fingerprints[i].regex})"
|
56
|
+
end
|
46
57
|
end
|
47
58
|
end
|
48
59
|
end
|
data/xml/ntp_banners.xml
CHANGED
@@ -419,17 +419,6 @@ NTP "banners", taken from a readvar response
|
|
419
419
|
<param pos="0" name="os.family" value="Solaris"/>
|
420
420
|
<param pos="0" name="os.product" value="Solaris"/>
|
421
421
|
</fingerprint>
|
422
|
-
<fingerprint pattern="processor="([^ ]+)",.*system="JUNOS/?([^ ]+)"" flags="REG_DOT_NEWLINE,REG_ICASE">
|
423
|
-
<description>Juniper/Netscreen JunOS NTP without a version</description>
|
424
|
-
<example>processor="i386", system="JUNOS7.0R2.7", leap=0, stratum=3</example>
|
425
|
-
<example>processor="i386", system="JUNOS6.4R1.6", leap=3, stratum=16</example>
|
426
|
-
<example>processor="i386", system="JUNOS5.5R2.3", leap=0, stratum=3</example>
|
427
|
-
<param pos="0" name="os.vendor" value="Juniper"/>
|
428
|
-
<param pos="0" name="os.family" value="Junos"/>
|
429
|
-
<param pos="0" name="os.product" value="Junos OS"/>
|
430
|
-
<param pos="2" name="os.arch"/>
|
431
|
-
<param pos="3" name="os.version"/>
|
432
|
-
</fingerprint>
|
433
422
|
<fingerprint pattern="^.*version="ntpd ([^ ]+)[^"]+",.*processor="([^ ]+)",.*system="JUNOS/?([^ ]+)"" flags="REG_DOT_NEWLINE,REG_ICASE">
|
434
423
|
<description>ntpd running on Juniper/Netscreen JunOS</description>
|
435
424
|
<example>
|
@@ -445,6 +434,17 @@ NTP "banners", taken from a readvar response
|
|
445
434
|
<param pos="2" name="os.arch"/>
|
446
435
|
<param pos="3" name="os.version"/>
|
447
436
|
</fingerprint>
|
437
|
+
<fingerprint pattern="processor="([^ ]+)",.*system="JUNOS/?([^ ]+)"" flags="REG_DOT_NEWLINE,REG_ICASE">
|
438
|
+
<description>Juniper/Netscreen JunOS NTP without a version</description>
|
439
|
+
<example>processor="i386", system="JUNOS7.0R2.7", leap=0, stratum=3</example>
|
440
|
+
<example>processor="i386", system="JUNOS6.4R1.6", leap=3, stratum=16</example>
|
441
|
+
<example>processor="i386", system="JUNOS5.5R2.3", leap=0, stratum=3</example>
|
442
|
+
<param pos="0" name="os.vendor" value="Juniper"/>
|
443
|
+
<param pos="0" name="os.family" value="Junos"/>
|
444
|
+
<param pos="0" name="os.product" value="Junos OS"/>
|
445
|
+
<param pos="2" name="os.arch"/>
|
446
|
+
<param pos="3" name="os.version"/>
|
447
|
+
</fingerprint>
|
448
448
|
<fingerprint pattern="^.*version="ntpd ([^ ]+)[^"]+",.*processor="([^ ]+)",.*system="Windows/?([^ ]+)?"" flags="REG_DOT_NEWLINE,REG_ICASE">
|
449
449
|
<description>ntpd running on Windows</description>
|
450
450
|
<example>
|
data/xml/smb_native_os.xml
CHANGED
@@ -262,6 +262,16 @@
|
|
262
262
|
<param pos="4" name="os.version"/>
|
263
263
|
</fingerprint>
|
264
264
|
|
265
|
+
<fingerprint pattern="^(Windows (?:7|8|8\.1)(?:| RT)) (\d+) (Service Pack \d+)$">
|
266
|
+
<description>Windows 7/8 (SP)</description>
|
267
|
+
<example os.version="Service Pack 1">Windows 7 7601 Service Pack 1</example>
|
268
|
+
<param pos="0" name="os.certainty" value="1.0"/>
|
269
|
+
<param pos="0" name="os.vendor" value="Microsoft"/>
|
270
|
+
<param pos="1" name="os.product"/>
|
271
|
+
<param pos="2" name="os.build"/>
|
272
|
+
<param pos="3" name="os.version"/>
|
273
|
+
</fingerprint>
|
274
|
+
|
265
275
|
<fingerprint pattern="^(Windows (?:7|8|8\.1)(?:| RT)) (\w+|\w+ \w+|\w+ \w+ \w+) (\d+)$">
|
266
276
|
<description>Windows 7/8 (Edition)</description>
|
267
277
|
<example os.edition="Enterprise">Windows 7 Enterprise 7600</example>
|
@@ -274,16 +284,6 @@
|
|
274
284
|
<param pos="3" name="os.build"/>
|
275
285
|
</fingerprint>
|
276
286
|
|
277
|
-
<fingerprint pattern="^(Windows (?:7|8|8\.1)(?:| RT)) (\d+) (Service Pack \d+)$">
|
278
|
-
<description>Windows 7/8 (SP)</description>
|
279
|
-
<example os.version="Service Pack 1">Windows 7 7601 Service Pack 1</example>
|
280
|
-
<param pos="0" name="os.certainty" value="1.0"/>
|
281
|
-
<param pos="0" name="os.vendor" value="Microsoft"/>
|
282
|
-
<param pos="1" name="os.product"/>
|
283
|
-
<param pos="2" name="os.build"/>
|
284
|
-
<param pos="3" name="os.version"/>
|
285
|
-
</fingerprint>
|
286
|
-
|
287
287
|
<fingerprint pattern="^(Windows (?:7|8|8\.1)(?:| RT)) (\d+)$">
|
288
288
|
<description>Windows 7/8</description>
|
289
289
|
<example>Windows 8 9200</example>
|
data/xml/snmp_sysdescr.xml
CHANGED
@@ -1895,7 +1895,6 @@ Copyright (c) 1995-2005 by Cisco Systems
|
|
1895
1895
|
<example>Dell Laser Printer 5100cn (Net 6.26, Controller 200408201123, Engine 01.00.04)</example>
|
1896
1896
|
<example>Dell Color Laser 3110cn; Net 8.29, Controller 200604102121, Engine 05.03.00</example>
|
1897
1897
|
<example>Dell Color Laser 5110cn; Net 11.33, Controller 200612011020, Engine 01.03.00</example>
|
1898
|
-
<example>Dell 2135cn MFP; Net 12.10, Controller 200903191302, Engine 03.00.10</example>
|
1899
1898
|
<example>Dell 1235cn; V1.70.01.06 Nov-14-2008;Engine 1.77.74;NIC V4.00.54 10-31-2008;S/N GJ8TJH1</example>
|
1900
1899
|
<example>Dell 1235cn; V1.70.01.08 Jan-29-2009;Engine 1.77.77;NIC V4.00.54 10-31-2008;S/N 9SMWJH1</example>
|
1901
1900
|
<param pos="0" name="os.vendor" value="Dell"/>
|
@@ -1938,15 +1937,6 @@ Copyright (c) 1995-2005 by Cisco Systems
|
|
1938
1937
|
<param pos="1" name="os.product"/>
|
1939
1938
|
</fingerprint>
|
1940
1939
|
|
1941
|
-
<fingerprint pattern="^Dell (\d{4}d?n) MFP.*$">
|
1942
|
-
<description>Dell Laser Printer</description>
|
1943
|
-
<example>Dell 2335dn MFP; 2.70.03.02;Engine 1.10.65;NIC V4.01.30(2335dn MFP) 02-05-2010;S/N JQF9FG1</example>
|
1944
|
-
<param pos="0" name="os.vendor" value="Dell"/>
|
1945
|
-
<param pos="0" name="os.family" value="Laser Printer"/>
|
1946
|
-
<param pos="0" name="os.device" value="Multifunction Device"/>
|
1947
|
-
<param pos="1" name="os.product"/>
|
1948
|
-
</fingerprint>
|
1949
|
-
|
1950
1940
|
<fingerprint pattern="^DELL Tape Library Remote Management Card$">
|
1951
1941
|
<description>Dell PowerVault Tape Library</description>
|
1952
1942
|
<example>DELL Tape Library Remote Management Card</example>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|