scapy chgmt
This commit is contained in:
parent
e03b4ce473
commit
de14ac4b8b
1 changed files with 17 additions and 17 deletions
|
@ -1,26 +1,26 @@
|
|||
import socket
|
||||
import random as r
|
||||
from scapy.all import *
|
||||
import random as r
|
||||
|
||||
L=[
|
||||
"G3T / HTTP/1.1\r\nHøst: localhost\r\n\r\n",
|
||||
L = [
|
||||
"GET / HTTP/1.1\r\nHost: 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
|
||||
adresse = "127.0.0.1"
|
||||
port = 80
|
||||
|
||||
def changeCara(val,nb):
|
||||
for i in range(nb):
|
||||
nb_aleatoire=r.randint(0,len(val)-1)
|
||||
val[nb_aleatoire]=chr(r.randint(0,256))
|
||||
return val
|
||||
|
||||
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())
|
||||
requete = L[r.randint(0, 2)]
|
||||
paquet = IP(dst=adresse) / TCP(dport=port, sport=RandShort(), flags="S") / Raw(load=requete)
|
||||
send(paquet, verbose=False)
|
||||
|
||||
'''
|
||||
|
||||
GET / HTTP/1.1
|
||||
Host: example.com
|
||||
|
||||
'''
|
||||
|
||||
if __name__=="__main__":
|
||||
if __name__ == "__main__":
|
||||
attaque()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue