aboutsummaryrefslogtreecommitdiff
path: root/analyse/script.sh
diff options
context:
space:
mode:
Diffstat (limited to 'analyse/script.sh')
-rwxr-xr-xanalyse/script.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/analyse/script.sh b/analyse/script.sh
index 3aa3503..aed04e4 100755
--- a/analyse/script.sh
+++ b/analyse/script.sh
@@ -25,14 +25,14 @@ read Interface
while :
do
- sudo tcpdump -i $Interface -c1 -nn tcp -w capturetcp.pcap
- sudo tcpdump -nn -r capturetcp.pcap > grostastcp
+ sudo tcpdump -i $Interface -c1 -nn tcp -w /tmp/capturetcp.pcap
+ sudo tcpdump -nn -r /tmp/capturetcp.pcap > /tmp/grostastcp
echo -e "Voici un paquet TCP\n"
- cat grostastcp | cut -d" " -f1 >> /tmp/heuretcp.txt
- cat grostastcp | cut -d" " -f2 >> /tmp/protocoletcp.txt
- cat grostastcp | cut -d" " -f3 >> /tmp/sourcetcp.txt
- cat grostastcp | cut -d" " -f5 >> /tmp/destinationtcp.txt
- cat grostastcp | cut -d" " -f15 >> /tmp/tailletcp.txt
+ cat /tmp/grostastcp | cut -d" " -f1 >> /tmp/heuretcp.txt
+ cat /tmp/grostastcp | cut -d" " -f2 >> /tmp/protocoletcp.txt
+ cat /tmp/grostastcp | cut -d" " -f3 >> /tmp/sourcetcp.txt
+ cat /tmp/grostastcp | cut -d" " -f5 >> /tmp/destinationtcp.txt
+ cat /tmp/grostastcp | cut -d" " -f15 >> /tmp/tailletcp.txt
tail -n1 /tmp/heuretcp.txt
tail -n1 /tmp/protocoletcp.txt
tcpvar=$(tail -n1 /tmp/sourcetcp.txt)
@@ -49,14 +49,14 @@ do
# Attention ici c'est UDP
- sudo tcpdump -i $Interface -c1 -nn udp -w captureudp.pcap
- sudo tcpdump -nn -r captureudp.pcap > grostasudp
+ sudo tcpdump -i $Interface -c1 -nn udp -w /tmp/captureudp.pcap
+ sudo tcpdump -nn -r /tmp/captureudp.pcap > /tmp/grostasudp
echo -e "Voici un paquet UDP\n"
- cat grostasudp | cut -d" " -f1 >> /tmp/heureudp.txt
- cat grostasudp | cut -d" " -f2 >> /tmp/protocoleudp.txt
- cat grostasudp | cut -d" " -f3 >> /tmp/sourceudp.txt
- cat grostasudp | cut -d" " -f5 >> /tmp/destinationudp.txt
- cat grostasudp | cut -d" " -f8 >> /tmp/tailleudp.txt
+ cat /tmp/grostasudp | cut -d" " -f1 >> /tmp/heureudp.txt
+ cat /tmp/grostasudp | cut -d" " -f2 >> /tmp/protocoleudp.txt
+ cat /tmp/grostasudp | cut -d" " -f3 >> /tmp/sourceudp.txt
+ cat /tmp/grostasudp | cut -d" " -f5 >> /tmp/destinationudp.txt
+ cat /tmp/grostasudp | cut -d" " -f8 >> /tmp/tailleudp.txt
tail -n1 /tmp/heureudp.txt
tail -n1 /tmp/protocoleudp.txt
udpvar=$(tail -n1 /tmp/sourceudp.txt)
@@ -71,5 +71,5 @@ do
tail -n1 /tmp/portdstudp.txt
tail -n1 /tmp/tailleudp.txt
- sudo python insertpaq.py
+ sudo python /root/ATS/analyse/insertpaq.py
done