i'm trying to build a MODBUS packet with scapy, but Wireshark can't recognize it. i mean, the MODBUS interpreted as the TCP data.
here is the python code of Scapy:
from scapy.all import *
class Modbus(Packet):
name = "Modbus/tcp"
fields_desc = [ ShortField("Transaction Identifier", 1),
ShortField("Protocol Identifier", 0),
ShortField("Length", 5),
XByteField("Unit Identifier",0),
]
def make_test():
pkt = TCP(sport=502, dport=502)
return Ether()/IP(src="5.5.5.101",dst="5.5.5.100")/pkt/Modbus()
while True:
send(make_test())
someone has an idea how to fix it?