Study guide

7.1 Network Reconnaissance, Unauthorized Access, and Port Scanning

EC-Council Certified Incident Handler ECIH

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Introduction to Incident Handling and Response

1.1 Information Security Fundamentals, Threat Landscapes, and Attack Vectors 1.2 Incident Management Principles, CSIRT Team Structures, and SOAR Automation 1.3 Cyber Defense Frameworks: NIST SP 800-61, ISO 27035, MITRE ATT&CK, and Cyber Kill Chain 1.4 Risk Management, Security Policies, and Security Auditing

2 Chapter 2: Incident Handling Process: Preparation, Detection, and Triage

2.1 Incident Response Preparation, Policies, and Playbook Design 2.2 Incident Recording, Categorization, and Triage Methodologies 2.3 Incident Notification, Escalation Paths, and Stakeholder Communication

3 Chapter 3: Incident Handling Process: Containment, Eradication, and Post-Incident

3.1 Incident Containment Strategies, Isolation, and Evidence Protection 3.2 Eradication Procedures, Remediation, and Secure System Recovery 3.3 Post-Incident Review, Lessons Learned, and Threat Intelligence Sharing

4 Chapter 4: Forensic Readiness and First Response

4.1 Forensic Readiness Planning, Legal Mandates, and Regulatory Compliance 4.2 First Response Principles, Scene Securing, and Order of Volatility 4.3 Digital Evidence Collection, Packaging, and Chain of Custody 4.4 Anti-Forensics Detection, Evidence Gaps, and Countermeasures

5 Chapter 5: Handling and Responding to Malware Incidents

5.1 Malware Classification, Attack Vectors, and Modern Threat Profiles 5.2 Static Analysis, Dynamic Analysis, and Sandboxing Workflows 5.3 Malware Detection, Memory Forensics, and Eradication Strategies

6 Chapter 6: Handling and Responding to Email Security Incidents

6.1 Email Attack Vectors: Phishing, Spear Phishing, BEC, and Spoofing 6.2 Email Header Forensics, Link Triage, and Malicious Attachment Analysis 6.3 Email Authentication Protocols (SPF, DKIM, DMARC) and Incident Containment

7 Chapter 7: Handling and Responding to Network Security Incidents

7.1 Network Reconnaissance, Unauthorized Access, and Port Scanning 7.2 Denial of Service (DoS/DDoS) Attack Mechanisms and Traffic Mitigation 7.3 Wireless Network Incidents, Session Hijacking, and Packet Analysis 7.4 Inappropriate Usage Incidents: Validation, Evidence, and Response

8 Chapter 8: Handling and Responding to Web Application Security Incidents

8.1 Web Application Threat Vectors: Injection, XSS, and CSRF Incidents 8.2 Web Server and Application Log Analysis (Apache, Nginx, IIS) 8.3 Web Application Incident Containment, Patching, and Defense-in-Depth

9 Chapter 9: Handling and Responding to Cloud Security Incidents

9.1 Cloud Shared Responsibility, Threat Landscape, and IAM Attacks 9.2 Cloud Telemetry and Audit Logging (AWS CloudTrail, Azure Activity, GCP Audit) 9.3 Cloud Incident Containment, Snapshot Forensics, and Container Security

10 Chapter 10: Handling and Responding to Insider Threats

10.1 Insider Threat Typologies, Behavioral Indicators, and Risk Profiles 10.2 Insider Threat Detection: UEBA, Data Loss Prevention, and Audit Trails 10.3 Insider Incident Investigation, Evidence Handling, and Legal Reporting

11 Chapter 11: Handling and Responding to Endpoint, IoT, and OT Incidents

11.1 Windows Endpoint Forensics and Volatile Artifact Analysis 11.2 Linux and macOS Endpoint Incident Investigation 11.3 Mobile Device Isolation, Acquisition, and Incident Handling 11.4 IoT Incident Handling and Firmware Investigation 11.5 OT and ICS Incident Handling: Safety, Visibility, and Recovery

7.1 Network Reconnaissance, Unauthorized Access, and Port Scanning

Key Takeaways Explain This Topic AI

Passive reconnaissance leverages OSINT, search engines (Shodan, Censys), and public DNS records without sending traffic directly to target networks, whereas active reconnaissance directly interacts with target boundaries via ping sweeps, port scans, and DNS zone transfer queries (AXFR).

TCP SYN scans (-sS) send RST after SYN-ACK instead of completing the handshake; TCP Connect scans (-sT) complete the connection and are more likely to produce application or service logs, though logging depends on the target and configuration.

Inverted and stealth scans—such as FIN (-sF), Xmas (-sX), and NULL (-sN) scans—exploit RFC 793 stipulations where closed ports return RST packets while open ports silently drop unexpected flag combinations, though Windows and Cisco network stacks deviate from RFC 793 by returning RSTs regardless of port state.

Unauthorized access techniques are differentiated by their operational methodology: brute-force attacks exhaustively test thousands of passwords against a single account, credential stuffing replays compromised credentials from public breaches, and password spraying tests a few common passwords against thousands of accounts to bypass lockout thresholds.

Network anomaly detection correlates NetFlow/IPFIX telemetry for volume/flow deviations with deep packet inspection platforms like Zeek (for detailed protocol connection logs) and Suricata/Snort (for signature-based alerts on port scanning and rapid authentication failures).

Last updated: October 2026

Network Reconnaissance, Unauthorized Access, and Port Scanning

Network perimeters are a major enterprise attack surface. Many intrusions include reconnaissance or scanning, but attackers can also use known targets, stolen credentials, trusted relationships, or pre-positioned access without observable scanning. For incident handlers, identifying preparatory indicators, dissecting port probes, distinguishing credential attack patterns, and detecting baseline traffic deviations are essential competencies.

Network Attack Surface and Reconnaissance Techniques

Reconnaissance allows adversaries to map infrastructure, address allocations, and listening services:

Passive Reconnaissance: Intelligence gathering without transmitting packets directly to target systems, generating no firewall or IDS alerts. Threat actors utilize Open-Source Intelligence (OSINT), querying WHOIS registries, examining Certificate Transparency logs via crt.sh, and mining passive DNS records. Adversaries leverage search engines like Shodan and Censys to index open ports, banners, TLS certificates, and device types, discovering exposed management consoles or unpatched appliances out-of-band.

Active Reconnaissance: Probing boundary routers, firewalls, and hosts directly to elicit responses, providing concrete data regarding active hosts and network topology. A prime active vector is the DNS Zone Transfer (AXFR) . DNS servers utilize AXFR queries over TCP port 53 to replicate zone data between authoritative servers. When left unrestricted, an adversary executes an AXFR query (via dig) to download the complete zone database, obtaining the names and records exposed by that zone; this may reveal valuable addressing and service clues but not necessarily the complete internal topology.

Scanning Methodologies and Protocol Mechanics

Adversaries deploy scanners like Nmap to locate responsive hosts and inspect port states via distinct transport mechanics:

Ping Sweeps: Scanners verify host vitality before port enumeration. Standard sweeps send ICMP Echo Requests (Type 8) expecting Echo Replies (Type 0). Because firewalls frequently filter ICMP, scanners deploy TCP discovery (SYN to port 443, ACK to port 80) or local Layer 2 ARP sweeps that bypass host firewalls.

TCP SYN Stealth Scans (-sS): Termed half-open scanning, the TCP SYN scan is Nmap's default technique. The scanner transmits a SYN segment. If open, the target returns SYN-ACK; the scanner replies with RST rather than completing the handshake with an ACK. This half-open state usually prevents delivery to the listening application and often avoids full-connection service logs, while remaining visible to host, firewall, and network sensors. Closed ports return RST-ACK.

TCP Connect Scans (-sT): When lacking raw socket privileges, the scanner invokes the operating system connect() call, completing the full three-way handshake (SYN -> SYN-ACK -> ACK) before teardown. Because the socket is fully established, application services log the connection event, making -sT significantly noisier.

Inverted and Stealth Scans (FIN, Xmas, NULL): Under RFC 793, closed ports return RST-ACK to unexpected packets, while open ports drop them silently. A FIN scan (-sF) sets only FIN, an Xmas scan (-sX) sets FIN, PSH, and URG, and a NULL scan (-sN) clears all flags. While BSD Unix and Linux follow RFC 793, Windows and Cisco IOS return RST-ACK regardless of port state, rendering inverted scans ineffective against Windows.

UDP Scans (-sU): Because UDP is connectionless, the scanner sends UDP probes to target ports. Closed ports elicit an ICMP Type 3, Code 3 (Port Unreachable) error, while open ports return application data or drop probes silently (open|filtered). Because kernels rate-limit ICMP unreachable generation, UDP scanning across large port ranges is exceptionally slow.

Nmap Flags and Detection Signatures in IDS/IPS

Incident handlers must correlate operational scanner flags with network intrusion detection signatures:

Nmap Flags: Timing templates range from -T0 (Paranoid) to -T5 (Insane). Evasion options include packet fragmentation (-f), custom MTU sizing (--mtu 16), decoy generation (-D RND:10), and source port spoofing (-g 53 or --source-port 88) to bypass legacy firewall rules permitting inbound traffic from DNS or Kerberos ports.

IDS/IPS Signatures: Snort and Suricata detect scanning via protocol anomaly rules and preprocessors. An Xmas scan rule inspects raw TCP flags: alert tcp any any -> $HOME_NET any (msg:"SCAN Xmas Scan"; flags:FPU; classtype:attempted-recon; sid:1000001; rev:1;). Stream preprocessors (like Snort's sfPortscan) track unique destination ports per source host over sliding time windows, alerting when thresholds are exceeded (e.g., 20 ports within 5 seconds).

Unauthorized Access Detection and Credential Attacks

Following port discovery, adversaries target administrative services (SSH on TCP 22, RDP on TCP 3389, SMB on TCP 445, WinRM on TCP 5985/5986):

Brute-Force Attacks: Exhaustively testing thousands of passwords against a single targeted account (e.g., administrator or root), generating rapid failed authentications that trigger lockout thresholds.

Credential Stuffing: Automated replaying of exfiltrated credentials from public breaches across enterprise SSO, VPN, or web portals, capitalizing on password reuse.

Password Spraying: Horizontal testing of one or two common passwords (e.g., Autumn2026!) across thousands of enterprise user accounts, spacing attempts across hours to evade per-account lockout thresholds.

Authentication Telemetry: Correlating host security logs is essential. In Windows, handlers inspect Security event logs: Event ID 4625 denotes failed logons, Event ID 4624 records successful logons (Logon Type 3 for network/SMB and Logon Type 10 for RDP), and Event ID 4740 records account lockouts. On Linux, /var/log/auth.log or /var/log/secure captures failed passwords and invalid user attempts via sshd.

Network Baseline Deviations and Anomaly Detection

Early detection of reconnaissance and unauthorized access relies on identifying statistical deviations in network flow data and transaction logs:

NetFlow and IPFIX Telemetry: NetFlow/IPFIX records unidirectional flow summaries (IPs, ports, protocols, packet/byte counts, flow duration). Port scanning manifests as an extreme anomaly: a dramatic spike in flow records with minimal packets per flow (1-2 packets), tiny byte volumes (<100 bytes), short lifetimes (<50 milliseconds), and a high fan-out ratio (one source querying hundreds of unique destination ports or IPs).

Zeek Connection Logs: Zeek captures connection states in its conn.log history field. S0 denotes a SYN probe sent with no response received (filtered/dropped), Sr indicates a SYN followed by an immediate RST (closed port), and ShADdFf denotes a normal completed TCP session.

SIEM Correlation: SIEM platforms correlate NetFlow spikes with Zeek S0 connection histories and host authentication failures (Event ID 4625 clusters), isolating reconnaissance and credential attacks before lateral movement begins.

Loading diagram... TCP Port Scan Signatures: SYN vs Connect vs Inverted Scans