1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Merge pull request #1805 from mcovalt/electrum_salt_type_2

Electrum Salt-Type 2
This commit is contained in:
Jens Steube 2018-12-07 09:33:13 +01:00 committed by GitHub
commit 9d213147e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 200 additions and 4 deletions

View File

@ -236,6 +236,26 @@ DECLSPEC int is_valid_hex_32 (const u32 v)
return 1;
}
DECLSPEC int is_valid_base58_8 (const u8 v)
{
if (v > 'z') return 0;
if (v < '1') return 0;
if ((v > '9') && (v < 'A')) return 0;
if ((v > 'Z') && (v < 'a')) return 0;
return 1;
}
DECLSPEC int is_valid_base58_32 (const u32 v)
{
if (is_valid_base58_8 ((u8) (v >> 0)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 8)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 16)) == 0) return 0;
if (is_valid_base58_8 ((u8) (v >> 24)) == 0) return 0;
return 1;
}
DECLSPEC int find_keyboard_layout_map (const u32 search, const int search_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt)
{
for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++)

View File

@ -373,6 +373,22 @@ __kernel void m16600_m04 (KERN_ATTR_RULES_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}
@ -742,6 +758,22 @@ __kernel void m16600_s04 (KERN_ATTR_RULES_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -188,6 +188,22 @@ __kernel void m16600_mxx (KERN_ATTR_RULES_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}
@ -363,5 +379,21 @@ __kernel void m16600_sxx (KERN_ATTR_RULES_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -429,6 +429,22 @@ __kernel void m16600_m04 (KERN_ATTR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}
@ -856,6 +872,22 @@ __kernel void m16600_s04 (KERN_ATTR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -184,6 +184,22 @@ __kernel void m16600_mxx (KERN_ATTR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}
@ -357,5 +373,21 @@ __kernel void m16600_sxx (KERN_ATTR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -291,6 +291,22 @@ DECLSPEC void m16600 (SHM_TYPE u32a *s_te0, SHM_TYPE u32a *s_te1, SHM_TYPE u32a
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -197,6 +197,22 @@ __kernel void m16600_mxx (KERN_ATTR_VECTOR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}
@ -383,5 +399,21 @@ __kernel void m16600_sxx (KERN_ATTR_VECTOR_ESALT (electrum_wallet_t))
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
if (esalt_bufs[digests_offset].salt_type == 2)
{
if ((u8) (out[0] >> 0) != 'x') continue;
if ((u8) (out[0] >> 8) != 'p') continue;
if ((u8) (out[0] >> 16) != 'r') continue;
if ((u8) (out[0] >> 24) != 'v') continue;
if (is_valid_base58_32 (out[1]) == 0) continue;
if (is_valid_base58_32 (out[2]) == 0) continue;
if (is_valid_base58_32 (out[3]) == 0) continue;
if (atomic_inc (&hashes_shown[digests_offset]) == 0)
{
mark_hash (plains_buf, d_return_buf, salt_pos, digests_cnt, 0, digests_offset + 0, gid, il_pos);
}
}
}
}

View File

@ -248,7 +248,7 @@
- Added hash-mode 16300 = Ethereum Pre-Sale Wallet, PBKDF2-SHA256
- Added hash-mode 16400 = CRAM-MD5 Dovecot
- Added hash-mode 16500 = JWT (JSON Web Token)
- Added hash-mode 16600 = Electrum Wallet (Salt-Type 1-3)
- Added hash-mode 16600 = Electrum Wallet (Salt-Type 1)
##
## Bugs

View File

@ -252,7 +252,7 @@ NVIDIA GPUs require "NVIDIA Driver" (367.x or later)
- Bitcoin/Litecoin wallet.dat
- Blockchain, My Wallet
- Blockchain, My Wallet, V2
- Electrum Wallet (Salt-Type 1-3)
- Electrum Wallet (Salt-Type 1-2)
- KeePass 1 (AES/Twofish) and KeePass 2 (AES)
- JKS Java Key Store Private Keys (SHA1)
- Ethereum Wallet, PBKDF2-HMAC-SHA256

View File

@ -17870,7 +17870,7 @@ int electrum_wallet13_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf
const u32 salt_type = hc_strtoul ((const char *) salt_type_pos, NULL, 10);
if ((salt_type == 1) || (salt_type == 2) || (salt_type == 3))
if ((salt_type == 1) || (salt_type == 2))
{
// all ok
}

View File

@ -401,7 +401,7 @@ static const char *const USAGE_BIG[] =
" 11300 | Bitcoin/Litecoin wallet.dat | Password Managers",
" 12700 | Blockchain, My Wallet | Password Managers",
" 15200 | Blockchain, My Wallet, V2 | Password Managers",
" 16600 | Electrum Wallet (Salt-Type 1-3) | Password Managers",
" 16600 | Electrum Wallet (Salt-Type 1-2) | Password Managers",
" 13400 | KeePass 1 (AES/Twofish) and KeePass 2 (AES) | Password Managers",
" 15500 | JKS Java Key Store Private Keys (SHA1) | Password Managers",
" 15600 | Ethereum Wallet, PBKDF2-HMAC-SHA256 | Password Managers",