Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Tcpdump grab package script

Shulou Source: shulou.com Published: 2022-06-01 06:09:29 10月04日 Update

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

Tags: Scripts different files servers traffic services Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS Docker vpn MySQL