On this page 31 sections
  1. What a web server is
  2. Common web ports
  3. Initial enumeration
  4. HTTP headers
  5. Server banners
  6. Page title
  7. robots.txt
  8. HTTP methods
  9. OPTIONS
  10. PUT
  11. DELETE
  12. Directory listing
  13. Directory discovery
  14. File discovery
  15. FFUF belongs separately
  16. Authentication areas
  17. HTTP Basic authentication
  18. HTTP status codes
  19. User directories
  20. Virtual hosts
  21. HTTPS and TLS
  22. Certificate names
  23. Nmap HTTP enumeration
  24. Metasploit HTTP scanners
  25. Inspect source code
  26. Interesting files
  27. WebDAV belongs separately
  28. Shellshock belongs separately
  29. SQL injection belongs separately
  30. Enumeration workflow
  31. Quick reference
01

What a web server is

A web server accepts HTTP or HTTPS requests and returns resources such as HTML pages, images, scripts, API responses and downloadable files. Common web servers include Apache, Nginx and Microsoft IIS.

02

Common web ports

HTTP commonly uses TCP port 80 and HTTPS commonly uses TCP port 443. Web applications may also run on alternative ports such as 8000, 8080, 8443 or application-specific ports.

03

Initial enumeration

Start by identifying open web ports, server software, page titles and technologies exposed by the service.

HTTP service detection
nmap -sV -p 80,443 <TARGET>
Default web enumeration
nmap -sC -sV -p 80,443 <TARGET>
Alternative web ports
nmap -sV -p 80,443,8000,8080,8443 <TARGET>
04

HTTP headers

Response headers can reveal server software, cookies, authentication mechanisms, redirects, security controls and application behaviour.

Request headers only
curl -I http://<TARGET>/
Verbose request
curl -v http://<TARGET>/
05

Server banners

Headers such as Server or X-Powered-By may reveal web-server or application technologies. These values can be hidden or modified, so they should not be treated as definitive without additional evidence.

Inspect response headers
curl -I http://<TARGET>/
Nmap HTTP headers
nmap -p 80 --script http-headers <TARGET>
06

Page title

The HTML title can quickly indicate which application, administrative panel or product is running on a web port.

Nmap title enumeration
nmap -p 80,443 --script http-title <TARGET>
07

robots.txt

robots.txt tells search-engine crawlers which paths they should avoid indexing. These paths are not secret and can reveal interesting administrative, backup or application directories.

Retrieve robots.txt
curl http://<TARGET>/robots.txt
08

HTTP methods

HTTP supports multiple request methods. Common methods include GET, POST, HEAD and OPTIONS. Other methods such as PUT or DELETE can become security-relevant when they are enabled in an unsafe context.

09

OPTIONS

OPTIONS asks the server which HTTP methods or communication options are available for a resource.

Manual OPTIONS request
curl -i -X OPTIONS http://<TARGET>/
Nmap method enumeration
nmap -p 80 --script http-methods <TARGET>
10

PUT

PUT can be used to create or replace a resource when the server and target path allow it. Simply seeing PUT advertised does not prove that arbitrary file upload is possible.

OPTIONS first
curl -i -X OPTIONS http://<TARGET>/
11

DELETE

DELETE requests removal of a resource. Like PUT, its presence in an Allow header does not automatically mean unauthenticated users can use it successfully.

12

Directory listing

Directory listing occurs when a web server displays the files contained in a directory instead of serving a default index file. This can expose backups, documents, configuration files and other unintended content.

Inspect directory manually
curl http://<TARGET>/<DIRECTORY>/
13

Directory discovery

Content discovery attempts to identify directories and endpoints that are not directly linked from the main website.

DIRB basic scan
dirb http://<TARGET>/
Custom wordlist
dirb http://<TARGET>/ <WORDLIST>
14

File discovery

Enumeration should also look for files such as backups, configuration files, archives, scripts and administrative resources. File extensions may provide clues about the backend technology.

DIRB with extensions
dirb http://<TARGET>/ -X .php,.txt,.bak,.zip
15

FFUF belongs separately

FFUF is useful for advanced directory, file, parameter, virtual-host and fuzzing workflows. It is better documented in a dedicated fuzzing note rather than duplicating all of its functionality here.

16

Authentication areas

Identify login pages, administrative panels and paths protected by HTTP authentication. Different authentication mechanisms produce different response headers and status codes.

Inspect authentication headers
curl -I http://<TARGET>/<PROTECTED_PATH>
17

HTTP Basic authentication

HTTP Basic authentication transmits a base64-encoded username and password inside the Authorization header. HTTPS is required to protect those credentials in transit.

Authenticate with curl
curl -u <USERNAME>:<PASSWORD> http://<TARGET>/<PATH>
18

HTTP status codes

Status codes help interpret application behaviour. 200 indicates success, 301 and 302 redirects, 401 authentication required, 403 forbidden, 404 not found and 500 a server-side error.

Inspect response
curl -i http://<TARGET>/
19

User directories

Some web-server configurations expose per-user directories, historically through paths such as /~username/. Whether this is enabled depends on the server configuration.

Example user directory
http://<TARGET>/~<USERNAME>/
20

Virtual hosts

A single IP address may host multiple websites selected through the HTTP Host header. Finding additional hostnames can reveal applications that are not visible when browsing the IP directly.

Custom Host header
curl -H 'Host: <HOSTNAME>' http://<TARGET>/
21

HTTPS and TLS

HTTPS is HTTP transported over TLS. TLS enumeration can reveal certificate names, validity periods and additional hostnames through certificate fields.

Inspect TLS certificate
openssl s_client -connect <TARGET>:443 -servername <HOSTNAME>
Nmap certificate enumeration
nmap -p 443 --script ssl-cert <TARGET>
22

Certificate names

TLS certificates may contain Common Name and Subject Alternative Name entries associated with the service. These names can provide useful hostname-enumeration leads.

Inspect certificate
openssl s_client -connect <TARGET>:443 -servername <HOSTNAME> 2>/dev/null | openssl x509 -noout -subject -issuer -ext subjectAltName
23

Nmap HTTP enumeration

Nmap includes many HTTP NSE scripts for titles, headers, supported methods, directories and application-specific enumeration.

Common HTTP scripts
nmap -p 80,443 --script "http-title,http-headers,http-methods" <TARGET>
List HTTP scripts
ls /usr/share/nmap/scripts/http*
24

Metasploit HTTP scanners

Metasploit includes auxiliary modules for web-server version detection, directory enumeration and other HTTP checks. Search for modules relevant to the discovered service instead of relying on one universal scanner.

Search HTTP scanner modules
search type:auxiliary scanner/http
HTTP version scanner
use auxiliary/scanner/http/http_version
Show options
show options
25

Inspect source code

HTML and JavaScript may reveal endpoints, API paths, comments, application versions and client-side configuration. Browser developer tools and curl can help inspect the returned content.

Retrieve page source
curl http://<TARGET>/
26

Interesting files

During authorised enumeration, pay attention to backups, archives, configuration remnants, source files, documentation and version-control artifacts that may have been exposed unintentionally.

27

WebDAV belongs separately

WebDAV extends HTTP with functionality for remotely managing web resources. Although WebDAV relies on HTTP methods, its enumeration and misconfiguration testing are broad enough to belong in a dedicated note.

28

Shellshock belongs separately

Shellshock is a specific Bash CGI vulnerability and should not be treated as part of generic web-server enumeration. Generic HTTP enumeration may discover CGI endpoints, but vulnerability testing belongs in its own note.

29

SQL injection belongs separately

SQL injection is an application vulnerability rather than a generic web-server enumeration technique. This note focuses on identifying the HTTP service, application surface and exposed resources.

30

Enumeration workflow

Identify all HTTP and HTTPS ports, inspect page titles and headers, retrieve robots.txt, enumerate supported methods, discover directories and files, identify authentication areas and virtual hosts, then inspect TLS certificates and application content for additional enumeration leads.

Initial scan
nmap -sC -sV -p 80,443,8000,8080,8443 <TARGET>
Headers
curl -I http://<TARGET>/
Methods
curl -i -X OPTIONS http://<TARGET>/
Directories
dirb http://<TARGET>/
31

Quick reference

These are the HTTP and HTTPS enumeration commands worth remembering.

Nmap
nmap -sC -sV -p 80,443 <TARGET>
Headers
curl -I http://<TARGET>/
Verbose request
curl -v http://<TARGET>/
robots.txt
curl http://<TARGET>/robots.txt
OPTIONS
curl -i -X OPTIONS http://<TARGET>/
Nmap methods
nmap -p 80 --script http-methods <TARGET>
Directories
dirb http://<TARGET>/
TLS certificate
nmap -p 443 --script ssl-cert <TARGET>
Metasploit HTTP
use auxiliary/scanner/http/http_version