mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
CHG: 'lf awid brute' - extra check if device gotten offline
CHG: 'lf t55x7 brute' - extra check if device gotten offline CHG: 'lf nedap' - Nedap is supposed to be Diphase.
This commit is contained in:
parent
e4b65f5bc1
commit
8cdf15c2b3
3 changed files with 20 additions and 15 deletions
|
@ -127,7 +127,7 @@ int CmdHIDSim(const char *Cmd) {
|
||||||
|
|
||||||
int CmdHIDClone(const char *Cmd) {
|
int CmdHIDClone(const char *Cmd) {
|
||||||
|
|
||||||
unsigned int hi2 = 0, hi = 0, lo = 0;
|
uint32_t hi2 = 0, hi = 0, lo = 0;
|
||||||
int n = 0, i = 0;
|
int n = 0, i = 0;
|
||||||
UsbCommand c;
|
UsbCommand c;
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ static command_t CommandTable[] = {
|
||||||
{"fskdemod",CmdHIDDemodFSK, 0, "Realtime HID FSK demodulator"},
|
{"fskdemod",CmdHIDDemodFSK, 0, "Realtime HID FSK demodulator"},
|
||||||
{"sim", CmdHIDSim, 0, "HID tag simulator"},
|
{"sim", CmdHIDSim, 0, "HID tag simulator"},
|
||||||
{"clone", CmdHIDClone, 0, "Clone HID to T55x7"},
|
{"clone", CmdHIDClone, 0, "Clone HID to T55x7"},
|
||||||
{"wiegand", CmdHIDWiegand, 0, "Convert facility code/card number to Wiegand code"},
|
{"wiegand", CmdHIDWiegand, 1, "Convert facility code/card number to Wiegand code"},
|
||||||
{"brute", CmdHIDBrute, 0, "Bruteforce card number against reader"},
|
{"brute", CmdHIDBrute, 0, "Bruteforce card number against reader"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
@ -226,13 +226,14 @@ int CmdLFNedapClone(const char *Cmd) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
((ASK/biphase data rawdemod ab 0 64 1 0
|
((ASK/DIphase data rawdemod ab 0 64 1 0
|
||||||
//NEDAP - compat mode, ASK/Biphase, data rate 64, 4 data blocks
|
//NEDAP - compat mode, ASK/DIphase, data rate 64, 4 data blocks
|
||||||
blocks[0] = T55x7_MODULATION_BIPHASE | T55x7_BITRATE_RF_64 | 4<<T55x7_MAXBLOCK_SHIFT;
|
// DI-pahse (CDP) T55x7_MODULATION_DIPHASE
|
||||||
|
blocks[0] = T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_64 | 7<<T55x7_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
if (param_getchar(Cmd, 3) == 'Q' || param_getchar(Cmd, 3) == 'q')
|
if (param_getchar(Cmd, 3) == 'Q' || param_getchar(Cmd, 3) == 'q')
|
||||||
//t5555 (Q5) BITRATE = (RF-2)/2 (iceman)
|
//t5555 (Q5) BITRATE = (RF-2)/2 (iceman)
|
||||||
blocks[0] = T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | 64<<T5555_BITRATE_SHIFT | 4<<T5555_MAXBLOCK_SHIFT;
|
blocks[0] = T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | 64<<T5555_BITRATE_SHIFT | 7<<T5555_MAXBLOCK_SHIFT;
|
||||||
|
|
||||||
blocks[1] = bytebits_to_byte(bs,32);
|
blocks[1] = bytebits_to_byte(bs,32);
|
||||||
blocks[2] = bytebits_to_byte(bs+32,32);
|
blocks[2] = bytebits_to_byte(bs+32,32);
|
||||||
|
@ -273,7 +274,7 @@ int CmdLFNedapSim(const char *Cmd) {
|
||||||
size_t size = sizeof(bs);
|
size_t size = sizeof(bs);
|
||||||
memset(bs, 0x00, size);
|
memset(bs, 0x00, size);
|
||||||
|
|
||||||
// NEDAP, Bihase = 2, clock 64, inverted,
|
// NEDAP, Biphase = 2, clock 64, inverted, (DIPhase == inverted BIphase
|
||||||
uint8_t encoding = 2, separator = 0, clk=64, invert=1;
|
uint8_t encoding = 2, separator = 0, clk=64, invert=1;
|
||||||
uint16_t arg1, arg2;
|
uint16_t arg1, arg2;
|
||||||
arg1 = clk << 8 | encoding;
|
arg1 = clk << 8 | encoding;
|
||||||
|
@ -312,7 +313,7 @@ int CmdLFNedapChk(const char *Cmd){
|
||||||
uint8_t cl = 0x1D, ch = 0x1D, carry = 0;
|
uint8_t cl = 0x1D, ch = 0x1D, carry = 0;
|
||||||
uint8_t al, bl, temp;
|
uint8_t al, bl, temp;
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i){
|
for (int i = len; i >=0; --i){
|
||||||
al = data[i];
|
al = data[i];
|
||||||
for (int j = 8; j > 0; --j) {
|
for (int j = 8; j > 0; --j) {
|
||||||
|
|
||||||
|
|
|
@ -1464,7 +1464,6 @@ int CmdT55xxBruteForce(const char *Cmd) {
|
||||||
memcpy(filename, Cmd+2, len);
|
memcpy(filename, Cmd+2, len);
|
||||||
|
|
||||||
FILE * f = fopen( filename , "r");
|
FILE * f = fopen( filename , "r");
|
||||||
|
|
||||||
if ( !f ) {
|
if ( !f ) {
|
||||||
PrintAndLog("File: %s: not found or locked.", filename);
|
PrintAndLog("File: %s: not found or locked.", filename);
|
||||||
free(keyBlock);
|
free(keyBlock);
|
||||||
|
@ -1520,6 +1519,12 @@ int CmdT55xxBruteForce(const char *Cmd) {
|
||||||
uint64_t testpwd = 0x00;
|
uint64_t testpwd = 0x00;
|
||||||
for (uint16_t c = 0; c < keycnt; ++c ) {
|
for (uint16_t c = 0; c < keycnt; ++c ) {
|
||||||
|
|
||||||
|
if ( offline ) {
|
||||||
|
printf("Device offline\n");
|
||||||
|
free(keyBlock);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (ukbhit()) {
|
if (ukbhit()) {
|
||||||
ch = getchar();
|
ch = getchar();
|
||||||
(void)ch;
|
(void)ch;
|
||||||
|
@ -1532,7 +1537,6 @@ int CmdT55xxBruteForce(const char *Cmd) {
|
||||||
|
|
||||||
PrintAndLog("Testing %08X", testpwd);
|
PrintAndLog("Testing %08X", testpwd);
|
||||||
|
|
||||||
|
|
||||||
if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd)) {
|
if ( !AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, TRUE, testpwd)) {
|
||||||
PrintAndLog("Aquireing data from device failed. Quitting");
|
PrintAndLog("Aquireing data from device failed. Quitting");
|
||||||
free(keyBlock);
|
free(keyBlock);
|
||||||
|
@ -1540,7 +1544,6 @@ int CmdT55xxBruteForce(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
found = tryDetectModulation();
|
found = tryDetectModulation();
|
||||||
|
|
||||||
if ( found ) {
|
if ( found ) {
|
||||||
PrintAndLog("Found valid password: [%08X]", testpwd);
|
PrintAndLog("Found valid password: [%08X]", testpwd);
|
||||||
free(keyBlock);
|
free(keyBlock);
|
||||||
|
@ -1610,7 +1613,8 @@ int tryOnePassword(uint32_t password) {
|
||||||
|
|
||||||
if (tryDetectModulation())
|
if (tryDetectModulation())
|
||||||
return 1;
|
return 1;
|
||||||
else return 0;
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdT55xxRecoverPW(const char *Cmd) {
|
int CmdT55xxRecoverPW(const char *Cmd) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue