Skip to content

Commit

Permalink
add ps3 function nid support
Browse files Browse the repository at this point in the history
  • Loading branch information
jarveson committed Mar 30, 2017
1 parent 4b9e5f2 commit 5e98b52
Show file tree
Hide file tree
Showing 8 changed files with 1,909 additions and 0 deletions.
538 changes: 538 additions & 0 deletions OpenCL/m16110_a0.cl

Large diffs are not rendered by default.

504 changes: 504 additions & 0 deletions OpenCL/m16110_a1.cl

Large diffs are not rendered by default.

794 changes: 794 additions & 0 deletions OpenCL/m16110_a3.cl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions exampleps3.cmd
@@ -0,0 +1 @@
hashcat64.exe --potfile-disable -m 16110 -a 0 FF4A1633 ps3example.dict
4 changes: 4 additions & 0 deletions include/interface.h
Expand Up @@ -1186,6 +1186,8 @@ typedef enum display_len
DISPLAY_LEN_MAX_15000 = 128 + 1 + 64,
DISPLAY_LEN_MIN_15100 = 6 + 3 + 1 + 8 + 1 + 28,
DISPLAY_LEN_MAX_15100 = 6 + 6 + 1 + 8 + 1 + 28,
DISPLAY_LEN_MIN_16110 = 8,
DISPLAY_LEN_MAX_16110 = 8,
DISPLAY_LEN_MIN_99999 = 1,
DISPLAY_LEN_MAX_99999 = 55,

Expand Down Expand Up @@ -1512,6 +1514,7 @@ typedef enum kern_type
KERN_TYPE_SKIP32 = 14900,
KERN_TYPE_FILEZILLA_SERVER = 15000,
KERN_TYPE_NETBSD_SHA1CRYPT = 15100,
KERN_TYPE_PS3_NID = 16110,
KERN_TYPE_PLAINTEXT = 99999,

} kern_type_t;
Expand Down Expand Up @@ -1757,6 +1760,7 @@ int sha256b64s_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_bu
int filezilla_server_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);
int ps3_nid_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig);

/**
* hook functions
Expand Down
1 change: 1 addition & 0 deletions ps3example.dict
@@ -0,0 +1 @@
cellFsUtilMount
66 changes: 66 additions & 0 deletions src/interface.c
Expand Up @@ -239,6 +239,7 @@ static const char HT_14800[] = "iTunes Backup >= 10.0";
static const char HT_14900[] = "Skip32";
static const char HT_15000[] = "FileZilla Server >= 0.9.55";
static const char HT_15100[] = "Juniper/NetBSD sha1crypt";
static const char HT_16110[] = "PS3 Function NIDs";
static const char HT_99999[] = "Plaintext";

static const char HT_00011[] = "Joomla < 2.5.18";
Expand Down Expand Up @@ -14418,6 +14419,43 @@ int netbsd_sha1crypt_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf,
return (PARSER_OK);
}

int ps3_nid_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig)
{
if ((input_len < DISPLAY_LEN_MIN_16110) || (input_len > DISPLAY_LEN_MAX_16110)) return (PARSER_GLOBAL_LENGTH);

u32 *digest = (u32 *) hash_buf->digest;

salt_t *salt = hash_buf->salt;

if (is_valid_hex_string (input_buf, 8) == false) return (PARSER_HASH_ENCODING);

digest[0] = hex_to_u32 ((const u8 *) &input_buf[ 0]);
digest[1] = 0;
digest[2] = 0;
digest[3] = 0;
digest[4] = 0;

digest[0] -= SHA1M_A;
digest[1] -= SHA1M_B;
digest[2] -= SHA1M_C;
digest[3] -= SHA1M_D;
digest[4] -= SHA1M_E;

u32 salt_len = 32;

u8 salt_buf[32] = "6759659904250490566427499489741A";

u8 *salt_buf_ptr = (u8 *) salt->salt_buf;

salt_len = parse_and_store_salt (salt_buf_ptr, salt_buf, salt_len, hashconfig);

if (salt_len != 16) return (PARSER_SALT_LENGTH);

salt->salt_len = salt_len;

return (PARSER_OK);
}

int atlassian_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED const hashconfig_t *hashconfig)
{
if ((input_len < DISPLAY_LEN_MIN_12001) || (input_len > DISPLAY_LEN_MAX_12001)) return (PARSER_GLOBAL_LENGTH);
Expand Down Expand Up @@ -15082,6 +15120,7 @@ char *strhashtype (const u32 hash_mode)
case 14900: return ((char *) HT_14900);
case 15000: return ((char *) HT_15000);
case 15100: return ((char *) HT_15100);
case 16110: return ((char *) HT_16110);
case 99999: return ((char *) HT_99999);
}

Expand Down Expand Up @@ -18179,6 +18218,10 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const size_t out_le
(char *) salt.salt_buf,
ptr_plain);
}
else if (hash_mode == 16110)
{
snprintf(out_buf, out_len -1, "%08x", byte_swap_32(digest_buf[0]));
}
else if (hash_mode == 99999)
{
char *ptr = (char *) digest_buf;
Expand Down Expand Up @@ -22422,6 +22465,29 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->dgst_pos3 = 3;
break;

case 16110: hashconfig->hash_type = HASH_TYPE_SHA1;
hashconfig->salt_type = SALT_TYPE_EMBEDDED;
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
hashconfig->opts_type = OPTS_TYPE_PT_GENERATE_BE
| OPTS_TYPE_ST_ADD80
| OPTS_TYPE_ST_ADDBITS15
| OPTS_TYPE_ST_HEX;
hashconfig->kern_type = KERN_TYPE_PS3_NID;
hashconfig->dgst_size = DGST_SIZE_4_5;
hashconfig->parse_func = ps3_nid_parse_hash;
hashconfig->opti_type = OPTI_TYPE_ZERO_BYTE
| OPTI_TYPE_PRECOMPUTE_INIT
| OPTI_TYPE_PRECOMPUTE_MERKLE
| OPTI_TYPE_EARLY_SKIP
| OPTI_TYPE_NOT_ITERATED
| OPTI_TYPE_APPENDED_SALT
| OPTI_TYPE_RAW_HASH;
hashconfig->dgst_pos0 = 0;
hashconfig->dgst_pos1 = 1;
hashconfig->dgst_pos2 = 2;
hashconfig->dgst_pos3 = 3;
break;

case 99999: hashconfig->hash_type = HASH_TYPE_PLAINTEXT;
hashconfig->salt_type = SALT_TYPE_NONE;
hashconfig->attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
Expand Down
1 change: 1 addition & 0 deletions src/usage.c
Expand Up @@ -270,6 +270,7 @@ static const char *USAGE_BIG[] =
" 7200 | GRUB 2 | Operating-Systems",
" 9900 | Radmin2 | Operating-Systems",
" 125 | ArubaOS | Operating-Systems",
" 16110 | PS3 Function NID | Operating-Systems",
" 7700 | SAP CODVN B (BCODE) | Enterprise Application Software (EAS)",
" 7800 | SAP CODVN F/G (PASSCODE) | Enterprise Application Software (EAS)",
" 10300 | SAP CODVN H (PWDSALTEDHASH) iSSHA-1 | Enterprise Application Software (EAS)",
Expand Down

0 comments on commit 5e98b52

Please sign in to comment.