Skip to content

Instantly share code, notes, and snippets.

@Mons
Created August 13, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mons/df4973e2faba433c90bd to your computer and use it in GitHub Desktop.
Save Mons/df4973e2faba433c90bd to your computer and use it in GitHub Desktop.
IProto wireshark
local iproto_proto = Proto("iproto", "iproto protocol")
function iproto_proto.dissector(buffer, pinfo, tree)
pinfo.cols.protocol = "IPROTO"
local iprotree = tree:add(iproto_proto, buffer(), "IPROTO")
local buffer_len = buffer:len()
local offset = 0
while offset < buffer_len do
local len = buffer((offset + 4), 4):le_uint()
local sync = buffer((offset+8), 4):le_uint()
local subtree = iprotree:add(iproto_proto, buffer(), "packet " .. sync)
subtree:add(buffer(offset, 4), "msg: " ..buffer(offset, 4):le_uint())
subtree:add(buffer((offset+4), 4), "len: " .. len)
subtree:add(buffer((offset+8), 4), "sync: " .. sync)
subtree:add(buffer((offset+12), len), "data: " .. buffer((offset+12), len))
offset = offset + 12 + len
end
end
tcp_table = DissectorTable.get("tcp.port")
tcp_table:add(11311, iproto_proto)
-- (c) Maxim Andreev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment