MCPcopy Index your code
hub / github.com/secdev/scapy / nmap_udppacket_sig

Function nmap_udppacket_sig

scapy/modules/nmap.py:124–146  ·  view source on GitHub ↗
(snd, rcv)

Source from the content-addressed store, hash-verified

122
123
124def nmap_udppacket_sig(snd, rcv):
125 # type: (SndRcvList, PacketList) -> Dict
126 res = {}
127 if rcv is None:
128 res["Resp"] = "N"
129 else:
130 res["DF"] = "Y" if rcv.flags.DF else "N"
131 res["TOS"] = "%X" % rcv.tos
132 res["IPLEN"] = "%X" % rcv.len
133 res["RIPTL"] = "%X" % rcv.payload.payload.len
134 res["RID"] = "E" if snd.id == rcv[IPerror].id else "F"
135 res["RIPCK"] = "E" if snd.chksum == rcv[IPerror].chksum else (
136 "0" if rcv[IPerror].chksum == 0 else "F"
137 )
138 res["UCK"] = "E" if snd.payload.chksum == rcv[UDPerror].chksum else (
139 "0" if rcv[UDPerror].chksum == 0 else "F"
140 )
141 res["ULEN"] = "%X" % rcv[UDPerror].len
142 res["DAT"] = "E" if (
143 isinstance(rcv[UDPerror].payload, NoPayload) or
144 raw(rcv[UDPerror].payload) == raw(snd[UDP].payload)
145 ) else "F"
146 return res
147
148
149def nmap_match_one_sig(seen, ref):

Callers 1

nmap_probes2sigFunction · 0.85

Calls 1

rawFunction · 0.90

Tested by

no test coverage detected