Class: Wordpress

Inherits:
Fingerprinter::Technologies show all
Defined in:
lib/fingerprinter/technologies/cms/wordpress.rb

Overview

Wordpress Detection

Constant Summary collapse

HEADERS_REGEX =
{
  'link' => %r{rel="https//api\.w\.org/"},
  'x-pingback' => %r{/xmlrpc.php}
}.freeze
META_CONTENT_REGEX =
[
  'WordPress'
].freeze
BODY_CONTENT_REGEX =
[
  %r{<script src=['"]https?://[\w./-]+wp-embed\.min\.js},
  %r{<link rel=['"]stylesheet['"] id=['"][\w-]+['"]\s+href=['"]https?://[\w.-]+/wp-(?:content|includes)/},
  %r{<script src=['"]https?://[\w./-]+wp-(?:content|includes)}
].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

.run(data) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/fingerprinter/technologies/cms/wordpress.rb', line 20

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

  'WordPress'
end