recog 0.01 → 0.02

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2221758dde9a54ad057043aad3cad77ec8c8be7b
4
+ data.tar.gz: b2b077c53b397ebb0f32f88b38524e23ee8bae03
5
+ SHA512:
6
+ metadata.gz: 268d78f87daefe24734c09a665dec59f35ce26a3bdf1255669329c3ce1668e7fbbd8a93a59d47ee0d294bfdade4e6f505f022e3c2b2f9cb2798231753804da07
7
+ data.tar.gz: 8b953534f3954862bec8dbc987cd3d13dc92df8d65848517139dc12a4cddf575dfefdca91351428766a6c755817e549bd4735b85de41ea8924d1ef6f9b2f339f
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ script: bundle exec rspec spec
data/README.md CHANGED
@@ -3,6 +3,8 @@ Recog: A Recognition Framework
3
3
 
4
4
  Recog is a framework for identifying products, services, operating systems, and hardware by matching fingerprints against data returned from various network probes. Recog makes it simply to extract useful information from web server banners, snmp system description fields, and a whole lot more. Recog is open source, please see the [LICENSE](https://github.com/recog/LICENSE) file for more information.
5
5
 
6
+ [![Build Status](https://travis-ci.org/rapid7/recog.png)](https://travis-ci.org/rapid7/recog) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/rapid7/recog)
7
+ ==
6
8
 
7
9
  ## Installation
8
10
 
data/lib/recog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Recog
2
- VERSION = "0.01"
2
+ VERSION = "0.02"
3
3
  end
@@ -0,0 +1,46 @@
1
+ require_relative '../../lib/recog/db'
2
+
3
+ describe Recog::DB do
4
+ Dir[File.expand_path File.join('xml', '*.xml')].each do |xml_file_name|
5
+
6
+ describe "##{File.basename(xml_file_name)}" do
7
+
8
+ db = Recog::DB.new(xml_file_name)
9
+
10
+ it "has a match key" do
11
+ expect(db.match_key).not_to be_nil
12
+ expect(db.match_key).not_to be_empty
13
+ end
14
+
15
+ db.fingerprints.each do |fp|
16
+
17
+ context "#{fp.regex}" do
18
+
19
+ # Not yet enforced
20
+ # it "has a name" do
21
+ # expect(fp.name).not_to be_nil
22
+ # expect(fp.name).not_to be_empty
23
+ # end
24
+
25
+ it "has a regex" do
26
+ expect(fp.regex).not_to be_nil
27
+ expect(fp.regex.class).to be ::Regexp
28
+ end
29
+
30
+ # Not yet enforced
31
+ # it "has a test cases" do
32
+ # expect(fp.tests.length).not_to equal(0)
33
+ # end
34
+
35
+ fp.tests.each do |example|
36
+ it "passes self-test #{example.gsub(/\s+/, ' ')[0,32]}..." do
37
+ expect(fp.regex.match(example)).to_not eq(nil)
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+
44
+ end
45
+ end
46
+ end
data/xml/sip_banners.xml CHANGED
@@ -3,7 +3,7 @@
3
3
  SIP Server header values are matched against these patterns to fingerprint SIP devices.
4
4
  -->
5
5
 
6
- <fingerprint matches="sip_header.server">
6
+ <fingerprints matches="sip_header.server">
7
7
  <fingerprint pattern="^Cisco-SIPGateway/IOS-([\d\.x]+)$">
8
8
  <description>Cisco SIPGateway</description>
9
9
  <example>Cisco-SIPGateway/IOS-12.x</example>
@@ -0,0 +1,79 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ SIP User Agent header values are matched against these patterns to fingerprint SIP devices.
4
+ -->
5
+
6
+ <fingerprints matches="sip_header.user_agent">
7
+
8
+ <!-- Cisco Devices -->
9
+
10
+ <fingerprint pattern="^Cisco-SIPGateway/IOS-([\d\.x]+)$">
11
+ <description>Cisco SIPGateway</description>
12
+ <example>Cisco-SIPGateway/IOS-12.x</example>
13
+ <param pos="0" name="os.vendor" value="Cisco"/>
14
+ <param pos="0" name="os.product" value="IOS"/>
15
+ <param pos="1" name="os.version"/>
16
+ </fingerprint>
17
+
18
+
19
+ <!-- AVM.DE Devices -->
20
+
21
+ <fingerprint pattern="^FRITZ!OS$">
22
+ <description>AVM FritzOS Device</description>
23
+ <example>FRITZ!OS</example>
24
+ <param pos="0" name="os.vendor" value="AVM"/>
25
+ <param pos="0" name="os.product" value="FRITZ!BOX"/>
26
+ </fingerprint>
27
+
28
+ <fingerprint pattern="^(?:AVM )?(FRITZ!Box .*) +(\d+\.\d+\.\d+)">
29
+ <description>AVM FritzBox</description>
30
+ <example>AVM FRITZ!Box Fon 06.03.13</example>
31
+ <example>AVM FRITZ!Box Fon 06.03.65 (Jun 7 2005)</example>
32
+ <example>AVM FRITZ!Box Fon 06.03.89 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)</example>
33
+ <example>AVM FRITZ!Box Fon 5010 23.04.01 (Jan 25 2006)</example>
34
+ <example>AVM FRITZ!Box Fon 5010 Annex A 48.04.55 TAL (Mar 12 2008)</example>
35
+ <example>AVM FRITZ!Box Fon 5010 Annex A (ITA) 48.04.46 (Sep 14 2007)</example>
36
+ <example>AVM FRITZ!Box Fon 5012 (UI) 25.03.90 (3.01.03 tested by accredited T-Com test lab) (Oct 28 2005)</example>
37
+ <example>AVM FRITZ!Box Fon 5113 Annex A 83.04.69 (Dec 2 2008)</example>
38
+ <example>AVM FRITZ!Box Fon 5124 56.04.77 (Feb 14 2014)</example>
39
+ <example>AVM FRITZ!Box Fon 7170 Annex A.B ML Speedport W701V 58.04.67 (Dec 18 2008)</example>
40
+ <example>AVM FRITZ!Box 3272 126.05.50 (Feb 27 2013)</example>
41
+ <example>AVM FRITZ!Box 5050 (UI) 12.04.50 (Jan 30 2008)</example>
42
+ <example>AVM FRITZ!Box 6320 Cable 104.05.25 TAL (Jun 8 2012)</example>
43
+ <example>AVM FRITZ!Box 6320 v2 Cable 110.05.50 (Jan 31 2013)</example>
44
+ <example>AVM FRITZ!Box 6340 Cable (kbw) 115.05.50 (Jan 31 2013)</example>
45
+ <example>AVM FRITZ!Box 6810 LTE 108.05.50 (Feb 15 2013)</example>
46
+ <example>AVM FRITZ!Box 7170 Annex A 58.04.85 (Apr 4 2011)</example>
47
+ <example>AVM FRITZ!Box 7312 117.05.23 TAL (Jun 1 2012)</example>
48
+ <example>AVM FRITZ!Box Fon WLAN 7150 by TemTec EDV-Service 29.04.67 TAL (Nov 21 2008)</example>
49
+ <example>AVM FRITZ!Box Fon WLAN 7170 28.04.43 (Sep 14 2007)</example>
50
+ <example>AVM FRITZ!Box WLAN 3270 v3 Edition Italia 125.05.23 (Jul 6 2012)</example>
51
+ <example>AVM FRITZ!Box WLAN 3270 v3 Edition Italia 125.05.52 (Feb 7 2014)</example>
52
+ <example>AVM FRITZ!Box Speedport W701V Annex A 58.04.82 (May 12 2010)</example>
53
+ <param pos="0" name="os.vendor" value="AVM"/>
54
+ <param pos="0" name="os.family" value="FRITZ!Box"/>
55
+ <param pos="1" name="os.product"/>
56
+ <param pos="2" name="os.version"/>
57
+ </fingerprint>
58
+
59
+ <fingerprint pattern="^(?:AVM )?(FRITZ!Fon .*) +(\d+\.\d+\.\d+)">
60
+ <description>AVM FritzFon</description>
61
+ <example>AVM FRITZ!Fon 7150 (fs) 38.04.56 (Mar 31 2008)</example>
62
+ <example>AVM FRITZ!Fon WLAN 7150 Annex A 58.04.84 (Apr 4 2011)</example>
63
+ <param pos="0" name="os.vendor" value="AVM"/>
64
+ <param pos="0" name="os.family" value="FRITZ!Fon"/>
65
+ <param pos="1" name="os.product"/>
66
+ <param pos="2" name="os.version"/>
67
+ </fingerprint>
68
+
69
+ <fingerprint pattern="^(?:AVM )?(Multibox .*) +(\d+\.\d+\.\d+)">
70
+ <description>AVM Multibox</description>
71
+ <example>AVM Multibox 7390 NGN 84.05.09 (Jan 13 2012)</example>
72
+ <param pos="0" name="os.vendor" value="AVM"/>
73
+ <param pos="0" name="os.family" value="Multibox"/>
74
+ <param pos="1" name="os.product"/>
75
+ <param pos="2" name="os.version"/>
76
+ </fingerprint>
77
+
78
+
79
+ </fingerprints>
metadata CHANGED
@@ -1,78 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recog
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.01'
5
- prerelease:
4
+ version: '0.02'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Rapid7 Research
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-05 00:00:00.000000000 Z
11
+ date: 2014-08-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: cucumber
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: aruba
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: nokogiri
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  description: Recog is a framework for identifying products, services, operating systems,
@@ -88,8 +79,9 @@ executables:
88
79
  extensions: []
89
80
  extra_rdoc_files: []
90
81
  files:
91
- - .gitignore
92
- - .rspec
82
+ - ".gitignore"
83
+ - ".rspec"
84
+ - ".travis.yml"
93
85
  - Gemfile
94
86
  - Gemfile.lock
95
87
  - LICENSE
@@ -127,6 +119,7 @@ files:
127
119
  - spec/data/smb_native_os.txt
128
120
  - spec/data/test_fingerprints.xml
129
121
  - spec/lib/db_spec.rb
122
+ - spec/lib/fingerprint_self_test_spec.rb
130
123
  - spec/lib/formatter_spec.rb
131
124
  - spec/lib/match_reporter_spec.rb
132
125
  - spec/lib/nizer_spec.rb
@@ -145,6 +138,7 @@ files:
145
138
  - xml/pop_banners.xml
146
139
  - xml/rsh_resp.xml
147
140
  - xml/sip_banners.xml
141
+ - xml/sip_user_agents.xml
148
142
  - xml/smb_native_os.xml
149
143
  - xml/smtp_banners.xml
150
144
  - xml/smtp_debug.xml
@@ -164,27 +158,26 @@ files:
164
158
  - xml/upnp_banners.xml
165
159
  homepage: https://www.github.com/rapid7/recog
166
160
  licenses: []
161
+ metadata: {}
167
162
  post_install_message:
168
163
  rdoc_options: []
169
164
  require_paths:
170
165
  - lib
171
166
  required_ruby_version: !ruby/object:Gem::Requirement
172
- none: false
173
167
  requirements:
174
- - - ! '>='
168
+ - - ">="
175
169
  - !ruby/object:Gem::Version
176
170
  version: '0'
177
171
  required_rubygems_version: !ruby/object:Gem::Requirement
178
- none: false
179
172
  requirements:
180
- - - ! '>='
173
+ - - ">="
181
174
  - !ruby/object:Gem::Version
182
175
  version: '0'
183
176
  requirements: []
184
177
  rubyforge_project:
185
- rubygems_version: 1.8.23
178
+ rubygems_version: 2.2.2
186
179
  signing_key:
187
- specification_version: 3
180
+ specification_version: 4
188
181
  summary: Network service fingerprint database, classes, and utilities
189
182
  test_files: []
190
183
  has_rdoc: