-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathextended-xss-search.py
153 lines (108 loc) · 3.9 KB
/
extended-xss-search.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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Author: Damian Schwyrz
import sys
if sys.version_info < (3, 0):
sys.stdout.write("Sorry, requires Python 3.x\n")
sys.exit(1)
import ssl
import queue
from inc.Config import *
from inc.preparation.PrepareBaseRequest import *
from inc.preparation.PrepareAttackRequest import *
from inc.worker.WorkOnBaseRequest import *
from inc.worker.WorkOnTestRequest import *
ssl._create_default_https_context = ssl._create_unverified_context
def main():
config = Config()
config.show_summary()
base_tests = PrepareBaseRequest(config).tests
print("{} Executing {} base requests...".format(
Color.green("[ i ]"),
len(base_tests)
))
queue_base_requests = queue.Queue()
threads = []
host_params = {}
for workerIterator in range(0, config.max_threads):
print("{} Worker {} started...".format(
Color.green("[ i ]"),
workerIterator
))
worker = WorkOnBaseRequest(config, queue_base_requests, workerIterator, host_params)
worker.setDaemon(True)
worker.start()
threads.append(worker)
for data in base_tests:
queue_base_requests.put(data)
for item in threads:
item.join()
print("{} Finished with {} base requests...".format(
Color.green("[ i ]"),
len(base_tests)
))
if config.type_only_base_request:
attack_base_tests = PrepareAttackRequest(config, host_params).tests
print("{} Starting with {} payloaded base requests...".format(
Color.green("[ i ]"),
len(attack_base_tests)
))
queue_base_p_requests = queue.Queue()
threads = []
for workerIterator in range(0, config.max_threads):
print("{} Worker {} started...".format(
Color.green("[ i ]"),
workerIterator
))
worker = WorkOnTestRequest(config, queue_base_p_requests, workerIterator)
worker.setDaemon(True)
worker.start()
threads.append(worker)
for data in attack_base_tests:
queue_base_p_requests.put(data)
for item in threads:
item.join()
if config.type_only_base_request:
print("{} Stopping because only base requests are allowed...".format(
Color.red("[ i ]")
))
sys.exit()
print("{} Preparing finale attack requests...".format(
Color.green("[ i ]")
))
attack_requests = PrepareAttackRequest(config, host_params).tests
print("{} Executing {} attacks/tests... could take a while!". format(
Color.red("[ i ]"),
len(attack_requests)
))
queue_test_requests = queue.Queue()
threads = []
for workerIterator in range(0, config.max_threads):
print("{} Worker {} started...".format(
Color.green("[ i ]"),
workerIterator
))
worker = WorkOnTestRequest(config, queue_test_requests, workerIterator)
worker.setDaemon(True)
worker.start()
threads.append(worker)
for data in attack_requests:
queue_test_requests.put(data)
for item in threads:
item.join()
if __name__ == "__main__":
main()