@@ -157,7 +157,7 @@ def __init__(self, iface, bssid=None, essid=None):
157157 self .bssid = bssid
158158 self .essid = essid
159159 self .shift = Shifter (self .iface1 .iface , self .bssid , self .essid , V__ )
160- self . sig = signal (SIGINT , self .break_shifter )
160+ signal (SIGINT , self .break_shifter )
161161 self .aps ()
162162
163163 def aps (self ):
@@ -179,7 +179,6 @@ def break_shifter(self, sig, frame):
179179 del self .screen
180180
181181 __HEADERS = [color .BOLD + 'NO' , 'ESSID' , 'PWR' , 'ENC' , 'CIPHER' , 'AUTH' , 'CH' , 'BSSID' + color .END ]
182- self .sig = signal (SIGINT , lambda sig , frame : sys .exit ())
183182 tabulator__ = []
184183 ###
185184 __sig_LIST = []
@@ -199,6 +198,7 @@ def break_shifter(self, sig, frame):
199198 tabulator__ .append ([ap ['count' ], ap ['essid' ], ap ['pwr' ], ap ['auth' ], ap ['cipher' ], \
200199 ap ['psk' ], ap ['channel' ], ap ['bssid' ].upper ()])
201200 print "\n " + tabulate (tabulator__ , headers = __HEADERS )+ "\n "
201+ os .kill (os .getpid (), SIGINT )
202202
203203class Phazer :
204204
@@ -279,15 +279,15 @@ def h_crack(self, ap, p_to_h):
279279 pols = gen .get_pols ()
280280 self .call_PSK (pols , ap ['essid' ], ap ['auth' ])
281281
282- def d_h_crack (self , ap ):
282+ def d_h_crack (self , ap , timeout ):
283283 global WRITE__
284284
285285 y_h = False
286286
287287 while not y_h :
288288
289- pull .up ('Locating Clients from AP to generate handshake. Sleeping for 20 Seconds. ' )
290- self .sniper = Sniper (self .iface , ap ['bssid' ], ap ['essid' ], ap ['channel' ])
289+ pull .up ('Locating Clients from AP to generate handshake. Sleeping for %d Seconds. ' % timeout )
290+ self .sniper = Sniper (self .iface , ap ['bssid' ], ap ['essid' ], ap ['channel' ], timeout )
291291 self .sniper .cl_generator ()
292292 cls__ = self .sniper .clients ()
293293 pull .info ('Clients Detected. Number of Connected Users: %d' % len (cls__ ))
@@ -353,6 +353,7 @@ def main():
353353 parser .add_option ('-d' , '--dictionary' , dest = 'dictionary' , help = "Dictionary containing Passwords" )
354354 parser .add_option ('' , '--newhandshake' , dest = 'newhandshake' , default = False , action = "store_true" , help = "Discard previous handshake and capture new one. " )
355355 parser .add_option ('-n' , '--nowrite' , dest = "write" , default = True , action = "store_false" , help = "Do not Save the Captured Handshakes" )
356+ parser .add_option ('-t' , '--timeout' , dest = "timeout" , default = 20 , help = "Specify timeout for locating target clients. " )
356357 parser .add_option ('-v' , '--verbose' , dest = "verbose" , default = False , action = "store_true" , help = "Print hashes and verbose messages. " )
357358
358359 (options , args ) = parser .parse_args ()
@@ -410,6 +411,7 @@ def main():
410411
411412 phaser = Phazer (sniffer )
412413 target = phaser .get_input ()
414+ signal (SIGINT , lambda sig , frame : sys .exit ())
413415 pull .info ("You've choosed \" %s\" with encryption %s" % (target ['essid' ], target ['auth' ]))
414416 if not phaser .verify_h_crack (target ['bssid' ])[0 ] or NEW_HAND == True :
415417 if NEW_HAND :
@@ -418,7 +420,7 @@ def main():
418420 pull .delete ('Discarded Previous Handshake for "%s"' % (color .BOLD + target ['essid' ]+ color .END ))
419421 else :
420422 pull .info ('Attempting to Capture new handshake for "%s"' % (color .BOLD + target ['essid' ]+ color .END ))
421- phaser .d_h_crack (target )
423+ phaser .d_h_crack (target , int ( options . timeout ) )
422424 else :
423425 pull .use ("We've already got the handshake for this network. Attempting to Crack it." )
424426 phaser .h_crack (target , phaser .verify_h_crack (target ['bssid' ])[1 ])
0 commit comments