From 1b387ae90e2380e481887fdf3f1c5b015687854a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 20 May 2024 21:26:12 +0200 Subject: [PATCH] some simple identification tests, will need to expand on the idea later --- CHANGELOG.md | 2 ++ client/src/cmdlfhitag.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca56628b..a4710aeae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Change `lf hitag info` - now tries to identify different key fob emulators (@iceman1001) +- Added `lf hitag reader` - act as a Hitag2 reader (@iceman1001) - Fixed `lf hitag crack2` - now works. (@iceman1001) - Fixed wrong use of free() in desfire crypto on arm src, thanks @jlitewski! (@iceman1001) - Added `lf em 4x70 calc` - calculate `frn`/`grn` for a given `key` + `rnd` diff --git a/client/src/cmdlfhitag.c b/client/src/cmdlfhitag.c index 1a6e314d3..1d79fb68f 100644 --- a/client/src/cmdlfhitag.c +++ b/client/src/cmdlfhitag.c @@ -766,6 +766,26 @@ void annotateHitag2(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, void annotateHitagS(char *exp, size_t size, const uint8_t *cmd, uint8_t cmdsize, bool is_response) { } +static const char* identify_transponder_hitag2(uint32_t uid) { + + switch (uid) { + case 0x53505910: + return "IMMO Key emulator"; + break; + case 0x5accc811: + case 0x5accc821: + case 0x5accc831: + case 0x5accc841: + case 0x5accc851: + case 0x5accc861: + case 0x5accc871: + case 0x5accc881: + case 0x5accc891: + case 0x5accc8B1: + return "CN3 Tango Key emulator"; + } + return ""; +} static bool getHitag2Uid(uint32_t *uid) { @@ -822,6 +842,16 @@ static int CmdLFHitagInfo(const char *Cmd) { // print_hitag2_configuration(uid, 0x02); // print_hitag2_configuration(uid, 0x00); // print_hitag2_configuration(uid, 0x04); + + PrintAndLogEx(INFO, "--- " _CYAN_("Fingerprint")); + const char *s = identify_transponder_hitag2(uid); + if (strlen(s)) { + PrintAndLogEx(SUCCESS, "Found... " _GREEN_("%s"), s); + } else { + PrintAndLogEx(INFO, _RED_("n/a")); + } + + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; }