Project

General

Profile

Wiki » History » Version 5

zecke2, 02/19/2016 10:48 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
3
== What is it about ==
4
5
(U)SIM cards are Java capable and there is the Globalplatform that specifies standards API. SMS can
6
be addressed directly to the SIM card, the SIM card will get events for network selection and others, it
7
can modify call establishment attempts.
8
9
The following will show how to build the example applet and install it on your USIM. If you create plugins
10
please make them available as Free Software  and point us to them. If you find interesting Globalplatform
11
APIs or hacks please talk about it.
12
13
== What you will need ==
14
15
* sysmoUSIM-SJS1 card
16
* KIC, KID private keys of the card
17
* PCSC, serial card reader or be able to send SMS to the SIM card
18
* JDK to create Java1.1 bytecode to create/customize SIM Toolkit applets.
19
20 5 zecke2
== What you can read ==
21
22
* JavaCard API specification (http://www.andresteder.com/static/api/simtoolkitapi/sim/toolkit/package-summary.html)
23
* 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!
24
25 1 zecke2
== Building an example applet ==
26
27
{{{
28
git clone git://git.osmocom.org/sim/sim-tools/
29
git clone git://git.osmocom.org/sim/hello-stk
30
cd hello-stk
31
make
32
ls -la ./build/javacard/org/toorcamp/HelloSTK/javacard/HelloSTK.cap
33
}}}
34
35
If you have a javac in your system you have now built an example Helloworld applet.
36
37
== Working with a PC/SC reader ==
38
39
Make sure you have the KIC1, KIC2, KIC3 and KID1, KID2 and KID3 for your card. If you have a
40
CCC Event card from 31C3 or later you should be set and for the sysmoUSIM-SJS1 be sure to buy
41
the option that includes the ADM1 keys as otherwise no OTA keys will be provided to you (you will
42
have to buy a new batch of cards then).
43
44
{{{
45
#Clone if you have not done the above
46
git clone git://git.osmocom.org/sim/sim-tools/
47 4 zecke2
cd sim-tools/shady-sim
48 1 zecke2
49
# Load the applet
50 3 zecke2
python shadysim.py --pcsc -l HelloSTK.cap -i HelloSTK.cap \
51 2 zecke2
          --enable-sim-toolkit --module-aid d07002ca44900101 \
52
          --instance-aid d07002CA44900101 \
53
          --nonvolatile-memory-required 0100 \ 
54
          --volatile-memory-for-install 0100 \
55
          --max-menu-entry-text 15 \
56
          --max-menu-entries 05 --kic KIC1 \
57 1 zecke2
          --kid KID1
58
59
# Delete it (it takes time)
60 3 zecke2
python shadysim.py --pcsc -d d07002CA449001 \
61 2 zecke2
          --kic KIC1 \
62 1 zecke2
          --kid KID1
63
}}}
64 5 zecke2
65
66
== Working with a SMPP reader ==
67
68
Instead of directly interacting with the SIM through a PCSC reader the APDU is sent through SMPP. Replace
69
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)