fortra / impacket

Impacket is a collection of Python classes for working with network protocols.
https://www.coresecurity.com
Other
13.52k stars 3.58k forks source link

smbserver: smb2SetInfo SMB2_FILE_ALLOCATION_INFO not impl #1434

Open 9001 opened 2 years ago

9001 commented 2 years ago

Configuration

impacket version: 0.10.0 Python version: 3.10.7 Target OS: windows 10, smb2

Debug Output With Command String

./smbserver.py -username ed -password k -ts -debug -ip 192.168.123.1 -port 3945 -smb2support a /home/ed/dl
[2022-11-02 22:57:13] [-] Unknown level for set file info! 0x13

Additional context

tiny nitpick with examples/smbserver.py,

connecting from win10 and creating a new file using rightclick>new>textdocument makes win10 show an error message, Error 0x80070032: The request is not supported

the file does get created and becomes visible after a quick F5 so it's just a minor inconvenience

JerAxxxxxxx commented 1 year ago

When I edit a file, the file cannot be saved correctly.

I modified part of the code of impact/smbserver.py and added a condition in the smb2SetInfo method. It allows me to work normally for the time being, but I don't know what bad impact it will bring

elif informationLevel == smb2.SMB2_FILE_ALLOCATION_INFO:
   smbServer.log("allocation info, do nothing", logging.INFO)

Now I will not report errors on the server when creating and editing files