Class: ApacheOfbiz

Inherits:
Fingerprinter::Technologies show all
Defined in:
lib/fingerprinter/technologies/softwares/apache_ofbiz.rb

Overview

Apache Ofbiz Detection

Constant Summary collapse

META_CONTENT_REGEX =
[
  'Apache OFBiz'
].freeze
HEADERS_REGEX =
{
  'set-cookie' => /OFBiz\.Visitor/
}.freeze
BODY_CONTENT_REGEX =
[
  /Powered by.*OFBiz/
].freeze

Instance Attribute Summary

Attributes inherited from Fingerprinter::Technologies

#http_client, #results

Class Method Summary collapse

Methods inherited from Fingerprinter::Technologies

#initialize, kb, meta_detection, response_headers_check, #run, title_detection, whole_body_check

Constructor Details

This class inherits a constructor from Fingerprinter::Technologies

Class Method Details

.get_xmlrpc(url) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/fingerprinter/technologies/softwares/apache_ofbiz.rb', line 17

def self.get_xmlrpc(url)
  url = File.join(Utilities::Urls.up_to_port(url), '/webtools/control/xmlrpc')
  return if Utilities::Kb.inspected?(self, url)

  Utilities::Kb.inspected(self, url)
  Fingerprinter.http_client.get(url)[url]
end

.run(data) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fingerprinter/technologies/softwares/apache_ofbiz.rb', line 25

def self.run(data)
  response = data[:response]
  if response.code == 404
    response = get_xmlrpc(data[:url])
    return unless response&.code == 200

    data[:doc] = Utilities::Parser.doc(response.body)
  end

  return unless response_headers_check(response, HEADERS_REGEX) ||
                meta_detection(data[:doc], META_CONTENT_REGEX) ||
                whole_body_check(response, BODY_CONTENT_REGEX)

  'Apache OFBiz'
end