Project

General

Profile

SoftSIM » History » Version 13

fixeria, 01/21/2019 03:24 AM

1 11 fixeria
h2. softSIM
2 1 tsaitgaist
3 11 fixeria
softSIM is a collection of tools to play with the SIM applications (in the SIM card or elsewhere).
4 1 tsaitgaist
5 11 fixeria
It uses "bluetooth":http://bluetooth.org/ "profile":https://www.bluetooth.org/Technical/Specifications/adopted.htm "SIM Access Profile":https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=158740 as abstraction layer to access the SIM (but no Bluetooth is required).
6 1 tsaitgaist
7 11 fixeria
Possible use cases:
8 1 tsaitgaist
9 11 fixeria
* virtual SIM, simulated in software
10
* remote SIM access, using PC/SC interface
11
* remote SIM access, using a Bluetooth enabled phone as reader
12 1 tsaitgaist
13
14 11 fixeria
h2. Requirements
15 7 tsaitgaist
16 11 fixeria
All the scripts are written in Ruby:
17 1 tsaitgaist
18
<pre>
19 11 fixeria
$ sudo apt-get install ruby
20 1 tsaitgaist
</pre>
21 11 fixeria
22 1 tsaitgaist
To use all tools, additional libraries and gems are required (you might want to use "sudo gem install" if you have ruby smartcard package loading problems):
23
24
<pre>
25 11 fixeria
$ sudo apt-get install rubygems ruby-dev libdbus-ruby pcscd ruby-serialport libpcsclite1 libpcsclite-dev libruby libxml-ruby
26
$ gem install --user-install smartcard
27 9 tsaitgaist
</pre>
28 1 tsaitgaist
29 11 fixeria
detailed information is in README.
30 9 tsaitgaist
31 11 fixeria
h2. Source code
32 9 tsaitgaist
33 11 fixeria
<pre>
34
$ git clone git://git.osmocom.org/softsim.git
35
</pre>
36 1 tsaitgaist
37 11 fixeria
h2. Tools
38 1 tsaitgaist
39 12 fixeria
h3. General description
40 1 tsaitgaist
41 12 fixeria
At the moment, the following tools are available:
42 9 tsaitgaist
43 12 fixeria
* demo_server.rb - (BT)SAP Server implementation. Can either talk to a PC/SC reader, or use a stored dump. Clients can connect either via UNIX socket, or using TCP/IP.
44
* demo_client.rb - (BT)SAP Client demo. Can connect to our demo_server.rb either via UNIX socket, or using TCP/IP. Alternatively can connect to a regular phone (that does support this profile) using Bluetooth. Basically executes a sequence of common APDUs.
45
* apdu_forward.rb - forwards APDUs from a UNIX socket to a (BT)SAP server using TCP/IP.
46 8 tsaitgaist
47 3 tsaitgaist
h3. SIM copy
48
49
<pre>
50
./demo_client.rb -t copy
51
</pre>
52 11 fixeria
53 3 tsaitgaist
This file can then be used by the SIMOS server to do softSIM.
54
55 11 fixeria
There are limitations to the copy. Only the body of the files with access condition ALWAYS or CHV1 can be read, otherwise only the header is saved. Ki (the secret key used for authentication and encryption) *can not be extracted* (SIM cards can not be cloned). Only some A38 triplets are saved.
56 3 tsaitgaist
57 11 fixeria
Copying a card takes > 5min. Sometimes the copy hangs (the APDU traffic is blocked).
58 9 tsaitgaist
I don't know the origin of this problem (smartcard gem, pcscd, reader, card, ???).
59
Just wait ~30s and it will continue.
60
61 13 fixeria
h2. Using with [[OsmocomBB]]
62
63
The [[mobile]] application implements (BT)SAP Client, so it can connect to a (BT)SAP Server and use its SIM card.
64
65
h3. Configuration
66
67
By default, [[mobile]] is configured to use '/tmp/osmocom_sap' as UNIX socket address. This address can be changed in the VTY configuration:
68
69
<pre>
70
ms 1
71
  ...
72
  sap-socket /tmp/osmocom_sap
73
  ...
74
</pre>
75
76
Also, you can configure [[mobile]] to use (BT)SAP client as a SIM card interface at start-up:
77
78
79
<pre>
80
ms 1
81
  ...
82
  sap-socket /tmp/osmocom_sap
83
  sim sap
84
  ...
85
</pre>
86
87 11 fixeria
h2. Bugs & more
88 1 tsaitgaist
89
Please contact the author if any bug is discovered.
Add picture from clipboard (Maximum size: 48.8 MB)