Skip to content

Commit

Permalink
Check LDAP fields (#4524)
Browse files Browse the repository at this point in the history
  • Loading branch information
guedou committed Sep 5, 2024
1 parent a51bcd5 commit 1935723
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scapy/layers/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ def answers(self, other):
return isinstance(other, LDAP) and other.messageID == self.messageID

def mysummary(self):
if not self.protocolOp or not self.messageID:
return ""
return (
"%s(%s)"
% (
Expand Down
5 changes: 5 additions & 0 deletions test/regression.uts
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,11 @@ except Scapy_Exception:
file = BytesIO(b"\n\r\r\n\x00\x00\x008\x1a+<M\x00\x01\x00\x00\xef\xff\xff\x81\x01\x00\x00\x01\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x009\x00\x00\x00\x01\x00\x00\x000\x00e\x00\x00\x00\x00\x00\x00\x00\x008\x00\x00\x00\x06\x00\x00\x00d\x00\x00\x00\x00'\x00\x00\x00\x01\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x000\x00\x00\x00\x01\x00\x00\x008\x00\x00\n\x0c\x00A\x05\xc0\x01\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x01\x00\x00\x008\x00\x00\n\x0c\x00A\x05\xc0\x83\x00\x00\x043\x01\x00\x00\x00\x00\x00d\x00\x00\x00\x00d")
l = rdpcap(file)

# Issue #69628
file = BytesIO(b"M<\xb2\xa1 \x00\xff\xf9\xff\x00\x00\xff\xff\xff\xa1\xb2<M\x01\x00\x00\x00\x00\x00\x00\x17\xca\xca\xca\xca\xca\xca\xca\xca\xca\xca\r\x80\x01[\x00\x01noenum\x00\x00\x00\x00\x00\x06value\x01\x00\x00\x00\x00\x00\x00\x01\x85\xff\xff\x00\x00\x94\xc3\x000\x00\x08\xa0\xf30\x800\x000\x00")
l = rdpcap(file)
assert l[0][LDAP].summary() == "LDAP"

= Read a pcap file with wirelen != captured len
pktpcapwirelen = rdpcap(pcapwirelenfile)

Expand Down

0 comments on commit 1935723

Please sign in to comment.