Skip to content

Commit

Permalink
Do not attempt to intercept unexisting files
Browse files Browse the repository at this point in the history
  • Loading branch information
obilodeau committed Nov 15, 2022
1 parent 7361859 commit e7022cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyrdp/mitm/DeviceRedirectionMITM.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ def handleCreateResponse(self, request: DeviceCreateRequestPDU, response: Device

isFileRead = request.desiredAccess & (FileAccessMask.GENERIC_READ | FileAccessMask.FILE_READ_DATA) != 0
isDirectory = request.createOptions & CreateOption.FILE_NON_DIRECTORY_FILE == 0
fileExists = (response.ioStatus != NTSTATUS.STATUS_NO_SUCH_FILE)

if isFileRead and not isDirectory:
if fileExists and isFileRead and not isDirectory:
mapping = FileMapping.generate(request.path, self.config.fileDir, self.deviceRoot(response.deviceID), self.log)
key = (response.deviceID, response.fileID)
self.mappings[key] = mapping
Expand Down

0 comments on commit e7022cf

Please sign in to comment.