[Python] Comparing TCP checksums with Scapy?

Discussão em 'Python' iniciado por Stack, Abril 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to identify packets with incorrect checksums while using Scapy as a sniffer. I am able to get the original checksum by accessing

    packet[TCP].chksum


    I then remove this using

    del packet[TCP].chksum


    I would like to do something like

    if(originalChecksum == recomputedChecksum):
    # Checksum is valid


    I understand that using show2() recomputes the checksum, but is there anyway to access this attribute for comparing back to the original? Calling show2() simply displays what the checksum would be, and does not set any of the values in the packet.

    Thanks for any clarification

    Continue reading...

Compartilhe esta Página