Project

General

Profile

A5 GSM AT tricks » History » Version 5

laforge, 02/19/2016 10:47 PM
openmoko gsm apdu depends on firmware version

1 1 tnt
Some cellphones allow to access the SIM through AT commands which can be very useful to interrogate the SIM _while_ on the network, or if you don't have a SIM reader handy. Most of the time you need two commands, the first one selecting the proper directory or file on the SIM, then the second executing the command or doing the read.
2
3
= Phone support: =
4
== Good ==
5 4 tnt
 * '''iPhone''': Works. Tried with minicom on /dev/tty.debug while ssh'd on the phone. (needs Jailbreak to get SSH access)
6 1 tnt
7
== Bad ==
8 2 tnt
 * '''!OpenMoko''': Apparently the TI calypso prevents the submission of APDU class 0xA4 (GSM).
9 1 tnt
10 5 laforge
NOTE: This depends on the firmware. There are firmware versions that explicitly do not have the APDU class check!
11
12 1 tnt
= Commands =
13
14
== Run GSM algorithm ==
15
16
Commands:
17
{{{
18
AT+CSIM=14,"A0A40000027F20"
19
AT+CSIM=42,"A088000010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
20
}}}
21
22
''The 16 0xff are the RAND''
23
24
Sample run:
25
26
{{{
27
AT+CSIM=14,"A0A40000027F20"
28
+CSIM: 48,"000010247F20020000000000091100160800838A838A9000"
29
30
OK
31
AT+CSIM=42,"A088000010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
32
+CSIM: 28,"A5975E88E0940FC09AEFA0009000"
33
34
OK
35
}}}
36
37
In the respond command response, you find:
38 2 tnt
 * '''sres''': A5 97 5E 88
39
 * '''Kc''': E0 94 0F C0 9A EF A0 00
40 1 tnt
41
42
== Read EF files from the SIM ==
43
44
Some interesting parameters are saved on the SIM by the ME (for later use in case of reboot or something I guess).
45
46
=== Kc ''0x6F20'' ===
47
48
Commands:
49
{{{
50
AT+CSIM=14,"A0A40000026F20"
51
AT+CSIM=10,"A0B0000009"
52
}}}
53
54
Sample run:
55
{{{
56
AT+CSIM=14,"A0A40000026F20"
57
+CSIM: 34,"000000096F2004001100BB010200009000"
58
59
OK
60
AT+CSIM=10,"A0B0000009"
61
+CSIM: 22,"E0940FC09AEFA000009000"
62
63
OK
64
}}}
65
66
Again, you find the last Kc used here: E0 94 0F C0 9A EF A0 00
67
and also the key sequence number: 00
68
69
70
=== IMSI ''0x6F07'' ===
71
72
Commands:
73
{{{
74
AT+CSIM=14,"A0A40000026F07"
75
AT+CSIM=10,"A0B0000009"
76
}}}
77
78
Sample run:
79
{{{
80
/* FIXME: Do one */
81
}}}
82
83 3 ipse
IMSI can be also read by another command:
84
{{{
85
AT+CIMI
86
}}}
87
88
Sample run:
89
{{{
90
AT+CIMI
91
250997001138203
92
93
OK
94
}}}
95 1 tnt
96
=== LOCI ''0x6F7E'' ===
97
98
LOCI can be decomposed in:
99 2 tnt
 * TMSI![0:3]
100
 * LAI![4:8]
101
 * TMSI Time![9]
102
 * status![10]
103 1 tnt
104
Commands:
105
{{{
106
AT+CSIM=14,"A0A40000026F7E"
107
AT+CSIM=10,"A0B000000B"
108
}}}
109
110
Sample run:
111
{{{
112
/* FIXME: Do one */
113
}}}
Add picture from clipboard (Maximum size: 48.8 MB)