我将尝试使用以下Python脚本,使用基于PC的SIM卡读取器来重现USIM身份验证过程(不是我必须使用该脚本,但我没有找到其他脚本):https://osmocom.org/projects/osmo-sim-auth >
我的卡SIM卡读卡器正常运行并被检测到:
$ pcsc_scan
PC/SC device scanner
V 1.5.2 (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau@free.fr>
Using reader plug'n play mechanism
Scanning present readers...
0: Gemalto Prox Dual USB PC Link Reader [Prox-DU Contactless_13101538] 00 00
1: Gemalto Prox Dual USB PC Link Reader [Prox-DU Contact_13101538] 01 00
Thu Oct 18 08:51:09 2018
Reader 0: Gemalto Prox Dual USB PC Link Reader [Prox-DU Contactless_13101538] 00 00
Card state: Card removed,
Reader 1: Gemalto Prox Dual USB PC Link Reader [Prox-DU Contact_13101538] 01 00
Card state: Card inserted,
ATR: 3B 9F 96 80 3F C6 A0 80 31 E0 73 F6 21 16 57 4A 4D 02 0B 34 54 63 69
ATR: 3B 9F 96 80 3F C6 A0 80 31 E0 73 F6 21 16 57 4A 4D 02 0B 34 54 63 69
+ TS = 3B --> Direct Convention
...
pcscd服务正在运行:
systemctl status pcscd
● pcscd.service - PC/SC Smart Card Daemon
Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; v
Active: active (running) since Thu 2018-10-18 08:57:02 CEST; 1
Docs: man:pcscd(8)
Main PID: 23039 (pcscd)
Tasks: 6 (limit: 4915)
CGroup: /system.slice/pcscd.service
└─23039 /usr/sbin/pcscd --foreground --auto-exit
但是,然后我运行osmo-sim-auth.py
脚本,出现以下错误:
./osmo-sim-auth.py -r 00000000000000000000000000000000 -s
Testing SIM card with IMSI None
GSM Authentication
Traceback (most recent call last):
File "./osmo-sim-auth.py", line 125, in <module>
handle_sim(options, rand_bin)
File "./osmo-sim-auth.py", line 75, in handle_sim
print "SRES:\t%s" % b2a_hex(byteToString(ret[0]))
TypeError: 'NoneType' object has no attribute '__getitem__'
知道我在做什么错吗?
答案 0 :(得分:1)
如果没有GSM的AUC / HLR中生成的RAND值,则无法读取您尝试的信息。 GSM网络使用质询-响应机制对SIM进行身份验证。
对于GSM,您需要RAND值;对于UMTS,Ki,A3和A8算法类型,您需要RAND / AUTN值。
答案 1 :(得分:0)
您的命令用于GSM卡,如果尝试使用UMTS,则必须添加-a