intrigue-ident 0.48 → 0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/checks/nginx.rb CHANGED
@@ -13,8 +13,22 @@ module Check
13
13
  :version => nil,
14
14
  :match_type => :content_headers,
15
15
  :match_content => /server: nginx/i,
16
- :dynamic_version => lambda { |x| x["details"]["headers"].select{|h| h=~/nginx/}.first.split("/").last },
17
- :examples => ["https://api.appfire.com:443"],
16
+ :dynamic_version => lambda { |x| _first_header_capture(x,/server:(.*)/,["nginx","/"]) },
17
+ :examples => [
18
+ "https://api.appfire.com:443"
19
+ ],
20
+ :paths => ["#{url}"]
21
+ },
22
+ {
23
+ :type => "application",
24
+ :vendor => "Nginx",
25
+ :product =>"Nginx",
26
+ :match_details =>"nginx default 404 page - TODO needs multiline",
27
+ :version => nil,
28
+ :match_type => :content_body,
29
+ :match_content => /<hr><center>nginx<\/center>/i,
30
+ :examples => [ "http://202.1.239.132:80" ],
31
+ :hide => true,
18
32
  :paths => ["#{url}"]
19
33
  }
20
34
  ]
@@ -0,0 +1,25 @@
1
+ module Intrigue
2
+ module Ident
3
+ module Check
4
+ class Okta < Intrigue::Ident::Check::Base
5
+
6
+ def generate_checks(url)
7
+ [
8
+ {
9
+ :type => "service",
10
+ :vendor =>"Okta",
11
+ :product =>"Okta",
12
+ :match_details =>"okta auth",
13
+ :version => nil,
14
+ :match_type => :content_headers,
15
+ :match_content => /x-okta-backend/i,
16
+ :examples => ["http://autodiscover.westrsc.com:80"],
17
+ :paths => ["#{url}"]
18
+ }
19
+ ]
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
data/lib/checks/oracle.rb CHANGED
@@ -5,17 +5,31 @@ module Check
5
5
 
6
6
  def generate_checks(url)
7
7
  [
8
+ {
9
+ :type => "application",
10
+ :vendor => "Oracle",
11
+ :product =>"Application Server",
12
+ :match_details =>"Oracle app server listed in server header",
13
+ :references => [],
14
+ :version => nil,
15
+ :match_type => :content_headers,
16
+ :match_content => /server: Oracle-Application-Server/,
17
+ :hide => false,
18
+ :dynamic_version => lambda { |x| _first_header_capture(x,/server:.*\/(.*) Oracle-HTTP-Server,/) },
19
+ :examples => ["https://63.85.74.53:443"],
20
+ :paths => ["#{url}"]
21
+ },
8
22
  {
9
23
  :type => "application",
10
24
  :vendor => "Oracle",
11
25
  :product =>"Glassfish",
12
26
  :match_details =>"Oracle / Sun GlassFish Enterprise Server",
13
- :url => "",
27
+ :references => [],
14
28
  :version => nil,
15
29
  :match_type => :content_headers,
16
30
  :match_content => /Sun GlassFish Enterprise Server/,
17
- :hide => true,
18
- :dynamic_version => lambda { |x| x["details"]["headers"].join("\n").match(/Sun GlassFish Enterprise Server v([\d\.])/).captures[0] },
31
+ :hide => false,
32
+ :dynamic_version => lambda { |x| _first_header_capture(x,/Sun GlassFish Enterprise Server\sv([\d\.]+)/) },
19
33
  :examples => ["http://52.4.12.185/"],
20
34
  :paths => ["#{url}"]
21
35
  },
@@ -24,14 +38,32 @@ module Check
24
38
  :vendor => "Oracle",
25
39
  :product =>"Glassfish",
26
40
  :match_details =>"Oracle / Sun GlassFish Enterprise Server",
27
- :url => "",
41
+ :references => [],
28
42
  :version => nil,
29
43
  :match_type => :content_headers,
30
44
  :match_content => /GlassFish Server Open Source Edition/,
31
- :hide => true,
32
- :dynamic_version => lambda { |x| x["details"]["headers"].join("\n").match(/GlassFish Server Open Source Edition\s+([\d\.]+)$/).captures[0] },
45
+ :hide => false,
46
+ :dynamic_version => lambda { |x| _first_header_capture(x,/GlassFish Server Open Source Edition\s+([\d\.]+)$/) },
33
47
  :examples => ["http://52.2.97.57:80"],
34
48
  :paths => ["#{url}"]
49
+ },
50
+ {
51
+ :type => "application",
52
+ :vendor => "Oracle",
53
+ :product =>"JavaServer Faces",
54
+ :match_details =>"viewstate inclusion of javaserver faces",
55
+ :references => [
56
+ "http://www.oracle.com/technetwork/java/javaee/javaserverfaces-139869.html",
57
+ "http://www.oracle.com/technetwork/topics/index-090910.html",
58
+ "https://www.owasp.org/index.php/Java_Server_Faces",
59
+ "https://www.alphabot.com/security/blog/2017/java/Misconfigured-JSF-ViewStates-can-lead-to-severe-RCE-vulnerabilities.html"
60
+ ],
61
+ :version => nil,
62
+ :match_type => :content_body,
63
+ :match_content => /javax.faces.ViewState/,
64
+ :hide => false,
65
+ :examples => ["https://reset.oxy.com:443"],
66
+ :paths => ["#{url}"]
35
67
  }
36
68
  ]
37
69
  end
data/lib/checks/php.rb ADDED
@@ -0,0 +1,28 @@
1
+ module Intrigue
2
+ module Ident
3
+ module Check
4
+ class Php < Intrigue::Ident::Check::Base
5
+
6
+ def generate_checks(url)
7
+ [
8
+ {
9
+ :type => "application",
10
+ :vendor =>"PHP",
11
+ :product =>"PHP",
12
+ :match_details =>"",
13
+ :version => nil,
14
+ :match_type => :content_headers,
15
+ :match_content => /x-powered-by: PHP/i,
16
+ :dynamic_version => lambda { |x|
17
+ _first_header_capture(x,/x-powered-by: PHP\/(.*)/i,)
18
+ },
19
+ :examples => ["http://78.40.183.96:8081"],
20
+ :paths => ["#{url}"]
21
+ }
22
+ ]
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Intrigue
2
+ module Ident
3
+ module Check
4
+ class Zscaler < Intrigue::Ident::Check::Base
5
+
6
+ def generate_checks(url)
7
+ [
8
+ {
9
+ :type => "application",
10
+ :vendor =>"Restlet",
11
+ :product =>"Restlet",
12
+ :match_details =>"server header for Restlet",
13
+ :references => ["http://restlet.com/company/blog/2016/02/03/api-testing-testing-web-apis-using-dhc-by-restlet/"],
14
+ :match_type => :content_headers,
15
+ :match_content => /server: Restlet-Framework/i,
16
+ :dynamic_version => lambda { |x|
17
+ _first_header_capture(x,/server: Restlet-Framework\/(.*)/i)
18
+ },
19
+ :examples => ["http://128.109.13.60:80"],
20
+ :paths => ["#{url}"]
21
+ }
22
+ ]
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ module Intrigue
2
+ module Ident
3
+ module Check
4
+ class Sailpoint < Intrigue::Ident::Check::Base
5
+
6
+ def generate_checks(url)
7
+ [
8
+ {
9
+ :type => "application",
10
+ :vendor => "Sailpoint",
11
+ :product => "IdentityQ",
12
+ :references => [
13
+ "https://www.sailpoint.com/identity-management-software-identityiq/"
14
+ ],
15
+ :match_details => "Main page of a sailpoint identityq instance",
16
+ :version => nil,
17
+ :match_type => :content_body,
18
+ :match_content => /<title>SailPoint IdentityIQ/i,
19
+ :paths => ["#{url}"]
20
+ }
21
+ ]
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -8,14 +8,27 @@ module Check
8
8
  {
9
9
  :type => "application",
10
10
  :vendor => "Telerik",
11
- :product =>"Sitefinity",
12
- :match_details =>"Telerik Sitefinity is an ASP.NET 2.0-based Content Management System (CMS)",
11
+ :product => "Sitefinity",
12
+ :match_details => "Telerik Sitefinity is an ASP.NET 2.0-based Content Management System (CMS)",
13
13
  :url => "https://www.sitefinity.com/",
14
14
  :version => nil,
15
15
  :match_type => :content_body,
16
16
  :match_content => /Telerik.Sitefinity.Resources/,
17
- :dynamic_version => lambda { |x| x["details"]["hidden_response_data"].match(/Version=([\d\.]+),/).captures[0] },
18
- :verify_sites => [],
17
+ :dynamic_version => lambda { |x| _first_body_capture x, /Version=([\d\.]+),/ },
18
+ :examples => [],
19
+ :paths => ["#{url}"]
20
+ },
21
+ {
22
+ :type => "application",
23
+ :vendor => "Telerik",
24
+ :product => "Sitefinity",
25
+ :match_details => "Detect Telerik via a meta generator tag",
26
+ :url => "https://www.sitefinity.com/",
27
+ :version => nil,
28
+ :match_type => :content_body,
29
+ :match_content => /<meta\ name=\"Generator\"\ content=\"Sitefinity/,
30
+ :dynamic_version => lambda { |x| _first_body_capture x, /<meta name=\"Generator\" content=\"Sitefinity (.*)\ \/><link/ },
31
+ :examples => [],
19
32
  :paths => ["#{url}"]
20
33
  }
21
34
  ]
@@ -6,7 +6,7 @@ module Check
6
6
  def generate_checks(url)
7
7
  [
8
8
  {
9
- :type => "application",
9
+ :type => "service",
10
10
  :vendor =>"WPEngine",
11
11
  :tags => ["hosting_provider"],
12
12
  :product =>"WPEngine",
@@ -14,6 +14,7 @@ module Check
14
14
  :version => nil,
15
15
  :match_type => :content_body,
16
16
  :match_content => /This domain is successfully pointed at WP Engine, but is not configured for an account on our platform./,
17
+ :hide => true,
17
18
  :paths => ["#{url}"]
18
19
  }
19
20
  ]
@@ -0,0 +1,28 @@
1
+ module Intrigue
2
+ module Ident
3
+ module Check
4
+ class Restlet < Intrigue::Ident::Check::Base
5
+
6
+ def generate_checks(url)
7
+ [
8
+ {
9
+ :type => "service",
10
+ :vendor =>"Zscaler",
11
+ :product =>"Zscaler",
12
+ :match_details =>"server header for Zscaler",
13
+ :references => ["https://help.zscaler.com/zia/about-private-zens"],
14
+ :match_type => :content_headers,
15
+ :match_content => /server: Zscaler/i,
16
+ :dynamic_version => lambda { |x|
17
+ _first_header_capture(x,/server: Zscaler\/(.*)/i)
18
+ },
19
+ :examples => ["http://152.26.176.12:80"],
20
+ :paths => ["#{url}"]
21
+ }
22
+ ]
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -11,7 +11,7 @@ Dir["#{check_folder}/*.rb"].each { |file| require_relative file }
11
11
  module Intrigue
12
12
  module Ident
13
13
 
14
- VERSION=0.48
14
+ VERSION=0.49
15
15
 
16
16
  def generate_requests_and_check(url)
17
17
 
@@ -81,27 +81,33 @@ module Intrigue
81
81
 
82
82
  private
83
83
 
84
- def _match_to_cpe(m)
85
- out = "cpe:/#{m[:type]}:#{m[:vendor]}:#{m[:product]}"
86
- out << ":#{m[:version]}" if m[:version]
87
- out
88
- end
89
-
90
84
  def _construct_match_response(check, data)
91
- {
92
- :type => check[:type],
93
- :vendor => check[:vendor],
94
- :product => check[:product],
95
- :version => (check[:dynamic_version].call(data) if check[:dynamic_version]) || check[:version],
96
- :tags => check[:tags],
97
- :matched_content => check[:match_content],
98
- :match_type => check[:match_type],
99
- :match_details => check[:match_details],
100
- :hide => check[:hide]
101
- }
85
+ calculated_version = (check[:dynamic_version].call(data) if check[:dynamic_version]) || check[:version]
86
+
87
+ calculated_type = "a" if check[:type] == "application"
88
+ calculated_type = "h" if check[:type] == "hardware"
89
+ calculated_type = "o" if check[:type] == "operating_system"
90
+ calculated_type = "s" if check[:type] == "service" # literally made up
91
+
92
+ cpe_string = "cpe:/#{calculated_type}:#{check[:vendor]}:#{check[:product]}".downcase
93
+ cpe_string << ":#{calculated_version}".downcase if calculated_version
94
+
95
+ {
96
+ :type => check[:type],
97
+ :vendor => check[:vendor],
98
+ :product => check[:product],
99
+ :version => calculated_version,
100
+ :tags => check[:tags],
101
+ :matched_content => check[:match_content],
102
+ :match_type => check[:match_type],
103
+ :match_details => check[:match_details],
104
+ :hide => check[:hide],
105
+ :cpe => cpe_string
106
+ }
102
107
  end
103
108
 
104
109
  def _match_uri(check,data)
110
+ return nil unless check && data
105
111
 
106
112
  #puts "Trying to match #{check[:vendor]} #{check[:product]}: #{data["details"]["cookies"][0..10]}"
107
113
 
@@ -112,20 +118,20 @@ module Intrigue
112
118
  # if type "content", do the content check
113
119
 
114
120
  if check[:match_type] == :content_body
115
- if data["details"]["hidden_response_data"]
121
+ if data["details"] && data["details"]["hidden_response_data"]
116
122
  match = _construct_match_response(check,data) if data["details"]["hidden_response_data"] =~ check[:match_content]
117
123
  end
118
124
  elsif check[:match_type] == :content_headers
119
- if data["details"]["headers"]
125
+ if data["details"] && data["details"]["headers"]
120
126
  match = _construct_match_response(check,data) if data["details"]["headers"].join("\n") =~ check[:match_content]
121
127
  end
122
128
  elsif check[:match_type] == :content_cookies
123
129
  # Check only the set-cookie header
124
- if data["details"]["cookies"]
130
+ if data["details"] && data["details"]["cookies"]
125
131
  match = _construct_match_response(check,data) if data["details"]["cookies"] =~ check[:match_content]
126
132
  end
127
133
  elsif check[:match_type] == :checksum_body
128
- if data["details"]["response_data_hash"]
134
+ if data["details"] && data["details"]["response_data_hash"]
129
135
  match = _construct_match_response(check,data) if Digest::MD5.hexdigest(data["details"]["response_data_hash"]) == check[:checksum]
130
136
  end
131
137
  end
@@ -160,6 +166,7 @@ module Intrigue
160
166
  "host_id": 1571,
161
167
  "scripts": [],
162
168
  "products": [],
169
+ "cookies": "",
163
170
  "protocol": "tcp",
164
171
  "ip_address": "69.112.37.69",
165
172
  "javascript": [],
data/util/check.rb ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative "../lib/intrigue-ident"
3
+ include Intrigue::Ident
4
+ url = ARGV[0]
5
+ debug = ARGV[1] || nil
6
+ puts "Checking... #{url}"
7
+ matches = generate_requests_and_check(url)
8
+
9
+ if debug
10
+ puts "Debug: #{url}"
11
+ response = _http_request :get, "#{url}"
12
+ puts "Headers:"
13
+ response.each_header {|x| puts " - #{x}: #{response[x]}" }
14
+ puts "Body:"
15
+ puts response.body
16
+ end
17
+
18
+ puts "Results: "
19
+ matches.each{|x| puts " - #{x[:cpe]}" } if matches
20
+ puts "Done! #{matches.count} matches"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intrigue-ident
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.48'
4
+ version: '0.49'
5
5
  platform: ruby
6
6
  authors:
7
7
  - jcran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -63,6 +63,7 @@ files:
63
63
  - Gemfile.lock
64
64
  - intrigue-ident.gemspec
65
65
  - lib/check_factory.rb
66
+ - lib/checks/acquia.rb
66
67
  - lib/checks/adobe.rb
67
68
  - lib/checks/akamai.rb
68
69
  - lib/checks/amazon.rb
@@ -84,9 +85,11 @@ files:
84
85
  - lib/checks/gitlab.rb
85
86
  - lib/checks/google.rb
86
87
  - lib/checks/grafana.rb
88
+ - lib/checks/groovy.rb
87
89
  - lib/checks/heroku.rb
88
90
  - lib/checks/hp.rb
89
91
  - lib/checks/jenkins.rb
92
+ - lib/checks/jobvite.rb
90
93
  - lib/checks/joomla.rb
91
94
  - lib/checks/limesuvey.rb
92
95
  - lib/checks/lithium.rb
@@ -96,20 +99,27 @@ files:
96
99
  - lib/checks/mediawiki.rb
97
100
  - lib/checks/microsoft.rb
98
101
  - lib/checks/nagios.rb
102
+ - lib/checks/new_relic.rb
99
103
  - lib/checks/nginx.rb
104
+ - lib/checks/okta.rb
100
105
  - lib/checks/oracle.rb
101
106
  - lib/checks/palo_alto.rb
102
107
  - lib/checks/pardot.rb
103
108
  - lib/checks/pfsense.rb
109
+ - lib/checks/php.rb
104
110
  - lib/checks/phpmyadmin.rb
105
111
  - lib/checks/pivotal.rb
106
112
  - lib/checks/rabbitmq.rb
113
+ - lib/checks/restlet.rb
114
+ - lib/checks/sailpoint.rb
107
115
  - lib/checks/team_city.rb
108
116
  - lib/checks/telerik.rb
109
117
  - lib/checks/varnish.rb
110
118
  - lib/checks/vmware.rb
111
119
  - lib/checks/wp_engine.rb
120
+ - lib/checks/zscaler.rb
112
121
  - lib/intrigue-ident.rb
122
+ - util/check.rb
113
123
  homepage: https://intrigue.io
114
124
  licenses:
115
125
  - BSD