Tcpdump grab package script
Due to the recent abnormal server traffic, a simple shell packet capture script is written, which is saved in different files every 10 minutes. The script is as follows:
#! / bin/sh
# This is tcpdump script
One=1
Two=2
While (($one! = $two))
Do
Sleep 1
TIME= `date +% F "-"% HRV% M:% S`
Tcpdump-I eth0-s 0-w tcpdum.$TIME &
Sleep 600
Ps-ef | grep tcpdump | grep-v grep | awk'{print $2}'| xargs kill-9
Done