Fix but when cracking with John, small fixes.
* --crack commands printed consistently (same color/format). * Only warn about PMKID -> hashcat once if any selected handshakes are PMKIDs
This commit is contained in:
@@ -61,11 +61,11 @@ class AttackWPA(Attack):
|
||||
self.success = False
|
||||
return False
|
||||
|
||||
Color.pl('\n{+} {C}Cracking WPA Handshake:{W} Using {C}aircrack-ng{W} via' +
|
||||
Color.pl('\n{+} {C}Cracking WPA Handshake:{W} Running {C}aircrack-ng{W} with' +
|
||||
' {C}%s{W} wordlist' % os.path.split(Configuration.wordlist)[-1])
|
||||
|
||||
# Crack it
|
||||
key = Aircrack.crack_handshake(handshake, Configuration.wordlist)
|
||||
key = Aircrack.crack_handshake(handshake, show_command=False)
|
||||
if key is None:
|
||||
Color.pl('{!} {R}Failed to crack handshake: {O}%s{R} did not contain password{W}' % Configuration.wordlist.split(os.sep)[-1])
|
||||
self.success = False
|
||||
|
||||
@@ -28,7 +28,7 @@ class Cowpatty(Dependency):
|
||||
'-s', handshake.essid
|
||||
]
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
process = Process(command)
|
||||
stdout, stderr = process.get_output()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class Hashcat(Dependency):
|
||||
command.append('--force')
|
||||
command.extend(additional_arg)
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
process = Process(command)
|
||||
stdout, stderr = process.get_output()
|
||||
if ':' not in stdout:
|
||||
@@ -150,7 +150,7 @@ class HcxPcapTool(Dependency):
|
||||
]
|
||||
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
|
||||
process = Process(command)
|
||||
stdout, stderr = process.get_output()
|
||||
@@ -173,7 +173,7 @@ class HcxPcapTool(Dependency):
|
||||
]
|
||||
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
|
||||
process = Process(command)
|
||||
stdout, stderr = process.get_output()
|
||||
|
||||
@@ -33,20 +33,20 @@ class John(Dependency):
|
||||
# Crack john file
|
||||
command = [
|
||||
'john',
|
||||
'--format', john_format,
|
||||
'--format=%s' % john_format,
|
||||
'--wordlist', Configuration.wordlist,
|
||||
john_file
|
||||
]
|
||||
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
process = Process(command)
|
||||
process.wait()
|
||||
|
||||
# Run again with --show to consistently get the password
|
||||
command = ['john', '--show', john_file]
|
||||
if show_command:
|
||||
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
||||
Color.pl('{+} {D}Running: {W}{P}%s{W}' % ' '.join(command))
|
||||
process = Process(command)
|
||||
stdout, stderr = process.get_output()
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ class CrackHelper:
|
||||
return
|
||||
|
||||
hs_to_crack = cls.get_user_selection(handshakes)
|
||||
any_pmkid = any([hs['type'] == 'PMKID' for hs in hs_to_crack])
|
||||
|
||||
# Tools for cracking & their dependencies.
|
||||
available_tools = {
|
||||
@@ -84,6 +85,8 @@ class CrackHelper:
|
||||
if tool_name not in available_tools:
|
||||
Color.pl('{!} {R}"%s"{O} tool not found, defaulting to {C}aircrack{W}' % tool_name)
|
||||
tool_name = 'aircrack'
|
||||
elif any_pmkid and tool_name != 'hashcat':
|
||||
Color.pl('{!} {O}Note: PMKID hashes will be cracked using {C}hashcat{W}')
|
||||
|
||||
try:
|
||||
for hs in hs_to_crack:
|
||||
@@ -251,9 +254,6 @@ class CrackHelper:
|
||||
|
||||
@classmethod
|
||||
def crack_pmkid(cls, hs, tool_name):
|
||||
if tool_name != 'hashcat':
|
||||
Color.pl('{!} {O}Note: PMKIDs can only be cracked using hashcat{W}')
|
||||
|
||||
key = Hashcat.crack_pmkid(hs['filename'], verbose=True)
|
||||
|
||||
if key is not None:
|
||||
|
||||
Reference in New Issue
Block a user