1

I'm implementing a protocol in Scapy, and here is what I've done far (details omitted):

class Protocol - #Defines some common headers
    def guess_payload_class:
        return ProtocolAction1

class ProtocolAction1 - #Defines some action to be done by the protocol.


class ProtocolAnswer - #Defines some common headers
    def guess_payload_class:
        return ProtocolAction1Anser

class ProtocolAction1Answer - #Defines the answer when Action1 has been done.

bind_layers(UDP, Protocol, dport=port)
bind_layers(UDP, ProtocolAnswer, sport=port)

However, when I do an sr(IP()/UDP()/Protocol()/ProtocolAction1()), I can never get an answer (although the server sends it). My intention is to get an IP()/UDP()/ProtocolAnswer()/ProtocolAction1Answer(). What am I doing wrong and how can I fix it?

4

0 回答 0