Home > Glossary > CompTIA PenTest+ > Egress Filtering

📖 What is Egress Filtering?

Egress filtering is the practice of monitoring and restricting outbound network traffic from an internal network to the internet. By limiting the ports and protocols allowed to leave the network, security professionals can prevent compromised systems from communicating with C2 servers or exfiltrating sensitive data.

🥋 Sensei Says:

"From a PenTest perspective, this is often your biggest hurdle during the C2 setup phase."

📚 Certification: CompTIA PenTest+ (PT0-002)

🔑 What are the Key Concepts of Egress Filtering?

  • Blocks non-standard ports to disrupt Command and Control (C2) channels, forcing attackers to use common ports like 80 or 443 for communication.
  • Prevents data exfiltration by restricting outbound protocols, making it difficult for attackers to move sensitive files via FTP, SSH, or SMB to external servers.
  • Penetration testers bypass these restrictions using tunneling techniques, such as DNS tunneling, to encapsulate malicious traffic within allowed protocols.
  • Implements a 'default-deny' posture, where all outbound traffic is blocked unless specifically permitted by a rule based on port, protocol, or destination.
  • Focuses on the 'outbound' direction of the firewall, contrasting with ingress filtering which protects the network from external threats entering the perimeter.

🎯 How does Egress Filtering appear on the PT0-002 Exam?

You may be asked to troubleshoot a failed reverse shell. If your listener on port 4444 is not receiving a connection, you should test for egress filtering on common ports.

A scenario might describe a target environment where all outbound traffic is blocked except for DNS. You will be asked to identify the most effective method for establishing C2 communication.

Expect questions about identifying the best defensive control to stop a compromised internal host from communicating with an external attacker's server, specifically focusing on preventing data exfiltration.

❓ Frequently Asked Questions

How do I test for egress filtering during an engagement?

Use tools like Netcat or Curl to attempt connections to a controlled external server on common ports (80, 443, 53). If connections fail on non-standard ports but succeed on 443, egress filtering is active.


Why is DNS often the weakest point in egress filtering?

DNS is critical for network operations; blocking it entirely breaks internet connectivity. Attackers exploit this by embedding data in DNS queries, allowing them to bypass firewalls that only inspect port 53.


Is egress filtering more important than ingress filtering for a PenTester?

While ingress prevents the initial breach, egress filtering is often the biggest hurdle for post-exploitation. It prevents the establishment of reverse shells and the successful exfiltration of sensitive data.

Related Terms from CompTIA PenTest+

📝 Related Study Guides

Comparison 8 min read

CISSP vs CISM: Which Certification Should You Pursue in 2026?

Choose CISSP if you want broad technical security expertise across eight domains, including cryptography, network security, and software development. Choose CISM if you're focused on information security management, governance, and risk management from a leadership perspective. CISSP is ideal for hands-on security architects, while CISM is designed for security managers and directors.

Career Guide 9 min read

The IT Certification Roadmap: Where to Start in 2026

Start your IT certification journey in 2026 with CompTIA A+ for general IT foundations, then branch into networking (Network+), cybersecurity (Security+), or cloud computing (AWS Cloud Practitioner or Azure Fundamentals) based on your career goals. Each path leads to advanced certifications like CISSP, AWS Solutions Architect, or CISM within 2-3 years of focused progression.

Comparison 10 min read

CISSP vs CISM: Which Certification Should You Pursue in 2026?

The CISSP is a broad, technical-to-managerial certification focusing on security operations and architecture across eight domains. In contrast, CISM is a specialized management certification centered on governance, risk management, and program development. Choose CISSP for comprehensive security expertise and CISM if you are pivoting specifically into security leadership and governance roles.

🧠

Test Your Knowledge

Think you understand Egress Filtering? Put it to the test with our practice exam.

Try 10 Free Questions

⭐ 1,000 expert-curated questions available with Premium

Upgrade Premium