Scapy Packages

1

I have some doubts that I can not heal about scapy , could you help me please?

Questions:

  • To declare a package in Scapy I do: pck = IP()/TCP() . With this I can query the layers of pkt , with for example: pkt[IP] or pkt[0] , there arises a doubt:

    • What kind of data is pkt ? A dictionary? How does it use a class like index (in IP case) or a number?
  • How does Scapy treat "/" of IP()/TCP() so that Python does not understand how the divider?

  • asked by anonymous 26.03.2017 / 22:00

    1 answer

    0

    Here he talks a little.

    link

    1. For the type try gives

    print(type(pkt))
    

    But in the doc when instantiating an IP it returns a <IP ... >

    2. But with respect to the operator, most likely in the code there was an overload of operators, overriding the standard behavior of the division using the Data Model of python [1].

    Reference:

    [1] link truediv

        
    27.03.2017 / 17:06