tool for anonymization of (telecom) PCAP files
Go to file
Harald Welte f0206b949b Catch exceptions while decoding the packet
If any exceptions are found while decoding the packet, remove it from
the output trace to ensure no information leaks.

In my real-world traces, I e.g. got the following exception terminating
the program:

CHOICE._from_per: S1AP-PDU, unknown extension index 699866529169900427952657872967740904512772918212192949539462653507496501180206847298869570851487786014667431700603926958879953036143148400114887836583469249625472224706264417515341607478659710751184333540332091231808038155414952989252906034887075176400074366401692584783210687966823902077240699797242085375
Traceback (most recent call last):
  File "./s1ap_reiniger.py", line 245, in <module>
    handle_pcap(sys.argv[1], sys.argv[2])
  File "./s1ap_reiniger.py", line 215, in handle_pcap
    pkt = handle_sctp_pkt(pkt, i)
  File "./s1ap_reiniger.py", line 193, in handle_sctp_pkt
    success = handle_sctp_chunk(chunk, pkt_number)
  File "./s1ap_reiniger.py", line 167, in handle_sctp_chunk
    handle_s1ap(s1ap(), pkt_number)
  File "./s1ap_reiniger.py", line 122, in handle_s1ap
    log.info("Processing S1AP message '%s:%s' (Packet %d)" % (msg[0], msg[1]['value'][0], pkt_number))
TypeError: byte indices must be integers or slices, not str
2019-09-27 10:04:54 +02:00
s1ap_reiniger.py Catch exceptions while decoding the packet 2019-09-27 10:04:54 +02:00