Skip to content

Instantly share code, notes, and snippets.

@TheWover
Forked from seajaysec/mymykat.sh
Created September 20, 2019 14:35
Show Gist options
  • Select an option

  • Save TheWover/58345b4fba54af2e97a8dd80258460ba to your computer and use it in GitHub Desktop.

Select an option

Save TheWover/58345b4fba54af2e97a8dd80258460ba to your computer and use it in GitHub Desktop.
super rough plaintext secret parser for pypykatz dumps
#!/bin/bash
# prereqs: pypykatz, all the dumps in current working dir
ext='.dmp'
for i in *$ext; do
txtfile=${i::-3}txt
secrets=${i::-3}secrets
pypykatz lsa minidump $i -o $txtfile;
grep 'password' $txtfile -B 2 | grep -v 'None' | grep 'password' -B 1 | sed -e "s#--##g" | sed '/^$/d' | sed '$!N;s/\n/ /' | sed 's/username //g' | sed 's/password /::/g' | tr -d '[:blank:]' | sort -u > $secrets
done
# deletes empty secrets files
find ./*.secrets -type f -empty -delete
# shows output at end, with filename
grep . *.secrets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment