blogs
Hash Cracking and the SAP Landscape

Introduction to Hash Cracking
Hashing is a one-way encryption method used to ensure data integrity, authenticate information, secure passwords, and other sensitive information. Hash functions transform data into a fixed-size string of characters that are uniform and deterministic, making it a great option for maintaining data security.
One of the main features in relation to password storage is that the results are one-way, this means that it is possible to obtain the same result with the same input data, but can’t calculate the input data knowing the result, which allows validating user credentials without knowing the original data.
Sometimes, as security professionals, we need to perform password cracking which is basically “recover” the plaintext value, to identify users with weak passwords, hijack other users accounts to elevate privileges to mention some use cases of this technique.
This blog will provide background on how SAP stores passwords and cracking tools that can be used to perform tests.
Password Storage in SAP Netweaver ABAP
SAP systems produce and store different types and versions of hashes according to its configuration. Furthermore, legacy and insecure values can be kept back to provide retrocompatibility, which is important because depending on the configuration parameters, it’s possible to have weak hashes stored in the SAP system database that can make it easier for a threat actor to obtain highly critical information about the user’s credentials.
Database Tables
SAP Netweaver ABAP stores passwords mainly in the database table USR02, also keeps user historical values in the tables USH02, USH02_ARC_TMP, and last but not least in table USRPWDHISTORY.
Although USR02 contains the active passwords, analyzing all the hashes can provide hints or partial passwords that can lead to mutate input test data or improve an existing dictionary.
Hash Functions and Formats
SAP systems implement several mechanisms to generate hashes and multiple values can be stored based on profile parameters configurations.
The field CODVN (Code Version of Password Hash Algorithm) in table USR02 represents the algorithm that is active for an specific registry, the possible values and hashing methods are:
| CODVN Value | Description |
| B | MD5 based function, limited to 8 uppercased characters ASCII encoded |
| D | MD5 based function, limited to 8 uppercased characters UTF8 encoded |
| F | SHA1 based function with fixed SALT, 40 characters UTF-8 encoded |
| H | SHA1 based function with random SALT, 40 characters UTF-8 encoded |
Vendors mentioned
Fill in the form on this page to read the full article.