From a1b54de57df05d3eef974af42b45485b76a0ba57 Mon Sep 17 00:00:00 2001 From: vSpaike <153102900+vSpaike@users.noreply.github.com> Date: Sat, 11 Jan 2025 23:37:28 +0100 Subject: [PATCH] app --- client/app.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/client/app.py b/client/app.py index 4914603..a9c199b 100644 --- a/client/app.py +++ b/client/app.py @@ -1,6 +1,21 @@ -from scapy.all import * +import socket +import random as r -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) +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 +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