Skip to content

pentagridsec/convertASPdotNETIdentityHash2hashcatFormat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Short introduction

The script in this directory converts ASP.NET Core Identity password hashes to the Hashcat format and supports hash versions 1, 2, and 3.

Our blog post gives more background regarding this project.

Usage

Start the program with the -h parameter to show help information.

% ./convertASPdotNETIdentityHash2hashcatFormat.py -h
This program converts ASP.NET Core Identity hashes to hashcat format.
usage: convertASPdotNETIdentityHash2hashcatFormat.py [-h] [-v] [-t] [-o output_file] input_file

options:
  -h Output help information.
  -v Verbose output with DEBUG log level.
  -i Display information on ASP.NET Core Identity hashes.
  -t Run predefined ASP.NET Core Identity hash test cases.
  -u Prepend the annotation from the input to the formated hash. Hashcat must be then used with option --username.
  -o Path to output directory to which the hashes (hashcat format) are written to files split by PRF.

input_file: Path to input file that includes the ASP.NET Core Identity hashes.
  * The ASP.NET Core Identity hashes must be in (normal) base64 encoded format.
  * The ASP.NET Core Identity hashes can be in-line appended with an annotation (e.g. username, email) using ":".
  * Empty lines will be filtered.

Examples:
# Get information about ASP.NET Core Identity structure
python3 convertASPdotNETIdentityHash2hashcatFormat.py -i

# Parse ASP.NET hashes from input_file
python3 convertASPdotNETIdentityHash2hashcatFormat.py obtainedASPdotNEThashes.txt

# Parse ASP.NET hashes from input_file to output folders structure
python3 convertASPdotNETIdentityHash2hashcatFormat.py -o outDir obtainedASPdotNEThashes.txt
# This will create a local folder "outDir" with sucessfull parsed ASP.NET Core Identity hashes split by PRF.
.
└── outDir
    ├── hashes.sha256
    └── hashes.sha512
# To crack such hashes with hashcat use "hashcat outDir/hashes.sha512 wordlist.txt"

# Parse ASP.NET hashes from input_file with usernames
python3 convertASPdotNETIdentityHash2hashcatFormat.py -u obtainedASPdotNEThashes.txt
# This will prepend the in-line annotation from the input file to the hashcat formated hash
# To crack such hashes (here: sha512 in folder "outDir") with hashcat
hashcat -m 12100 --username outDir/hashes.sha512 wordlist.txt
# To show cracked hashes with the annotations
hashcat --username --show outDir/hashes.sha512

This programs support the following ASP.NET Core Identity hash formats.
| ASP.NET version | Hash-Type          | Hash-Code |
| --------------- | ------------------ | --------- |
| v2,v3           | PBKDF2+HMAC-SHA1   |     12000 |
| v3              | PBKDF2+HMAC-SHA256 |     10900 |
| v3 (.NET > 7.0) | PBKDF2+HMAC-SHA512 |     12100 |

This program is developed Yannic Hemmer at Pentagrid AG, Buchs SG.

Copyright and License

This project is developed by Yannic Hemmer and published under a BSD licence with a non-military clause. Please read LICENSE.txt for further details.

About

Convert ASP.NET Core Identity password hashes to the Hashcat format with support for hash versions 1, 2, and 3.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages