aboutsummaryrefslogtreecommitdiff
path: root/analyse/script.sh
blob: 0eb3150c057becdb3f89c0a1a8574c8a57ee2024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

while :
do

	sudo tcpdump -i eth1 -nn -c1 -A src $1 -w capture.pcap
	sudo tcpdump -r capture.pcap > grostas
	cat grostas | cut -d" " -f1 >> /tmp/heure.txt
	cat grostas | cut -d" " -f2 >> /tmp/protocole.txt
	cat grostas | cut -d" " -f3 >> /tmp/source.txt
	cat grostas | cut -d" " -f5 >> /tmp/destination.txt
	tail -n1 /tmp/heure.txt
	tail -n1 /tmp/protocole.txt
	tail -n1 /tmp/source.txt
	tail -n1 /tmp/destination.txt
done