Active Reconnaissance: Network Scanning and Port Discovery

Devyush RaturiDevyush Raturi
3 min read

While passive reconnaissance provides valuable insights without direct interaction, active reconnaissance involves directly probing the target network to gather more detailed information. This phase, primarily focused on network scanning and port discovery, allows ethical hackers to map the target's infrastructure and identify potential entry points. This article will explore the techniques and tools used for active reconnaissance.

Understanding the Risks

Active reconnaissance, by its nature, involves direct interaction with the target system. This increases the risk of detection and potential disruption. Therefore, it's crucial to proceed with caution and obtain explicit permission before conducting any active scanning activities.

Network Scanning Techniques

  • Host Discovery: Identifying active hosts on the target network.

    • Ping Sweeps: Sending ICMP echo requests to a range of IP addresses to identify live hosts.

    • ARP Scans: Identifying hosts on the local network by sending ARP requests.

    • Nmap Host Discovery: Using Nmap's -sn or -sP options for host discovery.

  • Port Scanning: Identifying open ports and services on target systems.

    • TCP Connect Scan: Establishing a full TCP connection to each port.

    • SYN Scan (Stealth Scan): Sending SYN packets and analyzing the responses.

    • UDP Scan: Sending UDP packets to target ports.

    • FIN/NULL/Xmas Scans: Sending packets with specific TCP flags set.

  • OS Fingerprinting: Identifying the operating system running on target systems.

    • TCP/IP Stack Analysis: Analyzing the target's TCP/IP stack to infer the OS.

    • Nmap OS Detection: Using Nmap's -O option for OS detection.

  • Service Version Detection: Identifying the versions of services running on open ports.

    • This provides crucial information about potential vulnerabilities.

    • Nmap’s –sV option is very helpful.

Tools of the Trade

  • Nmap (Network Mapper): The most versatile and powerful network scanning tool. It supports various scan types, OS fingerprinting, and service version detection.

    • Example: nmap -A -T4 <target_ip> (aggressive scan).

    • Example: nmap -sV <target_ip> (service version detection).

  • Hping3: A network tool for crafting and sending custom TCP/IP packets.

    • Useful for advanced network testing and firewall evasion.
  • Netcat (nc): A versatile networking utility that can be used for port scanning, banner grabbing, and network communication.

  • Masscan: A high-speed port scanner designed for scanning large networks.

Port Discovery and Analysis

  • Common Ports: Understanding common ports and their associated services (e.g., HTTP: 80, SSH: 22, FTP: 21) is essential.

  • Banner Grabbing: Retrieving the banner or welcome message from a service to identify its version and type.

  • Firewall Analysis: Identifying firewall rules and filtering mechanisms.

  • Identifying Vulnerable Services: Correlating open ports and service versions with known vulnerabilities.

Ethical Considerations

  • Always obtain explicit permission before conducting any active reconnaissance activities.

  • Be mindful of the potential impact of your scans on the target system.

  • Avoid using aggressive scanning techniques that could disrupt services.

  • Adhere to ethical hacking principles and legal regulations.

Documentation

Thorough documentation is essential during the active reconnaissance phase. Record all findings, including IP addresses, open ports, running services, OS information, and identified vulnerabilities. This documentation will serve as a valuable resource during subsequent testing phases.

Conclusion

Active reconnaissance, particularly network scanning and port discovery, is a critical step in ethical hacking. By directly probing the target network, ethical hackers can gather detailed information about the target's infrastructure and identify potential entry points. However, it's crucial to proceed with caution and adhere to ethical guidelines and legal regulations. Mastering these techniques is fundamental for any security professional.

10
Subscribe to my newsletter

Read articles from Devyush Raturi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Devyush Raturi
Devyush Raturi