Skip to content

Commit

Permalink
Pad all SMB2 packets, even the last in a compound response
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 committed Jan 7, 2025
1 parent 0704387 commit 1c5a202
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions impacket/smbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4635,9 +4635,8 @@ def processRequest(self, connId, data):
finalData = []
totalPackets = len(packetsToSend)
for idx, packet in enumerate(packetsToSend):
padLen = 0
padLen = -len(packet) % 8
if idx + 1 < totalPackets:
padLen = -len(packet) % 8
packet['NextCommand'] = len(packet) + padLen

if connData['SignatureEnabled']:
Expand Down

0 comments on commit 1c5a202

Please sign in to comment.