Skip to content

Instantly share code, notes, and snippets.

@aidswidjaja
Last active July 1, 2022 05:57
Show Gist options
  • Save aidswidjaja/0ec36ea565b9226219852d15ffec9f3e to your computer and use it in GitHub Desktop.
Save aidswidjaja/0ec36ea565b9226219852d15ffec9f3e to your computer and use it in GitHub Desktop.
Opal card hacking

Aim: Dump contents of school Opal card, transfer to school ID card and use school ID card to tap on at stations.

Resources

Background

School opal card

NXP MIFARE Ultralight C (MF0ICU2) SAK: 0x00

NOTE: The whole MIFARE Ultralight family uses the same ATQA and SAK.

Block diagram

+------------------------------------------------------------------------------------+
|       +--------------------------------------------------------------------------+ |
|       | +----------------++---------------------------------------+ +----------+ | |
|       | |                ||         DIGITAL CONTROL UNIT          | |          | | |
|       | |                || +---------------------+ +-----------+ | |          | | |
|       | |                || | CRYPTO CO PROCESSOR | |           | | |          | | |
|       | |                || |                     | |           | | |          | | |
|       | |                || +---------------------+ |           | | |          | | |
| #-----+ |                ||                         |           | | |          | | |
| #     | |                || +---------------------+ |           | | |          | | |
| # ANT.| |  RF-INTERFACE  || | CRYPTO CONTROL UNIT | | EEPROM    | | |  EEPROM  | | |
| #     | |                || |                     | | INTERFACE | | |          | | |
| #-----+ |                || +---------------------+ |           | | |          | | |
|       | |                ||                         |           | | |          | | |
|       | |                || +---------------------+ |           | | |          | | |
|       | |                || | COMMAND INTERPRETER | |           | | |          | | |
|       | |                || |                     | |           | | |          | | |
|       | |                || +---------------------+ +-----------+ | |          | | |
|       | +----------------++---------------------------------------+ +----------+ | |
|       +--------------------------------------------------------------------------+ |
+------------------------------------------------------------------------------------+

Memory structure

[00]  *  04:94:15 0D (UIDO-UID2, BCCO)
[01]  *  2A:6E:65:80 (UID3-UID6) 
[02]  +  A1 48 39 00 (BCC1, INT, LOCKO-LOCK1) 
[03]  *  8A:A8:16:06 (0TPO-0TP3)

      +---------------------------+
04:05 |     Unknown (8 B) [xp]    |
      +---------------------------+
      +---------------------------+
06:0F |     Unknown (36 B) [.p]   |
      +---------------------------+
      +---------------------------+
10:27 |      Data (92 B) [?p]     |
      +---------------------------+
      
[28]  ?p  XX XX -- -- (LOCK2-LOCK3)
[29]  ?p  XX XX -- -- (CNT0-CNT1)
[2A]  ?p  04 -- -- -- (AUTH0)
[2B]  ?p  XX -- -- -- (AUTH1)

      +---------------------------+
2C:2F |     Unknown (16 B) [?P]   |
      +---------------------------+

Key

[x] = locked and blocked
[xp] = blocked and pwd-protected
[.p] = un(b)locked and pwd-protected
[?p] unknown and pwd-protected
[?P] unknown and pwd-protected write-only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment