[TOC] # Install SmartCard reader driver & PySIM Tool In this setup, we use the Ez100PU device as the smart card reader. To install its driver for: * Ubuntu: ``` git clone https://github.com/chihchun/ez100pu.git cd ez100pu/driver_ezusb_v1.5.3_for_64_bit/ ./install ``` * Windows: download the driver from here: `https://www.castlestech.com/wp-content/uploads/2020/02/EZ100_Driver_64bit.zip` Unzip, run the setup and follow the instruction to install the driver. Next, we install **pysim** tool written in Python by Osmocom with capability to read info from as well as programming new parameters to a SIM card. We need to install its dependencies: ``` git clone https://github.com/osmocom/pysim cd pysim sudo apt-get install --no-install-recommends pcscd libpcsclite-dev python3 python3-setuptools python3-pycryptodome python3-pyscard python3-pip pip3 install --user -r requirements.txt ``` # USIM Subscriber Information PLMN: - MCC: 001 - MNC: 01 Sysmocom USIM: | NO | IMSI | Key | OPc | | -- |--------------- | --------------------------------- | ----------- | | A | `001012959633601` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | | B | `001012959633602` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | | C | `001012959633603` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | Huatien USIM: | NO | IMSI | Key | OPc | | -- |--------------- | --------------------------------- | ----------- | | A | `001011234567895` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | | B | `001012209918901` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | | C | `001012209918902` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | | D | `001012209918903` | 465B5CE8B199B49FAA5F0A2EE238A6BC | E8ED289DEBA952E4283B54E88E6183CA | ## USIM Programming ### Test SIM Model: sysmocom sysmoISIM-SJA2 Software Utility: pySim (https://github.com/osmocom/pysim) Commandline Tool: pySim-shell.py Template Pysim Script: usim_prog.pysim Usage: ``` bash >python pySim-shell.py -p 0 Using PC/SC reader interface Waiting for card... Autodetected card type: sysmoISIM-SJA2 Info: Card is of type: UICC-SIM AIDs on card: USIM: a0000000871002ffffffff8907090000 (EF.DIR) ISIM: a0000000871004ffffffff8907090000 (EF.DIR) ADF.ISD: a000000003000000 ARA-M: a00000015141434c00 Detected CardModel: SysmocomSJA2 Welcome to pySim-shell! pySIM-shell (MF)> bulk_script usim_prog.pysim Ready for Programming: Insert card now (or CTRL-C to cancel) Waiting for card... Autodetected card type: sysmoISIM-SJA2 Info: Card is of type: UICC-SIM AIDs on card: USIM: a0000000871002ffffffff8907090000 (EF.DIR) ISIM: a0000000871004ffffffff8907090000 (EF.DIR) ADF.ISD: a000000003000000 ARA-M: a00000015141434c00 Detected CardModel: SysmocomSJA2 Transcript stdout: ---------------------8<--------------------- ... <skip> ... ---------------------8<--------------------- Transcript stderr: (none) +-------------+ + ## + + ## + + # ## + + ## # + + ## + +-------------+ Statistics: success :1, failure: 0 Programming successful: Remove card from reader Ready for Programming: Insert card now (or CTRL-C to cancel) Terminated by user! pySIM-shell (MF/DF.GSM/EF.PLMNsel)> ``` File Template to Program USIM **usim_prog.pysim** ``` console # script to be used with pySim-shell.py which is part of the Osmocom pysim package, # found at https://osmocom.org/projects/pysim/wiki set echo true # TODO: specify your card-specific ADM pin at the end of the verify_adm line below verify_adm <adm key> # Disable un-used services select ADF.USIM/EF.UST ust_service_deactivate 124 # Update PLMN of IMSI select ../EF.IMSI update_imsi_plmn <mcc&mnc> # Update Service Provider Name select ../../DF.GSM/EF.SPN update_binary 00<hexstring of SPN characters>ff # Update Service Provider Configurations select EF.PLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.OPLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.HPLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.PLMNsel update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff # quit quit ``` ### Example of update Test SIM - MCC: `001` - MNC: `01` - Test SIM's ADM key: `84694342` - Service Provider Name: `D-Link` **usim_prog.pysim** ``` console # script to be used with pySim-shell.py which is part of the Osmocom pysim package, # found at https://osmocom.org/projects/pysim/wiki #set echo true # TODO: specify your card-specific ADM pin at the end of the verify_adm line below verify_adm 84694342 # Disable un-used services select ADF.USIM/EF.UST ust_service_deactivate 124 # Update PLMN of IMSI to MCC `001` MNC `01` select ../EF.IMSI update_imsi_plmn 00101 # Update Service Provider Name to 'D-Link' select ../../DF.GSM/EF.SPN update_binary 00442D4C696E6Bff # Update Service Provider Configurations select EF.PLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.OPLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.HPLMNwAcT update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff select EF.PLMNsel update_binary ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff # quit quit ``` # Compatible Matrix ## Modem Module Information | | Vendor | Model | Revision | | ----------------- | ------- | --------- | ------------------------ | | DLink 1010 | Quectel | RG520N-EB | RG520NEBDER03A01M8G_OCPU | | DLink 3010 | Quectel | RM500Q-AE | RM500QAEAAR13A02M4G | | DLink 3010** | Quectel | RM520N-GL | RM520NGLAAR01A06M4G_01.001.01.001 | | DLink G560 | Quectel | RM520N-GL | RM520NGLAAR01A06M4G | | Quectel RM502Q-AE | Quectel | RM502Q-AE | RM502QAEAAR11A04M4G | | APAL 5G dongle | Compal | RXM-G1 | -- | Note: : **: using module RM520N-GL, same firmware version to G560 ## Test Result ### Date: 2023/08/04 #### DL/UL Central Freq: 3.6GHz (arfcn: 640256) | | DLink 1010 | DLink 3010**| DLink G560 | APAL 5G | | ---------- | ----------- | ----------- | ----------- | ------------ | | Sysmocom A | | OK | | | | Sysmocom B | | | OK | | | Sysmocom C | OK | | | OK | ### Date: 2023/07/31 #### DL/UL Central Freq: 3.6GHz (arfcn: 640256) | | DLink 1010 | DLink 3010**| DLink G560 | Quectel RM502Q-AE | | --------- | ----------- | ----------- | ----------- | ----------------- | | Huatien A | OK | OK | OK | RRC failure | | Huatien B | rebooting | no RACH | no RACH | not tested | #### DL/UL Central Freq: 3.65GHz (arfcn: 643589) | | DLink 1010 | DLink 3010**| DLink G560 | Quectel RM502Q-AE | | --------- | ----------- | ----------- | ----------- | ----------------- | | Huatien A | not tested | No camp | not tested | not tested | ### Date: 2023/07/17 #### DL/UL Central Freq: 3.6GHz (arfcn: 640256) | | DLink 1010 | DLink 3010 | DLink G560 | Quectel RM502Q-AE | | --------- | ----------- | ----------- | ----------- | ----------------- | | Sysmocom | CME Err: 13 | CME Err: 13 | CME Err: 13 | RRC failure | | Huatien A | OK | RRC failure | OK | RRC failure | | | DLink 3010* | | --------- | ----------- | | Sysmocom | CME Err: 13 | | Huatien A | OK | Note: : *: using module RM520N-GL, but different firmware version to G560 : **: using module RM520N-GL, same firmware version to G560 history
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.