Home > Glossary > PenTest+ Certification Exam > 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: PenTest+ Certification Exam (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 PenTest+ Certification Exam

📝 Related Study Guides

Study Guide 10 min read

The Ultimate CompTIA PenTest+ Study Guide

Passing the CompTIA PenTest+ exam requires a solid understanding of planning and scoping, information gathering, attacks and exploits, reporting, and tools. Consistent practice using high-quality resources is essential for success.

Study Guide 8 min read

How to Pass CompTIA PenTest+ on Your First Try

To pass the PenTest+ on your first try, you must combine hands-on lab experience with rigorous theoretical study, focusing heavily on vulnerability identification and the use of penetration testing tools.

Comparison 7 min read

CompTIA PenTest+ vs. CEH: Which Certification is Right for You?

The CompTIA PenTest+ focuses heavily on practical, hands-on vulnerability assessment and management, while the CEH provides a broader, more theoretical overview of ethical hacking concepts. Your choice depends on whether you prefer practical skills over theoretical knowledge.

🧠

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