From laforge at osmocom.org Mon Jan 4 22:57:54 2021 From: laforge at osmocom.org (Harald Welte) Date: Mon, 4 Jan 2021 23:57:54 +0100 Subject: simtrace2 Windows host In-Reply-To: References: Message-ID: Hi Jerome, On Mon, Dec 28, 2020 at 12:13:32PM +0100, J?rome Dufour wrote: > Is there a Windows version of the simtrace2 host software? No, there is not. It is certainly possible, but nobody has been working on a related port/reimplementation and/or contributed related code. We're always happy to receive contributions. -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From Tetsu.ITO at idemia.com Tue Jan 5 02:38:18 2021 From: Tetsu.ITO at idemia.com (ITO Tetsu) Date: Tue, 5 Jan 2021 02:38:18 +0000 Subject: simtrace2 Windows host In-Reply-To: References: Message-ID: Hello Jerome You can run linux in VMware and visualize it using Wireshark in Windows. This works well for me > C:\Users\LocalAdmin>plink.exe -load [SavedSession] -no-antispoof "tcpdump -w - -U -i lo udp port 4729" | "\Program Files\Wireshark\Wireshark.exe" -k -i - Best, Tetsu > -----Original Message----- > From: simtrace On Behalf Of Harald > Welte > Sent: Tuesday, January 5, 2021 07:58 > To: J?rome Dufour > Cc: simtrace at lists.osmocom.org > Subject: Re: simtrace2 Windows host > > This message is from an EXTERNAL SENDER - be CAUTIOUS, particularly with > links and attachments. > > ________________________________ > > > Hi Jerome, > > On Mon, Dec 28, 2020 at 12:13:32PM +0100, J?rome Dufour wrote: > > Is there a Windows version of the simtrace2 host software? > > No, there is not. It is certainly possible, but nobody has been working on a > related port/reimplementation and/or contributed related code. > > We're always happy to receive contributions. > > -- > - Harald Welte > https://urldefense.com/v3/__http://laforge.gnumonks.org/__;!!FZtbJVnXfw! > ijdFwB1qTTsr2gPWCJ58691z3uBL7lKEkoARSS3Jm93zc-lyL8pgSf-OzQl89R4$ > =============================================================== > ============= > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. A6) From laforge at gnumonks.org Fri Jan 8 22:53:51 2021 From: laforge at gnumonks.org (Harald Welte) Date: Fri, 8 Jan 2021 23:53:51 +0100 Subject: WIP / RFC for pysim 'next generation;' aka pysim-shell Message-ID: Dear Osmocom community, pySim-prog was nice when there were only 5 parameters on a SIM that we could program, and where the use case was pretty limited. Today, we have SIM/USIM/ISIM cards with hundreds of files and even more parameters to program. We cannot add a command line argument for each file to pySim-prog. Instead, this introduces an interactive command-line shell / REPL, in which one can navigate the file system of the card, read and update files both in raw format and in decoded/parsed format. The idea is primarily inspired by Henryk Ploetz' venerable cyberflex-shell, but implemented on a more modern basis using the cmd2 python module. You can see the very first prototype in the laforge/shell branch of pysim.git You can do things with it like this: ===> Start-up and authenticate with adm pin ---------------------------------------------------------------------- $ ./pysim-shell.py -p 0 Using PC/SC reader interface Autodetected card type: sysmoISIM-SJA2 AIDs on card: ['a0000000871002ffffffff8907090000', 'a0000000871004ffffffff8907090000'] Welcome to pySim-shell! pySIM-shell (3f00)> verify_adm 92990895 ---------------------------------------------------------------------- ===> interactive help ---------------------------------------------------------------------- pySIM-shell (3f00)> help Documented commands (use 'help -v' for verbose/'help ' for details): ISO7816 Commands ================ read_binary select_adf select_file update_binary update_record verify_chv pySim Commands ============== intro verify_adm USIM Commands ============= read_ehplmn ust_service_activate ust_service_deactivate pySim-shell built-in commands ============================= alias help macro quit run_script shell edit history py run_pyscript set shortcuts ---------------------------------------------------------------------- ===> more interactive help ---------------------------------------------------------------------- pySIM-shell (3f00)> help read_binary usage: read_binary [-h] [--file-id FILE_ID] [--offset OFFSET] [--length LENGTH] [--record-nr RECORD_NR] Read binary data from a transparent EF optional arguments: -h, --help show this help message and exit --file-id FILE_ID File ID --offset OFFSET Byte offset for start of read --length LENGTH Number of bytes to read --record-nr RECORD_NR Number of record to read ---------------------------------------------------------------------- ===> navigating the FS and reading files ---------------------------------------------------------------------- pySIM-shell (3f00)> select_file 7f20 ['622c8202782183027f20a509800171830400018d088a01058b032f0601c60f90017083010183018183010a83010b'] pySIM-shell (3f00/7f20)> read_binary --file-id 6f07 089910070000400310 ---------------------------------------------------------------------- ===> interaction with local filesystem, i.e. I/O redirect + shell commands ---------------------------------------------------------------------- pySIM-shell (3f00)> select_adf a0000000871002 pySIM-shell (a0000000871002)> select_file 5f3b pySIM-shell (a0000000871002/5f3b)> read_binary --file-id 4f20 > /tmp/f pySIM-shell (a0000000871002/5f3b)> !cat /tmp/f ffffffffffffffff07 ---------------------------------------------------------------------- ===> piping output through shell tools like grep ---------------------------------------------------------------------- pySIM-shell (3f00)> read_ust | grep 86 Service 86 - Allowed CSG Lists and corresponding indications ---------------------------------------------------------------------- ===> enabling/disabling services ---------------------------------------------------------------------- pySIM-shell (3f00/7f20)> ust_service_activate 123 pySIM-shell (3f00/7f20)> ust_service_deactivate 123 ---------------------------------------------------------------------- It's a very first prototype, but it is really promising. The major tasks I see to make this go anywhere is: * have "File" class with encoder/decoder methods, which are registered automatically with a 'file system' layer that knows about the DF/ADF hierarchy ** this allows us to have a "read-decoded" command, which will call the decode method of the file, automatically resolved by the selected FID/path * automatic mapping of file-name -> FID and FID -> file name ** when printing (like in the path), use the human-readable names ** allow users to use human-readable names in SELECT * decode + display the TLVs / FCPs after a SELECT (like cyberflex-shell * ability to enable/disable APDU trace * dynamically register/deregster commands based on the path, i.e. offer USIM commands only when in ADF_USIM We have quite a bit of that infrastructure in the c-language libosmosim, (part of libosmocore.git), but unfortunately not in python :/ Let me know if anyone is interested in joining this effort. Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From laforge at gnumonks.org Mon Jan 11 13:04:26 2021 From: laforge at gnumonks.org (Harald Welte) Date: Mon, 11 Jan 2021 14:04:26 +0100 Subject: WIP / RFC for pysim 'next generation;' aka pysim-shell In-Reply-To: References: Message-ID: Hi Bryan, On Sat, Jan 09, 2021 at 10:00:58AM -0500, bryan coxwell wrote: > I think this is a great idea and I'd love to help out, but I'm new to > working on open source projects. What's the best way for me to get started > in a way that would be helpful? thanks for reaching out. By now most of the APIs/architecture is sorted out, so you could a) make sure that ts_51_011.py (sim) / ts_31_102.py (usim) / ts_31_103.py (isim) contain class definitions for all of the files specified in the latest Release 16 3GPP specifications b) write encoder and decoder methods within the EF classes for the various files of interest. See the EF_IMSI() as an example. The Decoder method should return a python dict (possibly a hierarchy of dicts) and return the binary representation, while the encoder method should take the dict and produce the binary representation. Regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From bryancoxwell at gmail.com Sat Jan 9 15:00:58 2021 From: bryancoxwell at gmail.com (bryan coxwell) Date: Sat, 9 Jan 2021 10:00:58 -0500 Subject: WIP / RFC for pysim 'next generation;' aka pysim-shell In-Reply-To: References: Message-ID: Harald, I think this is a great idea and I'd love to help out, but I'm new to working on open source projects. What's the best way for me to get started in a way that would be helpful? Best, Bryan On Fri, Jan 8, 2021 at 5:54 PM Harald Welte wrote: > Dear Osmocom community, > > pySim-prog was nice when there were only 5 parameters on a SIM that we > could program, and where the use case was pretty limited. Today, we > have SIM/USIM/ISIM cards with hundreds of files and even more parameters > to program. We cannot add a command line argument for each file to > pySim-prog. > > Instead, this introduces an interactive command-line shell / REPL, > in which one can navigate the file system of the card, read and update > files both in raw format and in decoded/parsed format. > > The idea is primarily inspired by Henryk Ploetz' venerable > cyberflex-shell, but implemented on a more modern basis using > the cmd2 python module. > > You can see the very first prototype in the laforge/shell branch of > pysim.git > > You can do things with it like this: > > ===> Start-up and authenticate with adm pin > ---------------------------------------------------------------------- > $ ./pysim-shell.py -p 0 > Using PC/SC reader interface > Autodetected card type: sysmoISIM-SJA2 > AIDs on card: ['a0000000871002ffffffff8907090000', > 'a0000000871004ffffffff8907090000'] > Welcome to pySim-shell! > pySIM-shell (3f00)> verify_adm 92990895 > ---------------------------------------------------------------------- > > ===> interactive help > ---------------------------------------------------------------------- > pySIM-shell (3f00)> help > > Documented commands (use 'help -v' for verbose/'help ' for details): > > ISO7816 Commands > ================ > read_binary select_adf select_file update_binary update_record > verify_chv > > pySim Commands > ============== > intro verify_adm > > USIM Commands > ============= > read_ehplmn ust_service_activate ust_service_deactivate > > pySim-shell built-in commands > ============================= > alias help macro quit run_script shell > edit history py run_pyscript set shortcuts > > ---------------------------------------------------------------------- > > > ===> more interactive help > ---------------------------------------------------------------------- > pySIM-shell (3f00)> help read_binary > usage: read_binary [-h] [--file-id FILE_ID] [--offset OFFSET] [--length > LENGTH] [--record-nr RECORD_NR] > > Read binary data from a transparent EF > > optional arguments: > -h, --help show this help message and exit > --file-id FILE_ID File ID > --offset OFFSET Byte offset for start of read > --length LENGTH Number of bytes to read > --record-nr RECORD_NR > Number of record to read > ---------------------------------------------------------------------- > > > ===> navigating the FS and reading files > ---------------------------------------------------------------------- > pySIM-shell (3f00)> select_file 7f20 > > ['622c8202782183027f20a509800171830400018d088a01058b032f0601c60f90017083010183018183010a83010b'] > pySIM-shell (3f00/7f20)> read_binary --file-id 6f07 > 089910070000400310 > ---------------------------------------------------------------------- > > > ===> interaction with local filesystem, i.e. I/O redirect + shell commands > ---------------------------------------------------------------------- > pySIM-shell (3f00)> select_adf a0000000871002 > pySIM-shell (a0000000871002)> select_file 5f3b > pySIM-shell (a0000000871002/5f3b)> read_binary --file-id 4f20 > /tmp/f > pySIM-shell (a0000000871002/5f3b)> !cat /tmp/f > ffffffffffffffff07 > ---------------------------------------------------------------------- > > ===> piping output through shell tools like grep > ---------------------------------------------------------------------- > pySIM-shell (3f00)> read_ust | grep 86 > Service 86 - Allowed CSG Lists and corresponding indications > ---------------------------------------------------------------------- > > > ===> enabling/disabling services > ---------------------------------------------------------------------- > pySIM-shell (3f00/7f20)> ust_service_activate 123 > pySIM-shell (3f00/7f20)> ust_service_deactivate 123 > ---------------------------------------------------------------------- > > It's a very first prototype, but it is really promising. > > The major tasks I see to make this go anywhere is: > > * have "File" class with encoder/decoder methods, which are registered > automatically with a 'file system' layer that knows about the DF/ADF > hierarchy > ** this allows us to have a "read-decoded" command, which will > call the decode method of the file, automatically resolved by the > selected FID/path > * automatic mapping of file-name -> FID and FID -> file name > ** when printing (like in the path), use the human-readable names > ** allow users to use human-readable names in SELECT > * decode + display the TLVs / FCPs after a SELECT (like cyberflex-shell > * ability to enable/disable APDU trace > * dynamically register/deregster commands based on the path, i.e. offer > USIM commands only when in ADF_USIM > > We have quite a bit of that infrastructure in the c-language libosmosim, > (part of libosmocore.git), but unfortunately not in python :/ > > Let me know if anyone is interested in joining this effort. > > Regards, > Harald > -- > - Harald Welte > http://laforge.gnumonks.org/ > > ============================================================================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. > A6) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryancoxwell at gmail.com Fri Jan 15 00:59:04 2021 From: bryancoxwell at gmail.com (bryan coxwell) Date: Thu, 14 Jan 2021 19:59:04 -0500 Subject: WIP / RFC for pysim 'next generation;' aka pysim-shell In-Reply-To: References: Message-ID: <803E01D5-2235-4210-9989-EF040B86CE12@gmail.com> Sounds good to me. 51.011 looks to be unchanged, which I guess is expected. Working on updating 31.102 now. Thanks, Bryan Coxwell > On Jan 11, 2021, at 8:10 AM, Harald Welte wrote: > > ?Hi Bryan, > >> On Sat, Jan 09, 2021 at 10:00:58AM -0500, bryan coxwell wrote: >> I think this is a great idea and I'd love to help out, but I'm new to >> working on open source projects. What's the best way for me to get started >> in a way that would be helpful? > > thanks for reaching out. By now most of the APIs/architecture is sorted > out, so you could > > a) make sure that ts_51_011.py (sim) / ts_31_102.py (usim) / ts_31_103.py (isim) > contain class definitions for all of the files specified in the latest Release 16 > 3GPP specifications > > b) write encoder and decoder methods within the EF classes for the various files > of interest. See the EF_IMSI() as an example. The Decoder method should return > a python dict (possibly a hierarchy of dicts) and return the binary representation, > while the encoder method should take the dict and produce the binary representation. > > Regards, > Harald > -- > - Harald Welte http://laforge.gnumonks.org/ > ============================================================================ > "Privacy in residential applications is a desirable marketing option." > (ETSI EN 300 175-7 Ch. A6)