... | ... | @@ -19,17 +19,17 @@ 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
|
|
|
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_mobile/)
|
|
|
[pycrate_csn1dir](https://github.com/ANSSI-FR/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](https://github.com/ANSSI-FR/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](https://github.com/ANSSI-FR/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](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_mobile/TS24080_SS.py):
|
|
|
for Supplementary Service, which wraps some ASN.1-defined objects from the
|
|
|
[pycrate_asn1dir/SS.py](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_asn1dir/)
|
|
|
[pycrate_asn1dir/SS](https://github.com/ANSSI-FR/pycrate/blob/master/pycrate_asn1dir/SS.py)
|
|
|
module.
|
|
|
|
|
|
For LTE NAS, two main modules are available:
|
... | ... | @@ -41,7 +41,7 @@ Those structures are corresponding to the descriptions from section 8 of the 3GP |
|
|
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).
|
|
|
Moreover, in case the [CryptoMobile](https://github.com/mitshell/CryptoMobile)
|
|
|
library is installed and can be imported, the EMMSecProtNASMessage and EMMServiceRequest classes
|
|
|
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
|
... | ... | @@ -68,14 +68,14 @@ 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:
|
|
|
- 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)
|
|
|
- _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)
|
|
|
|
|
|
In case there is an error during the decoding of the buffer, this will be returned in
|
|
|
the `err` code, with a code corresponding to standard 3GPP NAS error code (e.g. which can be
|
|
|
used in a Status NAS message in return).
|
|
|
The `element` contains an Element's instance (or None, if the whole decoding failed), with
|
|
|
the while message header and information elements.
|
|
|
the whole message header and information elements.
|
|
|
|
|
|
Let's see some examples from the test directory:
|
|
|
|
... | ... | |