Script to quickly convert multiple .pcap captures to PMKID and HCCAPX, ready for Hashcat cracking

This is my very first bash script so go easy on me, but it seems to work fine.

convertwpa will loop through all your .pcap files and convert them to the appropriate format ready for Hashcat cracking. It separates them into two folders pmkid (Association captures) and hccapx (deauth handshake captures).

Let me know if something isn’t working correctly, or happy to improve it somehow.

 

#!/bin/bash

# Author: CyrisXD
# Twitter: @sudo_overflow
# Github: https://gist.github.com/CyrisXD/a73bd3425c8353214740578ba5da8b9d

# This script relies on - https://github.com/ZerBea/hcxtools
# Make sure hcxpcaptool is installed and available in terminal

# Save the script as convertwpa and make it executable
# chmod +x convertwpa

# Add convertwpa to your ~/.bash_profile
# sudo nano ~/.bash_profile

# Add the below line (without # hash)
# export PATH="path/to/convertwpa/folder"

# How to use
# Navigate to the folder with all your handshakes
# Run command: convertwpa
# Two folders (pmkid/hccapx) will be created with your converted handshakes

mkdir pmkid
mkdir hccapx
FILES=./*
EXT=".pcap"
for f in $FILES
do
if [[ "$f" == *"$EXT"* ]];then
  echo "Processing $f file..."
  FileName=$f
  # take action on each file. $f store current file name
  hcxpcaptool -z ./pmkid/${FileName/.pcap/}.pmkid ./$f
  hcxpcaptool -o ./hccapx/${FileName/.pcap/}.hccapx ./$f
fi
done

This looks awesome I will test it out this afternoon

1 Like