Skip to content

Instantly share code, notes, and snippets.

@jpylypiw
Last active July 17, 2020 17:30
Show Gist options
  • Save jpylypiw/468b15edf95af5cbdc45234c6d7d998a to your computer and use it in GitHub Desktop.
Save jpylypiw/468b15edf95af5cbdc45234c6d7d998a to your computer and use it in GitHub Desktop.
Analyze most rejected ip addresses for easywall
cat /var/log/syslog | grep "PROTO=TCP" | grep -o -P "SRC.{0,20}" | grep -o -P "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b" | sort -n | uniq -c | sort -n
cat /var/log/syslog | grep "218.63.72.113" | grep -o -P "DPT.{0,6}" | sort -n | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment