Skip to content

Instantly share code, notes, and snippets.

@shotgundebugging
Created March 29, 2026 19:25
Show Gist options
  • Select an option

  • Save shotgundebugging/6b98b6c8fc489a2ded92234df998a1ca to your computer and use it in GitHub Desktop.

Select an option

Save shotgundebugging/6b98b6c8fc489a2ded92234df998a1ca to your computer and use it in GitHub Desktop.
echo 'block drop out proto tcp to any port 43' | sudo pfctl -Ef -
# does two things:
#echo 'block drop out proto tcp to any port 43'
# - writes a one-line pf firewall rule to stdout
# - the rule means: drop outbound TCP traffic to any destination on port 43
# | sudo pfctl -Ef -
# - -f - means “load rules from stdin” because - is stdin
# - -E means “enable pf” if it is not already enabled
# Remove the temporary rule and restore the normal config:
# sudo pfctl -f /etc/pf.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment