Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Increasing user password max input length to 55 - CUDA
  • Loading branch information
e-ago committed Jun 14, 2018
1 parent 895d0c1 commit 28fe613
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 34 deletions.
1 change: 1 addition & 0 deletions Dictionary/recovery_passwords.txt
Expand Up @@ -1022,6 +1022,7 @@
361691-533148-515042-703681-134288-613899-332816-605352
333168-202950-060302-070147-451869-314270-091630-476828
717739-546799-536778-277805-373428-610467-420134-096294
310167-506253-293579-484627-356015-178585-002178-645799
373483-171160-123662-084480-459283-054252-189893-713053
008492-046035-577830-719752-105963-423621-160545-641025
336699-137181-070521-242198-155749-065384-489148-378499
Expand Down
6 changes: 5 additions & 1 deletion Dictionary/user_passwords.txt
Expand Up @@ -9,4 +9,8 @@ p!q=r+s?8904v9Z-0=p'2"4abc
somethingelsefjdsjfdsjoifds
blablalbalbalbla876
p!q=r+s?t&4v9Z-0=p'2"4abc
blablalbalbalbla123
blablalbalbalbla123
openwall@123
abchfudshfjidosaiu89
longpasswordlongpassword123456789012345678901234567890!
blablablablabla
Binary file added Images/imgWin10NotCompatLongPsw.vhd
Binary file not shown.
15 changes: 12 additions & 3 deletions run_tests.sh
Expand Up @@ -31,27 +31,36 @@ mv test_hash/hash_recv_pass.txt test_hash/imgWin10NotCompat_recovery_password.tx
printf "\n\n"


#Image encrypted with Windows 10 Enteprise using BitLocker Not Compatible Mode and a very long password
./build/bitcracker_hash -o test_hash -i ./Images/imgWin10NotCompatLongPsw.vhd
mv test_hash/hash_user_pass.txt test_hash/imgWin10NotCompatLong_user_password.txt
mv test_hash/hash_recv_pass.txt test_hash/imgWin10NotCompatLong_recovery_password.txt
printf "\n\n"

printf "\n\n************ Testing BitCracker CUDA version ************\n\n"
#Print help
./build/bitcracker_cuda -h

set -x
#Windows 8.1

./build/bitcracker_cuda -f ./test_hash/imgWin8_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -u
#Same test with MAC verification
./build/bitcracker_cuda -f ./test_hash/imgWin8_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -m -u

#Windows 7
./build/bitcracker_cuda -f ./test_hash/imgWin7_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -u

#Windows 10 Compatbile Mode
#Windows 10 Compatible Mode
./build/bitcracker_cuda -f ./test_hash/imgWin10Compat_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -u
./build/bitcracker_cuda -f ./test_hash/imgWin10Compat_recovery_password.txt -d ./Dictionary/recovery_passwords.txt $SINGLE_BLOCK -r
#Same test with MAC verification
./build/bitcracker_cuda -f ./test_hash/imgWin10Compat_recovery_password.txt -d ./Dictionary/recovery_passwords.txt $SINGLE_BLOCK -r -m

#Windows 10 Not Compatbile Mode
#Windows 10 Not Compatible Mode
./build/bitcracker_cuda -f ./test_hash/imgWin10NotCompat_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -u
./build/bitcracker_cuda -f ./test_hash/imgWin10NotCompat_recovery_password.txt -d ./Dictionary/recovery_passwords.txt $SINGLE_BLOCK -r
#Same test with MAC verification
./build/bitcracker_cuda -f ./test_hash/imgWin10NotCompat_recovery_password.txt -d ./Dictionary/recovery_passwords.txt $SINGLE_BLOCK -r -m

#Windows 10 Not Compatible Mode long password
./build/bitcracker_cuda -f ./test_hash/imgWin10NotCompatLong_user_password.txt -d ./Dictionary/user_passwords.txt $SINGLE_BLOCK -u
2 changes: 1 addition & 1 deletion src_CUDA/bitcracker.h
Expand Up @@ -76,7 +76,7 @@
#define MAX_INPUT_PASSWORD_LEN 27

#define PSW_CHAR_SIZE 64
#define PSW_INT_SIZE 16 //32 for double passwords
#define PSW_INT_SIZE 32 //it was 16

#define FIRST_LENGHT 27
#define SECOND_LENGHT 55
Expand Down
45 changes: 23 additions & 22 deletions src_CUDA/cuda_attack.cu
Expand Up @@ -259,7 +259,7 @@ __global__ void decrypt_vmk(int tot_psw_kernel, int *found, unsigned char * vmkK
int gIndex = (threadIdx.x+blockIdx.x*blockDim.x);
int index_generic;
int indexW=(gIndex*PSW_INT_SIZE);
//int8_t redo=0;
int8_t redo=0;

while(gIndex < tot_psw_kernel)
{
Expand All @@ -283,7 +283,7 @@ __global__ void decrypt_vmk(int tot_psw_kernel, int *found, unsigned char * vmkK

//----------------------------------------------------- FIRST HASH ------------------------------------------------
indexW=(gIndex*PSW_INT_SIZE);
//redo=0;
redo=0;
schedule0 = (uint32_t) (tex1Dfetch(w_password, (indexW+0)));
schedule1 = (uint32_t) (tex1Dfetch(w_password, (indexW+1)));
schedule2 = (uint32_t) (tex1Dfetch(w_password, (indexW+2)));
Expand All @@ -299,6 +299,9 @@ __global__ void decrypt_vmk(int tot_psw_kernel, int *found, unsigned char * vmkK
schedule12 = (uint32_t) (tex1Dfetch(w_password, (indexW+12)));
schedule13 = (uint32_t) (tex1Dfetch(w_password, (indexW+13)));
schedule14 = (uint32_t) (tex1Dfetch(w_password, (indexW+14)));
//Input password is shorter than FIRST_LENGHT
if(schedule14 == -1) schedule14=0;
else if(method == MODE_USER_PASS) redo=1;
schedule15 = (uint32_t) (tex1Dfetch(w_password, (indexW+15)));

ALL_SCHEDULE_LAST16()
Expand All @@ -318,27 +321,25 @@ __global__ void decrypt_vmk(int tot_psw_kernel, int *found, unsigned char * vmkK
//User password only
if(method == MODE_USER_PASS)
{
/*
schedule0 = (uint32_t) (tex1Dfetch(w_password, (indexW+0)));
schedule1 = (uint32_t) (tex1Dfetch(w_password, (indexW+1)));
schedule2 = (uint32_t) (tex1Dfetch(w_password, (indexW+2)));
schedule3 = (uint32_t) (tex1Dfetch(w_password, (indexW+3)));
schedule4 = (uint32_t) (tex1Dfetch(w_password, (indexW+4)));
schedule5 = (uint32_t) (tex1Dfetch(w_password, (indexW+5)));
schedule6 = (uint32_t) (tex1Dfetch(w_password, (indexW+6)));
schedule7 = (uint32_t) (tex1Dfetch(w_password, (indexW+7)));
schedule8 = (uint32_t) (tex1Dfetch(w_password, (indexW+8)));
schedule9 = (uint32_t) (tex1Dfetch(w_password, (indexW+9)));
schedule10 = (uint32_t) (tex1Dfetch(w_password, (indexW+10)));
schedule11 = (uint32_t) (tex1Dfetch(w_password, (indexW+11)));
schedule12 = (uint32_t) (tex1Dfetch(w_password, (indexW+12)));
schedule13 = (uint32_t) (tex1Dfetch(w_password, (indexW+13)));
schedule14 = (uint32_t) (tex1Dfetch(w_password, (indexW+14)));
schedule15 = (uint32_t) (tex1Dfetch(w_password, (indexW+15)));
if(redo == 1)
{
schedule0 = (uint32_t) (tex1Dfetch(w_password, (indexW+16)));
schedule1 = (uint32_t) (tex1Dfetch(w_password, (indexW+17)));
schedule2 = (uint32_t) (tex1Dfetch(w_password, (indexW+18)));
schedule3 = (uint32_t) (tex1Dfetch(w_password, (indexW+19)));
schedule4 = (uint32_t) (tex1Dfetch(w_password, (indexW+20)));
schedule5 = (uint32_t) (tex1Dfetch(w_password, (indexW+21)));
schedule6 = (uint32_t) (tex1Dfetch(w_password, (indexW+22)));
schedule7 = (uint32_t) (tex1Dfetch(w_password, (indexW+23)));
schedule8 = (uint32_t) (tex1Dfetch(w_password, (indexW+24)));
schedule9 = (uint32_t) (tex1Dfetch(w_password, (indexW+25)));
schedule10 = (uint32_t) (tex1Dfetch(w_password, (indexW+26)));
schedule11 = (uint32_t) (tex1Dfetch(w_password, (indexW+27)));
schedule12 = (uint32_t) (tex1Dfetch(w_password, (indexW+28)));
schedule13 = (uint32_t) (tex1Dfetch(w_password, (indexW+29)));
schedule14 = (uint32_t) (tex1Dfetch(w_password, (indexW+30)));
schedule15 = (uint32_t) (tex1Dfetch(w_password, (indexW+31)));

a = first_hash0;
b = first_hash1;
c = first_hash2;
Expand All @@ -363,7 +364,7 @@ __global__ void decrypt_vmk(int tot_psw_kernel, int *found, unsigned char * vmkK
first_hash7 += h;

}
*/

//----------------------------------------------------- SECOND HASH ------------------------------------------------
schedule0 = first_hash0;
schedule1 = first_hash1;
Expand Down
10 changes: 3 additions & 7 deletions src_CUDA/utils.cu
Expand Up @@ -237,9 +237,9 @@ int readFilePassword(uint32_t ** buf_i, char ** buf_c, int maxNumPsw, FILE *fp)
size = (strlen(tmp)-1);

//User passwords longer than 27 characters not supported yet
if(attack_mode == MODE_USER_PASS && ( size > FIRST_LENGHT || size < MIN_INPUT_PASSWORD_LEN) && print_once == 0)
if(attack_mode == MODE_USER_PASS && ( size > SECOND_LENGHT || size < MIN_INPUT_PASSWORD_LEN) && print_once == 0)
{
fprintf(stderr, "WARNING: During USER PASSWORD attack, only passwords between 8 and 27 character are considered. Passwords like %s will be ignored.\n", tmp);
fprintf(stderr, "WARNING: During USER PASSWORD attack, only passwords between %d and %d character are considered. Passwords like %s will be ignored.\n", MIN_INPUT_PASSWORD_LEN, SECOND_LENGHT, tmp);
print_once=1;
}

Expand Down Expand Up @@ -318,15 +318,11 @@ int readFilePassword(uint32_t ** buf_i, char ** buf_c, int maxNumPsw, FILE *fp)

if(size <= FIRST_LENGHT)
{
((*buf_i)+(i*PSW_INT_SIZE)+14)[0] = 0;
((*buf_i)+(i*PSW_INT_SIZE)+14)[0] = -1;
((*buf_i)+(i*PSW_INT_SIZE)+15)[0] = ((uint8_t)(((size*2) << 3) >> 8)) << 8 | ((uint8_t)((size*2) << 3));
}
else
{
// Next release!
fprintf(stderr, "ERROR!\n");
exit(EXIT_FAILURE);

((*buf_i)+(i*PSW_INT_SIZE)+30)[0] = 0;
((*buf_i)+(i*PSW_INT_SIZE)+31)[0] = ((uint8_t)(((size*2) << 3) >> 8)) << 8 | ((uint8_t)((size*2) << 3));
}
Expand Down

0 comments on commit 28fe613

Please sign in to comment.