Created
November 4, 2018 15:49
-
-
Save barryirwin/612071df8d2c77d26097d36960e8efd6 to your computer and use it in GitHub Desktop.
Sort for top destination ports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# (c) Barry Irwin <bvi@moria.org> | |
# November 2018 | |
# takes in a tcpdump input as below. prints out a lsit of the destination ports sources. | |
# format expected (TCp/UDP only) | |
# 02:57:23.020317 IP A.B.C.D.SPORT > A.B.C.D.dport : Flags [S], seq 1995830557, win 14600, length 0 | |
cat - | awk '{print $5}' | awk -F. '{print $5}'| sed -e 's/://g' |sort | uniq -c | sort -rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment