You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a system stores a monetary balance directly on a MiFare Classic card, you can often manipulate it because Classic uses NXP’s deprecated Crypto1 cipher. Crypto1 has been broken for years, allowing recovery of sector keys and full read/write of card memory with commodity hardware (e.g., Proxmark3).
101
+
102
+
End-to-end workflow (abstracted):
103
+
104
+
1) Dump the original card and recover keys
105
+
106
+
```bash
107
+
# Attempt all built-in Classic key recovery attacks and dump the card
108
+
hf mf autopwn
109
+
```
110
+
111
+
This typically recovers sector keys (A/B) and generates a full-card dump in the client dumps folder.
112
+
113
+
2) Locate and understand the value/integrity fields
114
+
115
+
- Perform legitimate top-ups on the original card and take multiple dumps (before/after).
116
+
- Do a diff of the two dumps to identify the changing blocks/bytes that represent the balance and any integrity fields.
117
+
- Many Classic deployments either use the native "value block" encoding or roll their own checksums (e.g., XOR of the balance with another field and a constant). After changing the balance, recompute the integrity bytes accordingly and ensure all duplicated/complemented fields are consistent.
118
+
119
+
3) Write the modified dump to a writable “Chinese magic” Classic tag
120
+
121
+
```bash
122
+
# Load a modified binary dump onto a UID-changeable Classic tag
123
+
hf mf cload -f modified.bin
124
+
```
125
+
126
+
4) Clone the original UID so terminals recognize the card
127
+
128
+
```bash
129
+
# Set the UID on a UID-changeable tag (gen1a/gen2 magic)
130
+
hf mf csetuid -u <original_uid>
131
+
```
132
+
133
+
5) Use at terminals
134
+
135
+
Readers that trust the on-card balance and the UID will accept the manipulated card. Field observations show many deployments cap balances based on field width (e.g., 16-bit fixed-point).
136
+
137
+
Notes
138
+
139
+
- If the system uses native Classic value blocks, remember the format: value (4B) + ~value (4B) + value (4B) + block address + ~address. All parts must match.
140
+
- For custom formats with simple checksums, differential analysis is the fastest way to derive the integrity function without reversing firmware.
141
+
- Only UID-changeable tags ("Chinese magic" gen1a/gen2) allow writing block 0/UID. Normal Classic cards have read-only UIDs.
-[NFC card vulnerability exploitation in KioSoft Stored Value (SEC Consult)](https://sec-consult.com/vulnerability-lab/advisory/nfc-card-vulnerability-exploitation-leading-to-free-top-up-kiosoft-payment-solution/)
The Proxmark3 allows to perform other actions like **eavesdropping** a **Tag to Reader communication** to try to find sensitive data. In this card you could just sniff the communication with and calculate the used key because the **cryptographic operations used are weak** and knowing the plain and cipher text you can calculate it (`mfkey64` tool).
37
37
38
+
#### MiFare Classic quick workflow for stored-value abuse
39
+
40
+
When terminals store balances on Classic cards, a typical end-to-end flow is:
# Use diffing of before/after top-up dumps to locate fields
48
+
49
+
# 3) Write modified dump to a UID-changeable ("Chinese magic") tag
50
+
proxmark3> hf mf cload -f modified.bin
51
+
52
+
# 4) Clone original UID so readers recognize the card
53
+
proxmark3> hf mf csetuid -u <original_uid>
54
+
```
55
+
56
+
Notes
57
+
58
+
-`hf mf autopwn` orchestrates nested/darkside/HardNested-style attacks, recovers keys, and creates dumps in the client dumps folder.
59
+
- Writing block 0/UID only works on magic gen1a/gen2 cards. Normal Classic cards have read-only UID.
60
+
- Many deployments use Classic "value blocks" or simple checksums. Ensure all duplicated/complemented fields and checksums are consistent after editing.
61
+
62
+
See a higher-level methodology and mitigations in:
63
+
64
+
{{#ref}}
65
+
pentesting-rfid.md
66
+
{{#endref}}
67
+
38
68
### Raw Commands
39
69
40
70
IoT systems sometimes use **nonbranded or noncommercial tags**. In this case, you can use Proxmark3 to send custom **raw commands to the tags**.
@@ -61,7 +91,11 @@ proxmark3> script run mfkeys
61
91
62
92
You can create a script to **fuzz tag readers**, so copying the data of a **valid card** just write a **Lua script** that **randomize** one or more random **bytes** and check if the **reader crashes** with any iteration.
-[NXP statement on MIFARE Classic Crypto1](https://www.mifare.net/en/products/chip-card-ics/mifare-classic/security-statement-on-crypto1-implementations/)
99
+
-[NFC card vulnerability exploitation in KioSoft Stored Value (SEC Consult)](https://sec-consult.com/vulnerability-lab/advisory/nfc-card-vulnerability-exploitation-leading-to-free-top-up-kiosoft-payment-solution/)
0 commit comments