Understanding the underlying infrastructure is critical for identifying potential vulnerabilities. Fingerprinting the web server involves discovering the server type and version, along with its components.
HTTP headers can inadvertently leak information about the web server. Tools such as Netcraft can analyze a domain's web server and provide details like version and historical OS information.
$ nc www.netcraft.com 80
GET / HTTP/1.1
Host: www.netcraft.comResponse:
HTTP/1.1 200 OK
Date: Sat, 18 Apr 2009 13:08:40 GMT
Server: Apache
Content-Length: 88750Netcraft (www.netcraft.com) is also useful for subdomain enumeration, providing details about web servers, name servers, and IP addresses.
Manual tools like netcat, httprint, WhatWeb, and Wappalyzer can be used for web server identification. They analyze responses, revealing the server version, installed modules, and enabled devices.
$ nc 134.170.185.46 80
HEAD / HTTP/1.0
HTTP/1.1 301 Moved Permanently
Cache-Control: private
...
Server: Microsoft-IIS/8.5$ whatweb -h- Browser plugin-based tool providing web server information.
Identifying installed modules, such as ISAPI modules for IIS or Apache modules, is crucial. These modules may impact the results of security tests.
Subdomain enumeration expands the attack surface and can reveal hidden panels or intranet applications.
Netcraft can be used to list subdomains and gather detailed information about each subdomain, including the web server version.
Google search operators help enumerate subdomains by restricting results to a specific domain.
Example: Google Search
site:.microsoft.comVarious tools like dnsrecon, subbrute, fierce, nmap, dnsenum, knock, theHarvester, and recon-ng can be used for subdomain enumeration.
$ python subbrute.py microsoft.com$ dnsrecon -d microsoft.com -g$ theharvester -d microsoft.com -b google -l 200 -f /root/Desktop/msresults.htmlZone transfers can reveal all DNS records for a domain, including subdomains. This can be achieved through commands like nslookup or dig.
$ nslookup
> server [NAMESERVER FOR mydomain.com]
> ls -d mydomain.com$ dig @nameserver axfr mydomain.comVirtual hosts share an IP address with multiple domains. Tools like fierce can identify virtual hosts, essential in shared hosting environments.
$ fierce -dns elearnsecurity.com