[cmd]cat /etc/pf.conf > forums.freebsd.org[/cmd]
# $FreeBSD: release/9.2.0/share/examples/pf/pf.conf 218854 2011-02-19 14:57:00Z brucec $
# $OpenBSD: pf.conf,v 1.34 2007/02/24 19:30:59 millert Exp $
#
# See pf.conf(5) and /usr/share/examples/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.
#################################################
## _------------------- ##
##::::::::::::| Tor configuration |::::::::::::##
## ------------------- ##
#################################################
#!-----[ note ]
#
# sockstat -4l
# tcpdump -w /var/log/tcpdump/[file] -i $ext_if
# tcpdump -tttt -r /var/log/tcpdump/[file_date].pcap
#
#!---------------[ eof ]
#!-----[ begin ruleset ]
### ---> defence systems initializing ---> standby for status ---> may the force be with you!
ext_if="NIC"
set skip on lo1
antispoof for $ext_if inet
### can't get the right syntax/order for this scrub option: consult manual
#scrub in on $ext_if all fragment reassemble
#scrub in all fragment reassemble no-df max-mss 1440
#scrub in all
block in from no-route to any
block in from urpf-failed to any
block in quick on $ext_if from any to 255.255.255.255
block in log quick on $ext_if from { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 255.255.255.255/32 } to any
### ...say NO to probes! operation: blackhole
### * F : FIN - Finish; end of session
### * S : SYN - Synchronize; indicates request to start session
### * R : RST - Reset; drop a connection
### * P : PUSH - Push; packet is sent immediately
### * A : ACK - Acknowledgement
### * U : URG - Urgent
### * E : ECE - Explicit Congestion Notification Echo
### * W : CWR - Congestion Window Reduced
block in quick on $ext_if proto tcp flags FUP/WEUAPRSF
block in quick on $ext_if proto tcp flags WEUAPRSF/WEUAPRSF
block in quick on $ext_if proto tcp flags SRAFU/WEUAPRSF
block in quick on $ext_if proto tcp flags /WEUAPRSF
block in quick on $ext_if proto tcp flags SR/SR
block in quick on $ext_if proto tcp flags SF/SF
pass out on $ext_if proto { tcp, udp, icmp } from any to any modulate state
pass in on $ext_if proto tcp from any to any port ssh flags S/SA synproxy state
pass in on $ext_if proto tcp from any to any port www flags S/SA synproxy state
### ssh brute force table needs building to st0p th3 h4x0rz
#table <ssh_abuse> persist
#block in quick from <ssh_abuse>
#pass in on $ext_if proto tcp to any port ssh flags S/SA keep state (max-src-conn 10, max-src-conn-rate 3/5, overload <ssh_abuse> flush)
### lockdown protocol engaged >> the fortress activated >> NSA freezone
#block in all
#pass out all keep state
### ---> system security level 1 in effect ---> deathstar defences online ---> good job, luke!
#!-----[ eof ]