* Still not "print" option for --crack. * Checks hashcat for devices, uses --force if no devices are found. * Interrupting --crack stops entire process, not just a single crack attempt * Changed wordlist location, hopefully completes #102.
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from .dependency import Dependency
|
|
from ..config import Configuration
|
|
from ..util.color import Color
|
|
from ..util.process import Process
|
|
from ..tools.hashcat import HcxPcapTool
|
|
|
|
import os
|
|
import re
|
|
|
|
|
|
class Cowpatty(Dependency):
|
|
''' Wrapper for Cowpatty program. '''
|
|
dependency_required = False
|
|
dependency_name = 'cowpatty'
|
|
dependency_url = 'https://tools.kali.org/wireless-attacks/cowpatty'
|
|
|
|
|
|
@staticmethod
|
|
def crack_handshake(handshake, show_command=False):
|
|
# Crack john file
|
|
command = [
|
|
'cowpatty',
|
|
'-f', Configuration.wordlist,
|
|
'-r', handshake.capfile,
|
|
'-s', handshake.essid
|
|
]
|
|
if show_command:
|
|
Color.pl('{+} {D}{C}Running %s{W}' % ' '.join(command))
|
|
process = Process(command)
|
|
stdout, stderr = process.get_output()
|
|
|
|
key = None
|
|
for line in stdout.split('\n'):
|
|
if 'The PSK is "' in line:
|
|
key = line.split('"', 1)[1][:-2]
|
|
break
|
|
|
|
return key
|