Module: CMSScanner::Target::Server::Generic
- Included in:
- CMSScanner::Target
- Defined in:
- lib/cms_scanner/target/server/generic.rb
Overview
Some Apche specific implementation
Instance Method Summary collapse
-
#headers(path = nil, params = {}) ⇒ Hash
The headers.
-
#server(path = nil, params = {}) ⇒ Symbol
The detected remote server (:Apache, :IIS).
Instance Method Details
#headers(path = nil, params = {}) ⇒ Hash
Returns The headers.
27 28 29 30 |
# File 'lib/cms_scanner/target/server/generic.rb', line 27 def headers(path = nil, params = {}) # The HEAD method might be rejected by some servers ... maybe switch to GET ? NS::Browser.head(url(path), params).headers end |
#server(path = nil, params = {}) ⇒ Symbol
Returns The detected remote server (:Apache, :IIS).
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cms_scanner/target/server/generic.rb', line 10 def server(path = nil, params = {}) headers = headers(path, params) return unless headers case headers[:server] when /\Aapache/i :Apache when /\AMicrosoft-IIS/i :IIS end end |