No history yet

Advanced Network Reconnaissance

Beyond the Ping

You already know how to check if a machine is online. Now it's time to learn what that machine is doing. Advanced reconnaissance is about moving from passive observation to active intelligence gathering. We're going to use Nmap, a powerful network scanner, to map our target's attack surface in detail.

Our first step is to choose the right tool for the job. Not all scans are created equal. The most basic scan is a TCP Connect scan. It completes the full three-way handshake (SYNSYN, SYNACKSYN-ACK, ACKACK) with the target port. It's reliable and doesn't require special privileges to run, but it's also very noisy. Any decent logging system will record the connection attempt, making you easy to spot.

A Connect scan is like knocking on a door and waiting for someone to fully open it. It's obvious you're there.

For a quieter approach, we use a SYN scan, sometimes called a half-open scan. This scan sends a SYNSYN packet, just like the Connect scan. But when the target replies with a SYNACKSYN-ACK (indicating the port is open), the scanner sends a RSTRST (reset) packet instead of the final ACKACK. The connection is never fully established. Because the application layer is never reached, this method is far less likely to be logged by the target system.

Here's a quick comparison:

Scan TypeCommand FlagStealth LevelPrivileges Needed
TCP Connect-sTLowNone
SYN (Stealth)-sSHighRoot/Administrator

Identifying the Target

Knowing a port is open is useful, but knowing what's running on that port is critical. Is port 80 running Apache 2.4.41 or Microsoft IIS 10.0? The answer determines your next move. Service version detection tells us exactly what software and version is listening on an open port. We can do this in Nmap with the -sV flag.

# -sV: Probe open ports to determine service/version info
# -T4: Use a more aggressive timing template for a faster scan
nmap -sV -T4 192.168.1.1

Beyond the service, we need to identify the underlying operating system. Every OS implements the TCP/IP stack slightly differently. OS fingerprinting works by sending a series of specifically crafted probes to the target and analysing the responses. Tiny variations in things like TCP window sizes, packet header options, and ICMP responses can reveal the OS with surprising accuracy. Nmap's -O flag enables this feature.

Combining service version detection with OS fingerprinting gives you a detailed blueprint of the target machine.

Advanced Tactics

Sometimes, even a SYN scan isn't stealthy enough. An Intrusion Detection System (IDS) might flag a burst of SYN packets from a single IP. This is where an idle scan comes in. It's a truly blind scanning technique that uses a third-party, idle machine (a 'zombie') to send the packets. Your IP address never directly communicates with the target, making you effectively invisible.

The real power of Nmap, however, lies in its scripting engine. The Nmap Scripting Engine (NSE) allows users to write (and use pre-written) scripts to automate a wide variety of networking tasks. These scripts can detect specific vulnerabilities, perform more advanced enumeration, or even conduct basic exploitation. Using the default scripts (-sC) is a great way to expand your reconnaissance.

# -sS: SYN scan
# -sC: Run default NSE scripts
# -O: Enable OS detection
# -oA: Output in all formats (Normal, XML, and Grepable)
nmap -sS -sC -O -oA scan_results 192.168.1.0/24

This single command will perform a stealth scan of an entire subnet, run default scripts to find common issues, attempt to identify the OS of each host, and save the results for later analysis. This is the foundation of effective, automated reconnaissance.

Practice core commands like sudo nmap -sn for discovery, sudo nmap -sS -sV -O -T3 for controlled enumeration, --script safe or -sC for NSE, prefer -T2/-T3 over -T4 on fragile targets, and save outputs with -oA for later analysis.

Time to test what you've learned.

Quiz Questions 1/6

Why is a SYN scan (-sS) generally considered stealthier than a TCP Connect scan (-sT)?

Quiz Questions 2/6

Which Nmap flag would you use to determine the specific software and version running on an open port, for example, 'Apache 2.4.41' on port 80?

These techniques move beyond simply finding open doors; they involve understanding the locks, the frame, and the material the door is made of. Mastering them is a fundamental step toward becoming an effective ethical hacker.