... | ... | @@ -2,59 +2,59 @@ |
|
|
|
|
|
## modules for handling NAS messages
|
|
|
All the NAS-related messages are available in the
|
|
|
[pycrate_mobile](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/) directory.
|
|
|
[pycrate_mobile](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/) directory.
|
|
|
|
|
|
The following modules provide structures for dealing with 2G and 3G NAS messages:
|
|
|
- [TS24008_MM](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24008_MM.py):
|
|
|
- [TS24008_MM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24008_MM.py):
|
|
|
contains all structures for Mobility Management messages
|
|
|
- [TS24008_CC](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24008_CC.py):
|
|
|
- [TS24008_CC](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24008_CC.py):
|
|
|
for Call Control
|
|
|
- [TS24008_GMM](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24008_GMM.py):
|
|
|
- [TS24008_GMM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24008_GMM.py):
|
|
|
for GPRS Mobility Management
|
|
|
- [TS24008_SM](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24008_SM.py):
|
|
|
- [TS24008_SM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24008_SM.py):
|
|
|
for GPRS Session Management
|
|
|
|
|
|
All those structures are corresponding mostly to the descriptions from section 9
|
|
|
of the 3GPP TS 24.008 specification. They are themselves using IEs (Information
|
|
|
Elements) defined in section 10 of the specification, and available in the module
|
|
|
[TS24008_IE](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24008_IE.py), with
|
|
|
[TS24008_IE](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24008_IE.py), with
|
|
|
the exception of IEs for GPRS using CSN.1, which are defined in the
|
|
|
[pycrate_csn1dir](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_csn1dir/)
|
|
|
[pycrate_csn1dir](https://github.com/p1sec/pycrate/blob/master/pycrate_csn1dir/)
|
|
|
directory.
|
|
|
|
|
|
For SMS and Supplementary Services, other modules are available:
|
|
|
- [TS24011_PPSMS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24011_PPSMS.py):
|
|
|
- [TS24011_PPSMS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24011_PPSMS.py):
|
|
|
for Point-to-Point Short Message Service, which itself calls
|
|
|
- [TS23040_SMS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS23040_SMS.py):
|
|
|
- [TS23040_SMS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS23040_SMS.py):
|
|
|
for SMS itself
|
|
|
- [TS24080_SS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24080_SS.py):
|
|
|
- [TS24080_SS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24080_SS.py):
|
|
|
for Supplementary Service, which wraps some ASN.1-defined objects from the
|
|
|
[pycrate_asn1dir/SS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_asn1dir/SS.py)
|
|
|
[pycrate_asn1dir/SS](https://github.com/p1sec/pycrate/blob/master/pycrate_asn1dir/SS.py)
|
|
|
module.
|
|
|
|
|
|
For LTE NAS, two main modules are available:
|
|
|
- [TS24301_EMM](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24301_EMM.py):
|
|
|
- [TS24301_EMM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24301_EMM.py):
|
|
|
for EPS Mobility Management
|
|
|
- [TS24301_ESM](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24301_ESM.py):
|
|
|
- [TS24301_ESM](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24301_ESM.py):
|
|
|
for EPS Session Management
|
|
|
Those structures are corresponding to the descriptions from section 8 of the 3GPP
|
|
|
TS 24.301 specification. IEs defined in section 9 are available in the module
|
|
|
[TS24301_IE](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24301_IE.py).
|
|
|
[TS24301_IE](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/TS24301_IE.py).
|
|
|
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.
|
|
|
|
|
|
All classes representing NAS messages and information elements are deriving from few
|
|
|
base classes defined in the
|
|
|
[TS24007](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24007.py)
|
|
|
[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'
|
|
|
structures and providing custom functions for decoding any cellular NAS messages:
|
|
|
- [NASLTE](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/NASLTE.py):
|
|
|
- [NASLTE](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NASLTE.py):
|
|
|
for LTE-only EMM and ESM NAS messages,
|
|
|
- [NAS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/NAS.py):
|
|
|
- [NAS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NAS.py):
|
|
|
for all 2G-3G and LTE NAS messages.
|
|
|
|
|
|
## What is missing
|
... | ... | @@ -67,7 +67,7 @@ implemented (i.e. Group and Broadcast Call Control, GTTP and LCS). |
|
|
|
|
|
## Decoding NAS messages
|
|
|
In order to decode NAS messages, the simplest way is to used one of the two functions
|
|
|
used in the [NAS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/NAS.py) module:
|
|
|
used in the [NAS](https://github.com/p1sec/pycrate/blob/master/pycrate_mobile/NAS.py) module:
|
|
|
- _parse_NAS_MO(buf) -> (element, err)_, for parsing Mobile Originating message (i.e. uplink)
|
|
|
- _parse_NAS_MT(buf) -> (element, err)_, for parsing Mobile Terminating message (i.e. downlink)
|
|
|
|
... | ... | |