... | ... | @@ -44,18 +44,34 @@ Moreover, in case the [CryptoMobile](https://github.com/mitshell/CryptoMobile) |
|
|
library is installed and can be imported, the `EMMSecProtNASMessage` and `EMMServiceRequest` classes
|
|
|
have methods dedicated to the LTE NAS cryptographic operations.
|
|
|
|
|
|
For 5G NAS, three main modules are available:
|
|
|
- [TS24501_FGMM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24501_FGMM.py):
|
|
|
for 5G Mobility Management
|
|
|
- [TS24501_FGSM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24501_FGSM.py):
|
|
|
for 5G Session Management
|
|
|
- [TS24501_UEPOL](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24501_UEPOL.py):
|
|
|
for 5G UE Policy
|
|
|
Those structures are corresponding to the descriptions from section 8 and annex D
|
|
|
of the 3GPP TS 24.501 specification. IEs defined in section 9 are available in the module
|
|
|
[TS24501_IE](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24501_IE.py).
|
|
|
Moreover, in case the [CryptoMobile](https://github.com/mitshell/CryptoMobile)
|
|
|
library is installed and can be imported, the `FGMMSecProtNASMessage` class has methods
|
|
|
dedicated to the 5G NAS cryptographic operations.
|
|
|
|
|
|
All classes representing NAS messages and information elements are deriving from few
|
|
|
base classes defined in the
|
|
|
[TS24007](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24007.py)
|
|
|
module, which implements some specific aspects of cellular layer 3 message structures
|
|
|
as defined in the TS 24.007 3GPP specification.
|
|
|
|
|
|
Finally, two _top-level_ modules are enabling the import of most of those NAS messages'
|
|
|
Finally, three _top-level_ modules are enabling the import of most of those NAS messages'
|
|
|
structures and providing custom functions for decoding any cellular NAS messages:
|
|
|
- [NASLTE](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NASLTE.py):
|
|
|
for LTE-only EMM and ESM NAS messages,
|
|
|
- [NAS5G](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NAS5G.py):
|
|
|
for 5G-only 5GMM, 5GSM and 5G UE Policy NAS messages,
|
|
|
- [NAS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NAS.py):
|
|
|
for all 2G-3G and LTE NAS messages.
|
|
|
for all 2G-3G, LTE and 5G NAS messages.
|
|
|
|
|
|
## Decoding NAS messages
|
|
|
In order to decode NAS messages, the simplest way is to used one of the two functions
|
... | ... | @@ -541,10 +557,10 @@ all optional IEs that are set, will appear directly in the message encoding: |
|
|
>>> IEs['CKSN']= 4
|
|
|
>>> IEs['LocUpdateType'] = {'Type': 1}
|
|
|
>>> IEs['LAI'] = (u'20820', 0x4321)
|
|
|
>>> IEs['ID'] = {'type': 1, 'ident': '208209876543210'}
|
|
|
>>> IEs['ID'] = {'type': 1, 'ident': u'208209876543210'}
|
|
|
>>> IEs['AddUpdateParams'] = {'CSMO': 1, 'CSMT': 1}
|
|
|
>>> IEs
|
|
|
{'LocUpdateType': {'Type': 1}, 'ID': {'ident': '208209876543210', 'type': 1}, 'AddUpdateParams': {'CSMT': 1, 'CSMO': 1}, 'CKSN': 4, 'LAI': (u'20820', 17185)}
|
|
|
{'LocUpdateType': {'Type': 1}, 'ID': {'ident': u'208209876543210', 'type': 1}, 'AddUpdateParams': {'CSMT': 1, 'CSMO': 1}, 'CKSN': 4, 'LAI': (u'20820', 17185)}
|
|
|
>>> Msg = MMLocationUpdatingRequest(val=IEs)
|
|
|
>>> show(Msg)
|
|
|
### MMLocationUpdatingRequest ###
|
... | ... | |