Project

General

Profile

Wiki » History » Version 7

iamdielenram, 10/31/2018 05:04 PM

1 1 zecke2
Dieter Spaar has modified the shadysim.py to support the configured OTA mode on the sysmoUSIM-SJS1 (and by extension the SIM Cards issued at 31C3, the following camp and 32C3).
2 1 zecke2
3 1 zecke2
4 6 zecke2
h2. What is it about
5 6 zecke2
6 6 zecke2
7 1 zecke2
(U)SIM cards are Java capable and there is the Globalplatform that specifies standards API. SMS can
8 1 zecke2
be addressed directly to the SIM card, the SIM card will get events for network selection and others, it
9 1 zecke2
can modify call establishment attempts.
10 1 zecke2
11 1 zecke2
The following will show how to build the example applet and install it on your USIM. If you create plugins
12 1 zecke2
please make them available as Free Software  and point us to them. If you find interesting Globalplatform
13 1 zecke2
APIs or hacks please talk about it.
14 1 zecke2
15 1 zecke2
16 6 zecke2
h2. What you will need
17 6 zecke2
18 6 zecke2
19 1 zecke2
* sysmoUSIM-SJS1 card
20 1 zecke2
* KIC, KID private keys of the card
21 1 zecke2
* PCSC, serial card reader or be able to send SMS to the SIM card
22 1 zecke2
* JDK to create Java1.1 bytecode to create/customize SIM Toolkit applets.
23 1 zecke2
24 1 zecke2
25 6 zecke2
h2. What you can read
26 6 zecke2
27 6 zecke2
28 6 zecke2
* [[JavaCard]] API specification (http://www.andresteder.com/static/api/simtoolkitapi/sim/toolkit/package-summary.html)
29 1 zecke2
* 3GPP sim.toolkit API (http://www.etsi.org/deliver/etsi_ts/101400_101499/101476/07.00.00_60/ts_101476v070000p.pdf). Specially setEvent is a good keyword to look at!
30 5 zecke2
31 1 zecke2
32 6 zecke2
h2. Building an example applet
33 6 zecke2
34 6 zecke2
35 6 zecke2
<pre>
36 1 zecke2
git clone git://git.osmocom.org/sim/sim-tools/
37 1 zecke2
git clone git://git.osmocom.org/sim/hello-stk
38 1 zecke2
cd hello-stk
39 1 zecke2
make
40 1 zecke2
ls -la ./build/javacard/org/toorcamp/HelloSTK/javacard/HelloSTK.cap
41 6 zecke2
</pre>
42 1 zecke2
43 1 zecke2
If you have a javac in your system you have now built an example Helloworld applet.
44 1 zecke2
45 7 iamdielenram
h2. More applets
46 7 iamdielenram
47 7 iamdielenram
Follow the same steps as building the Helloworld applet.
48 7 iamdielenram
49 7 iamdielenram
h3. SMS I'm alive
50 7 iamdielenram
51 7 iamdielenram
Applet to deliver an SMS the very first time the SIM registers in the GSM/GPRS network
52 7 iamdielenram
<pre>
53 7 iamdielenram
git clone https://github.com/PodgroupConnectivity/sim-applet-sms-im-alive.git
54 7 iamdielenram
</pre>
55 7 iamdielenram
56 7 iamdielenram
h3. APN autoconfiguration
57 7 iamdielenram
58 7 iamdielenram
Applet to configure a PDP Context with a correct APN via RUN AT proactive command
59 7 iamdielenram
<pre>
60 7 iamdielenram
git clone https://github.com/PodgroupConnectivity/sim-applet-apn-autoconf.git
61 7 iamdielenram
</pre>
62 7 iamdielenram
63 7 iamdielenram
h3. Data heartbeat
64 7 iamdielenram
65 7 iamdielenram
Applet to monitor the status of data connectivity over-the-air
66 7 iamdielenram
<pre>
67 7 iamdielenram
git clone https://github.com/PodgroupConnectivity/sim-applet-data-heartbeat.git
68 7 iamdielenram
</pre>
69 7 iamdielenram
70 1 zecke2
71 6 zecke2
h2. Working with a PC/SC reader
72 6 zecke2
73 6 zecke2
74 1 zecke2
Make sure you have the KIC1, KIC2, KIC3 and KID1, KID2 and KID3 for your card. If you have a
75 1 zecke2
CCC Event card from 31C3 or later you should be set and for the sysmoUSIM-SJS1 be sure to buy
76 1 zecke2
the option that includes the ADM1 keys as otherwise no OTA keys will be provided to you (you will
77 1 zecke2
have to buy a new batch of cards then).
78 1 zecke2
79 6 zecke2
<pre>
80 4 zecke2
#Clone if you have not done the above
81 1 zecke2
git clone git://git.osmocom.org/sim/sim-tools/
82 1 zecke2
cd sim-tools/shady-sim
83 3 zecke2
84 2 zecke2
# Load the applet
85 6 zecke2
python shadysim.py --pcsc -l [[HelloSTK]].cap -i [[HelloSTK]].cap \
86 2 zecke2
          --enable-sim-toolkit --module-aid d07002ca44900101 \
87 1 zecke2
          --instance-aid d07002CA44900101 \
88 2 zecke2
          --nonvolatile-memory-required 0100 \ 
89 1 zecke2
          --volatile-memory-for-install 0100 \
90 1 zecke2
          --max-menu-entry-text 15 \
91 1 zecke2
          --max-menu-entries 05 --kic KIC1 \
92 2 zecke2
          --kid KID1
93 2 zecke2
94 1 zecke2
# Delete it (it takes time)
95 1 zecke2
python shadysim.py --pcsc -d d07002CA449001 \
96 1 zecke2
          --kic KIC1 \
97 3 zecke2
          --kid KID1
98 6 zecke2
</pre>
99 1 zecke2
100 1 zecke2
101 6 zecke2
102 6 zecke2
h2. Working with a SMPP reader
103 6 zecke2
104 5 zecke2
105 5 zecke2
Instead of directly interacting with the SIM through a PCSC reader the APDU is sent through SMPP. Replace
106 5 zecke2
the --pcsc call with --smpp and lines starting with SMPP are printed. These then need to be sent.
Add picture from clipboard (Maximum size: 48.8 MB)