This commit is contained in:
iceman1001 2023-01-29 04:59:50 +01:00
parent 9bd7e41d39
commit 09f2bf9f02
8 changed files with 455 additions and 416 deletions

View file

@ -189,8 +189,7 @@ static int get_uid_slix(uint32_t start_time, uint32_t* eof_time, uint8_t* uid) {
uint16_t recvlen = 0;
SendDataTag(cmd, sizeof(cmd), false, true, answer, ISO15693_MAX_RESPONSE_LENGTH, start_time, ISO15693_READER_TIMEOUT, eof_time, &recvlen);
if(recvlen != 12)
{
if (recvlen != 12) {
return PM3_ETIMEOUT;
}
@ -2781,13 +2780,11 @@ static uint32_t disable_eas_15693_Slix(uint32_t start_time, uint32_t* eof_time,
return PM3_ETIMEOUT;
}
if(usepwd)
{
if (usepwd) {
int res_setpass = set_pass_15693_Slix(start_time, eof_time, 0x10, password, uid);
if(res_setpass != PM3_SUCCESS)
{
if (res_setpass != PM3_SUCCESS) {
return PM3_EWRONGANSWER;
}
}
@ -2817,12 +2814,10 @@ static uint32_t enable_eas_15693_Slix(uint32_t start_time, uint32_t* eof_time, u
return PM3_ETIMEOUT;
}
if(usepwd)
{
if (usepwd) {
int res_setpass = set_pass_15693_Slix(start_time, eof_time, 0x10, password, uid);
if(res_setpass != PM3_SUCCESS)
{
if (res_setpass != PM3_SUCCESS) {
return PM3_EWRONGANSWER;
}
}
@ -2882,8 +2877,7 @@ static uint32_t pass_protect_EASAFI_15693_Slix(uint32_t start_time, uint32_t *eo
int res_setpass = set_pass_15693_Slix(start_time, eof_time, 0x10, password, uid);
if(res_setpass != PM3_SUCCESS)
{
if (res_setpass != PM3_SUCCESS) {
return PM3_EWRONGANSWER;
}
@ -2902,25 +2896,20 @@ static uint32_t pass_protect_EASAFI_15693_Slix(uint32_t start_time, uint32_t *eo
return PM3_SUCCESS;
}
static uint32_t write_afi_15693(uint32_t start_time, uint32_t *eof_time, uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi)
{
static uint32_t write_afi_15693(uint32_t start_time, uint32_t *eof_time, uint8_t *password, bool usepwd, uint8_t *uid, bool use_uid, uint8_t afi) {
if(!use_uid)
{
if (!use_uid) {
int res_getuid = get_uid_slix(start_time, eof_time, uid);
if(res_getuid != PM3_SUCCESS)
{
if (res_getuid != PM3_SUCCESS) {
return res_getuid;
}
}
if(usepwd)
{
if (usepwd) {
int res_setpass = set_pass_15693_Slix(start_time, eof_time, 0x10, password, uid);
if(res_setpass != PM3_SUCCESS)
{
if (res_setpass != PM3_SUCCESS) {
return PM3_EWRONGANSWER;
}
}
@ -3023,8 +3012,7 @@ void WritePasswordSlixIso15693(uint8_t *old_password, uint8_t *new_password, uin
get_uid_slix(start_time, &eof_time, uid);
res = set_pass_15693_Slix(start_time, &eof_time, pwd_id, old_password, uid);
if(res != PM3_SUCCESS)
{
if (res != PM3_SUCCESS) {
reply_ng(CMD_HF_ISO15693_SLIX_WRITE_PWD, res, NULL, 0);
switch_off();
return;

View file

@ -1383,13 +1383,11 @@ static int CmdHF15WriteAfi(const char *Cmd) {
CLIParserFree(ctx);
if(pwdlen == 4)
{
if (pwdlen == 4) {
payload.use_pwd = true;
}
if(uidlen == 8)
{
if (uidlen == 8) {
payload.use_uid = true;
}
@ -1399,8 +1397,7 @@ static int CmdHF15WriteAfi(const char *Cmd) {
return PM3_EINVARG;
}
if(pwdlen > 0 && pwdlen != 4)
{
if (pwdlen > 0 && pwdlen != 4) {
PrintAndLogEx(WARNING, "password must be 4 hex bytes if provided");
return PM3_ESOFT;
}
@ -2387,8 +2384,7 @@ static int CmdHF15SlixEASEnable(const char *Cmd) {
int pwdlen = 0;
int ret_pwdparse = CLIParamHexToBuf(arg_get_str(ctx, 1), payload.pwd, 4, &pwdlen);
if((pwdlen > 0 && pwdlen != 4) || ret_pwdparse != 0)
{
if ((pwdlen > 0 && pwdlen != 4) || ret_pwdparse != 0) {
PrintAndLogEx(WARNING, "password must be 4 hex bytes if provided");
return PM3_ESOFT;
}
@ -2397,15 +2393,12 @@ static int CmdHF15SlixEASEnable(const char *Cmd) {
CLIParserFree(ctx);
if(pwdlen > 0 )
{
if (pwdlen > 0) {
PrintAndLogEx(INFO, "Trying to enable EAS mode using password " _GREEN_("%s")
, sprint_hex_inrow(payload.pwd, sizeof(payload.pwd))
);
payload.usepwd = true;
}
else
{
} else {
PrintAndLogEx(INFO, "Trying to enable EAS mode without using a password");
payload.usepwd = false;
}
@ -2426,12 +2419,9 @@ static int CmdHF15SlixEASEnable(const char *Cmd) {
break;
}
case PM3_EWRONGANSWER: {
if(pwdlen > 0 )
{
if (pwdlen > 0) {
PrintAndLogEx(WARNING, "the password provided was not accepted");
}
else
{
} else {
PrintAndLogEx(WARNING, "either a password is required or EAS mode is locked");
}
break;
@ -2465,8 +2455,7 @@ static int CmdHF15SlixEASDisable(const char *Cmd) {
int pwdlen = 0;
int ret_pwdparse = CLIParamHexToBuf(arg_get_str(ctx, 1), payload.pwd, 4, &pwdlen);
if((pwdlen > 0 && pwdlen != 4) || ret_pwdparse != 0)
{
if ((pwdlen > 0 && pwdlen != 4) || ret_pwdparse != 0) {
PrintAndLogEx(WARNING, "password must be 4 hex bytes if provided");
return PM3_ESOFT;
}
@ -2475,15 +2464,12 @@ static int CmdHF15SlixEASDisable(const char *Cmd) {
CLIParserFree(ctx);
if(pwdlen > 0 )
{
if (pwdlen > 0) {
PrintAndLogEx(INFO, "Trying to disable EAS mode using password " _GREEN_("%s")
, sprint_hex_inrow(payload.pwd, sizeof(payload.pwd))
);
payload.usepwd = true;
}
else
{
} else {
PrintAndLogEx(INFO, "Trying to enable EAS mode without using a password");
payload.usepwd = false;
}
@ -2503,12 +2489,9 @@ static int CmdHF15SlixEASDisable(const char *Cmd) {
break;
}
case PM3_EWRONGANSWER: {
if(pwdlen > 0 )
{
if (pwdlen > 0) {
PrintAndLogEx(WARNING, "the password provided was not accepted");
}
else
{
} else {
PrintAndLogEx(WARNING, "either a password is required or EAS mode is locked");
}
break;
@ -2648,16 +2631,14 @@ static int CmdHF15SlixWritePassword(const char *Cmd) {
CLIGetHexWithReturn(ctx, 2, payload.old_pwd, &pwdlen);
if(pwdlen > 0 && pwdlen != 4)
{
if (pwdlen > 0 && pwdlen != 4) {
PrintAndLogEx(WARNING, "old password must be 4 hex bytes if provided");
return PM3_ESOFT;
}
CLIGetHexWithReturn(ctx, 3, payload.new_pwd, &pwdlen);
if(pwdlen != 4)
{
if (pwdlen != 4) {
PrintAndLogEx(WARNING, "new password must be 4 hex bytes");
return PM3_ESOFT;
}
@ -2667,33 +2648,22 @@ static int CmdHF15SlixWritePassword(const char *Cmd) {
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)value, sizeof(value), &vlen);
if (vlen > 0) {
if (strcmp(value, "read") == 0)
{
if (strcmp(value, "read") == 0) {
PrintAndLogEx(SUCCESS, "Selected read pass");
payload.pwd_id = 0x01;
}
else if (strcmp(value, "write") == 0)
{
} else if (strcmp(value, "write") == 0) {
PrintAndLogEx(SUCCESS, "Selected write pass");
payload.pwd_id = 0x02;
}
else if (strcmp(value, "privacy") == 0)
{
} else if (strcmp(value, "privacy") == 0) {
PrintAndLogEx(SUCCESS, "Selected privacy pass");
payload.pwd_id = 0x04;
}
else if (strcmp(value, "destroy") == 0)
{
} else if (strcmp(value, "destroy") == 0) {
PrintAndLogEx(SUCCESS, "Selected destroy pass");
payload.pwd_id = 0x08;
}
else if (strcmp(value, "easafi") == 0)
{
} else if (strcmp(value, "easafi") == 0) {
PrintAndLogEx(SUCCESS, "Selected easafi pass");
payload.pwd_id = 0x10;
}
else
{
} else {
PrintAndLogEx(ERR, "t argument must be 'read', 'write', 'privacy', 'destroy', or 'easafi'");
return PM3_EINVARG;
}
@ -2756,14 +2726,12 @@ static int CmdHF15AFIPassProtect(const char *Cmd) {
bool confirmation = arg_get_lit(ctx, 2);
if(pwdlen != 4)
{
if (pwdlen != 4) {
PrintAndLogEx(WARNING, "password must be 4 hex bytes");
return PM3_ESOFT;
}
if(confirmation == 0)
{
if (confirmation == 0) {
PrintAndLogEx(WARNING, "This irreversible command must be confirmed with the -c flag");
return PM3_ESOFT;
}
@ -2823,14 +2791,12 @@ static int CmdHF15EASPassProtect(const char *Cmd) {
bool confirmation = arg_get_lit(ctx, 2);
if(pwdlen != 4)
{
if (pwdlen != 4) {
PrintAndLogEx(WARNING, "password must be 4 hex bytes");
return PM3_ESOFT;
}
if(confirmation == 0)
{
if (confirmation == 0) {
PrintAndLogEx(WARNING, "This irreversible command must be confirmed with the -c flag");
return PM3_ESOFT;
}

View file

@ -1656,6 +1656,34 @@
],
"usage": "hf 15 list [-h1crux] [--frame] [-f <fn>]"
},
"hf 15 passprotectafi": {
"command": "hf 15 passprotectafi",
"description": "Password protect AFI. Cannot be undone.",
"notes": [
"hf 15 passprotectafi -p 00000000 -c"
],
"offline": false,
"options": [
"-h, --help This help",
"-p, --password <hex> EAS/AFI password, 8 hex bytes",
"-c, --confirm confirm the execution of this irreversible command"
],
"usage": "hf 15 passprotectafi [-hc] -p <hex>"
},
"hf 15 passprotecteas": {
"command": "hf 15 passprotecteas",
"description": "Password protect EAS. Cannot be undone.",
"notes": [
"hf 15 passprotecteas -p 00000000 -c"
],
"offline": false,
"options": [
"-h, --help This help",
"-p, --password <hex> EAS/AFI password, 8 hex bytes",
"-c, --confirm confirm the execution of this irreversible command"
],
"usage": "hf 15 passprotecteas [-hc] -p <hex>"
},
"hf 15 raw": {
"command": "hf 15 raw",
"description": "Sends raw bytes over ISO-15693 to card",
@ -1776,8 +1804,34 @@
],
"usage": "hf 15 sim [-h] -u <8b hex> [-b <dec>]"
},
"hf 15 slixdisable": {
"command": "hf 15 slixdisable",
"hf 15 slixeasdisable": {
"command": "hf 15 slixeasdisable",
"description": "Disable EAS mode on SLIX ISO-15693 tag",
"notes": [
"hf 15 slixeasdisable -p 0F0F0F0F"
],
"offline": false,
"options": [
"-h, --help This help",
"-p, --pwd <hex> optional password, 8 hex bytes"
],
"usage": "hf 15 slixeasdisable [-h] [-p <hex>]"
},
"hf 15 slixeasenable": {
"command": "hf 15 slixeasenable",
"description": "Enable EAS mode on SLIX ISO-15693 tag",
"notes": [
"hf 15 slixeasenable -p 0F0F0F0F"
],
"offline": false,
"options": [
"-h, --help This help",
"-p, --pwd <hex> optional password, 8 hex bytes"
],
"usage": "hf 15 slixeasenable [-h] [-p <hex>]"
},
"hf 15 slixprivacydisable": {
"command": "hf 15 slixprivacydisable",
"description": "Disable privacy mode on SLIX ISO-15693 tag",
"notes": [
"hf 15 slixdisable -p 0F0F0F0F"
@ -1787,7 +1841,35 @@
"-h, --help This help",
"-p, --pwd <hex> password, 8 hex bytes"
],
"usage": "hf 15 slixdisable [-h] -p <hex>"
"usage": "hf 15 slixprivacydisable [-h] -p <hex>"
},
"hf 15 slixprivacyenable": {
"command": "hf 15 slixprivacyenable",
"description": "Enable privacy mode on SLIX ISO-15693 tag",
"notes": [
"hf 15 slixenable -p 0F0F0F0F"
],
"offline": false,
"options": [
"-h, --help This help",
"-p, --pwd <hex> password, 8 hex bytes"
],
"usage": "hf 15 slixprivacyenable [-h] -p <hex>"
},
"hf 15 slixwritepwd": {
"command": "hf 15 slixwritepwd",
"description": "Write a password on a SLIX family ISO-15693 tag",
"notes": [
"hf 15 slixwritepwd -t READ -o 00000000 -n 12131415"
],
"offline": false,
"options": [
"-h, --help This help",
"-t, --type <read|write|privacy|destroy|easafi> which password field to write to (some tags do not support all password types)",
"-o, --old <hex> old password (if present), 8 hex bytes",
"-n, --new <hex> new password, 8 hex bytes"
],
"usage": "hf 15 slixwritepwd [-h] -t <read|write|privacy|destroy|easafi> [-o <hex>] -n <hex>"
},
"hf 15 sniff": {
"command": "hf 15 sniff",
@ -1827,19 +1909,16 @@
"description": "Write AFI on card",
"notes": [
"hf 15 writeafi -* --afi 12",
"hf 15 writeafi -u E011223344556677 --afi 12"
"hf 15 writeafi -u E011223344556677 --afi 12 -p 0F0F0F0F"
],
"offline": false,
"options": [
"-h, --help This help",
"-u, --uid <hex> full UID, 8 bytes",
"--ua unaddressed mode",
"-* scan for tag",
"-2 use slower '1 out of 256' mode",
"-o, --opt set OPTION Flag (needed for TI)",
"--afi <dec> AFI number (0-255)"
"--afi <dec> AFI number (0-255)",
"-p, --pwd <hex> optional AFI/EAS password"
],
"usage": "hf 15 writeafi [-h*2o] [-u <hex>] [--ua] --afi <dec>"
"usage": "hf 15 writeafi [-h] [-u <hex>] --afi <dec> [-p <hex>]"
},
"hf 15 writedsfid": {
"command": "hf 15 writedsfid",
@ -11408,7 +11487,7 @@
},
"script help": {
"command": "script help",
"description": "This is a feature to run Lua/Cmd/Python scripts. You can place scripts within the luascripts/cmdscripts/pyscripts folders. --------------------------------------------------------------------------------------- script list available offline: yes",
"description": "This is a feature to run Lua/Cmd scripts. You can place scripts within the luascripts/cmdscripts folders. --------------------------------------------------------------------------------------- script list available offline: yes",
"notes": [],
"offline": true,
"options": [],
@ -11803,8 +11882,8 @@
}
},
"metadata": {
"commands_extracted": 742,
"commands_extracted": 748,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2023-01-27T01:57:37"
"extracted_on": "2023-01-29T03:58:53"
}
}

View file

@ -236,7 +236,13 @@ Check column "offline" for their availability.
|`hf 15 esave `|N |`Save emulator memory into image file`
|`hf 15 eview `|N |`View emulator memory`
|`hf 15 sim `|N |`Fake an ISO-15693 tag`
|`hf 15 slixdisable `|N |`Disable privacy mode on SLIX ISO-15693 tag`
|`hf 15 slixwritepwd `|N |`Writes a password on a SLIX ISO-15693 tag`
|`hf 15 slixeasdisable `|N |`Disable EAS mode on SLIX ISO-15693 tag`
|`hf 15 slixeasenable `|N |`Enable EAS mode on SLIX ISO-15693 tag`
|`hf 15 slixprivacydisable`|N |`Disable privacy mode on SLIX ISO-15693 tag`
|`hf 15 slixprivacyenable`|N |`Enable privacy mode on SLIX ISO-15693 tag`
|`hf 15 passprotectafi `|N |`Password protect AFI - Cannot be undone`
|`hf 15 passprotecteas `|N |`Password protect EAS - Cannot be undone`
|`hf 15 wrbl `|N |`Write a block`
|`hf 15 findafi `|N |`Brute force AFI of an ISO-15693 tag`
|`hf 15 writeafi `|N |`Writes the AFI on an ISO-15693 tag`