Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix PRs - Two bugs fixed #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wifite/model/handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def aircrack_handshakes(self):
command = 'echo "" | aircrack-ng -a 2 -w - -b %s "%s"' % (self.bssid, self.capfile)
(stdout, stderr) = Process.call(command)

if 'passphrase not in dictionary' in stdout.lower():
if 'passphrase not in dictionary' in stdout.lower() or 'key not found' in stdout.lower():
return [(self.bssid, None)]
else:
return []
Expand Down
25 changes: 14 additions & 11 deletions wifite/util/crack.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class CrackHelper:
'PMKID': 'PMKID Hash'
}

# Tools for cracking & their dependencies.
possible_tools = [
('aircrack', [Aircrack]),
('hashcat', [Hashcat, HcxPcapTool]),
('john', [John, HcxPcapTool]),
('cowpatty', [Cowpatty])
]

@classmethod
def run(cls):
Configuration.initialize(False)
Expand All @@ -52,23 +60,18 @@ def run(cls):
hs_to_crack = cls.get_user_selection(handshakes)
all_pmkid = all([hs['type'] == 'PMKID' for hs in hs_to_crack])

# Tools for cracking & their dependencies.
available_tools = {
'aircrack': [Aircrack],
'hashcat': [Hashcat, HcxPcapTool],
'john': [John, HcxPcapTool],
'cowpatty': [Cowpatty]
}
# Identify missing tools
missing_tools = []
for tool, dependencies in available_tools.items():
available_tools = []
for tool, dependencies in cls.possible_tools:
missing = [
dep for dep in dependencies
if not Process.exists(dep.dependency_name)
]
if len(missing) > 0:
available_tools.pop(tool)
missing_tools.append( (tool, missing) )
missing_tools.append((tool, missing))
else:
available_tools.append(tool)

if len(missing_tools) > 0:
Color.pl('\n{!} {O}Unavailable tools (install to enable):{W}')
Expand All @@ -81,7 +84,7 @@ def run(cls):
tool_name = 'hashcat'
else:
Color.p('\n{+} Enter the {C}cracking tool{W} to use ({C}%s{W}): {G}' % (
'{W}, {C}'.join(available_tools.keys())))
'{W}, {C}'.join(available_tools)))
tool_name = raw_input()
if tool_name not in available_tools:
Color.pl('{!} {R}"%s"{O} tool not found, defaulting to {C}aircrack{W}' % tool_name)
Expand Down