Closed Marc-Egli closed 1 year ago
When decoding an EMMCPServiceRequest is seems that the NASContainer field is not recursively decoded.
EMMCPServiceRequest
NASContainer
Here is a code snippet that shows the wrong behavior:
from pycrate_mobile.NAS import * from pycrate_mobile import * # EMMCPServiceRequest is Mobile Originated Msg, err = parse_NASLTE_MO(unhexlify('074d70780001ce6703091011570233c9d1')) # NASContainer is not corretly decoded show(Msg) # EMMULNASTransport Msg, err = parse_NASLTE_MO(unhexlify('0763020904')) # NASContainer is correctly decoded show(Msg)
EMMCPServiceRequest is a message from the UE to the network which means the condition in parse_NASLTE_MO should be modified.
parse_NASLTE_MO
https://github.com/P1sec/pycrate/blob/5120eb20fede8f5c2e6115946b711f4a0074b029/pycrate_mobile/NASLTE.py#L151
A fix would be to check if typ is also equal to 77 in the code line above and replace the elif statement by an if statement as an EMMCPServiceRequest contains both an ESMContainer and a NASContainer.
typ
77
elif
if
ESMContainer
Thank you in advance.
Thanks for reporting. This should be fixed after the 2 last commits.
Thank you !
When decoding an
EMMCPServiceRequest
is seems that theNASContainer
field is not recursively decoded.Here is a code snippet that shows the wrong behavior:
EMMCPServiceRequest
is a message from the UE to the network which means the condition inparse_NASLTE_MO
should be modified.https://github.com/P1sec/pycrate/blob/5120eb20fede8f5c2e6115946b711f4a0074b029/pycrate_mobile/NASLTE.py#L151
A fix would be to check if
typ
is also equal to77
in the code line above and replace theelif
statement by anif
statement as anEMMCPServiceRequest
contains both anESMContainer
and aNASContainer
.Thank you in advance.