This content was extracted from HTB Academy

process by HTB

Types of Reconnaissance

Web reconnaissance encompasses two fundamental methodologies:ย activeย andย passiveย reconnaissance. Each approach offers distinct advantages and challenges, and understanding their differences is crucial for adequate information gathering.

Active Reconnaissance

In active reconnaissance, the attackerย directly interacts with the target systemย to gather information. This interaction can take various forms:

TechniqueDescriptionExampleToolsRisk of Detection
Port ScanningIdentifying open ports and services running on the target.Using Nmap to scan a web server for open ports like 80 (HTTP) and 443 (HTTPS).Nmap, Masscan, UnicornscanHigh: Direct interaction with the target can trigger intrusion detection systems (IDS) and firewalls.
Vulnerability ScanningProbing the target for known vulnerabilities, such as outdated software or misconfigurations.Running Nessus against a web application to check for SQL injection flaws or cross-site scripting (XSS) vulnerabilities.Nessus, OpenVAS, NiktoHigh: Vulnerability scanners send exploit payloads that security solutions can detect.
Network MappingMapping the targetโ€™s network topology, including connected devices and their relationships.Using traceroute to determine the path packets take to reach the target server, revealing potential network hops and infrastructure.Traceroute, NmapMedium to High: Excessive or unusual network traffic can raise suspicion.
Banner GrabbingRetrieving information from banners displayed by services running on the target.Connecting to a web server on port 80 and examining the HTTP banner to identify the web server software and version.Netcat, curlLow: Banner grabbing typically involves minimal interaction but can still be logged.
OS FingerprintingIdentifying the operating system running on the target.Using Nmapโ€™s OS detection capabilities (-O) to determine if the target is running Windows, Linux, or another OS.Nmap, Xprobe2Low: OS fingerprinting is usually passive, but some advanced techniques can be detected.
Service EnumerationDetermining the specific versions of services running on open ports.Using Nmapโ€™s service version detection (-sV) to determine if a web server is running Apache 2.4.50 or Nginx 1.18.0.NmapLow: Similar to banner grabbing, service enumeration can be logged but is less likely to trigger alerts.
Web SpideringCrawling the target website to identify web pages, directories, and files.Running a web crawler like Burp Suite Spider or OWASP ZAP Spider to map out the structure of a website and discover hidden resources.Burp Suite Spider, OWASP ZAP Spider, Scrapy (customisable)Low to Medium: Can be detected if the crawlerโ€™s behaviour is not carefully configured to mimic legitimate traffic.

Active reconnaissance provides a direct and often more comprehensive view of the targetโ€™s infrastructure and security posture. However, it also carries a higher risk of detection, as the interactions with the target can trigger alerts or raise suspicion.

Passive Reconnaissance

In contrast, passive reconnaissance involves gathering information about the targetย without directly interactingย with it. This relies on analysing publicly available information and resources, such as:

TechniqueDescriptionExampleToolsRisk of Detection
Search Engine QueriesUtilising search engines to uncover information about the target, including websites, social media profiles, and news articles.Searching Google for โ€œ[Target Name] employeesโ€ to find employee information or social media profiles.Google, DuckDuckGo, Bing, and specialised search engines (e.g., Shodan)Very Low: Search engine queries are normal internet activity and unlikely to trigger alerts.
WHOIS LookupsQuerying WHOIS databases to retrieve domain registration details.Performing a WHOIS lookup on a target domain to find the registrantโ€™s name, contact information, and name servers.whois command-line tool, online WHOIS lookup servicesVery Low: WHOIS queries are legitimate and do not raise suspicion.
DNSAnalysing DNS records to identify subdomains, mail servers, and other infrastructure.Usingย digย to enumerate subdomains of a target domain.dig, nslookup, host, dnsenum, fierce, dnsreconVery Low: DNS queries are essential for internet browsing and are not typically flagged as suspicious.
Web Archive AnalysisExamining historical snapshots of the targetโ€™s website to identify changes, vulnerabilities, or hidden information.Using the Wayback Machine to view past versions of a target website to see how it has changed over time.Wayback MachineVery Low: Accessing archived versions of websites is a normal activity.
Social Media AnalysisGathering information from social media platforms like LinkedIn, Twitter, or Facebook.Searching LinkedIn for employees of a target organisation to learn about their roles, responsibilities, and potential social engineering targets.LinkedIn, Twitter, Facebook, specialised OSINT toolsVery Low: Accessing public social media profiles is not considered intrusive.
Code RepositoriesAnalysing publicly accessible code repositories like GitHub for exposed credentials or vulnerabilities.Searching GitHub for code snippets or repositories related to the target that might contain sensitive information or code vulnerabilities.GitHub, GitLabVery Low: Code repositories are meant for public access, and searching them is not suspicious.