From 19ed529dee5f6e3ba810e1d9e4db9c604f29a583 Mon Sep 17 00:00:00 2001 From: Christina Quast Date: Wed, 24 Jun 2015 15:23:59 +0200 Subject: [PATCH] apdu_split.py: INS array updated,CLA sync disabled! There are more instruction codes, after which data is expected from the SIM card. Therefore, the array with commands known to expect SIM card data has been extended. Feel free to extend it even further. !! ATTENTION !! The only synchronization mechanism for parsing APDUs (naively looking for a 0xA0 byte) is deactivated! It only worked well for the sniffing mode, but getting out of sync is fatal for the MITM mode. !! A NEW MEANS OF SYNCHRONISATION HAS TO BE FOUND !! --- usb_application/apdu_split.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usb_application/apdu_split.py b/usb_application/apdu_split.py index 6225beef..d2bb6847 100755 --- a/usb_application/apdu_split.py +++ b/usb_application/apdu_split.py @@ -118,12 +118,12 @@ class Apdu_splitter: apdu_states.APDU_S_SW2 : func_APDU_S_SW2, apdu_states.PTS : func_PTS } - INS_data_expected = [0xC0, 0xB0] + INS_data_expected = [0xC0, 0xB0, 0xB2, 0x12, 0xF2] def split(self, c): - if c == 0xA0: - self.state = apdu_states.APDU_S_CLA -# print("state: ", self.state, c) + # if c == 0xA0: + # self.state = apdu_states.APDU_S_CLA + print("state: ", self.state, hex(c)) self.Apdu_S[self.state](self, c)