master-thesis/bin/sniff-host.sh

19 lines
246 B
Bash
Raw Normal View History

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