Created
October 24, 2017 10:16
-
-
Save dtmsecurity/54fd17616df0ec373e828b2152003b81 to your computer and use it in GitHub Desktop.
Needed a dirty way to convert mimikatz output for mscache to hashcat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
# .\hashcat64.exe -m 2100 .\inhash.txt .\rockyou.txt | |
if len(sys.argv[1]) > 0: | |
fh = open(str(sys.argv[1]),"r") | |
lines = fh.readlines() | |
fh.close() | |
outputLine = "$DCC2$10240#" | |
for line in lines: | |
m = re.search(r'RID.+\((.+)\)$',line) | |
if m: | |
rid = m.group(1) | |
m = re.search(r'User : .+\\(.+)$',line) | |
if m: | |
user = m.group(1) | |
outputLine += user.strip() + "#" | |
m = re.search(r'MsCacheV2 : (.+)$',line) | |
if m: | |
hashstring = m.group(1) | |
outputLine += hashstring.strip() | |
print(outputLine) | |
outputLine = "$DCC2$10240#" | |
# .\hashcat64.exe -m 1100 .\inhash.txt .\rockyou.txt | |
if len(sys.argv[1]) > 0: | |
fh = open(str(sys.argv[1]),"r") | |
lines = fh.readlines() | |
fh.close() | |
outputLine = "" | |
user = "" | |
for line in lines: | |
m = re.search(r'RID.+\((.+)\)$',line) | |
if m: | |
rid = m.group(1) | |
m = re.search(r'User : .+\\(.+)$',line) | |
if m: | |
user = m.group(1) | |
m = re.search(r'MsCacheV1 : (.+)$',line) | |
if m: | |
hashstring = m.group(1) | |
outputLine += hashstring.strip() + ":" + user.strip() | |
print(outputLine) | |
outputLine = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment