Overview
Firewalls and IDS/IPS systems are designed to detect and block malicious traffic. Understanding how to evade these systems is crucial for penetration testing.Common Evasion Techniques
1. Source Port Manipulation
Why it works:- Many firewalls allow traffic from “trusted” ports (53, 80, 443, 25)
- Port 53 (DNS) is often allowed both inbound and outbound
- Administrators rarely block DNS traffic
2. Decoy Scanning
Purpose: Hide your real IP among fake ones3. Packet Fragmentation
Purpose: Split packets to evade signature-based detection4. Timing Manipulation
Purpose: Avoid rate-based detectionLab Example: HTB Academy Hard
Scenario: Target has restrictive firewall that blocks most scans Solution:Advanced Evasion Techniques
1. IPv6 Evasion
2. Idle Scan (Zombie Scan)
3. Custom Packet Crafting
Firewall Detection
Identify Firewall Presence
Firewall Fingerprinting
Best Practices
- Start with stealth techniques
- Combine multiple evasion methods
- Monitor for detection
- Document successful techniques
- Respect scope and permissions
Common Mistakes to Avoid
- Using predictable decoy IPs
- Ignoring timing considerations
- Over-fragmenting packets
- Not testing evasion effectiveness
- Forgetting to use appropriate source ports
Tools and Resources
- Nmap: Primary scanning tool
- Netcat: Connection testing
- Hping3: Custom packet crafting
- Scapy: Python packet manipulation
- Firewalk: Firewall analysis
References
- HTB Academy: Firewall and IDS/IPS Evasion
- Nmap Network Scanning Guide
- Penetration Testing Execution Standard (PTES)
Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with theask query parameter: