Commit graph

279 commits

Author SHA1 Message Date
iceman1001
2d610b8dc0 text & style 2025-06-08 10:02:00 +02:00
Antiklesys
80e1c7f0d4 Implemented hf iclass sim -t 7
Implemented an iclass sim function that prevents simulated card responses after updating block 3.
Block 3 gets updated with the XOR key as if it was in personalization mode.
2025-06-07 23:12:21 +08:00
iceman1001
6fbb13ba41 style 2025-06-07 11:50:03 +02:00
Antiklesys
f49bc8ebaa
Update iclass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-06-07 17:00:28 +08:00
Antiklesys
606f65496c
Update iclass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-06-07 16:46:44 +08:00
Antiklesys
9c672d8289
Update iclass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-06-07 16:42:49 +08:00
Antiklesys
b4edcb9510 Updated hf iclass sim -t 6
Updates to the functionality of iclass sim -t 6 to specifically target the last SIO block and to do it automatically.
It now checks the AIA to determine if the card is SR or SE and adjust the block to jam based on the SIO length declared in block 6 (if SE) or fixed length if SR.
2025-06-07 13:46:19 +08:00
Antiklesys
94794f7519 Implemented a hf iclass sim variation
hf iclass sim -t 3 variation that glitches specific block responses during read/write operations based on the value of the last byte of block 31.
2025-06-07 02:15:01 +08:00
iceman1001
f41d6fad53 style 2025-06-06 13:27:02 +02:00
Antiklesys
e68be39a41 Updated hf iclass legrec to be able to use shorter delays
Added an option for hf iclass legrec to further increase speeds by using a shorter delay of 1500 vs the default of 3390.
This seems to be stable on new silicon especially now that we're keeping the field always on.
It may be more risky for the --fast operation.
2025-06-06 16:06:53 +08:00
Antiklesys
fd098ba12f Update iclass.c 2025-06-05 21:29:01 +08:00
Antiklesys
7acf507826 Update iclass.c
Minor optimizations to remove duplicate code
2025-06-05 21:18:03 +08:00
Antiklesys
083a9ce945 Updated hf iclass legrec with a fast option and improved AA2 selection
1- Added a --fast option for hf iclass legrec that further increases the speed from 4.6 key updates/second to 7.4 key updates/second. This is achieved by skipping some safety checks and is a very fast but more risky operation.
2- Automated AA2 block selection based on the values in the config block
3- Other minor code cleanups
2025-06-05 20:44:58 +08:00
iceman1001
186ed6fb07 make style 2025-06-04 18:05:30 +02:00
Antiklesys
7225ea6ac4
Update iclass.c
Removed unused value of blockno

Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-06-04 22:46:44 +08:00
Antiklesys
81d7ac1f59
Update iclass.c
Re-added stop tracing in main loop to avoid crashes

Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-06-04 22:41:30 +08:00
Antiklesys
d654f6e78f Improved hf iclass legrec speed
Improved the speed of hficlass legrec from 7200 keys / hrs to 17800 keys / hr by removing the need to drop the field and re-select, re-authenticate with the card at every loop.
Re-select and re-authenticate will still happen if there's a read error and a loop needs to be repeated.
2025-06-04 22:34:28 +08:00
Antiklesys
2b2a1cc0a2 Updated hf iclass legrec
Updated hf iclass legrec to support pm3 button interrupt for user abort
Cleaned up messaging to look more neat and tidy during the process
2025-05-31 14:09:00 +08:00
iceman1001
749c23a6b5 iclass tear on device side , moved around debug printing not to disturb timings between reading and writing tag during stabilize weak bit phase 2025-05-30 20:46:27 +02:00
Antiklesys
23d9783b26 Updated hf iclass legrec
Updated hf iclass legrec:
1- Fixed communication timing inconsistencies by moving away from iclass_writeblock_ext to iclass_writeblock_sp which supports start_time and end_time
2- Reduced number of debug messages being printed

Overall this reduces slightly the speed of the process, but it should make it more stable as the timings are now all correctly being accounted for.
2025-05-31 02:15:13 +08:00
Antiklesys
2105dbc379
Update iclass.c
Clarified what tear success means

Signed-off-by: Antiklesys <syselkitna@gmail.com>
2025-05-30 13:05:25 +08:00
Antiklesys
c32f655023 Improved hf iclass tear erase phase readability
Improved readability of erase phase during iclass tear (client and arm side).
It is redundant to see a list of FF during the erase phase (which can be pretty lengthy), so it will only show it once when all bits are FF and then will resume printing the moment bits start changing again post erase phase.
2025-05-30 13:00:35 +08:00
Antiklesys
04cfe2a43e Modified iclass recover operations
1- Renamed legreclookup to legbrute to be in line with the command name
2- Updated estimate values with speed increase gains
3- Improved some if statements readability in iclass.c and added start_time = eof_time + DELAY_ICLASS_VICC_TO_VCD_READER; to increase speed by ~8% (1.86 loops per second to 2.01 loops per second = ~560 more loops per hour).

Tried disabling some arm communications/comments but the speed increase was negligible (~1 sec / 1000 updates).
2025-05-30 12:36:42 +08:00
iceman1001
804acfbefa the device side of iclass tear off is implemented. The base was done by @antiklesys. This version differs by the concept of trying to stabilize weak bits by performing a write operation in conjuction with the detected tear. Its untested but I can replicate most of the tears we performed client side. You will need to call the proxmark3 client with -f , ./pm3 -f to force flush out text which is needed for the inplace printing. I thought this was done automatically but it wasnt. hf iclass tear --arm + all the normal params to run on device side 2025-05-30 01:37:13 +02:00
iceman1001
74f1936132 convert to our calloc instead since we prefer to know allocated shared memory is empty. Also removed a malloc(1) which is just a waste of bytes just like @NVX said a year ago at DefCon 2025-05-25 09:55:32 +02:00
iceman1001
875b3c44b4 unify text - step 1 2025-03-25 10:12:16 +01:00
Philippe Teuwen
dc1cab14ef cppcheck redundantAssignment 2025-03-24 21:41:31 +01:00
iceman1001
3a3ea75d12 style 2024-11-15 14:28:14 +01:00
Antiklesys
0b7d76d7cd Fixed keygen bug in legrec
Fixed legrec bug that was generating blank keys after misalignment in commit: 110dfab668
2024-11-07 19:20:50 +08:00
Antiklesys
110dfab668 Improved algorithm for hf iclass legrec
Improved algorithm for hf iclass legrec by taking in account the hash0 limitations for the ending bits distributions of each key bite, thus reducing the key entropy and number of required tries from 2^24 to almost 2^19
2024-11-06 16:52:48 +08:00
iceman1001
b3285cce8a style 2024-11-02 15:13:40 +01:00
Antiklesys
88364f6a48
Update iclass.c
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2024-10-20 11:18:50 +08:00
Antiklesys
d6f8f9db4a Updated hf iclass legrec arm side and added custom key to dictionary
Updated hf iclass legrec arm functionality
Added new custom standard key to the repository

Todo: Improve keygen algorithm efficiency
2024-10-20 11:16:46 +08:00
iceman1001
618451048e allow for a reply to be sent when simulating iclass 2024-09-13 13:38:25 +02:00
iceman1001
9c181dd83d step one of bounds checking all responses when receiving ISO14443A frames... because @doegox find a missbehaving IC clone..... 2024-09-05 17:52:10 +02:00
Antiklesys
f9970a3048 Update iclass.c
Improved error logging to better understand what's happening
2024-09-02 17:53:22 +08:00
iceman1001
4de7b7d6b9 style 2024-07-21 16:19:21 +02:00
Antiklesys
f8fbcc2754 Bugfixes and code improvements for hf iclass legrec
1- Inlined functions related to hf iclass legrec within util.c for marginal performance gains.
2- Fixed bug preventing errors to be displayed properly and the process from interrupting on an error or on completion.
3- Fixed code indentation of the while loop in iclass.c
4- Fixed bug in the while cycle (was missing index++)
5- Improved ways to display hex results by using dbhexdump
2024-07-21 13:55:17 +08:00
Antiklesys
7a37ec2655 Update iclass.c 2024-07-20 01:45:53 +08:00
Antiklesys
66b030290a Update iclass.c
Changed more variables to lowercase
2024-07-19 18:42:37 +08:00
Antiklesys
27cbdd3031 Update on variables and comments
Added missing definition of picopass block size in util.c
Changed some variables to full lowercase
Added comment explanation on correlation between macs and decimal values
2024-07-19 18:34:36 +08:00
Antiklesys
a127a38cb6 Updated some as per iceman's comments
Made multiple changes as per iceman's comments.
Removed redundant/unused function i forgot into cmdhficlass.c
Moved conversion functions in util.c for now but haven't yet check if it's possible to reuse the current fuctions already there. Will do that in a moment.
2024-07-19 18:27:36 +08:00
Antiklesys
1832997ccb Iclass Legacy Raw Key Recovery Function
Based on the work described in Dismantling iClass whitepaper.
hf iclass legbrute is tested working
hf iclass legrec is partially working: logic of operations and sequence seems to be in order and was tested on simulated data to be effective. The privilege escalation part is still not successful, but the logic should be correct.
2024-07-19 14:47:13 +08:00
iceman1001
2981dd94f7 had to keep track if the field is on or off on deviceside for 14b raw.\nAdded picopass ISO14443-B anticollision. It allows us to send raw packages over 14b. 2024-01-16 15:12:16 +01:00
nvx
7b0ca43695 Fix iClass dump truncating the AA2 area and improve dump reliability by fixing cmd retry delays. 2023-11-26 19:04:54 +10:00
iceman1001
4986959706 fix logic for epurse updates 2023-10-09 15:48:01 +02:00
iceman1001
7b3e84c0d6 better fix for the PAGEMAP issue 2023-10-09 15:14:53 +02:00
iceman1001
d41f0c394e hf iclass wrbl - the pagemap bit maps isnt the best to handle all four cases. This atleast fixes one issue with them 2023-10-09 15:04:49 +02:00
nvx
186308cb4a Add hf iclass creditepurse command to allow crediting the epurse debit value. 2023-09-10 23:00:23 +10:00
Philippe Teuwen
8ac8e3d7d0 reduce variable scopes 2023-01-15 02:23:19 +01:00