output interesting http-headers

This commit is contained in:
Christian Mehlmauer
2013-07-19 14:14:13 +02:00
parent f49b53b095
commit bb35837ea1
6 changed files with 87 additions and 0 deletions

View File

@@ -19,6 +19,14 @@ class Browser
process(url, params.merge(method: :post))
end
# @param [ String ] url
# @param [ Hash ] params
#
# @return [ Typhoeus::Response ]
def head(url, params = {})
process(url, params.merge(method: :head))
end
# @param [ String ] url
# @param [ Hash ] params
#

View File

@@ -6,6 +6,7 @@ require 'wp_target/wp_readme'
require 'wp_target/wp_registrable'
require 'wp_target/wp_config_backup'
require 'wp_target/wp_login_protection'
require 'wp_target/interesting_headers'
require 'wp_target/wp_custom_directories'
require 'wp_target/wp_full_path_disclosure'
@@ -15,6 +16,7 @@ class WpTarget < WebSite
include WpTarget::WpRegistrable
include WpTarget::WpConfigBackup
include WpTarget::WpLoginProtection
include WpTarget::InterestingHeaders
include WpTarget::WpCustomDirectories
include WpTarget::WpFullPathDisclosure

View File

@@ -0,0 +1,36 @@
# encoding: UTF-8
class WpTarget < WebSite
module InterestingHeaders
# Checks for interesting headers
def interesting_headers
response = Browser.head(@uri.to_s)
headers = response.headers
InterestingHeaders.known_headers.each do |h|
headers.delete(h)
end
headers.to_a.compact.sort
end
protected
# @return Array
def self.known_headers
%w{
Location
Date
Content-Type
Content-Length
Connection
Etag
Expires
Last-Modified
Pragma
Vary
Cache-Control
}
end
end
end