Skip to content

Instantly share code, notes, and snippets.

@barryirwin
Created November 4, 2018 15:38
Show Gist options
  • Save barryirwin/68b33c04f5028cc650c8e6ef85df33d4 to your computer and use it in GitHub Desktop.
Save barryirwin/68b33c04f5028cc650c8e6ef85df33d4 to your computer and use it in GitHub Desktop.
Top Sources form a pcap file
#!/bin/sh
# (c) Barry Irwin <bvi@moria.org>
# November 2018
# takes in a tcpdump input as below. prints out a lsit of the top sources.
# format expected
# 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 $3}' | awk -F. '{print $1"."$2"."$3"."$4}'| sort | uniq -c | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment