Esempio n. 1
0
File: USIM.py Progetto: 1mentat/card
 def __init__(self):
     '''
     initializes like an ISO7816-4 card with CLA=0x00
     and checks available AID (Application ID) read from EF_DIR
     
     initializes on the MF
     '''
     # initialize like a UICC
     ISO7816.__init__(self, CLA=0x00)
     self.AID = []
     
     if self.dbg >= 2:
         log(3, '(UICC.__init__) type definition: %s' % type(self))
         log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))
     
     # USIM selection from AID
     if self.dbg:
         log(3, '(USIM.__init__) UICC AID found:')
     self.get_AID()
     for aid in self.AID:
         if  tuple(aid[0:5]) == (0xA0, 0x00, 0x00, 0x00, 0x87) \
         and tuple(aid[5:7]) == (0x10, 0x02) :
             usim = self.select(addr=aid, type='aid')
             if usim is None and self.dbg:
                 log(2, '(USIM.__init__) USIM AID selection failed')
             if usim is not None:
                 self.USIM_AID = aid
                 if self.dbg:
                     log(3, '(USIM.__init__) USIM AID selection succeeded\n')
Esempio n. 2
0
    def __init__(self):
        '''
        initialize like an ISO7816-4 card with CLA=0xA0
        can also be used for USIM working in SIM mode,
        '''
        ISO7816.__init__(self, CLA=0xA0)
        if self.dbg:
            print '[DBG] type definition: %s' % type(self)
            print '[DBG] CLA definition: %s' % hex(self.CLA)

        self.caller = {
            'Kc': self.get_Kc,
            'IMSI': self.get_imsi,
            'LOCI': self.get_loci,
            'HPLMN': self.get_subscr_sim_hplmn,
            'PLMN_SEL': self.get_subscr_sim_plmnsel,
            'ICCID': self.get_subscr_iccid,
            'SPN': self.get_subscr_sim_spn,
            'ACC': self.get_subscr_sim_acc,
            'FPLMN': self.get_subscr_sim_fplmn,
            'MSISDN': self.get_subscr_sim_msisdn,
            'PRINT_ALL': self.print_sim_card_info,
            'Kc-W': self.write_subscr_Kc,
            'LOCI-W': self.write_subscr_loci,
            'SMSP': self.get_subscr_smsp,
            'GSM_ALGO': self.run_gsm_algorithm
        }
Esempio n. 3
0
    def __init__(self):
        '''
        initializes like an ISO7816-4 card with CLA=0x00
        and checks available AID (Application ID) read from EF_DIR
        
        initializes on the MF
        '''
        # initialize like a UICC
        ISO7816.__init__(self, CLA=0x00)
        self.AID = []
        self.dbg = 0

        if self.dbg >= 2:
            log(3, '(UICC.__init__) type definition: %s' % type(self))
            log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))

        # USIM selection from AID
        if self.dbg:
            log(3, '(USIM.__init__) UICC AID found:')
        self.get_AID()
        for aid in self.AID:
            if  tuple(aid[0:5]) == (0xA0, 0x00, 0x00, 0x00, 0x87) \
            and tuple(aid[5:7]) == (0x10, 0x02) :
                usim = self.select(addr=aid, type='aid')
                if usim is None and self.dbg:
                    log(2, '(USIM.__init__) USIM AID selection failed')
                if usim is not None:
                    self.USIM_AID = aid
                    if self.dbg:
                        log(3,
                            '(USIM.__init__) USIM AID selection succeeded\n')
Esempio n. 4
0
    def __init__(self):
        '''
        initializes like an ISO7816-4 card with CLA=0x00
        and checks available AID (Application ID) read from EF_DIR
        
        initializes on the MF
        '''
        # initialize like a UICC
        ISO7816.__init__(self, CLA=0x00)
        self.AID = []
        if self.dbg:
            print '[DBG] type definition: %s' % type(self)
            print '[DBG] CLA definition: %s' % hex(self.CLA)

        # USIM selection from AID
        print '[+] UICC AID found:'
        self.get_AID()
        for aid in self.AID:
            if  tuple(aid[0:5]) == (0xA0, 0x00, 0x00, 0x00, 0x87) \
            and tuple(aid[5:7]) == (0x10, 0x04) :
                isim = self.select(Data=aid, typ='aid')
                if isim is None:
                    print '[+] ISIM AID selection failed'
                else:
                    print '[+] ISIM AID selection succeeded\n'
Esempio n. 5
0
File: SIM.py Progetto: 12019/card
 def __init__(self):
     '''
     initialize like an ISO7816-4 card with CLA=0xA0
     can also be used for USIM working in SIM mode,
     '''
     ISO7816.__init__(self, CLA=0xA0)
     
     if self.dbg >= 2:
         log(3, '(SIM.__init__) type definition: %s' % type(self))
         log(3, '(SIM.__init__) CLA definition: %s' % hex(self.CLA))
Esempio n. 6
0
File: SIM.py Progetto: ncouture/card
    def __init__(self):
        """
        initialize like an ISO7816-4 card with CLA=0xA0
        can also be used for USIM working in SIM mode,
        """
        ISO7816.__init__(self, CLA=0xA0)

        if self.dbg >= 2:
            log(3, '(SIM.__init__) type definition: %s' % type(self))
            log(3, '(SIM.__init__) CLA definition: %s' % hex(self.CLA))
Esempio n. 7
0
    def __init__(self):
        '''
        initializes like an ISO7816-4 card with CLA=0x00
        and check available AID (Application ID) read straight after card init
        '''
        ISO7816.__init__(self, CLA=0x00)
        self.AID = []

        if self.dbg >= 2:
            log(3, '(UICC.__init__) type definition: %s' % type(self))
            log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))
Esempio n. 8
0
File: EMV.py Progetto: mitshell/card
 def __init__(self):
     '''
     initializes like an ISO7816-4 card with CLA=0x00
     and check available AID (Application ID) read straight after card init
     '''
     ISO7816.__init__(self, CLA=0x00)
     self.AID = []
     
     if self.dbg >= 2:
         log(3, '(UICC.__init__) type definition: %s' % type(self))
         log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))
Esempio n. 9
0
    def __init__(self):
        '''
        initializes like an ISO7816-4 card with CLA=0x00
        and checks available AID (Application ID) read from EF_DIR
        
        initializes on the MF
        '''
        # initialize like a UICC
        ISO7816.__init__(self, CLA=0x00)
        self.AID = []

        if self.dbg >= 2:
            log(3, '(UICC.__init__) type definition: %s' % type(self))
            log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))

        self.SELECT_ADF_USIM()
Esempio n. 10
0
 def __init__(self):
     '''
     initializes like an ISO7816-4 card with CLA=0x00
     and checks available AID (Application ID) read from EF_DIR
     
     initializes on the MF
     '''
     # initialize like a UICC
     ISO7816.__init__(self, CLA=0x00)
     self.AID = []
     
     if self.dbg >= 2:
         log(3, '(UICC.__init__) type definition: %s' % type(self))
         log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))
     
     self.SELECT_ADF_USIM()
Esempio n. 11
0
 def __init__(self, reader=''):
     """
     initializes like an ISO7816-4 card with CLA=0x00
     and checks available AID (Application ID) read from EF_DIR
     
     initializes on the MF
     """
     # initialize like a UICC
     ISO7816.__init__(self, CLA=0x00, reader=reader)
     self.AID = []
     self.AID_GP = {}
     self.AID_USIM = None
     self.AID_ISIM = None
     #
     if self.dbg >= 2:
         log(3, '(UICC.__init__) type definition: %s' % type(self))
         log(3, '(UICC.__init__) CLA definition: %s' % hex(self.CLA))
     #
     self.SELECT_ADF_USIM()
Esempio n. 12
0
 def __init__(self):
     '''
     initialize like an ISO7816-4 card with CLA=0xA0
     can also be used for USIM working in SIM mode,
     '''
     ISO7816.__init__(self, CLA=0xA0)
     if self.dbg:
         print '[DBG] type definition: %s' % type(self)
         print '[DBG] CLA definition: %s' % hex(self.CLA)
     
     self.caller = {
     'KC' : self.get_Kc,
     'IMSI' : self.get_imsi,
     'LOCI' : self.get_loci,
     'HPPLMN' : self.get_hpplmn,
     'PLMN_SEL' : self.get_plmnsel,
     'ACC' : self.get_acc,
     'ICCID' : self.get_iccid,
     'FPLMN' : self.get_fplmn,
     'MSISDN' : self.get_msisdn,
     'SMSP' : self.get_smsp,
     }