archive.mgm51.com

Sources under BSD licence

Return to Sources under BSD licence home page
PFSTATS

PFStats is a script that formats the output of a pfctl -v -s rules command into a one-line-per-rule format. Written for /bin/sh Bourne Shell.

Tested under FreeBSD 8.4, 9.1 and OpenBSD 5.4.

Sample output is shown below.

BSD license

Download pfstats 1.1 (1KB)


 

 

# pfstats.sh
Evals Packets Bytes Rule 2,398,499 1,599,076 158,060,918 scrub in all fragment reassemble 239,954 140,285 54,716,663 block drop in all 43,221 368,544 517,507,367 pass out quick proto tcp all flags S/FSRA modulate state 218,248 39,114 7,206,526 pass out quick proto udp all keep state 1,423 171 11,988 pass out quick proto icmp all keep state 14,364 4 240 block drop in quick on fxp0 inet proto tcp from any to any port = 135 14,360 0 0 block drop in quick on fxp0 inet proto tcp from any to any port = 137 14,360 0 0 block drop in quick on fxp0 inet proto tcp from any to any port = 138 14,360 6 320 block drop in quick on fxp0 inet proto tcp from any to any port = 139 14,354 20 1,028 block drop in quick on fxp0 inet proto tcp from any to any port = 445 159,389 0 0 block drop in quick from <maliciousIP> to any 16,772 42 2,520 block drop in quick proto tcp from <SpamBlock> to any port = 25 7,340 416,527 937,998,242 pass in quick proto tcp from any to <Port80Pass> port = 80 flags S/SA keep state #