diff --git a/client/Dockerfile b/client/Dockerfile index ffe8373..76ce601 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,5 +1,9 @@ -FROM python:alphine +FROM python:alpine WORKDIR /app COPY . . +RUN apk add \ + gcc \ + libpcap-dev \ + && pip install -r requirements.txt CMD ["python3","app.py"] diff --git a/client/app.py b/client/app.py index a277ddc..4914603 100644 --- a/client/app.py +++ b/client/app.py @@ -1,5 +1,6 @@ from scapy.all import * for i in range(512,2048): - pkt = IP(dst='locahost') / IP(src='192.168.1.69')/ TCP(dport=80,sport=i,flags='S') / ICMP() - sr(pkt) + 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/requirements.txt b/client/requirements.txt new file mode 100644 index 0000000..ffc5bb6 --- /dev/null +++ b/client/requirements.txt @@ -0,0 +1 @@ +scapy==2.6.1 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..94e559e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +services: + web: + build: + context: server + dockerfile: Dockerfile + container_name: web + ports: + - 80:80 + networks: + - network + + client: + build: + context: client + dockerfile: Dockerfile + container_name: client + networks: + - network + +networks: + network: + driver: bridge + diff --git a/server/docker-compose.yml b/server/docker-compose.yml deleted file mode 100644 index 8324e76..0000000 --- a/server/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - web: - build: - context: . - dockerfile: Dockerfile - container_name: web - ports: - - 80:80 -