def exposed_crack_list(self, job_id, hashes, hash_type): ''' Cracks a list of hashes ''' logging.info("Method called: exposed_crack_list") self.mutex.acquire() ascii_hashes = [] for hsh in hashes: ascii_hashes.append(hsh.encode('ascii', 'ignore')) self.is_busy = True self.current_job_id = job_id self.mutex.release() tables = self.rainbow_tables[hash_type].encode('ascii', 'ignore') logging.info( "Recieved new assignment, now targeting %d hashes with %d thread(s)" % (len(hashes), self.threads)) results = RainbowCrack.hash_list( len(ascii_hashes), ascii_hashes, tables, maxThreads=self.threads, debug=self.debug) self.mutex.acquire() self.is_busy = False self.mutex.release() return results
def exposed_crack_list(self, job_id, hashes, hash_type, threads=0): ''' Cracks a list of hashes, note the control server sets the number of threads by default this should equal the number of detected CPU cores ''' if threads <= 0: threads = 1 self.mutex.acquire() self.is_busy = True self.current_job_id = job_id self.mutex.release() tables = self.rainbow_tables[hash_type] logging.info( "Recieved new assignment, now targeting %s hashes" % len(hashes)) results = RainbowCrack.hash_list( len(hashes), hashes, tables, maxThreads=threads) self.mutex.acquire() self.is_busy = False self.mutex.release() return results
def exposed_crack_list(self, job_id, hashes, hash_type): ''' Cracks a list of hashes ''' logging.info("Method called: exposed_crack_list") self.mutex.acquire() ascii_hashes = [] for hsh in hashes: ascii_hashes.append(hsh.encode('ascii', 'ignore')) self.is_busy = True self.current_job_id = job_id self.mutex.release() tables = self.rainbow_tables[hash_type].encode('ascii', 'ignore') logging.info( "Recieved new assignment, now targeting %d hashes with %d thread(s)" % (len(hashes), self.threads)) results = RainbowCrack.hash_list(len(ascii_hashes), ascii_hashes, tables, maxThreads=self.threads, debug=self.debug) self.mutex.acquire() self.is_busy = False self.mutex.release() return results