recog 0.01

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/.gitignore +3 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +42 -0
  5. data/LICENSE +23 -0
  6. data/README.md +63 -0
  7. data/bin/recog_export.rb +81 -0
  8. data/bin/recog_match.rb +51 -0
  9. data/bin/recog_verify.rb +45 -0
  10. data/features/match.feature +16 -0
  11. data/features/support/env.rb +5 -0
  12. data/features/verify.feature +31 -0
  13. data/features/xml/banners.xml +2 -0
  14. data/features/xml/failing_banners_fingerprints.xml +20 -0
  15. data/features/xml/matching_banners_fingerprints.xml +22 -0
  16. data/features/xml/no_tests.xml +53 -0
  17. data/features/xml/successful_tests.xml +33 -0
  18. data/features/xml/tests_with_failures.xml +10 -0
  19. data/features/xml/tests_with_warnings.xml +10 -0
  20. data/lib/recog.rb +3 -0
  21. data/lib/recog/db.rb +38 -0
  22. data/lib/recog/db_manager.rb +27 -0
  23. data/lib/recog/fingerprint.rb +60 -0
  24. data/lib/recog/formatter.rb +51 -0
  25. data/lib/recog/match_reporter.rb +77 -0
  26. data/lib/recog/matcher.rb +60 -0
  27. data/lib/recog/matcher_factory.rb +14 -0
  28. data/lib/recog/nizer.rb +263 -0
  29. data/lib/recog/verifier.rb +46 -0
  30. data/lib/recog/verifier_factory.rb +13 -0
  31. data/lib/recog/verify_reporter.rb +85 -0
  32. data/lib/recog/version.rb +3 -0
  33. data/recog.gemspec +34 -0
  34. data/spec/data/best_os_match_1.yml +17 -0
  35. data/spec/data/best_os_match_2.yml +17 -0
  36. data/spec/data/best_service_match_1.yml +17 -0
  37. data/spec/data/smb_native_os.txt +31 -0
  38. data/spec/data/test_fingerprints.xml +24 -0
  39. data/spec/lib/db_spec.rb +89 -0
  40. data/spec/lib/formatter_spec.rb +69 -0
  41. data/spec/lib/match_reporter_spec.rb +90 -0
  42. data/spec/lib/nizer_spec.rb +124 -0
  43. data/spec/lib/verify_reporter_spec.rb +112 -0
  44. data/xml/apache_os.xml +295 -0
  45. data/xml/architecture.xml +45 -0
  46. data/xml/ftp_banners.xml +808 -0
  47. data/xml/h323_callresp.xml +701 -0
  48. data/xml/hp_pjl_id.xml +435 -0
  49. data/xml/http_cookies.xml +379 -0
  50. data/xml/http_servers.xml +3326 -0
  51. data/xml/http_wwwauth.xml +412 -0
  52. data/xml/imap_banners.xml +267 -0
  53. data/xml/nntp_banners.xml +51 -0
  54. data/xml/ntp_banners.xml +538 -0
  55. data/xml/pop_banners.xml +452 -0
  56. data/xml/rsh_resp.xml +90 -0
  57. data/xml/sip_banners.xml +14 -0
  58. data/xml/smb_native_os.xml +385 -0
  59. data/xml/smtp_banners.xml +1738 -0
  60. data/xml/smtp_debug.xml +45 -0
  61. data/xml/smtp_ehlo.xml +53 -0
  62. data/xml/smtp_expn.xml +95 -0
  63. data/xml/smtp_help.xml +212 -0
  64. data/xml/smtp_mailfrom.xml +24 -0
  65. data/xml/smtp_noop.xml +45 -0
  66. data/xml/smtp_quit.xml +31 -0
  67. data/xml/smtp_rcptto.xml +33 -0
  68. data/xml/smtp_rset.xml +23 -0
  69. data/xml/smtp_turn.xml +23 -0
  70. data/xml/smtp_vrfy.xml +109 -0
  71. data/xml/snmp_sysdescr.xml +8008 -0
  72. data/xml/snmp_sysobjid.xml +284 -0
  73. data/xml/ssh_banners.xml +790 -0
  74. data/xml/upnp_banners.xml +590 -0
  75. metadata +190 -0
@@ -0,0 +1,3 @@
1
+ # ignore rvm files
2
+ .ruby-version
3
+ .ruby-gemset
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'nokogiri'
4
+
5
+ group :test do
6
+ gem 'rspec', '~> 2.14.1'
7
+ gem 'cucumber', '~> 1.3.8'
8
+ gem 'aruba', '~> 0.5.3'
9
+ end
@@ -0,0 +1,42 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ aruba (0.5.3)
5
+ childprocess (>= 0.3.6)
6
+ cucumber (>= 1.1.1)
7
+ rspec-expectations (>= 2.7.0)
8
+ builder (3.2.2)
9
+ childprocess (0.3.9)
10
+ ffi (~> 1.0, >= 1.0.11)
11
+ cucumber (1.3.10)
12
+ builder (>= 2.1.2)
13
+ diff-lcs (>= 1.1.3)
14
+ gherkin (~> 2.12)
15
+ multi_json (>= 1.7.5, < 2.0)
16
+ multi_test (>= 0.0.2)
17
+ diff-lcs (1.2.5)
18
+ ffi (1.9.3)
19
+ gherkin (2.12.2)
20
+ multi_json (~> 1.3)
21
+ mini_portile (0.5.2)
22
+ multi_json (1.8.2)
23
+ multi_test (0.0.3)
24
+ nokogiri (1.6.1)
25
+ mini_portile (~> 0.5.0)
26
+ rspec (2.14.1)
27
+ rspec-core (~> 2.14.0)
28
+ rspec-expectations (~> 2.14.0)
29
+ rspec-mocks (~> 2.14.0)
30
+ rspec-core (2.14.7)
31
+ rspec-expectations (2.14.4)
32
+ diff-lcs (>= 1.1.3, < 2.0)
33
+ rspec-mocks (2.14.4)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ aruba (~> 0.5.3)
40
+ cucumber (~> 1.3.8)
41
+ nokogiri
42
+ rspec (~> 2.14.1)
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2014, Rapid7
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice, this
11
+ list of conditions and the following disclaimer in the documentation and/or
12
+ other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,63 @@
1
+ Recog: A Recognition Framework
2
+ =====
3
+
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
+
6
+
7
+ ## Installation
8
+
9
+ Recog consists of both XML fingerprint files and an assortment of code, mostly in Ruby, that makes it easy to develop, test, and use the contained fingerprints. In order to use the included ruby code, a recent version of Ruby (1.9.3+) is required, along with Rubygems and the `bundler` gem. Once these dependencies are in place, use the following commands to grab the latest source code and install any additional dependencies.
10
+
11
+ $ git clone git@github.com:rapid7/recog.git
12
+ $ cd recog
13
+ $ bundle install
14
+
15
+ ## Maturity
16
+
17
+ Please note that while the XML fingerprints themselves are quite stable and well-tested, the Ruby codebase in Recog is still fairly new and subject to change quickly. Please contact us (research[at]rapid7.com) before leveraging the Recog code within any production projects.
18
+
19
+ ## Fingerprints
20
+
21
+ The fingerprints within Recog are stored in XML files, each of which is designed to match a specific protocol response string or field. For example, the file [ssh_banners.xml](https://github.com/recog/xml/ssh_banners.xml) can determine the os, vendor, and sometimes hardware product by matching the initial SSH daemon banner string.
22
+
23
+ A fingerprint file consists of an XML document like the following:
24
+
25
+ 01: <?xml version="1.0"?>
26
+ 02:
27
+ 03: <fingerprints matches="ssh.banner">
28
+ 04:
29
+ 05: <fingerprint pattern="^RomSShell_([\d\.]+)$">
30
+ 06: <description>Allegro RomSShell SSH</description>
31
+ 07: <example>RomSShell_4.62</example>
32
+ 08: <param pos="0" name="service.vendor" value="Allegro"/>
33
+ 09: <param pos="0" name="service.product" value="RomSShell"/>
34
+ 10: <param pos="1" name="service.version"/>
35
+ 11: </fingerprint>
36
+ 12:
37
+ 13: </fingerprints>
38
+
39
+ The first line should always consist of the XML version declaration. The first element should always be a <fingerpints/> block with a `matches` attribute indicating what this fingerprint file is supposed to match. The `matches` attribute is normally in the form of protocol.field.
40
+
41
+ Inside of the <fingerprints/> element there should be one or more <fingerprint/> elements. Every fingerprint should contain a `pattern` attribute, which contains the regular expression to be used against the match key.
42
+
43
+ Inside of the fingerprint, a <description/> element should contain a human-readable string describing this fingerprint.
44
+
45
+ The <example/> element should contain a successful match for the fingerprint's `pattern`. Multiple <example/> elements are preferred, as these elements are used for the built-in regression testing suite.
46
+
47
+ the <param/> elements contain a `pos` attribute, which indicates what capture field from the `pattern` should be extracted, or `0` for a static string. The `name` attribute is the key that will be reported in the case of a successful match and the `value` will either be a static string for `pos` values of `0` or missing and taken from the captured field.
48
+
49
+ Once a fingerprint has been added, the <examples/> entries can be tested by executing `bin/recog_verify.rb` against the fingerprint file:
50
+
51
+ $ bin/recog_verify.rb xml/ssh_banners.xml
52
+
53
+ Matches can be tested on the command-line in a similar fashion:
54
+
55
+ $ echo 'OpenSSH_6.6p1 Ubuntu-2ubuntu1' | bin/recog_match.rb xml/ssh_banners.xml -
56
+ MATCH: {"service.version"=>"6.6p1", "openssh.comment"=>"Ubuntu-2ubuntu1", "service.vendor"=>"OpenBSD", "service.family"=>"OpenSSH", "service.product"=>"OpenSSH", "data"=>"OpenSSH_6.6p1 Ubuntu-2ubuntu1"}
57
+
58
+
59
+
60
+
61
+
62
+
63
+
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
4
+ require 'optparse'
5
+ require 'ostruct'
6
+ require 'recog'
7
+
8
+ def squash_lines(str)
9
+ str.split(/\n/).join(' ').gsub(/\s+/, ' ')
10
+ end
11
+
12
+ def export_text(options)
13
+ end
14
+
15
+ def export_ruby(options)
16
+ $stdout.puts "# Recog fingerprint database export [ #{File.basename(options.xml_file)} ] on #{Time.now.to_s}"
17
+ $stdout.puts "fp_str = '' # Set this value to the match string"
18
+ $stdout.puts "fp_match = {} # Match results are stored here"
19
+ $stdout.puts ""
20
+ $stdout.puts "case fp_str"
21
+ options.db.fingerprints.each do |fp|
22
+ puts " # #{squash_lines fp.name}"
23
+ puts " when /#{fp.regex.to_s}/"
24
+ fp.tests.each do |test|
25
+ puts " # Example: #{squash_lines test}"
26
+ end
27
+ fp.params.each_pair do |k,v|
28
+ if v[0] == 0
29
+ puts " fp_match[#{k.inspect}] = #{v[1].inspect}"
30
+ else
31
+ puts " fp_match[#{k.inspect}] = $#{v[0].to_s}"
32
+ end
33
+ end
34
+ puts ""
35
+ end
36
+ $stdout.puts "end"
37
+ end
38
+
39
+
40
+ options = OpenStruct.new(etype: :ruby)
41
+
42
+ option_parser = OptionParser.new do |opts|
43
+ opts.banner = "Usage: #{$0} [options] XML_FINGERPRINTS_FILE"
44
+ opts.separator "Exports an XML fingerprint database to another format."
45
+ opts.separator ""
46
+ opts.separator "Options"
47
+
48
+ opts.on("-t", "--type type",
49
+ "Choose a type of export.",
50
+ " [r]uby (default - export a ruby case statement with regular expressions)",
51
+ " [t]ext (export a text description of the fingerprints)") do |etype|
52
+ case etype.downcase
53
+ when /^r/
54
+ options.etype = :ruby
55
+ when /^t/
56
+ options.etype = :text
57
+ end
58
+ end
59
+
60
+ opts.on("-h", "--help", "Show this message.") do
61
+ puts opts
62
+ exit
63
+ end
64
+ end
65
+ option_parser.parse!(ARGV)
66
+
67
+ if ARGV.count != 1
68
+ puts option_parser
69
+ exit
70
+ end
71
+
72
+ options.xml_file = ARGV.shift
73
+ options.db = Recog::DB.new(options.xml_file)
74
+
75
+ case options.etype
76
+ when :ruby
77
+ export_ruby(options)
78
+ when :text
79
+ export_text(options)
80
+ end
81
+
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
4
+ require 'optparse'
5
+ require 'ostruct'
6
+ require 'recog'
7
+ require 'recog/matcher_factory'
8
+
9
+ options = OpenStruct.new(color: false, detail: false, fail_fast: false)
10
+
11
+ option_parser = OptionParser.new do |opts|
12
+ opts.banner = "Usage: #{$0} [options] XML_FINGERPRINT_FILE <BANNERS_FILE>"
13
+ opts.separator "Identifies the matches and misses between the fingerprints and the banners file."
14
+ opts.separator ""
15
+ opts.separator "Options"
16
+
17
+ opts.on("-f", "--format FORMATTER",
18
+ "Choose a formatter.",
19
+ " [s]ummary (default - failure/match msgs)",
20
+ " [d]etail (msgs with total counts)") do |format|
21
+ if format.start_with? 'd'
22
+ options.detail = true
23
+ end
24
+ end
25
+
26
+ opts.on("--fail-fast [NUM]",
27
+ "Stop after number of failures (default: 10).") do |num|
28
+ options.fail_fast = true
29
+ options.stop_after = (num.to_i == 0) ? 10 : num.to_i
30
+ end
31
+
32
+ opts.on("-c", "--color", "Enable color in the output.") do
33
+ options.color = true
34
+ end
35
+
36
+ opts.on("-h", "--help", "Show this message.") do
37
+ puts opts
38
+ exit
39
+ end
40
+ end
41
+ option_parser.parse!(ARGV)
42
+
43
+ if ARGV.count != 2
44
+ puts option_parser
45
+ exit
46
+ end
47
+
48
+ ndb = Recog::DB.new(ARGV.shift)
49
+ options.fingerprints = ndb.fingerprints
50
+ matcher = Recog::MatcherFactory.build(options)
51
+ matcher.match_banners(ARGV.shift || "-")
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
4
+ require 'optparse'
5
+ require 'ostruct'
6
+ require 'recog'
7
+ require 'recog/verifier_factory'
8
+
9
+ options = OpenStruct.new(color: false, detail: false)
10
+
11
+ option_parser = OptionParser.new do |opts|
12
+ opts.banner = "Usage: #{$0} [options] XML_FINGERPRINTS_FILE"
13
+ opts.separator "Verifies that each fingerprint passes its internal tests."
14
+ opts.separator ""
15
+ opts.separator "Options"
16
+
17
+ opts.on("-f", "--format FORMATTER",
18
+ "Choose a formatter.",
19
+ " [s]ummary (default - failure/warning msgs and summary)",
20
+ " [d]etail (fingerprint name with tests and expanded summary)") do |format|
21
+ if format.start_with? 'd'
22
+ options.detail = true
23
+ end
24
+ end
25
+
26
+ opts.on("-c", "--color", "Enable color in the output.") do
27
+ options.color = true
28
+ end
29
+
30
+ opts.on("-h", "--help", "Show this message.") do
31
+ puts opts
32
+ exit
33
+ end
34
+ end
35
+ option_parser.parse!(ARGV)
36
+
37
+ if ARGV.count != 1
38
+ puts option_parser
39
+ exit
40
+ end
41
+
42
+ ndb = Recog::DB.new(ARGV.shift)
43
+ options.fingerprints = ndb.fingerprints
44
+ verifier = Recog::VerifierFactory.build(options)
45
+ verifier.verify_tests
@@ -0,0 +1,16 @@
1
+ Feature: Match
2
+ Scenario: Finds matches
3
+ When I run `match.rb matching_banners_fingerprints.xml banners.xml`
4
+ Then it should pass with:
5
+ """
6
+ MATCH: {"pureftpd.config"=>"[privsep] [TLS] ", "service.family"=>"Pure-FTPd", "service.product"=>"Pure-FTPd", "data"=>"---------- Welcome to Pure-FTPd [privsep] [TLS] ----------"}
7
+ MATCH: {"os.vendor"=>"Sun", "os.family"=>"Solaris", "os.product"=>"Solaris", "os.device"=>"General", "host.name"=>"polaris", "os.version"=>"5.8", "data"=>"polaris FTP server (SunOS 5.8) ready."}
8
+ """
9
+
10
+ Scenario: Fails at finding matches
11
+ When I run `match.rb failing_banners_fingerprints.xml banners.xml`
12
+ Then it should pass with:
13
+ """
14
+ FAIL: ---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
15
+ FAIL: polaris FTP server (SunOS 5.8) ready
16
+ """
@@ -0,0 +1,5 @@
1
+ require 'aruba/cucumber'
2
+
3
+ Before do
4
+ @dirs = ["features/xml"]
5
+ end
@@ -0,0 +1,31 @@
1
+ Feature: Verify
2
+ Scenario: No tests
3
+ When I run `verify.rb no_tests.xml`
4
+ Then it should pass with:
5
+ """
6
+ SUMMARY: Test completed with 0 successful, 0 warnings, and 0 failures
7
+ """
8
+
9
+ Scenario: Successful tests
10
+ When I run `verify.rb successful_tests.xml`
11
+ Then it should pass with:
12
+ """
13
+ SUMMARY: Test completed with 2 successful, 0 warnings, and 0 failures
14
+ """
15
+
16
+ Scenario: Tests with warnings
17
+ When I run `verify.rb tests_with_warnings.xml`
18
+ Then it should pass with:
19
+ """
20
+ WARN: 'Pure-FTPd' failed to match \"---------- Welcome to Pure-FTPd ----------\" key 'pureftpd.config'' with (?-mix:^-{10} Welcome to Pure-FTPd (.*)-{10}$)'
21
+ SUMMARY: Test completed with 1 successful, 1 warnings, and 0 failures
22
+ """
23
+
24
+ Scenario: Tests with failures
25
+ When I run `verify.rb tests_with_failures.xml`
26
+ Then it should pass with:
27
+ """
28
+ FAIL: 'foo test' failed to match "bar" with (?-mix:^foo$)'
29
+ FAIL: '' failed to match "This almost matches" with (?-mix:^This matches$)'
30
+ SUMMARY: Test completed with 0 successful, 0 warnings, and 2 failures
31
+ """
@@ -0,0 +1,2 @@
1
+ ---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
2
+ polaris FTP server (SunOS 5.8) ready.
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0"?>
2
+ <fingerprints>
3
+ <fingerprint pattern="^=\(.\*.\)=-\.:\. \(\( Welcome to PureFTPd (\d+\..+) \)\) \.:\.-=\(.\*.\)=-$">
4
+ <example>=(&lt;*&gt;)=-.:. (( Welcome to PureFTPd 1.1.0 )) .:.-=(&lt;*&gt;)=-</example>
5
+ <description>Older Pure-FTPd versions</description>
6
+ <param pos="0" name="service.family" value="Pure-FTPd"/>
7
+ <param pos="0" name="service.product" value="Pure-FTPd"/>
8
+ <param pos="1" name="service.version"/>
9
+ </fingerprint>
10
+ <fingerprint pattern="^(\S+) FTP Server \(Solaris (\S+)\) ready\.?$" flags="REG_ICASE">
11
+ <description>SunOS/Solaris</description>
12
+ <example>example.com FTP server (Solaris 5.7) ready.</example>
13
+ <param pos="0" name="os.vendor" value="Sun"/>
14
+ <param pos="0" name="os.family" value="Solaris"/>
15
+ <param pos="0" name="os.product" value="Solaris"/>
16
+ <param pos="0" name="os.device" value="General"/>
17
+ <param pos="1" name="host.name"/>
18
+ <param pos="2" name="os.version"/>
19
+ </fingerprint>
20
+ </fingerprints>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0"?>
2
+ <fingerprints>
3
+ <fingerprint pattern="^-{10} Welcome to Pure-FTPd (.*)-{10}$">
4
+ <example>---------- Welcome to Pure-FTPd ----------</example>
5
+ <description>Pure-FTPd
6
+ Config data can be zero or more of: [privsep] [TLS]
7
+ </description>
8
+ <param pos="1" name="pureftpd.config"/>
9
+ <param pos="0" name="service.family" value="Pure-FTPd"/>
10
+ <param pos="0" name="service.product" value="Pure-FTPd"/>
11
+ </fingerprint>
12
+ <fingerprint pattern="^(\S+) FTP Server \(SunOS (\S+)\) ready\.?$" flags="REG_ICASE">
13
+ <description>SunOS/Solaris</description>
14
+ <example>example.com FTP server (SunOS 5.7) ready.</example>
15
+ <param pos="0" name="os.vendor" value="Sun"/>
16
+ <param pos="0" name="os.family" value="Solaris"/>
17
+ <param pos="0" name="os.product" value="Solaris"/>
18
+ <param pos="0" name="os.device" value="General"/>
19
+ <param pos="1" name="host.name"/>
20
+ <param pos="2" name="os.version"/>
21
+ </fingerprint>
22
+ </fingerprints>
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ SMTP response lines to the EHLO command are matched against these patterns
4
+ (1 line at a time) to fingerprint SMTP servers.
5
+
6
+ See comment at the top of smtp_banners.xml for additional info.
7
+ -->
8
+
9
+ <fingerprints>
10
+ <fingerprint pattern="^500[ -]Syntax error, command &quot;XXXX&quot; unrecognized$">
11
+ <description>
12
+ Cisco PIX changes the command letters to 'X' before passing
13
+ them to the real SMTP server.
14
+ </description>
15
+ <param pos="0" name="service.vendor" value="Cisco"/>
16
+ <param pos="0" name="service.family" value="PIX"/>
17
+ <param pos="0" name="service.product" value="PIX"/>
18
+ </fingerprint>
19
+
20
+ <!--
21
+ Don't try to infer a fingerprint from XEXCH50, because if we do, it might overwrite
22
+ a very precise MS IIS SMTP service or MS Exchange Server fingerprint found with the
23
+ help of smtp_banners.xml. Instead, this case is handled specially by the Jess rule
24
+ smtp-iis-xexch50-svc-fingerprint. -mrb
25
+
26
+ <fingerprint pattern="^250[ -] *XEXCH50.*$">
27
+ <description>
28
+ Microsoft Exchange/IIS server
29
+ </description>
30
+ <param pos="0" name="service.vendor" value="Microsoft"/>
31
+ <param pos="0" name="service.family" value="IIS"/>
32
+ <param pos="0" name="service.product" value="IIS"/>
33
+ <param pos="0" name="os.vendor" value="Microsoft"/>
34
+ <param pos="0" name="os.family" value="Windows"/>
35
+ <param pos="0" name="os.device" value="General"/>
36
+ <param pos="0" name="os.product" value="Windows"/>
37
+ </fingerprint>
38
+ -->
39
+
40
+ <fingerprint pattern="^221[ -]See ya in cyberspace$">
41
+ <description>
42
+ 221 See ya in cyberspace
43
+ </description>
44
+ <param pos="0" name="service.vendor" value="Alt-N"/>
45
+ <param pos="0" name="service.family" value="MDaemon"/>
46
+ <param pos="0" name="service.product" value="MDaemon"/>
47
+ <param pos="0" name="os.vendor" value="Microsoft"/>
48
+ <param pos="0" name="os.family" value="Windows"/>
49
+ <param pos="0" name="os.device" value="General"/>
50
+ <param pos="0" name="os.product" value="Windows"/>
51
+ <param pos="0" name="os.arch" value="x86"/>
52
+ </fingerprint>
53
+ </fingerprints>