No history yet

Advanced Reconnaissance

The Digital Footprint

Information gathering, or reconnaissance, is the foundation of a successful penetration test.

In black box testing, you start with almost nothing, just a target name or an IP address. Your success depends on how well you can map the terrain before the first real attack. This isn't just about finding open ports; it's about understanding the organization, its technology, and its people from the outside in.

OSINT

noun

Open Source Intelligence. It refers to the collection and analysis of data gathered from public, or open, sources to produce actionable intelligence.

We'll explore two complementary approaches: passive and active reconnaissance. Passive recon is like watching a building from across the street with binoculars. Active recon is like walking up and rattling the doorknobs. Both are essential, but knowing when to use each is what separates a novice from an expert.

Passive Gathering

Passive reconnaissance is the art of gathering information without ever directly interacting with the target's systems. You're a ghost, collecting data from public records, social media, and search engines. The goal is to build a detailed profile of the target's infrastructure, personnel, and technologies without raising any alarms. Since you never send a single packet to the target's servers, this phase is virtually undetectable.

Lesson image

Your primary tools here are OSINT frameworks and advanced search engine techniques. Think beyond a simple Google search. Use operators like site:, filetype:, and inurl: to uncover sensitive documents, login portals, and network diagrams that were never meant to be public. Tools like theHarvester can automate this process, scraping search engines and public sources for email addresses, subdomains, and employee names associated with a target domain.

# Example using theHarvester to find information on a domain
theHarvester -d example.com -b google,bing,linkedin

Other valuable sources include job postings, which often reveal the specific technologies a company uses, and social media profiles of employees, which can yield clues about internal projects or company culture. Websites like Shodan search for internet-connected devices, giving you a look at the target's external hardware without ever touching it directly.

Active Probing

Once you have a solid foundation from passive recon, it's time to get your hands dirty with active information gathering. This involves directly probing the target's network to confirm the data you've collected and uncover new details. This is where you start sending packets, and with that comes the risk of detection. The key is to be methodical and, when necessary, stealthy.

Network scanning is the core of active recon. Tools like Nmap are indispensable for identifying live hosts, open ports, and the services running on them. A simple port scan can tell you if a server is running a web server on port 80, an SSH server on port 22, or something else entirely. But advanced Nmap usage is where the real skill lies.

Instead of just scanning for ports, you can perform version detection (-sV) to identify the exact software and version number running on a service. This is critical, as it allows you to search for known vulnerabilities associated with that specific version.

Staying Stealthy

A loud, aggressive scan is like kicking down the front door. It will get you noticed. Modern Intrusion Detection Systems (IDS) and firewalls are designed to spot and block standard Nmap scans. To remain undetected, you need to modify your approach.

Stealthy scanning involves techniques designed to mimic legitimate network traffic or to be so slow they fly under the radar. For example, instead of a full TCP connect scan (-sT), which is easily logged, you can use a SYN scan (-sS). This "half-open" scan sends a SYN packet and waits for a SYN-ACK response, but never completes the connection, making it less likely to be logged.

Other techniques include:

  • Timing Controls: Using options like -T2 (polite) or -T1 (sneaky) in Nmap slows the scan down dramatically, making it harder for an IDS to correlate the packets as part of a malicious scan.
  • Packet Fragmentation: The -f option splits packets into smaller fragments, which can sometimes bypass older or poorly configured firewalls.
  • Decoys: The -D option allows you to include decoy IP addresses in your scan, making it appear as though multiple hosts are scanning the target, obscuring your true location.
# A stealthy Nmap scan using a slow timing template, SYN scan, and decoys
sudo nmap -sS -T2 -D DECOY_IP1,DECOY_IP2 YOUR_IP TARGET_IP

By combining thorough passive intelligence with careful, stealthy active probing, you can build a comprehensive map of your target. This map is the blueprint for the next phases of your penetration test, guiding you toward the most promising vulnerabilities.

Ready to test your knowledge? Let's see how well you've grasped these advanced reconnaissance techniques.

Quiz Questions 1/5

What is the fundamental difference between passive and active reconnaissance in black box testing?

Quiz Questions 2/5

An ethical hacker wants to discover PDF documents containing network diagrams for a target company, using only a search engine. Which search query is most likely to yield relevant results?

Mastering these methods ensures you have the best possible intelligence before you attempt any form of exploitation.