1
+ import os
2
+ import time
3
+ def fyddos ():
4
+ IGNORE_IP_LIST = "/usr/local/ddos/ignore.ip.list"
5
+ PGOPDIR = "/usr/local/ddos/ddos.conf"
6
+ PROG = "/usr/local/ddos/ddos.sh"
7
+ if os .path .exists (PROG ):
8
+ print '[+]The execution file exists to continue the program.'
9
+ else :
10
+ print '[-]The execution file does not exist, the closing procedure.'
11
+ exit ()
12
+ if os .path .exists (PGOPDIR ):
13
+ print '[+]The configuration file exists to start the execution of the program.'
14
+ else :
15
+ print '[-]There is no exit procedure for the configuration file.'
16
+ exit ()
17
+ if os .path .exists (IGNORE_IP_LIST ):
18
+ print '[+]The IP white list file exists to continue the program.'
19
+ else :
20
+ print '[-]IP white list file does not exist, end the program.'
21
+ exit ()
22
+
23
+ time .sleep (1 )
24
+ print '[+]Start configuring the IP white list.'
25
+ IPlist = raw_input ('Please enter your white list IP, and if not, enter q to enter the next step:' )
26
+ if IPlist == 'q' :
27
+ try :
28
+ import dy1
29
+ except Exception , g :
30
+ print '[-]Catch the error cause:' ,g
31
+ print '[+]It has been added to it.'
32
+ time .sleep (3 )
33
+ try :
34
+ import dy2
35
+ except Exception , r :
36
+ print '[-]Catch the error cause:' ,r
37
+ time .sleep (3 )
38
+ try :
39
+ import dy3
40
+ except Exception , p :
41
+ print '[-]Catch the error cause:' ,p
42
+ print '[+]Query information,Please input: netstat -ntu | awk ' '{print $5}' ' | cut -d: -f1 | sort | uniq-c | sort -n command view.'
43
+ isd = os .system ('ddos' )
44
+ sda = os .system ('service iptables status' )
45
+ print isd
46
+ print sda
47
+
48
+ else :
49
+ list = open ('/usr/local/ddos/ignore.ip.list' ,'w' )
50
+ list .write (IPlist + "\n " )
51
+ print '[+]It has been added to it:' ,IPlist
52
+ time .sleep (3 )
53
+ try :
54
+ import dy1
55
+ except Exception , w :
56
+ print ('[-]Catch the error cause:' ,w )
57
+ time .sleep (3 )
58
+ try :
59
+ import dy2
60
+ except Exception , d :
61
+ print '[-]Catch the error cause:' ,d
62
+ time .sleep (3 )
63
+ try :
64
+ import dy3
65
+ except Exception ,z :
66
+ print '[-]Catch the error cause:' ,z
67
+ print '[+]Query information,Please input: netstat -ntu | awk ' '{print $5}' ' | cut -d: -f1 | sort | uniq-c | sort -n command view.'
68
+ isds = os .system ('ddos' )
69
+ sdas = os .system ('service iptables status' )
70
+ print isds
71
+ print sdas
72
+
73
+ fyddos ()
0 commit comments