aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuneji <61687883+Luneji@users.noreply.github.com>2020-05-19 15:16:54 +0200
committerGitHub <noreply@github.com>2020-05-19 15:16:54 +0200
commitb245e50ae50fbd955063b94b6e3a06e3f4ad2b17 (patch)
treed15a4611c051f057a51c9e1a1386d2abc470e57d
parent0e2c8f18bad8c5f7db465fc053f12f9d2241e07f (diff)
Update 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