Skip to content

Commit

Permalink
更新博文:安卓使用 PN532 读写 NFC:一些提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Lord authored Feb 9, 2024
1 parent 75402cc commit 5bc9e9b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions _posts/2023-07-10-安卓使用PN532读写NFC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tags: [网络安全, NFC, PN532]
title: 安卓使用 PN532 读写 NFC
slug: android-pn532-nfc
last_modified_at: 2023-7-11
last_modified_at: 2024-2-9
---

## 动机
Expand Down Expand Up @@ -88,10 +88,12 @@ ISO/IEC 14443A (106 kbps) target:

### nfc-mfclassic

PN532放在卡片上,执行,若输出类似下图则完全无加密,可以直接读写。
PN532放在卡片上,执行,若输出类似下图则完全无加密,可以直接读写。如果卡片有加密,则需要在原有命令末尾再指定一个存有密钥的`.mfd`文件。

详细命令行参数请参考 [nfc-mfclassic(1) - Arch manual pages](https://man.archlinux.org/man/nfc-mfclassic.1.en)

```console
$ nfc-mfclassic r a u dump.mfd
$ nfc-mfclassic r a u dump.mfd # `a`指使用密钥A,`u`指使用默认UID
NFC reader: user defined device opened
Found MIFARE Classic card:
ISO/IEC 14443A (106 kbps) target:
Expand All @@ -104,7 +106,7 @@ Reading out 64 blocks |.........................................................
Done, 64 of 64 blocks read.
Writing data to file: dump.mfd ...Done.

$ nfc-mfclassic W a u dump.mfd # 相比w,W会写入0扇区
$ nfc-mfclassic W a u dump.mfd # 相比w,W会写入0扇区0块
NFC reader: user defined device opened
Found MIFARE Classic card:
ISO/IEC 14443A (106 kbps) target:
Expand Down Expand Up @@ -210,6 +212,8 @@ Arch: `yay -S mfterm`

Termux: 自行编译,`wget https://github.com/4ZM/mfterm/releases/download/v1.0.7/mfterm-1.0.7.tar.gz && tar xvf mfterm-1.0.7.tar.gz && cd mfterm-1.0.7/ && ./configure --prefix=$PREFIX "CFLAGS=-Wno-error" && make && make install`

注意这里的`write unlocked`不一定能写入0扇区0块,此时可以尝试使用`nfc-mfclassic W`

### mfdread

Python脚本,用于查看`.mfd`转储。
Expand Down

0 comments on commit 5bc9e9b

Please sign in to comment.