SCUTIL ====== ScUtil is a cross platform, interactive command line utility that provides in-depth examination of ISO 7816 smart cards. Features -------- - Display SIM card contents including phonebook and SMS's. Verify/change PIN, verify PUK/PIN2. - Display EMV (credit card) contents. - Display CB (carte bancaire) contents and verify PIN. - Display S*y viewing card contents. - List, read, write and erase ISO 7816-4 files. - Edit and send low level ISO 7816-3 commands. - Probe command classes or instructions. - Display and analyze Answer To Reset. - Detailed command timing and tracing. - Fully scriptable. Requirements ------------ - A supported target/compiler: Linux 2.6.x, gcc 3.4 or 4.x Win32, Mingw gcc 4.2 Win32, Microsoft Visual C++ 32-bit DOS, DJGPP gcc 4.0 32-bit DOS, OpenWatcom - A Phoenix or SmartMouse compatible card reader Building -------- - Extracct the source into an empty directory. - For Linux and Mingw open a command shell and type make. - For DJGPP double-click makedjg.bat. You may need to edit this file if DJGPP is installed somewhre other than c:\djgpp. - For OpenWatcom double-click WCDOS32.BAT. You may need to edit this file if OpenWatcom is installed somewhre other than c:\watcom. - For Microsoft Visual C++, open the project scutil.dsp and perform a build all. Execution --------- scutil [options] -D : Card reader device name -C : Card clock frequency (Hz) -I : Invert card detect sense -b : Set data buffer size (16384) -t : Decrease verbosity of output -v : Increase verbosity of output -h : Help Commands: -------- what [i=0] : Print card info with detail i= 1..5 rst : Reset the card atr : Print card's ATR scan [x] : Probe command classes or instructions in class x sim [...] : SIM card operations. See 'sim help' emv [...] : EMV bank card operations. See 'emv help' cb [...] : Carte Bancaire operations. See 'cb help' sky [...] : Sky viewing card operations. See 'sky help' ===== ISO7816-4 files : ==================================================== ls [x1 [x2]] : Select file by ID [x1..x2] and print details slct <$text|x x..> : Select file by name and print details rbin [i=0 [n]] : Load data[0..n) & print offset [i..i+n) of current EF rrec [f=1 [l]] : Load data[0..] & print record [f..l] of current EF wbin : Write data[0..n) to offset i of current EF ubin : Update data[0..n) to offset i of current EF erase : Erase n octets at offset i of current EF wrec : Write data[0..] len n to record [f..l] of current EF sfi : Print record dump of all short file indices ===== ISO7816-3 cmds : ==================================================== class [x] : Set ISO7816 command class x cread : ISO7816 command & read data cwrit : ISO7816 command & write data. Append hex data if lc=* resp [le] : ISO7816 response command & read data enter [i [file|* x..]] : Enter hex data[i..] from stdin, file or inline print [i j [file]] : Print hex data[i..j) to file ===== Environment : ==================================================== trace [on|off|1|0] : Enable or disable ISO7816 data trace warn [on|off|1|0] : Enable or disable ISO7816 warnings exec [file] : Execute commands from a script file echo [on|off|text] : Enable or disable command echoing - also @ disables rem [text] : Script comment - also ; and # help [command] : Show command help - also ? quit : Quit NB commands may be abbreviated to the first 2 letters. SIM card operations: info [i=1] : Print SIM info with detail i=1..5 print [f [l [file]]] : Print phonebook entries f..l to file input [f [l [file]]] : Input phonebook entries f..l from stdin or file text [f [l [file]]] : Print SMS messages f..l to file pin [v|e|d|c] : Print PIN state, Verify, Enable, Disable or Change pin2 : Enter & verify PIN2 code puk : Enter & verify PUK (PIN unblock) code auth : Run the GSM algorithm and print SRES & Kc help [command] : Show help on a SIM operation EMV card operations: info [i=1] : Print card info with detail i=1..5 list [i=1] : List PSE applications with detail i=1..5 app [x [x...]] : Select application ID proc [i=1] : Print transaction info for current app, detail i help [command] : Show help on an EMV operation Carte Bancaire operations: info [i=1] : Print card info with detail i=1..5 pin : Enter and verify PIN code help [command] : Show help on an EMV operation Sky viewing card operations: info [i=1] : Print card info with detail i=1..3 cmds [i=1] : Print command set scram : Initialise the scrambler pin : Print customer PIN code ecm : Write ECM data[0..n) and print response help [command] : Show help on a Sky card operation Acknowledgements ---------------- smartcard_list.txt by Ludovic Rousseau: http://ludovic.rousseau.free.fr/softwares/pcsc-tools