Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3inlc committed Jan 25, 2018
2 parents 22044b9 + 73b50d0 commit 6c59ca1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
6 changes: 5 additions & 1 deletion python/htpclient/hashcat_cracker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import string
import logging
import subprocess
from queue import Queue, Empty
Expand Down Expand Up @@ -106,8 +107,11 @@ def run_loop(self, proc, chunk, task):
f.close()
logging.info("Progress:" + str("{:6.2f}".format(relative_progress/100)) + "% Cracks: " + str(cracks_count) + " Accepted: " + str(ans['cracked']) + " Skips: " + str(ans['skipped']) + " Zaps: " + str(len(zaps)))
else:
# hacky solution to exclude warnings from hashcat
if str(line[0]) not in string.printable:
continue
line = line.decode()
if ":" in line and "Line-length exception" not in line:
if ":" in line:
cracks.append(line.strip())
else:
pass
Expand Down
28 changes: 10 additions & 18 deletions python/htpclient/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,19 @@ def run(self):

@staticmethod
def get_os():
if os.name == 'nt':
system = 1 # Windows
elif os.name == 'posix':
# Linux or OS X
if platform.system() == 'Darwin':
system = 2 # OS X
else:
system = 0 # Linux
else:
system = 0 # Linux
return system
osdict = {"Linux": 0,
"Windows": 1,
"Darwin": 2}
os = platform.system()
return osdict[os]

@staticmethod
def get_os_extension():
if os.name == 'nt':
ext = '.exe' # Windows
elif os.name == 'posix':
ext = '' # Linux or OS X
else:
ext = ''
return ext
extdict = {0: "", # Linux
1: ".exe", # Windows
2: ""} # Mac OS
os = Initialize.get_os()
return extdict[os]

def __login(self):
req = JsonRequest({'action': 'login', 'token': self.config.get_value('token'), 'clientSignature': self.get_version()})
Expand Down

0 comments on commit 6c59ca1

Please sign in to comment.