| name | macos-firewall-bypass-audit |
| description | Audit and test macOS firewall configurations for potential bypass vulnerabilities. Use this skill whenever you need to assess macOS firewall security, check for known bypass techniques, enumerate allowed traffic, inspect PF rules, or validate Network Extension filter configurations. This skill helps security professionals identify weaknesses in firewall rules, test for CVE-2024-44206 and other recent vulnerabilities, and harden macOS systems against firewall evasion attacks. |
macOS Firewall Bypass Audit
A skill for security professionals to audit macOS firewall configurations and identify potential bypass vulnerabilities. This skill covers defensive testing of firewall rules, Network Extension filters, and known CVEs.
When to Use This Skill
Use this skill when you need to:
- Audit macOS firewall configurations for security assessments
- Test for known firewall bypass vulnerabilities (CVE-2024-44206, PF rule-ordering bugs, etc.)
- Enumerate allowed network traffic and identify whitelisted applications
- Inspect Packet Filter (PF) rules generated by GUI firewalls
- Check for Network Extension filter stability issues
- Validate that firewall rules are actually blocking intended traffic
- Research firewall bypass techniques for defensive hardening
Quick Start
lsof -i TCP -sTCP:ESTABLISHED
sudo pfctl -a com.apple/250.ApplicationFirewall -sr
pfctl -sr | grep quick
Audit Categories
1. Whitelist Abuse Detection
Firewalls often whitelist well-known macOS processes. Check if suspicious processes are masquerading as legitimate ones.
What to look for:
- Processes named
launchd, mdnsreponder, or other Apple-signed binaries
- Unexpected network activity from whitelisted processes
- Binary paths that don't match expected system locations
Audit command:
lsof -i -n | grep -E "(launchd|mdnsreponder|nsurlsessiond)"
2. DNS Resolution Analysis
DNS queries go through mdnsreponder, which is Apple-signed and typically allowed through firewalls.
Audit approach:
- Monitor DNS traffic patterns
- Check for unusual DNS query volumes
- Verify DNS responses match expected domains
3. Browser-Based Traffic Inspection
Browsers can be used to exfiltrate data even when other applications are blocked.
Test browser exfiltration paths:
| Browser | Command |
|---|
| Safari | open -j -a Safari "https://test-domain.com" |
| Chrome | "Google Chrome" --headless "https://test-domain.com" |
| Firefox | firefox-bin --headless "https://test-domain.com" |
Audit tip: Check if browser processes have outgoing network entitlements:
codesign -d --entitlements :- /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 2>/dev/null | grep network
4. CVE-2024-44206 Testing (Web Content Filter Bypass)
Vulnerability: Safari/WebKit double URL-encoding bypass in Screen Time filters (patched July 2024).
Test procedure:
open "http://test%2Eexample.com%2F./"
Expected behavior:
- Patched system: Request blocked by Screen Time
- Vulnerable system: Safari loads the page despite filter
Remediation: Update to macOS version with July 2024 security patches.
5. PF Rule-Ordering Bug Check (macOS 14 Sonoma)
Vulnerability: Rules with quick keyword silently ignored in early macOS 14 beta (fixed in RC 2, build 23A344).
Test procedure:
pfctl -sr | grep quick
sudo tcpdump -n -i en0 not port 53
Expected behavior:
- If
quick rules exist but traffic still flows, the bug may be present
- Verify macOS build number:
sw_vers -buildVersion
6. QUIC/ECH Evasion Testing (macOS 12+)
Vulnerability: HTTP/3 over QUIC with Encrypted Client Hello can bypass domain filters.
Test procedure:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--enable-quic \
--origin-to-force-quic-on=test-domain.com:443 \
--enable-features=EncryptedClientHello \
--user-data-dir=/tmp/h3test \
https://test-domain.com
curl --http3-only https://test-domain.com
Expected behavior:
- If domain is blocked but request succeeds, filter cannot parse QUIC/ECH
- Check firewall logs for UDP/443 traffic
7. Network Extension Filter Stability (macOS 15 Sequoia)
Vulnerability: Early 15.0/15.1 builds crash third-party Network Extension filters.
Test procedure:
log stream --predicate 'subsystem == "com.apple.networkextension"' --style syslog
python3 - <<'PY'
import socket
for i in range(5000):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(b'X'*32, ('1.1.1.1', 53))
PY
Expected behavior:
- Watch for filter crash/restart cycles
- Check if firewall GUI still shows "active" while rules are dropped
8. Entitlement Enumeration
Find binaries with outgoing network entitlements that could be abused.
Audit command:
codesign -d --entitlements :- /path/to/bin 2>/dev/null | \
plutil -extract com.apple.security.network.client xml1 -o - -
for bin in /System/Applications/App\ Store.app/Contents/MacOS/App\ Store \
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/MacOS/User; do
echo "=== $bin ==="
codesign -d --entitlements :- "$bin" 2>/dev/null | grep -A2 network.client
done
Audit Workflow
Step 1: Baseline Assessment
- Document current firewall configuration
- List all allowed applications
- Capture baseline network traffic
- Note macOS version and build number
Step 2: Vulnerability Testing
- Test for CVE-2024-44206 (if applicable)
- Check PF rule ordering (macOS 14)
- Test QUIC/ECH bypass (macOS 12+)
- Stress test Network Extension filters (macOS 15)
Step 3: Whitelist Analysis
- Enumerate all whitelisted processes
- Check for process masquerading
- Verify binary paths and signatures
- Review DNS resolution patterns
Step 4: Remediation Planning
- Update macOS to latest security patches
- Configure firewall to block QUIC/UDP-443 if needed
- Implement application allowlisting by path, not just name
- Enable logging for Network Extension events
- Consider additional monitoring for DNS and browser traffic
Scripts
Use the bundled scripts for common audit tasks:
check-allowed-traffic.sh - List all established TCP connections
inspect-pf-rules.sh - Display PF rules from GUI firewalls
check-entitlements.sh - Find binaries with network entitlements
test-quic-capability.sh - Check if QUIC/ECH is available
monitor-netext.sh - Watch Network Extension filter logs
References
Safety Notes
- Always perform audits on systems you own or have explicit authorization to test
- Some tests may generate network traffic - ensure you're in a controlled environment
- CVE testing should only be done on systems where you can verify patch status
- Network Extension stress tests may temporarily impact firewall functionality
- Document all findings and remediate vulnerabilities discovered