ADD: Added the possibility to exit the bruteforce mode (either rangesearch or file) with the keyboard.

FIX:  if not found, the range search printed wrong number.
This commit is contained in:
iceman1001 2015-12-01 22:47:03 +01:00
parent 3f26796673
commit d08faa4e02
2 changed files with 18 additions and 8 deletions

View file

@ -61,7 +61,7 @@ start:
case -2 : PrintAndLog("Card is not vulnerable to Darkside attack (doesn't send NACK on authentication requests).\n"); break;
case -3 : PrintAndLog("Card is not vulnerable to Darkside attack (its random number generator is not predictable).\n"); break;
case -4 : PrintAndLog("Card is not vulnerable to Darkside attack (its random number generator seems to be based on the wellknown");
PrintAndLog("generating polynomial with 16 effective bits only, but shows unexpected behaviour.\n"); break;
PrintAndLog("generating polynomial with 16 effective bits only, but shows unexpected behaviour.\n"); break;
default: ;
}
break;

View file

@ -1394,6 +1394,12 @@ int CmdT55xxBruteForce(const char *Cmd) {
uint64_t testpwd = 0x00;
for (uint16_t c = 0; c < keycnt; ++c ) {
if (ukbhit()) {
getchar();
printf("\naborted via keyboard!\n");
return 0;
}
testpwd = bytes_to_num(keyBlock + 4*c, 4);
PrintAndLog("Testing %08X", testpwd);
@ -1423,23 +1429,27 @@ int CmdT55xxBruteForce(const char *Cmd) {
if ( start_password >= end_password ) return usage_t55xx_bruteforce();
PrintAndLog("Search password range [%08X -> %08X]", start_password, end_password);
PrintAndLog("Search password range [%08X -> %08X]", start_password, end_password);
uint32_t i = start_password;
while ((!found) && (i <= end_password)){
printf(".");
fflush(stdout);
if (ukbhit()) {
getchar();
printf("\naborted via keyboard!\n");
return 0;
}
if (!AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, i)) {
PrintAndLog("Aquireing data from device failed. Quitting");
return 0;
}
found = tryDetectModulation();
if (found)
break;
if ((i % 0x100) == 0) printf("[%08x], ",i);
if (found) break;
i++;
}
@ -1448,7 +1458,7 @@ int CmdT55xxBruteForce(const char *Cmd) {
if (found)
PrintAndLog("Found valid password: [%08x]", i);
else
PrintAndLog("Password NOT found. Last tried: [%08x]", i);
PrintAndLog("Password NOT found. Last tried: [%08x]", --i);
return 0;
}