Network Scanning and Evasion Techniques
Discover hosts, services, and OS details while understanding evasion strategies and defensive countermeasures.
Content
TCP Connect and SYN Scanning
Versions:
Watch & Learn
AI-discovered learning video
TCP Connect vs SYN Scanning — The Knock, The Nod, and the Ghost
You already did the map-making (Footprinting and Reconnaissance) and learned who’s alive on the network (Host Discovery). Now it's time to knock on the doors and see which services answer. But do it like a responsible guest, not a burglar.
In the previous lessons you learned how to pick targets and find hosts without being a nuisance. Building on that, this piece digs into how TCP scans work at a protocol level, why you’d pick one scan type over another, and what defenders look for. We’ll also cover high-level evasion concepts (for context and defense) while keeping everything ethical and appropriate for a lab or authorized engagement.
Quick refresher (no replay, promised)
You already:
- Collected OSINT to prioritize targets (Footprinting).
- Chosen a scanning strategy and target list.
- Performed host discovery using ARP/ICMP when appropriate.
Now you’re deciding how to ask a target which services it’s running. The two classic ways are TCP Connect (full-open) and SYN (half-open) scanning. Think of them as different manners of ringing the doorbell.
The TCP handshake (the tiny drama that explains everything)
Client -> Server : SYN (Hey, I want to talk)
Server -> Client : SYN-ACK (I hear you, here’s how I respond)
Client -> Server : ACK (Great — established)
- A completed three-way handshake = a full TCP connection.
- If the server responds with RST (reset) or there’s no SYN-ACK, the port is closed or filtered.
SYN scanning interrupts this handshake mid-drama to get the answer without finishing the conversation. TCP Connect allows the full handshake to complete — which is louder but simpler.
What are they, in plain (slightly dramatic) English?
TCP Connect (Full-open)
- The scanner performs a complete TCP handshake with the target port. If the handshake succeeds, the port is open — then the scanner closes the connection politely (or awkwardly).
- Analogy: You walk up to a door, enter the house, look around, and then leave. The homeowner definitely noticed you.
Pros:
- Uses only standard OS networking; easy and reliable.
- No special privileges required on the scanning host.
Cons:
- Noisy: Connections appear in logs and on IDS.
- Slower per-connection overhead because full handshake and teardown happen.
SYN Scan (Half-open / Stealthy-ish)
- The scanner sends a SYN and waits. If it receives SYN-ACK, it notes the port as open and then sends RST to tear down the handshake before completion.
- Analogy: You press the doorbell, peek through the window, and leave before the homeowner opens the door. Less obvious, but still leaves traces.
Pros:
- Less noisy in application logs (no full connection), often faster.
- Commonly requires raw socket privileges (so usually needs elevated rights).
Cons:
- Still detectable by good IDS/host-based logging.
- Might be blocked or yield false negatives on devices that treat half-open handshakes specially.
Comparison table (TL;DR)
| Feature | TCP Connect | SYN Scan |
|---|---|---|
| Noise level | High (full connections) | Lower (no full connections) |
| Reliability | Very reliable | Reliable, but some defenses interfere |
| Privileges needed | Normal OS sockets | Raw sockets / elevated privileges |
| Detectable by IDS | Yes (connection logs) | Yes (SYN patterns, RSTs) |
Real-world examples & when to use each
- Use TCP Connect when you: have limited privileges, are in a constrained lab environment, or want maximum compatibility and reliability.
- Use SYN Scan when you: have permission and privileges, want a faster sweep, and are probing large ranges where noise matters.
Always document scope and authorization. In an authorized pentest, stating the scan types and expected noise in the rules of engagement is standard practice.
High-level view of evasion (for defender empathy)
I’ll be blunt: teaching people how to evade detection is a tightrope. Instead of a toolkit, here’s a categorization of evasion strategies so defenders can understand and prepare. I’ll deliberately avoid granular, how-to steps.
Common evasion categories attackers think about:
- Timing and pacing — spreading packets out to avoid triggering rate-based alerts.
- Protocol oddities — crafting packets that exploit edge-case handling in stacks.
- Source obfuscation — using intermediaries or spoofing to hide origin.
- Payload shaping — altering size/fragmentation to confuse parsers.
Defender takeaway: alerts that rely on single heuristics (e.g., burst detection only) are brittle. Combine logs, flow data, and endpoint telemetry.
How defenders detect and respond (actionable for defenders, not attackers)
- Monitor SYN/connection ratios: lots of SYNs without established connections is suspicious.
- Correlate network flow logs with host logs: dropped RSTs, half-open sockets, or unexpected resets tell tales.
- Use baselining: normal traffic patterns per subnet/service help identify anomalies.
- Block or rate-limit suspicious IPs after verifying authorization and contextual info.
- Run active deception/lures in controlled subnets to catch curious scanners.
Ethical & legal boilerplate (read this like it’s your legal guardian)
- Always have written authorization for scanning. Get scope, time windows, and contact details in advance.
- Test in segmented labs or dedicated permissioned networks when learning. Never — and I mean never — scan systems you don’t own or aren’t authorized to test.
- Report findings responsibly and include noise metrics so system owners can triage.
Mini pseudocode: what a scanner does (conceptual)
for each target in target_list:
send SYN to target:port
wait for response
if response == SYN-ACK:
mark port OPEN
(optionally) send RST to abort
elif response == RST or ICMP unreachable:
mark port CLOSED or FILTERED
else:
mark port FILTERED (no response)
This is a state machine, not a recipe. Use it to understand logic, not to implement misuse.
Closing — the dramatic insight
Scanning is less about breaking in and more about listening closely to how machines answer. A polite, authorized scan teaches you the network’s grammar. A noisy, unauthorized one gets you on a very short mailing list with legal counsel.
Key takeaways:
- SYN scans are stealthier but not magic; Connect scans are simple and chatty.
- Evasion is a concept attackers love; defenders should design multi-layered detection instead of relying on single heuristics.
- Always operate with permission, scope, and documentation.
Final thought: being a good ethical hacker means being the kind of person who asks before opening a door — and leaves a note when they’ve been inside.
Comments (0)
Please sign in to leave a comment.
No comments yet. Be the first to comment!