master-thesis/bin/sniff-host.sh

19 lines
246 B
Bash
Raw Normal View History

2019-03-21 19:36:01 +00:00
#!/bin/sh
2019-03-21 19:37:25 +00:00
if [ $# -ne 2 ]; then
echo "$0 host name"
exit 1
fi
2019-03-21 19:36:01 +00:00
set -x
2019-03-30 16:07:58 +00:00
cd ~/master-thesis/pcap
2019-03-21 19:37:25 +00:00
2019-03-21 19:36:01 +00:00
host=$1
name=$2
now=$(date +%F-%H%M)
2019-03-21 19:39:42 +00:00
filename=${name}-${now}-${host}.pcap
2019-03-21 19:36:01 +00:00
intf=${host}-eth0
mx "$host" tcpdump -ni ${intf} -w "${filename}"