flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

Legic Prime support

Open Builderhummel opened this issue 2 years ago • 18 comments

Description of the feature you're suggesting.

Legic Prime is a standard similar to Mifare and it is common in europe.

It would be helpful to be able to read and emulate the legic prime cards just like mifare.

(The algorithm is also available in the Proxmark3 source code, like the Mifare one)

Anything else?

The flipper project is really interesting. Legic Prime support would make it a lot more practical.

Builderhummel avatar Aug 31 '22 08:08 Builderhummel

Legic Prime is really common here in europe. There is a big market for cheap access systems and the fact that it is totally reversed (broken) does not mean security consultants don't recommend it anymore. This would be a great addition for the flipper :+1: .

I am not sure but seems like the hardware should be capable of it. For reference see the implementation of proxmark3 like @Builderhummel mentioned:

https://github.com/Proxmark/proxmark3/blob/master/client/cmdhflegic.c

and its implementations:

https://github.com/Proxmark/proxmark3/blob/master/armsrc/legicrf.c https://github.com/Proxmark/proxmark3/blob/master/common/legic_prng.c

david-bla avatar Sep 01 '22 16:09 david-bla

can't really help on the implementing front here but i have the hardware to test it, just ping me up

BuckarooBanzay avatar Sep 01 '22 17:09 BuckarooBanzay

We'll come back to this after RFID rewriting in C

skotopes avatar Sep 06 '22 17:09 skotopes

@skotopes Thanks. The Frequency tag is wrong tho, since Legic Prime uses 13,56 MHz.

Builderhummel avatar Sep 12 '22 08:09 Builderhummel

Worth noting that the Proxmark sources use its built-in FPGA, so adapting the code is going to be challenging.

Here is a talk about how the Legic protocol was reversed: https://fahrplan.events.ccc.de/congress/2009/Fahrplan/events/3709.en.html The linked slides have a lot of detail.

panki27 avatar Sep 30 '22 10:09 panki27

@skotopes is there any progress?

Tetris81 avatar Feb 05 '23 10:02 Tetris81

@DrZlo13 wanna take a look?

skotopes avatar Feb 05 '23 10:02 skotopes

@skotopes is there any progress?

Can you attach RFID RAW records here?

skotopes avatar Feb 05 '23 10:02 skotopes

@skotopes i have one but is my work card But I found a patch for LegicPrime on the site, maybe that will help:

https://itooktheredpill.irgendwo.org/2010/mensakarte-entschluesselt/ https://itooktheredpill.irgendwo.org/2010/legic-karten-beschreiben/ "Den eigentlichen Patch gibt es hier: legicfastreader.diff"

legicfastreader.diff legicfastreader.diff.txt

I don't know anything about programming but it looks like c+

Tetris81 avatar Feb 05 '23 11:02 Tetris81

We still need some keys or records. Is there any place where we can order it online?

skotopes avatar Feb 05 '23 13:02 skotopes

@skotopes One of their obscurity strategies is afaik to (almost) only sell B2B. But after some searching, I found this shop in the UK that doesn't require you to request a quote: https://www.windmill-computing.com/products/view-one/pn/BDG-ISO-LEGIC-P1024/page/smart-cards

panki27 avatar Feb 06 '23 08:02 panki27

@panki27 @Astrrra will research this protocol when she get time

skotopes avatar Feb 06 '23 11:02 skotopes

HI! Support for Legic Prime is technically possible for us, we will implement it in the future.

Astrrra avatar Mar 07 '23 18:03 Astrrra

@Astrrra I suspect I have some legic cards and I did a raw read from rfid menu. Lmk if the files can be of help. Ability to read/emulate those would be awesome.

achtnullzwei avatar Apr 03 '23 12:04 achtnullzwei

Hi! It looks like this FR belongs to this forum post: https://forum.flipperzero.one/t/legic-prime/14159 Right?

parsley avatar Jun 19 '23 07:06 parsley

Legic Prime is technically all about timing, there are good resources about problems with timing and their solutions while emulating tags on the proxmark forum and their source. The tag raw values are "encrypted" with a XOR value also present on each card. Most importantly they use custom non-standard crc8 and crc16 generators to validate values present on the card which need to be calculated on the fly if emulating cards.

Also here the proxmark forum is a very good source of knowledge for prime tags.. Raw support for Legic Prime tags would be really awesome, where one could build an app upon :)

devBioS avatar Nov 05 '23 19:11 devBioS

Hey @gornekich @skotopes any updates?

Boringsapiens avatar Apr 15 '24 10:04 Boringsapiens

Not really

skotopes avatar Apr 26 '24 08:04 skotopes