fingerprinter 0.1.6 → 0.1.8

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: 701ce40db725878091d58e64e82bdf02b54043b81ef417c192288354ceee73d0
4
+ data.tar.gz: 0c09713a4d7a023e426b178fc0b02b832816f33e04188a584100c7dc412daf75
5
5
  SHA512:
6
- metadata.gz: 4720f0b52bf5130c980d759abc42ae829dd64da3feedb3c65c67be159d55500700433ea6d27483a1ff65dd8caa7e3e4b467ca46de7f173c68969df5d2f633815
7
- data.tar.gz: f9a778664a1e258ee7894daf4eb9dee52bd40b3e925b5fa6c890df8126c151fc36f979ea97486d1979f9eafdd4a0f285fa42b2029b0a6147abe840ec3b477051
6
+ metadata.gz: 0d1583979e056fda56d4aed03db3a6c6c1ae6028f65cdb39a7e18222ba308225ff58eb910b1e2b7226ab3c7495bf585faefb9b930fbd39e9faf3ce130a10725a
7
+ data.tar.gz: 8fc0c2fe89d8ac30bf51b9b38dbdba4a0c0ab2b161e604ce17e60bda2d565d51851c5a92ae3bd82ccc2ae8b620bc4603c2332b7b3c49024623b9da8fac20d56b
@@ -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[paas.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.8
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