Module: Msf::HTTP::Wordpress::Base

Included in:
Msf::HTTP::Wordpress
Defined in:
lib/msf/http/wordpress/base.rb

Instance Method Summary collapse

Instance Method Details

#wordpress_and_online?Rex::Proto::Http::Response?

Checks if the site is online and running wordpress

Returns:


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/msf/http/wordpress/base.rb', line 8

def wordpress_and_online?
  begin
    res = send_request_cgi({
        'method' => 'GET',
        'uri' => normalize_uri(target_uri.path)
    })
    return res if res and
        res.code == 200 and
        (
          res.body =~ /["'][^"']*\/wp-content\/[^"']*["']/i or
          res.body =~ /<link rel=["']wlwmanifest["'].*href=["'].*\/wp-includes\/wlwmanifest\.xml["'] \/>/i or
          res.body =~ /<link rel=["']pingback["'].*href=["'].*\/xmlrpc\.php["'] \/>/i
        )
    return nil
  rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
    print_error("#{peer} - Error connecting to #{target_uri}")
    return nil
  end
end