mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
Update iclass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
This commit is contained in:
parent
dddc917e6e
commit
03d851b828
1 changed files with 8 additions and 8 deletions
|
@ -2246,7 +2246,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
|
|
||||||
while (!card_select || !card_auth) {
|
while (!card_select || !card_auth) {
|
||||||
Iso15693InitReader(); //has to be at the top as it starts tracing
|
Iso15693InitReader(); //has to be at the top as it starts tracing
|
||||||
if (!msg->debug) {
|
if (msg->debug == false) {
|
||||||
set_tracing(false); //disable tracing to prevent crashes - set to true for debugging
|
set_tracing(false); //disable tracing to prevent crashes - set to true for debugging
|
||||||
} else {
|
} else {
|
||||||
if (loops == 1) {
|
if (loops == 1) {
|
||||||
|
@ -2280,7 +2280,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
card_auth = true;
|
card_auth = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!card_auth || !card_select) {
|
if (card_auth == false || card_select == false) {
|
||||||
reinit_tentatives++;
|
reinit_tentatives++;
|
||||||
switch_off();
|
switch_off();
|
||||||
}
|
}
|
||||||
|
@ -2294,7 +2294,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
uint8_t blockno = 24;
|
uint8_t blockno = 24;
|
||||||
int priv_esc_tries = 0;
|
int priv_esc_tries = 0;
|
||||||
bool priv_esc = false;
|
bool priv_esc = false;
|
||||||
while (!priv_esc) {
|
while (priv_esc == false) {
|
||||||
//The privilege escalation is done with a readcheck and not just a normal read!
|
//The privilege escalation is done with a readcheck and not just a normal read!
|
||||||
iclass_send_as_reader(read_check_cc, sizeof(read_check_cc), &start_time, &eof_time, shallow_mod);
|
iclass_send_as_reader(read_check_cc, sizeof(read_check_cc), &start_time, &eof_time, shallow_mod);
|
||||||
// expect a 8-byte response here
|
// expect a 8-byte response here
|
||||||
|
@ -2341,7 +2341,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
memcpy(msg->req.key, original_mac, 8);
|
memcpy(msg->req.key, original_mac, 8);
|
||||||
res = authenticate_iclass_tag(&msg->req, &hdr, &start_time, &eof_time, mac1);
|
res = authenticate_iclass_tag(&msg->req, &hdr, &start_time, &eof_time, mac1);
|
||||||
if (msg->test) {
|
if (msg->test) {
|
||||||
if (res != true) {
|
if (res == false) {
|
||||||
DbpString(_RED_("*** CARD EPURSE IS SILENT! RISK OF BRICKING! DO NOT EXECUTE KEY UPDATES! SCAN IT ON READER FOR EPURSE UPDATE, COLLECT NEW TRACES AND TRY AGAIN! ***"));
|
DbpString(_RED_("*** CARD EPURSE IS SILENT! RISK OF BRICKING! DO NOT EXECUTE KEY UPDATES! SCAN IT ON READER FOR EPURSE UPDATE, COLLECT NEW TRACES AND TRY AGAIN! ***"));
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2350,7 +2350,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (res != true) {
|
if (res == false) {
|
||||||
DbpString("Write Operation : "_GREEN_("VERIFIED! Card Key Updated!"));
|
DbpString("Write Operation : "_GREEN_("VERIFIED! Card Key Updated!"));
|
||||||
written = true;
|
written = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2360,7 +2360,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!write_error) {
|
if (write_error == false) {
|
||||||
//Step6 Perform 8 authentication attempts + 1 to verify if we found the weak key
|
//Step6 Perform 8 authentication attempts + 1 to verify if we found the weak key
|
||||||
for (int i = 0; i < 8 ; ++i) {
|
for (int i = 0; i < 8 ; ++i) {
|
||||||
iclass_send_as_reader(read_check_cc2, sizeof(read_check_cc2), &start_time, &eof_time, shallow_mod);
|
iclass_send_as_reader(read_check_cc2, sizeof(read_check_cc2), &start_time, &eof_time, shallow_mod);
|
||||||
|
@ -2380,7 +2380,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
//regardless of bits being found, restore the original key and verify it
|
//regardless of bits being found, restore the original key and verify it
|
||||||
bool reverted = false;
|
bool reverted = false;
|
||||||
uint8_t revert_retries = 0;
|
uint8_t revert_retries = 0;
|
||||||
while (!reverted) {
|
while (reverted == false) {
|
||||||
//Regain privilege escalation with a readcheck
|
//Regain privilege escalation with a readcheck
|
||||||
iclass_send_as_reader(read_check_cc, sizeof(read_check_cc), &start_time, &eof_time, shallow_mod);
|
iclass_send_as_reader(read_check_cc, sizeof(read_check_cc), &start_time, &eof_time, shallow_mod);
|
||||||
// TODO: check result
|
// TODO: check result
|
||||||
|
@ -2424,7 +2424,7 @@ void iClass_Recover(iclass_recover_req_t *msg) {
|
||||||
completed = true;
|
completed = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (!write_error) { //if there was a write error, re-run the loop for the same key index
|
if (write_error == false) { //if there was a write error, re-run the loop for the same key index
|
||||||
loops++;
|
loops++;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue