Skip to content

Instantly share code, notes, and snippets.

Created February 12, 2009 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/62723 to your computer and use it in GitHub Desktop.
Save anonymous/62723 to your computer and use it in GitHub Desktop.
echo "outbound TCP connection 8051992 for dmz:192.168.10.223/21 (192.168.10.223/21) to servers:192.168.1.70/2037 (192.168.1.70/2037)" | perl -le 'while($line=<STDIN>){ if($line=~m/^inbound|outbound\s+(TCP|UDP|ICMP)\s+connection\s+[0-9]+\s+for\s+([A-Za-z]+):([0-9\.]+)\/([0-9]+) .*to.* ([A-Za-z]+):([0-9\.]+)\/([0-9]+).*/){ print "$1 $2 $3 $4 $5 $6 $7\n";}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment