Legacy tools¶
legacy tools are the classic pySim-prog
and pySim-read
programs that
existed long before pySim-shell
.
These days, you should primarily use pySim-shell
instead of these
legacy tools.
pySim-prog¶
pySim-prog
was the first part of the pySim software suite. It started as
a tool to write ICCID, IMSI, MSISDN and Ki to very simplistic SIM cards, and
was later extended to a variety of other cards. As the number of features supported
became no longer bearable to express with command-line arguments, pySim-shell was
created.
Basic use cases can still use pySim-prog.
Program customizable SIMs¶
Two modes are possible:
one where you specify every parameter manually :
./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -i <IMSI> -s <ICCID>
one where they are generated from some minimal set :
./pySim-prog.py -n 26C3 -c 49 -x 262 -y 42 -z <random_string_of_choice> -j <card_num>
With <random_string_of_choice> and <card_num>, the soft will generate ‘predictable’ IMSI and ICCID, so make sure you choose them so as not to conflict with anyone. (for eg. your name as <random_string_of_choice> and 0 1 2 … for <card num>).
- You also need to enter some parameters to select the device :
-t TYPE : type of card (supersim, magicsim, fakemagicsim or try ‘auto’) -d DEV : Serial port device (default /dev/ttyUSB0) -b BAUD : Baudrate (default 9600)
pySim-read¶
pySim-read
allows you to read some data from a SIM card. It will only some files
of the card, and will only read files accessible to a normal user (without any special authentication)
These days, you should use the export
command of pySim-shell
instead. It performs a much more comprehensive export of all of the
[standard] files that can be found on the card. To get a human-readable
decode instead of the raw hex export, you can use export --json
.
Specifically, pySim-read will dump the following:
MF
EF.ICCID
DF.GSM
EF,IMSI
EF.GID1
EF.GID2
EF.SMSP
EF.SPN
EF.PLMNsel
EF.PLMNwAcT
EF.OPLMNwAcT
EF.HPLMNAcT
EF.ACC
EF.MSISDN
EF.AD
EF.SST
ADF.USIM
EF.EHPLMN
EF.UST
EF.ePDGId
EF.ePDGSelection
ADF.ISIM
EF.PCSCF
EF.DOMAIN
EF.IMPI
EF.IMPU
EF.UICCIARI
EF.IST
pySim-read usage¶
Legacy tool for reading some parts of a SIM card
usage: pySim-read.py [-h] [-d DEV] [-b BAUD] [--pcsc-shared]
[-p PCSC | --pcsc-regex REGEX] [--modem-device DEV]
[--modem-baud BAUD] [--osmocon PATH]
Serial Reader¶
Use a simple/ultra-low-cost serial reader attached to a (physical or USB/virtual) RS232 port. This doesn’t work with all RS232-attached smart card readers, only with the very primitive readers following the ancient Phoenix or Smart Mouse design.
- -d, --device
Serial Device for SIM access
Default:
'/dev/ttyUSB0'
- -b, --baud
Baud rate used for SIM access
Default:
9600
PC/SC Reader¶
Use a PC/SC card reader to talk to the SIM card. PC/SC is a standard API for how applications
access smart card readers, and is available on a variety of operating systems, such as Microsoft
Windows, MacOS X and Linux. Most vendors of smart card readers provide drivers that offer a PC/SC
interface, if not even a generic USB CCID driver is used. You can use a tool like pcsc_scan -r
to obtain a list of readers available on your system.
- --pcsc-shared
Open PC/SC reaer in SHARED access (default: EXCLUSIVE)
Default:
False
- -p, --pcsc-device
Number of PC/SC reader to use for SIM access
- --pcsc-regex
Regex matching PC/SC reader to use for SIM access
AT Command Modem Reader¶
Talk to a SIM Card inside a mobile phone or cellular modem which is attached to this computer and offers an AT command interface including the AT+CSIM interface for Generic SIM access as specified in 3GPP TS 27.007.
- --modem-device
Serial port of modem for Generic SIM Access (3GPP TS 27.007)
- --modem-baud
Baud rate used for modem port
Default:
115200
OsmocomBB Reader¶
Use an OsmocomBB compatible phone
to access the SIM inserted to the phone SIM slot. This will require you to run the OsmocomBB firmware inside
the phone (can be ram-loaded). It also requires that you run the osmocon
program, which provides a unix
domain socket to which this reader driver can attach.
- --osmocon
Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)