recog 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11aff7826c38e379d719a70b39406f4d861f8d3f
4
- data.tar.gz: 98f54e902871cb73ddcffbb7e0f72be5b21bf143
3
+ metadata.gz: 3dae72d67109cf15c20e6558c44ad5f738c87804
4
+ data.tar.gz: 8cc293a78015095182401d7683cb6af9e6ebdb9e
5
5
  SHA512:
6
- metadata.gz: 398dc88dfda3030d5d0e8da3c0774fc95ec99c2506f9f15ba528ef5ec930591f02f43d313ec5ed06cb4b7bb28798ef71bf53a539a6b50b8158a7f0b69877e0ed
7
- data.tar.gz: 19bf9ddccb4031ade9bf5d94feb4516df400816eaf81a894b24716e06ef7e5d5a2400bd0424d55875b38451fcad83edb7f99f7b00ac1e38fa059447682f17d0a
6
+ metadata.gz: cedc1ee373b890001b36169dad53ecd92566c2ee307e66d28d46c094ece296e73527a7b6d464182ad4ecdb665d35c55b7d5a129646c4d3eedaeeafdc44892f1b
7
+ data.tar.gz: 58f1a2f88709b31d1edc8c028f6848ac581f4c597c11d137eff2538b4d43ee65189c5c36ffdc7848077e2f32662618384d7b172195f8a9e34fd846de541c4bce
@@ -108,8 +108,11 @@ class Fingerprint
108
108
  return if params.empty?
109
109
  params.each do |param_name, pos_value|
110
110
  pos, value = pos_value
111
- next unless pos != 0 && !value.to_s.empty?
112
- yield :fail, "'#{@name}'s #{param_name} is a non-zero pos but specifies a value of '#{value}'"
111
+ if pos > 0 && !value.to_s.empty?
112
+ yield :fail, "'#{@name}'s #{param_name} is a non-zero pos but specifies a value of '#{value}'"
113
+ elsif pos == 0 && value.to_s.empty?
114
+ yield :fail, "'#{@name}'s #{param_name} is not a capture (pos=0) but doesn't specify a value"
115
+ end
113
116
  end
114
117
  end
115
118
 
@@ -1,3 +1,3 @@
1
1
  module Recog
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
@@ -31,6 +31,23 @@ describe Recog::DB do
31
31
  db.fingerprints.each_index do |i|
32
32
  fp = db.fingerprints[i]
33
33
 
34
+ context "#{fp.name}" do
35
+ fp.params.each do |param_name, pos_value|
36
+ pos, value = pos_value
37
+ it "doesn't have param values for capture params" do
38
+ if pos > 0 && !value.to_s.empty?
39
+ fail "'#{fp.name}'s #{param_name} is a non-zero pos but specifies a value of '#{value}'"
40
+ end
41
+ end
42
+
43
+ it "doesn't omit values for non-capture params" do
44
+ if pos == 0 && value.to_s.empty?
45
+ fail "'#{fp.name}'s #{param_name} is not a capture (pos=0) but doesn't specify a value"
46
+ end
47
+ end
48
+ end
49
+ end
50
+
34
51
  context "#{fp.regex}" do
35
52
 
36
53
  it "has a name" do
@@ -308,8 +308,7 @@ more text</example>
308
308
  <example>OOPS: vsftpd: root is not mounted.</example>
309
309
  <example>OOPS: cannot read user list file:/etc/vsftpd.user_list</example>
310
310
  <param pos="0" name="service.family" value="vsFTPd"/>
311
- <param pos="0" name="service.product" value="vsFTPd Extended"/>
312
- <param pos="0" name="service.version"/>
311
+ <param pos="0" name="service.product" value="vsFTPd"/>
313
312
  </fingerprint>
314
313
  <fingerprint pattern="^FileZilla Server(?: version)? (?:v)?(\d\.[\w.]+(?: beta)?).*$">
315
314
  <description>FileZilla FTP Server</description>
@@ -1070,7 +1069,7 @@ more text</example>
1070
1069
  <param pos="0" name="service.vendor" value="GNU"/>
1071
1070
  <param pos="1" name="service.version"/>
1072
1071
  <param pos="0" name="hw.vendor" value="ZyXEL"/>
1073
- <param pos="1" name="hw.family" value="WiMax"/>
1072
+ <param pos="0" name="hw.family" value="WiMax"/>
1074
1073
  <param pos="0" name="hw.device" value="WAP"/>
1075
1074
  </fingerprint>
1076
1075
  <fingerprint pattern="^Speedport W ?(\S+) (?:Typ [A|B] )?FTP Server v([\d.]+) ready$$">
@@ -1080,7 +1079,7 @@ more text</example>
1080
1079
  <example hw.product="722V" os.version="1.18.000">Speedport W722V FTP Server v1.18.000 ready</example>
1081
1080
  <param pos="0" name="hw.vendor" value="Deutsche Telekom"/>
1082
1081
  <param pos="0" name="hw.device" value="WAP"/>
1083
- <param pos="1" name="hw.family" value="Speedport"/>
1082
+ <param pos="0" name="hw.family" value="Speedport"/>
1084
1083
  <param pos="1" name="hw.product"/>
1085
1084
  <param pos="2" name="os.version"/>
1086
1085
  </fingerprint>
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: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rapid7 Research
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-22 00:00:00.000000000 Z
11
+ date: 2016-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.5.2
240
+ rubygems_version: 2.6.6
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: Network service fingerprint database, classes, and utilities
@@ -268,4 +268,3 @@ test_files:
268
268
  - spec/lib/recog/nizer_spec.rb
269
269
  - spec/lib/recog/verify_reporter_spec.rb
270
270
  - spec/spec_helper.rb
271
- has_rdoc: