SoftSIM » History » Version 5
Anonymous, 02/19/2016 10:49 PM
1 | 1 | tsaitgaist | == presentation == |
---|---|---|---|
2 | |||
3 | softSIM is a collection of tools to play with the SIM application (in the SIM card or elsewhere). |
||
4 | |||
5 | It uses [http://bluetooth.org/ bluetooth] [https://www.bluetooth.org/Technical/Specifications/adopted.htm profile] [https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=158740 SIM Access Profile] as abstraction layer to access the SIM (but no bluetooth is required). |
||
6 | |||
7 | The final purpose is to provide a virtual SIM, simulated in software. |
||
8 | |||
9 | == requirements == |
||
10 | |||
11 | All the scripts are written in ruby : |
||
12 | {{{ |
||
13 | sudo apt-get install ruby |
||
14 | }}} |
||
15 | To use all tools, additionnal libraries and gems are required : |
||
16 | {{{ |
||
17 | 4 | tsaitgaist | sudo apt-get install rubygems ruby-dev libdbus-ruby libserialport-ruby pcscd libpcsclite1 libpcsclite-dev libruby libxml-ruby |
18 | 1 | tsaitgaist | sudo gem install smartcard |
19 | }}} |
||
20 | detailed information is in README |
||
21 | |||
22 | to get the code : |
||
23 | {{{ |
||
24 | git clone git://git.osmocom.org/softsim.git |
||
25 | }}} |
||
26 | |||
27 | == tools == |
||
28 | |||
29 | 2 | tsaitgaist | === SAP === |
30 | |||
31 | 1 | tsaitgaist | SAP is useful as it provides a easy common way to talk to the SIM, not restricted to any device (as PCSC is). |
32 | |||
33 | 2 | tsaitgaist | The SAP methods are implemented in {{{sap/common.rb}}}. Client and Server are also provided in {{{sap/client.rb}}} and {{{sap/server.rb}}}. |
34 | 1 | tsaitgaist | The client is ready to use, with the {{{connect,atr,apdu,disconnect}}} methods. |
35 | A tool to connect to BTSAP servers is also provided (some phones offer this profile). |
||
36 | |||
37 | You have to tell the Server how to communicate with the SIM. |
||
38 | 3 | tsaitgaist | Two implementations are provided : {{{pcsc_server.rb}}} uses as normal card reader (PCSC), and {{{simos_server.rb}}} which is the software SIM (a SIMOS is partially implemented, the SIM files have to be provided). |
39 | 1 | tsaitgaist | |
40 | To test it, use {{{demo_client.rb}}} and {{{demo_server.rb}}}. |
||
41 | 2 | tsaitgaist | |
42 | === SIM information === |
||
43 | |||
44 | {{{info_client.rb}}} retrieves and displays information stored in the SIM (IMSI,MSISDM,[http://www.mirider.com/weblog/2010/08/03/#20100803-ciphering_indicator OFM],Kc,...). |
||
45 | |||
46 | 1 | tsaitgaist | You can run it using {{{demo_client.rb}}} |
47 | 3 | tsaitgaist | |
48 | === SIM copy === |
||
49 | |||
50 | {{{copy_client.rb}}} copies all the files (not only GSM related) from the SIM into a XML file. |
||
51 | This file can then be used by the SIMOS server to do softSIM. |
||
52 | |||
53 | There are limitations to the copy. |
||
54 | Only the body of the files with access condition ALWAYS or CHV1 can be read, otherwise only the header is saved. |
||
55 | Ki (the secret key used for authentication and encryption) can not be extracted (SIM cards can not be cloned). |
||
56 | Only some A38 triplets are saved. |
||
57 | |||
58 | Copying a card takes > 5min. |
||
59 | Sometimes the copy hangs (the APDU traffic is blocked). |
||
60 | I don't know the origin of this problem (smartcard gem, pcscd, reader, card, ???). |
||
61 | Just wait ~30s and it will continue. |
||
62 | |||
63 | == bugs & more == |
||
64 | 1 | tsaitgaist | |
65 | Please contact the author if any bug is discovered. |