25
25
# You should have received a copy of the GNU General Public License
26
26
# along with this program. If not, see <http://www.gnu.org/licenses/>.
27
27
28
- import re
29
- import time
30
- import base64
31
- import ftplib
32
- import socket
33
- import urllib2
28
+ import re
29
+ import time
30
+ import base64
31
+ import ftplib
32
+ import socket
33
+ import urllib2
34
34
35
- from PyQt5 import QtCore
35
+ from PyQt5 import QtCore
36
36
37
37
38
38
class HTTP_Authentication (object ):
@@ -110,11 +110,11 @@ def login_ftp(self,username,password):
110
110
111
111
112
112
class Bruteforce_Attack (QtCore .QThread ):
113
- successful_login_signal = QtCore .pyqtSignal ('QString' , 'QString' )
114
- We_Got_Error_signal = QtCore .pyqtSignal ()
115
- Next_Try_signal = QtCore .pyqtSignal ()
116
- Finished_bruteforce_signal = QtCore .pyqtSignal ()
117
-
113
+ successful_login_signal = QtCore .pyqtSignal ('QString' , 'QString' )
114
+ We_Got_Error_signal = QtCore .pyqtSignal ()
115
+ Next_Try_signal = QtCore .pyqtSignal ()
116
+ Finished_bruteforce_signal = QtCore .pyqtSignal ()
117
+
118
118
def __init__ (self ):
119
119
QtCore .QThread .__init__ (self )
120
120
self ._timer = 0
@@ -201,49 +201,49 @@ def _run_bruteforce(self):
201
201
self .next_try_details = (self ._calculate_percentage (),username ,password )
202
202
try :
203
203
self .bruteforce_http_method .login_http (username ,password ) # TELNET HERE
204
- self .successful_login_signal .emit (username , password )
204
+ self .successful_login_signal .emit (username , password )
205
205
except Exception ,message :
206
206
if ("connection timed out" in str (message ).lower ()):
207
207
self ._error_message = "Unable to connect to the remote address, Connection timed out"
208
- self .We_Got_Error_signal .emit ()
208
+ self .We_Got_Error_signal .emit ()
209
209
return
210
210
if ("no route to host" in str (message ).lower ()):
211
211
self ._error_message = "Unable to connect to the remote address, Connection timed out"
212
- self .We_Got_Error_signal .emit ()
212
+ self .We_Got_Error_signal .emit ()
213
213
return
214
214
215
215
if ("error 404" in str (message ).lower ()):
216
216
self ._error_message = "The remote target returned an HTTP 404 error code, meaning that the requested page does not exist"
217
- self .We_Got_Error_signal .emit ()
217
+ self .We_Got_Error_signal .emit ()
218
218
return
219
219
220
220
if ("name or service not known" in str (message ).lower ()):
221
221
self ._error_message = "Unable to connect to the remote address, Connection timed out"
222
- self .We_Got_Error_signal .emit ()
222
+ self .We_Got_Error_signal .emit ()
223
223
return
224
224
225
225
if ("unreachable" in str (message ).lower ()):
226
226
self ._error_message = "Unable to connect to the remote address, Connection timed out"
227
- self .We_Got_Error_signal .emit ()
227
+ self .We_Got_Error_signal .emit ()
228
228
return
229
229
230
230
if ("connection refused" in str (message ).lower ()):
231
231
self ._error_message = "The connection was refused by the remote service, Please try again"
232
- self .We_Got_Error_signal .emit ()
232
+ self .We_Got_Error_signal .emit ()
233
233
return
234
234
235
235
if ("no address associated" in str (message ).lower ()):
236
236
self ._error_message = "No address is associated with the target hostname"
237
- self .We_Got_Error_signal .emit ()
237
+ self .We_Got_Error_signal .emit ()
238
238
return
239
239
240
240
if (self .control == False ):
241
241
return
242
242
243
- self .Next_Try_signal .emit ()
243
+ self .Next_Try_signal .emit ()
244
244
time .sleep (self ._timer )
245
245
246
- self .Finished_bruteforce_signal .emit ()
246
+ self .Finished_bruteforce_signal .emit ()
247
247
self .control = False
248
248
249
249
@@ -257,44 +257,44 @@ def _run_bruteforce(self):
257
257
self .next_try_details = (self ._calculate_percentage (),username ,password )
258
258
try :
259
259
if (self .bruteforce_http_method .login_telnet (username ,password )): # FTP HERE
260
- self .successful_login_signal .emit (username , password )
260
+ self .successful_login_signal .emit (username , password )
261
261
except Exception ,message :
262
262
if ("name or service not known" in str (message ).lower ()):
263
263
self ._error_message = "Unable to resolve target hostname"
264
- self .We_Got_Error_signal .emit ()
264
+ self .We_Got_Error_signal .emit ()
265
265
return
266
266
267
267
if ("connection timed out" in str (message ).lower ()):
268
268
self ._error_message = "Unable to connect to the remote address, Connection timed out"
269
- self .We_Got_Error_signal .emit ()
269
+ self .We_Got_Error_signal .emit ()
270
270
return
271
271
if ("no route to host" in str (message ).lower ()):
272
272
self ._error_message = "Unable to connect to the remote address, Connection timed out"
273
- self .We_Got_Error_signal .emit ()
273
+ self .We_Got_Error_signal .emit ()
274
274
return
275
275
276
276
if ("unreachable" in str (message ).lower ()):
277
277
self ._error_message = "Unable to connect to the remote address, Connection timed out"
278
- self .We_Got_Error_signal .emit ()
278
+ self .We_Got_Error_signal .emit ()
279
279
return
280
280
281
281
if ("connection refused" in str (message ).lower ()):
282
282
self ._error_message = "The connection was refused by the remote service, Please try again"
283
- self .We_Got_Error_signal .emit ()
283
+ self .We_Got_Error_signal .emit ()
284
284
return
285
285
286
286
if ("no address associated" in str (message ).lower ()):
287
287
self ._error_message = "No address is associated with the target hostname"
288
- self .We_Got_Error_signal .emit ()
288
+ self .We_Got_Error_signal .emit ()
289
289
return
290
290
291
291
if (self .control == False ):
292
292
return
293
293
294
- self .Next_Try_signal .emit ()
294
+ self .Next_Try_signal .emit ()
295
295
time .sleep (self ._timer )
296
296
297
- self .Finished_bruteforce_signal .emit ()
297
+ self .Finished_bruteforce_signal .emit ()
298
298
self .control = False
299
299
300
300
@@ -308,45 +308,45 @@ def _run_bruteforce(self):
308
308
self .next_try_details = (self ._calculate_percentage (),username ,password )
309
309
try :
310
310
self .bruteforce_http_method .login_ftp (username ,password ) # FTP HERE
311
- self .successful_login_signal .emit (username , password )
311
+ self .successful_login_signal .emit (username , password )
312
312
except Exception ,message :
313
313
if ("name or service not known" in str (message ).lower ()):
314
314
self ._error_message = "Unable to resolve target hostname"
315
- self .We_Got_Error_signal .emit ()
315
+ self .We_Got_Error_signal .emit ()
316
316
return
317
317
318
318
if ("connection timed out" in str (message ).lower ()):
319
319
self ._error_message = "Unable to connect to the remote address, Connection timed out"
320
- self .We_Got_Error_signal .emit ()
320
+ self .We_Got_Error_signal .emit ()
321
321
return
322
322
if ("no route to host" in str (message ).lower ()):
323
323
self ._error_message = "Unable to connect to the remote address, Connection timed out"
324
- self .We_Got_Error_signal .emit ()
324
+ self .We_Got_Error_signal .emit ()
325
325
return
326
326
327
327
if ("unreachable" in str (message ).lower ()):
328
328
self ._error_message = "Unable to connect to the remote address, Connection timed out"
329
- self .We_Got_Error_signal .emit ()
329
+ self .We_Got_Error_signal .emit ()
330
330
return
331
331
332
332
if ("connection refused" in str (message ).lower ()):
333
333
self ._error_message = "The connection was refused by the remote service, Please try again"
334
- self .We_Got_Error_signal .emit ()
334
+ self .We_Got_Error_signal .emit ()
335
335
return
336
336
337
337
338
338
if ("no address associated" in str (message ).lower ()):
339
339
self ._error_message = "No address is associated with the target hostname"
340
- self .We_Got_Error_signal .emit ()
340
+ self .We_Got_Error_signal .emit ()
341
341
return
342
342
343
343
if (self .control == False ):
344
344
return
345
345
346
- self .Next_Try_signal .emit ()
346
+ self .Next_Try_signal .emit ()
347
347
time .sleep (self ._timer )
348
348
349
- self .Finished_bruteforce_signal .emit ()
349
+ self .Finished_bruteforce_signal .emit ()
350
350
self .control = False
351
351
352
352
0 commit comments