presentation
softSIM is a collection of tools to play with the SIM application (in the SIM card or elsewhere).
It uses bluetooth profile SIM Access Profile as abstraction layer to access the SIM (but no bluetooth is required).
The final purpose is to provide a virtual SIM, simulated in software.
requirements
All the scripts are written in ruby :
sudo apt-get install ruby
To use all tools, additionnal libraries and gems are required :
sudo apt-get install rubygems ruby-dev gem source -a http://rubygems.org sudo apt-get install libdbus-ruby sudo gem install serialport sudo apt-get install pcscd libpcsclite1 libpcsclite-dev libruby sudo gem install smartcard sudo apt-get install libxml-ruby
detailed information is in README
to get the code :
git clone git://git.osmocom.org/softsim.git
tools
SAP
SAP is useful as it provides a easy common way to talk to the SIM, not restricted to any device (as PCSC is).
The SAP methods are implemented in sap/common.rb. Client and Server are also provided in sap/client.rb and sap/server.rb. The client is ready to use, with the connect,atr,apdu,disconnect methods. A tool to connect to BTSAP servers is also provided (some phones offer this profile).
You have to tell the Server how to communicate with the SIM. 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).
To test it, use demo_client.rb and demo_server.rb.
SIM information
info_client.rb retrieves and displays information stored in the SIM (IMSI,MSISDM, OFM,Kc,...).
You can run it using demo_client.rb
SIM copy
copy_client.rb copies all the files (not only GSM related) from the SIM into a XML file. This file can then be used by the SIMOS server to do softSIM.
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.
Copying a card takes > 5min. Sometimes the copy hangs (the APDU traffic is blocked). I don't know the origin of this problem (smartcard gem, pcscd, reader, card, ???). Just wait ~30s and it will continue.
bugs & more
Please contact the author if any bug is discovered.

