1. 程式人生 > >python scapy 網絡卡發包

python scapy 網絡卡發包

 1 from scapy.all import *
 2 
 3 pkt = Ether(src='11:22:33:44:55:77', dst='11:22:33:44:55:66')/ARP(op="who-has", pdst='1.1.1.200')
 4 sendp(pkt, inter=1, count=5, iface="enp7s0f1")
 5 
 6 pkt = Ether(dst="ff:ff:ff:ff:ff:ff")/IP(src='1.1.1.200', dst='255.255.255.255')/UDP(sport=68, dport=67)
 7 sendp(pkt, inter=1, count=5, iface="
enp7s0f1") 8 9 data = 'data' 10 pkt = Ether(dst="22:33:44:55:66:77:88")/IP(src='1.1.1.200', dst='2.2.2.200')/UDP(sport=100, dport=200)/data 11 sendp(pkt, inter=1, count=5, iface="enp7s0f1")