Ejemplo n.º 1
0
def _test_s1ap_prep():
    GLOBAL.clear()
    try:
        load_module('S1AP')
    except:
        log('Module "S1AP" unavailable')
        return None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'A'
    unh = lambda x: x.decode('hex')
    #
    # logs taken from an Amarisoft LTE100 network
    # http://www.amarisoft.com
    #
    pkts = map(unh, [\
    '0011002d000004003b00080063f310001a2d00003c400a0380656e623161326430004000070000004063f3100089400140',
    '201100170000020069000b000063f3100000800100010057400132',
    '000c408083000005000800020001001a005b5a17e24564d9040741020bf663f3108001010000000104e060c04000210208d011d1271a8080211001000010810600000000830600000000000d00000a005263f31000015c0a003103e5e0341363f310000111035758a65d0100e0004300060063f3100001006440080063f3101a2d00100086400130',
    '000b4038000003000000020064000800020001001a002524075200c38bb94032cc40b533057327b25e335510a4f43c006d9c90017ed284accdaf768c',
    '000d403b000005000000020064000800020001001a001211171f524dde06075308b7ae79df8ece4200006440080063f3101a2d0010004340060063f3100001',
    '00090080b30000060000000200640008000200010042000a1805f5e1006002faf0800018006500003400604500093c0f807f00016403b9d2465127e0c3b4e302074202e0060063f310000100245208c101090807746573743132330501c0a80302270e8080210a0300000a8106c0a8fd01500bf663f310800101000000011363f310000123050400000001006b000518000c000000490020c9b9530a37fc57d7a7a66a476677cac689cf9cb4c713ba88da20b4fb8bb2bdd9',
    '00164050000003000000020064000800020001004a403d3c01d001037c5980060008208183930d1bf8fff1bf8fff1bf8fff1bf8fff1bf8fff1bf8fff1bf8ffeff9ffd75103004870ca74a92246058c0000000000',
    '200900220000030000400200640008400200010033400f000032400a0a1f7f0001014ca724db',
    '00124015000003000000020064000800020001000240020280',
    '001700110000020063000400640001000240020280',
    '2017000f000002000040020064000840020001'
    ])
    return pkts
Ejemplo n.º 2
0
def _test_s1ap_prep():
    GLOBAL.clear()
    try:
        load_module('S1AP')
    except:
        log('Module "S1AP" unavailable')
        return None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'A'
    unh = lambda x: x.decode('hex')
    #
    # logs taken from an Amarisoft LTE100 network
    # http://www.amarisoft.com
    #
    pkts = map(unh, [\
    '0011002d000004003b00080063f310001a2d00003c400a0380656e623161326430004000070000004063f3100089400140',
    '201100170000020069000b000063f3100000800100010057400132',
    '000c408083000005000800020001001a005b5a17e24564d9040741020bf663f3108001010000000104e060c04000210208d011d1271a8080211001000010810600000000830600000000000d00000a005263f31000015c0a003103e5e0341363f310000111035758a65d0100e0004300060063f3100001006440080063f3101a2d00100086400130',
    '000b4038000003000000020064000800020001001a002524075200c38bb94032cc40b533057327b25e335510a4f43c006d9c90017ed284accdaf768c',
    '000d403b000005000000020064000800020001001a001211171f524dde06075308b7ae79df8ece4200006440080063f3101a2d0010004340060063f3100001',
    '00090080b30000060000000200640008000200010042000a1805f5e1006002faf0800018006500003400604500093c0f807f00016403b9d2465127e0c3b4e302074202e0060063f310000100245208c101090807746573743132330501c0a80302270e8080210a0300000a8106c0a8fd01500bf663f310800101000000011363f310000123050400000001006b000518000c000000490020c9b9530a37fc57d7a7a66a476677cac689cf9cb4c713ba88da20b4fb8bb2bdd9',
    '00164050000003000000020064000800020001004a403d3c01d001037c5980060008208183930d1bf8fff1bf8fff1bf8fff1bf8fff1bf8fff1bf8fff1bf8ffeff9ffd75103004870ca74a92246058c0000000000',
    '200900220000030000400200640008400200010033400f000032400a0a1f7f0001014ca724db',
    '00124015000003000000020064000800020001000240020280',
    '001700110000020063000400640001000240020280',
    '2017000f000002000040020064000840020001'
    ])
    return pkts
Ejemplo n.º 3
0
def _test_x2ap_prep():
    GLOBAL.clear()
    try:
        load_module('X2AP')
    except:
        log('Module "X2AP" unavailable')
        return None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'A'
    unh = lambda x: x.decode('hex')
    #
    # logs nicely submitted by Alexandre De Oliveira (P1)
    # (2nd from http://www.pcapr.net/view/nos/2014/8/0/10/x2ap.pcap.html)
    #
    pkts = map(unh, [\
'000600808a000004001500080011f1110001013000140051020000330011f11101011010029011f111004c2c05dc330000340011f1110101102000a011f111004c2c05dc444000350011f1110101103000a011f111005eec189c3300010011f1110a0ab010002705dc001800060011f1118000a8dd4018000002100040030001031001400a0001c006001008020100',
'0000007b000006000a00020001000540020000000b000800522018000000200017000700522018000102000e004100010000000000303132333435363738393031323334353637383930313233343536373839303120000000000004400e0000010a03e01401a8c000000002020000000f400c000052201800000021800003',
       ])
    return pkts
Ejemplo n.º 4
0
def _test_x2ap_prep():
    GLOBAL.clear()
    try:
        load_module('X2AP')
    except:
        log('Module "X2AP" unavailable')
        return None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'A'
    unh = lambda x: x.decode('hex')
    #
    # logs nicely submitted by Alexandre De Oliveira (P1)
    # (2nd from http://www.pcapr.net/view/nos/2014/8/0/10/x2ap.pcap.html)
    #
    pkts = map(unh, [\
'000600808a000004001500080011f1110001013000140051020000330011f11101011010029011f111004c2c05dc330000340011f1110101102000a011f111004c2c05dc444000350011f1110101103000a011f111005eec189c3300010011f1110a0ab010002705dc001800060011f1118000a8dd4018000002100040030001031001400a0001c006001008020100',
    '0000007b000006000a00020001000540020000000b000800522018000000200017000700522018000102000e004100010000000000303132333435363738393031323334353637383930313233343536373839303120000000000004400e0000010a03e01401a8c000000002020000000f400c000052201800000021800003',
       ])
    return pkts
Ejemplo n.º 5
0
def _test_rrc3g_prep():
    GLOBAL.clear()
    try:
        load_module('RRC3G')
    except:
        log('Module "RRC3G" unavailable')
        return None, None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'U'
    unh = lambda x: x.decode('hex')
    #
    # logs taken with a Samsung Galaxy S2 and xgoldmon from
    # https://github.com/2b-as/xgoldmon
    #
    pkts = map(unh, [\
    # PagingType1 (PCCH)
    '4455c803999055c601b95855aa06b09e',
    '4255ba00047855840454b2',
    '4055c8039990',
    # ActiveSetUpdate (DL-DCCH)
    'd2f17f0cb000304a00880a014aa0',
    'c70b4b01f800384a0cf80b4348087980',
    # DownlinkDirectTransfer (DL-DCCH)
    'ca0d7d191940002061e0',
    'b8bd242d114e02e101300bc05f020e9fe02300be9c607b15e540258640400000',
    # PhysicalChannelReconfiguration (DL-DCCH)
    'adb98ce3d28000c01147c400466ff0707a2515459fcc008cdfe0e0f44a2a8b06bec002337f8383d128aa2a9433e02d0d3a300880a034a943cc0550d3c6',
    # RRCConnectionRelease (DL-DCCH)
    'c94874130bc800',
    # RadioBearerReconfiguration (DL-DCCH)
    '9576583b9b00000000881cfeb41648c1386c82cfe741648c1386c83cfe741648c1386c009700',
    # RadioBearerSetup (DL-DCCH)
    'd5956df0938204aa41d00804c42388303a80e2b8830428103388304a8124100b0120a4b4989352b95f83788120111d9b1c442880027020a20476688100ce111d5824401e0445ce0c73d7a487088000204e0414408ecd4810100ce111db8090803c088bc002607e013600',
    # SecurityModeCommand (DL-DCCH)
    'b81ea4c39c0e8001800128c0000101310008c00380990c02',
    'e7848cd48c0e0001800128c0000100f10000c002fdfa0b8b0040',
    # SignallingConnectionRelease (DL-DCCH)
    'bc9728229440',
    # InitialDirectTransfer (UL-DCCH)
    '15001700603138081ab8c5802fa5002f55fe00020a50',
    '15860a018040408017c083a8000880cf981159ffacb316288001f2b335e400c97ce799384018c02fa7d4144b09881faf08019010000600004ac0',
    '15001700602920a01ab8c5802fa5002f55fe0001caf0',
    # UplinkDirectTransfer (UL-DCCH)
    '97e91641aec002c1968401704800',
    # SecurityModeComplete (UL-DCCH)
    'a452ec578d31111111800002016200218000',
    # RadioBearerSetupComplete (UL-DCCH)
    'efd728f42bcc000024d0',
    # RadioBearerReconfigurationComplete (UL-DCCH)
    '847d9dc832c000',
    # ActiveSetUpdateComplete (UL-DCCH)
    'e431772f2800',
    # PhysicalChannelReconfigurationComplete (UL-DCCH)
    'f3e0b9537a4000',
    ])
    
    # The following RRC frames are not encoded in a PER compliant / canonical 
    # way
    pkts_non_canon = map(unh, [\
    # MeasurementControl (DL-DCCH)
    # here, the RNC encodes CellInfo components with their DEFAULT values,
    # even for ASN.1 basic objects,...
    'a3549e989a008310c935be7be4ea51736ee514def25117afa51626fe516d20',
    'cdcc61022a010310c8ef8ce91bca2c55c4a2f65cca2485d4a2375dca2bf5e4a28d5eca298df4a2e15fca2f9c',
    '208803b8fc128a5d43288294528b154728825492883f4b28b3f4d288234f28b395128b435328a5b5528bcd5728bd959289215b288dd5d2888d5f28afd6128b316328a1d6528a356728a636928b856b28be76d289a16f2888371289357328b3d7528831772893f7928a3d7b28b637d288c97f289714c4585858b82180bb2b7510a0160293ecadd4ff9c20',
    # RadioBearerReleaseFailure (UL-DCCH)
    # here, the UE encodes:
    # laterNonCriticalExtensions, 
    # which is however empty (it contains only OPTIONAL components, and none 
    # are encoded...) and this is handled differently in Paging frames, where 
    # the laterNonCriticalExtensions are not encoded at all: damned RNC !!!
    '39a0',
    # RRCConnectionSetupComplete (UL-DCCH)
    # here, the UE encodes:
    # dl-PhysChCapabilityFDD-v380ext, rrcConnectionSetupComplete-v3a0ext,
    # rrcConnectionSetupComplete-v3g0ext, 
    # which are however empty (they contain only OPTIONAL components, and none 
    # are encoded...)
    '4b88000220000c64350aa0d4a8550d412808900030002b01981ab8c58218050908a2050a104035084a39f742cf4d76e509473ee859e9aedea128e7dd0b3d35db97010144109c38f5d0d0b3d35db400640740616378c24fd2845e1220d000',
    ])
    #
    return pkts, pkts_non_canon
Ejemplo n.º 6
0
def _test_rrc3g_prep():
    GLOBAL.clear()
    try:
        load_module('RRC3G')
    except:
        log('Module "RRC3G" unavailable')
        return None, None
    ASN1.ASN1Obj._RAISE_SILENTLY = False
    ASN1.ASN1Obj.CODEC = PER
    PER.VARIANT = 'U'
    unh = lambda x: x.decode('hex')
    #
    # logs taken with a Samsung Galaxy S2 and xgoldmon from
    # https://github.com/2b-as/xgoldmon
    #
    pkts = map(unh, [\
    # PagingType1 (PCCH)

    '4455c803999055c601b95855aa06b09e',
    '4255ba00047855840454b2',
    '4055c8039990',
    # ActiveSetUpdate (DL-DCCH)
    'd2f17f0cb000304a00880a014aa0',
    'c70b4b01f800384a0cf80b4348087980',
    # DownlinkDirectTransfer (DL-DCCH)
    'ca0d7d191940002061e0',
    'b8bd242d114e02e101300bc05f020e9fe02300be9c607b15e540258640400000',
    # PhysicalChannelReconfiguration (DL-DCCH)
    'adb98ce3d28000c01147c400466ff0707a2515459fcc008cdfe0e0f44a2a8b06bec002337f8383d128aa2a9433e02d0d3a300880a034a943cc0550d3c6',
    # RRCConnectionRelease (DL-DCCH)
    'c94874130bc800',
    # RadioBearerReconfiguration (DL-DCCH)
    '9576583b9b00000000881cfeb41648c1386c82cfe741648c1386c83cfe741648c1386c009700',
    # RadioBearerSetup (DL-DCCH)
    'd5956df0938204aa41d00804c42388303a80e2b8830428103388304a8124100b0120a4b4989352b95f83788120111d9b1c442880027020a20476688100ce111d5824401e0445ce0c73d7a487088000204e0414408ecd4810100ce111db8090803c088bc002607e013600',
    # SecurityModeCommand (DL-DCCH)
    'b81ea4c39c0e8001800128c0000101310008c00380990c02',
    'e7848cd48c0e0001800128c0000100f10000c002fdfa0b8b0040',
    # SignallingConnectionRelease (DL-DCCH)
    'bc9728229440',
    # InitialDirectTransfer (UL-DCCH)
    '15001700603138081ab8c5802fa5002f55fe00020a50',
    '15860a018040408017c083a8000880cf981159ffacb316288001f2b335e400c97ce799384018c02fa7d4144b09881faf08019010000600004ac0',
    '15001700602920a01ab8c5802fa5002f55fe0001caf0',
    # UplinkDirectTransfer (UL-DCCH)
    '97e91641aec002c1968401704800',
    # SecurityModeComplete (UL-DCCH)
    'a452ec578d31111111800002016200218000',
    # RadioBearerSetupComplete (UL-DCCH)
    'efd728f42bcc000024d0',
    # RadioBearerReconfigurationComplete (UL-DCCH)
    '847d9dc832c000',
    # ActiveSetUpdateComplete (UL-DCCH)
    'e431772f2800',
    # PhysicalChannelReconfigurationComplete (UL-DCCH)
    'f3e0b9537a4000',
    ])

    # The following RRC frames are not encoded in a PER compliant / canonical
    # way
    pkts_non_canon = map(unh, [\
    # MeasurementControl (DL-DCCH)
    # here, the RNC encodes CellInfo components with their DEFAULT values,
    # even for ASN.1 basic objects,...



    'a3549e989a008310c935be7be4ea51736ee514def25117afa51626fe516d20',
    'cdcc61022a010310c8ef8ce91bca2c55c4a2f65cca2485d4a2375dca2bf5e4a28d5eca298df4a2e15fca2f9c',
    '208803b8fc128a5d43288294528b154728825492883f4b28b3f4d288234f28b395128b435328a5b5528bcd5728bd959289215b288dd5d2888d5f28afd6128b316328a1d6528a356728a636928b856b28be76d289a16f2888371289357328b3d7528831772893f7928a3d7b28b637d288c97f289714c4585858b82180bb2b7510a0160293ecadd4ff9c20',
    # RadioBearerReleaseFailure (UL-DCCH)
    # here, the UE encodes:
    # laterNonCriticalExtensions,
    # which is however empty (it contains only OPTIONAL components, and none
    # are encoded...) and this is handled differently in Paging frames, where
    # the laterNonCriticalExtensions are not encoded at all: damned RNC !!!
    '39a0',
    # RRCConnectionSetupComplete (UL-DCCH)
    # here, the UE encodes:
    # dl-PhysChCapabilityFDD-v380ext, rrcConnectionSetupComplete-v3a0ext,
    # rrcConnectionSetupComplete-v3g0ext,
    # which are however empty (they contain only OPTIONAL components, and none
    # are encoded...)
    '4b88000220000c64350aa0d4a8550d412808900030002b01981ab8c58218050908a2050a104035084a39f742cf4d76e509473ee859e9aedea128e7dd0b3d35db97010144109c38f5d0d0b3d35db400640740616378c24fd2845e1220d000',
    ])
    #
    return pkts, pkts_non_canon