fingerprinter 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: 5a235ab2c1e2f911a87dd87eaa83d1b81ae974614f57ded0e9c69dd96c946b4d
4
- data.tar.gz: f0b6197d8604b4b655a53cd2d7112f2f142e5048135956137518cd1011b1dcc9
3
+ metadata.gz: bc97915b45277081abb4d06cbd9463bc82b214be082bec3aaa0af5655f28026d
4
+ data.tar.gz: 782347d3a249269a1c543f1c94230e88b9183b2bf3a310b10c7df4a9ee73f3f7
5
5
  SHA512:
6
- metadata.gz: 4720f0b52bf5130c980d759abc42ae829dd64da3feedb3c65c67be159d55500700433ea6d27483a1ff65dd8caa7e3e4b467ca46de7f173c68969df5d2f633815
7
- data.tar.gz: f9a778664a1e258ee7894daf4eb9dee52bd40b3e925b5fa6c890df8126c151fc36f979ea97486d1979f9eafdd4a0f285fa42b2029b0a6147abe840ec3b477051
6
+ metadata.gz: fe3aef3a9410d4a932e8b12b3f57a51c0d4286ebe006b5f6d53146231e0537b9874f35237c51c88ce324d54382d0a0de8bd48db3de9c0b826c4728f3aa23946d
7
+ data.tar.gz: 04e0164fe28d9ada0ad3d2095bc12b1bfa66d2447ed2ef8748b747391403acd6f3bd130bce371105fb8dd28be0a22c2ae974e68d5de5eb49fb7be95c663d68a5
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # ServiceNow Detection
4
+ class ServiceNow < Fingerprinter::Technologies
5
+ HEADERS_REGEX = {
6
+ 'server' => /ServiceNow/,
7
+ 'set-cookie' => /glide_user/
8
+ }.freeze
9
+
10
+ BODY_CONTENT_REGEX = [
11
+ /About ServiceNow/
12
+ ].freeze
13
+
14
+ def self.run(data)
15
+ return unless response_headers_check(data[:response], HEADERS_REGEX) ||
16
+ title_detection(data[:doc], 'ServiceNow') ||
17
+ whole_body_check(data[:response], BODY_CONTENT_REGEX)
18
+
19
+ 'ServiceNow'
20
+ end
21
+ end
data/lib/fingerprinter.rb CHANGED
@@ -8,6 +8,11 @@ module Fingerprinter
8
8
  Dir[File.join(__dir__, 'fingerprinter', 'core/*.rb')].sort.each { |file| require file }
9
9
  Dir[File.join(__dir__, 'fingerprinter', 'utilities/*.rb')].sort.each { |file| require file }
10
10
 
11
+ EXCLUSIONS = %w[pass.diod.orange.com].freeze
12
+ WILDCARDS = [
13
+ ['Application is not available', 'The application is currently not serving requests at this endpoint']
14
+ ].freeze
15
+
11
16
  def self.http_client
12
17
  @http_client ||= HttpClient.new
13
18
  end
@@ -32,8 +37,11 @@ module Fingerprinter
32
37
 
33
38
  def run(urls)
34
39
  urls.each do |url|
40
+ next if EXCLUSIONS.any? { |exclusion| url.match?(exclusion) }
41
+
35
42
  response = get_response(url)
36
43
  next unless response
44
+ next if wildcard?(response)
37
45
 
38
46
  url = effective_url(response, url)
39
47
 
@@ -55,6 +63,13 @@ module Fingerprinter
55
63
 
56
64
  private
57
65
 
66
+ def wildcard?(response)
67
+ response_body = response.body
68
+ WILDCARDS.any? do |patterns|
69
+ patterns.all? { |pattern| response_body&.include?(pattern) }
70
+ end
71
+ end
72
+
58
73
  def get_response(url)
59
74
  response = nil
60
75
  3.times do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fingerprinter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua MARTINELLE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -68,6 +68,7 @@ files:
68
68
  - lib/fingerprinter/technologies/softwares/apache_ofbiz.rb
69
69
  - lib/fingerprinter/technologies/softwares/f5_next_central_manager.rb
70
70
  - lib/fingerprinter/technologies/softwares/nexus_repository.rb
71
+ - lib/fingerprinter/technologies/softwares/servicenow.rb
71
72
  - lib/fingerprinter/technologies/softwares/tinyproxy.rb
72
73
  - lib/fingerprinter/utilities/kb.rb
73
74
  - lib/fingerprinter/utilities/parser.rb