Project

General

Profile

A5 GSM AT tricks » History » Version 6

laforge, 02/19/2016 10:48 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
4 6 laforge
h1. Phone support: =
5
 Good ==
6
* *iPhone*: Works. Tried with minicom on /dev/tty.debug while ssh'd on the phone. (needs Jailbreak to get SSH access)
7 1 tnt
8 6 laforge
9
h2. Bad
10
11
* *!OpenMoko*: Apparently the TI calypso prevents the submission of APDU class 0xA4 (GSM).
12
13 1 tnt
NOTE: This depends on the firmware. There are firmware versions that explicitly do not have the APDU class check!
14
15
16 6 laforge
h1. Commands
17 1 tnt
18 6 laforge
19
20
h2. Run GSM algorithm
21
22
23 1 tnt
Commands:
24 6 laforge
<pre>
25 1 tnt
AT+CSIM=14,"A0A40000027F20"
26
AT+CSIM=42,"A088000010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
27 6 laforge
</pre>
28 1 tnt
29 6 laforge
_The 16 0xff are the RAND_
30 1 tnt
31
Sample run:
32
33 6 laforge
<pre>
34 1 tnt
AT+CSIM=14,"A0A40000027F20"
35
+CSIM: 48,"000010247F20020000000000091100160800838A838A9000"
36
37
OK
38
AT+CSIM=42,"A088000010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
39
+CSIM: 28,"A5975E88E0940FC09AEFA0009000"
40
41
OK
42 6 laforge
</pre>
43 1 tnt
44
In the respond command response, you find:
45 6 laforge
* *sres*: A5 97 5E 88
46
* *Kc*: E0 94 0F C0 9A EF A0 00
47 1 tnt
48 2 tnt
49
50 6 laforge
h2. Read EF files from the SIM
51
52
53 1 tnt
Some interesting parameters are saved on the SIM by the ME (for later use in case of reboot or something I guess).
54
55
56 6 laforge
h3. Kc _0x6F20_
57
58
59 1 tnt
Commands:
60 6 laforge
<pre>
61 1 tnt
AT+CSIM=14,"A0A40000026F20"
62
AT+CSIM=10,"A0B0000009"
63 6 laforge
</pre>
64 1 tnt
65
Sample run:
66 6 laforge
<pre>
67 1 tnt
AT+CSIM=14,"A0A40000026F20"
68
+CSIM: 34,"000000096F2004001100BB010200009000"
69
70
OK
71
AT+CSIM=10,"A0B0000009"
72
+CSIM: 22,"E0940FC09AEFA000009000"
73
74
OK
75 6 laforge
</pre>
76 1 tnt
77
Again, you find the last Kc used here: E0 94 0F C0 9A EF A0 00
78
and also the key sequence number: 00
79
80
81
82 6 laforge
h3. IMSI _0x6F07_
83
84
85 1 tnt
Commands:
86 6 laforge
<pre>
87 1 tnt
AT+CSIM=14,"A0A40000026F07"
88
AT+CSIM=10,"A0B0000009"
89 6 laforge
</pre>
90 1 tnt
91
Sample run:
92 6 laforge
<pre>
93 1 tnt
/* FIXME: Do one */
94 6 laforge
</pre>
95 3 ipse
96
IMSI can be also read by another command:
97 6 laforge
<pre>
98 3 ipse
AT+CIMI
99 6 laforge
</pre>
100 3 ipse
101
Sample run:
102 6 laforge
<pre>
103 3 ipse
AT+CIMI
104
250997001138203
105
106
OK
107 6 laforge
</pre>
108 1 tnt
109
110 6 laforge
h3. LOCI _0x6F7E_
111
112
113 2 tnt
LOCI can be decomposed in:
114 6 laforge
* TMSI![0:3]
115
* LAI![4:8]
116
* TMSI Time!r9
117
* status!r10
118 1 tnt
119
Commands:
120 6 laforge
<pre>
121 1 tnt
AT+CSIM=14,"A0A40000026F7E"
122
AT+CSIM=10,"A0B000000B"
123 6 laforge
</pre>
124 1 tnt
125
Sample run:
126 6 laforge
<pre>
127 1 tnt
/* FIXME: Do one */
128 6 laforge
</pre>
Add picture from clipboard (Maximum size: 48.8 MB)