Course contentsShow
← Security
Lesson 371 of 3,0528. Network Security - ReconnaissanceFree lesson

Protocol and Port Manipulation

Leverage alternative protocols, source port selection, and protocol encapsulation to evade filtering rules.

Protocol and Port Manipulation

What You'll Learn

You'll learn how attackers bypass network filters by disguising scans with unexpected protocols, unusual source ports, and encapsulation tricks.

The Core Idea

Firewalls and intrusion detection systems often make decisions based on which port and which protocol you're using. They might block incoming traffic on port 22 (SSH) but allow port 80 (HTTP). Protocol and port manipulation exploits these assumptions by making your reconnaissance traffic look like something it's not.

Think of it like a speakeasy during Prohibition: the front door is locked, but if you knock in the right pattern or enter through the "grocery store" facade, you get in. Your scanning traffic does the same thing—it disguises itself to slip past security controls.

Key Techniques

Alternative Protocols

Instead of standard TCP, you might use UDP, ICMP, or SCTP. Many firewalls scrutinize TCP carefully but give ICMP echo requests a free pass (because "ping is harmless," right?).

Source Port Selection

Firewalls often trust certain source ports. For example, traffic from port 53 (DNS) or port 20 (FTP-data) might be automatically allowed because admins assume it's response traffic. By setting your scan's source port to 53, you can bypass simple stateless filters.

Protocol Encapsulation

Wrap your scanning packets inside seemingly innocent protocols. Tunnel TCP scans inside HTTP requests, or hide data in DNS queries. The firewall sees "just DNS traffic" while your actual reconnaissance payload hides within.

Why It Works

Many security devices use simplistic rules like "allow TCP from any source port 53" without deep packet inspection. By manipulating which port you appear to come from or which protocol wrapper you use, you exploit these gaps.

Key Takeaway:
Protocol and port manipulation evades filters by disguising scan traffic as trusted protocols or using unexpected source ports that security rules overlook.