-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
74 lines (56 loc) · 1.4 KB
/
Copy pathtest.py
File metadata and controls
74 lines (56 loc) · 1.4 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# TAD courtesy #
# deckardfr aka Samy Duc #
# mail : samy.duc@gmail.com !
# fork me !
from probe import *
import re
class Test:
def __init__(self):
help = "help : python probe.py [-u=XXX : url] URL [-p=80 : port] [-s probe] [-a=time : attack with given time] [-ap : get time and attack] [? : help]"
self.probe = False
self.attack = False
self.timer = 0
self.url = ""
self.port = 80
self.safe = True
# ugly interface
for arg in sys.argv:
if(arg == sys.argv[0]):
pass
elif(arg[:3] == "-p=" and len(arg) >= 4):
# port
self.port = (int)(arg[3:])
elif(arg == "-s"):
# probing
self.probe = True
elif(arg == "-ap"):
self.probe = True
self.attack = True
elif(arg[:3] == "-a=" and len(arg) >= 4):
self.timer = (int)(arg[3:])
elif(arg[:3] == "-u=" and len(arg) >= 4):
self.url = arg[3:]
if(self.url[:len("http")] != "http"):
self.url = "http://" + self.url
# if no args and less than 3 /, we add a trailer /
if(self.url.count("3") < 3):
self.url += "/"
else:
print(help)
self.safe = False
break
def probing(self):
test = Probe(self.url, self.port, 0)
test.probe()
return test.slow
def attacking(self):
pass
def main(self):
if(self.safe):
if(self.probe):
self.timer = self.probing()
if(self.attack):
self.attacking()
if __name__ == "__main__" :
test = Test()
test.main()