HTTP HTML Title Tag Content Grabber - Metasploit


This page contains detailed information about how to use the auxiliary/scanner/http/title metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: HTTP HTML Title Tag Content Grabber
Module: auxiliary/scanner/http/title
Source code: modules/auxiliary/scanner/http/title.rb
Disclosure date: -
Last modification time: 2021-03-18 13:04:01 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: -

Generates a GET request to the provided webservers and returns the server header, HTML title attribute and location header (if set). This is useful for rapidly identifying interesting web applications en mass.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/http/title
msf auxiliary(title) > show options
    ... show and set options ...
msf auxiliary(title) > set RHOSTS ip-range
msf auxiliary(title) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(title) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(title) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(title) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Description


Generates a GET request to the provided web servers and returns the server header, HTML title attribute and location header (if set). This is useful for rapidly identifying interesting web applications en mass.

Verification Steps


  1. Do: use auxiliary/scanner/http/title
  2. Do: set rhosts [ips]
  3. Do: run

Options


SHOW_TITLES

If set to false, will not show the titles on the console as they are grabbed. Defaults to true.

STORE_NOTES

If set to false, will not store the captured information in notes. Use notes -t http.title to view. Defaults to true.

Scenarios


Apache/2.4.38 inside a Docker container

msf5 > use auxiliary/scanner/http/title
msf5 auxiliary(scanner/http/title) > set RHOSTS 172.17.0.2
RHOSTS => 172.17.0.2
msf5 auxiliary(scanner/http/title) > run

[+] [172.17.0.2:80] [C:200] [R:] [S:Apache/2.4.38 (Debian)] LOCAL TESTING
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Confirming using Burp Suite Community Edition


HTTP GET Request

GET / HTTP/1.1
Host: 172.17.0.2
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0

Server Response

HTTP/1.1 200 OK
Date: Wed, 16 Oct 2019 17:27:49 GMT
Server: Apache/2.4.38 (Debian)
X-Powered-By: PHP/7.2.23
Content-Length: 68
Connection: close
Content-Type: text/html; charset=UTF-8

<html><head><title>LOCAL TESTING</title></head><body></body></html>

Confirming using Nikto


This will only identify server version and Location header, not HTML title.

nikto -host http://172.17.0.2 -Plugin headers

- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          172.17.0.2
+ Target Hostname:    172.17.0.2
+ Target Port:        80
+ Start Time:         2019-10-16 19:30:55 (GMT2)
---------------------------------------------------------------------------
+ Server: Apache/2.4.38 (Debian)
+ Retrieved x-powered-by header: PHP/7.2.23

Confirming using NMAP


Utilizing the http-title NMAP script.

# nmap -sV -p80 --script http-title 127.0.0.1
Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-20 21:11 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000049s latency).

PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.41 ((Debian))
|_http-server-header: Apache/2.4.41 (Debian)
|_http-title: Apache2 Debian Default Page: It works

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 6.42 seconds

Confirming using CURL


This will use grep to filter for just the content between the title tags.

# curl -s 127.0.0.1:80 | grep \<title\>
<title>Apache2 Debian Default Page: It works</title>

Go back to menu.

Msfconsole Usage


Here is how the scanner/http/title auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/http/title

msf6 auxiliary(scanner/http/title) > show info

       Name: HTTP HTML Title Tag Content Grabber
     Module: auxiliary/scanner/http/title
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Stuart Morgan <[email protected]>

Check supported:
  No

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  Proxies                       no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                        yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT        80               yes       The target port (TCP)
  SHOW_TITLES  true             yes       Show the titles on the console as they are grabbed
  SSL          false            no        Negotiate SSL/TLS for outgoing connections
  STORE_NOTES  true             yes       Store the captured information in notes. Use "notes -t http.title" to view
  TARGETURI    /                yes       The base path
  THREADS      1                yes       The number of concurrent threads (max one per host)
  VHOST                         no        HTTP server virtual host

Description:
  Generates a GET request to the provided webservers and returns the 
  server header, HTML title attribute and location header (if set). 
  This is useful for rapidly identifying interesting web applications 
  en mass.

Module Options


This is a complete list of options available in the scanner/http/title auxiliary module:

msf6 auxiliary(scanner/http/title) > show options

Module options (auxiliary/scanner/http/title):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   Proxies                       no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                        yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT        80               yes       The target port (TCP)
   SHOW_TITLES  true             yes       Show the titles on the console as they are grabbed
   SSL          false            no        Negotiate SSL/TLS for outgoing connections
   STORE_NOTES  true             yes       Store the captured information in notes. Use "notes -t http.title" to view
   TARGETURI    /                yes       The base path
   THREADS      1                yes       The number of concurrent threads (max one per host)
   VHOST                         no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the scanner/http/title auxiliary module:

msf6 auxiliary(scanner/http/title) > show advanced

Module advanced options (auxiliary/scanner/http/title):

   Name                  Current Setting                                     Required  Description
   ----                  ---------------                                     --------  -----------
   DOMAIN                WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   FingerprintCheck      true                                                no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                         no        HTTP connection and receive timeout
   HttpPassword                                                              no        The HTTP password to specify for authentication
   HttpRawHeaders                                                            no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace             false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly  false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                              no        The HTTP username to specify for authentication
   SSLVersion            Auto                                                yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   ShowProgress          true                                                yes       Display progress messages during a scan
   ShowProgressPercent   10                                                  yes       The interval in percent that progress should be shown
   UserAgent             Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   VERBOSE               false                                               no        Enable detailed status messages
   WORKSPACE                                                                 no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the scanner/http/title module can do:

msf6 auxiliary(scanner/http/title) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the scanner/http/title auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(scanner/http/title) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Notes storage is false and titles are not being shown on the console. There isn't much point in running this module.


Here is a relevant code snippet related to the "Notes storage is false and titles are not being shown on the console. There isn't much point in running this module." error message:

29:	      ])
30:	  end
31:	
32:	  def run
33:	    if !datastore['STORE_NOTES'] && !datastore['SHOW_TITLES']
34:	      print_error("Notes storage is false and titles are not being shown on the console. There isn't much point in running this module.")
35:	    else
36:	      super
37:	    end
38:	  end
39:	

[<TARGET_HOST>:<RPORT>] No response


Here is a relevant code snippet related to the "[<TARGET_HOST>:<RPORT>] No response" error message:

44:	        'uri' => normalize_uri(target_uri.path)
45:	      )
46:	
47:	      # If no response, quit now
48:	      if res.nil?
49:	        vprint_error("[#{target_host}:#{rport}] No response")
50:	        return
51:	      end
52:	
53:	      # Retrieve the headers to capture the Location and Server header
54:	      # Note that they are case-insensitive but stored in a hash

[<TARGET_HOST>:<RPORT>] No HTTP headers


Here is a relevant code snippet related to the "[<TARGET_HOST>:<RPORT>] No HTTP headers" error message:

58:	        res.headers.each do |key, val|
59:	          location_header = val if key.downcase == 'location'
60:	          server_header  = val if key.downcase == 'server'
61:	        end
62:	      else
63:	        vprint_error("[#{target_host}:#{rport}] No HTTP headers")
64:	      end
65:	
66:	      # If the body is blank, just stop now as there is no chance of a title
67:	      if res.body.nil?
68:	        vprint_error("[#{target_host}:#{rport}] No webpage body")

[<TARGET_HOST>:<RPORT>] No webpage body


Here is a relevant code snippet related to the "[<TARGET_HOST>:<RPORT>] No webpage body" error message:

63:	        vprint_error("[#{target_host}:#{rport}] No HTTP headers")
64:	      end
65:	
66:	      # If the body is blank, just stop now as there is no chance of a title
67:	      if res.body.nil?
68:	        vprint_error("[#{target_host}:#{rport}] No webpage body")
69:	        return
70:	      end
71:	
72:	      # Very basic, just match the first title tag we come to. If the match fails,
73:	      # there is no chance that we will have a title

[<TARGET_HOST>:<RPORT>] No webpage title


Here is a relevant code snippet related to the "[<TARGET_HOST>:<RPORT>] No webpage title" error message:

71:	
72:	      # Very basic, just match the first title tag we come to. If the match fails,
73:	      # there is no chance that we will have a title
74:	      rx = %r{<title>[\n\t\s]*(?<title>.+?)[\s\n\t]*</title>}im.match(res.body.to_s)
75:	      unless rx
76:	        vprint_error("[#{target_host}:#{rport}] No webpage title")
77:	        return
78:	      end
79:	
80:	      # Last bit of logic to capture the title
81:	      rx[:title].strip!

[<TARGET_HOST>:<RPORT>] No webpage title


Here is a relevant code snippet related to the "[<TARGET_HOST>:<RPORT>] No webpage title" error message:

87:	        if datastore['STORE_NOTES']
88:	          notedata = { code: res.code, port: rport, server: server_header, title: rx_title, redirect: location_header, uri: datastore['TARGETURI'] }
89:	          report_note(host: target_host, port: rport, type: "http.title", data: notedata, update: :unique_data)
90:	        end
91:	      else
92:	        vprint_error("[#{target_host}:#{rport}] No webpage title")
93:	      end
94:	    end
95:	
96:	    rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
97:	    rescue ::Timeout::Error, ::Errno::EPIPE

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


Stuart Morgan <stuart.morgan[at]mwrinfosecurity.com>

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.