pysmb is an experimental SMB/CIFS library written in Python. It implements the client-side SMB/CIFS protocol (SMB1 and SMB2) which allows your Python application to access and transfer files to/from SMB/CIFS shared folders like your Windows file sharing and Samba folders.
I've been trying to use pysmb to connect to an SMB server which requires SMB2 signatures on each message. Reviewing wireshark traces, I could see every request was failing due to STATUS_ACCESS_DENIED
On the server (which uses Samba) ... I found logs that pointed to bad signatures:
[2020/02/18 13:37:24.472262, 0] ../libcli/smb/smb2_signing.c:179(smb2_signing_check_pdu)
Bad SMB2 signature for message
[2020/02/18 13:37:24.472404, 0] ../lib/util/util.c:555(dump_data)
[0000] 4C 74 8E 9E 67 79 A6 54 B9 C5 57 28 C2 D9 DE 1E Lt..gy.T ..W(....
[2020/02/18 13:37:24.472457, 0] ../lib/util/util.c:555(dump_data)
[0000] 29 0E D4 08 45 B9 02 F5 A6 93 BF 8C 3A F6 51 3E )...E... ....:.Q>
Pretty new to all this, but I found a pretty good example of the signature key generation method here:
I've been trying to use pysmb to connect to an SMB server which requires SMB2 signatures on each message. Reviewing wireshark traces, I could see every request was failing due to
STATUS_ACCESS_DENIED
On the server (which uses Samba) ... I found logs that pointed to bad signatures:
Pretty new to all this, but I found a pretty good example of the signature key generation method here:
https://github.com/SecureAuthCorp/impacket/blob/master/impacket/ntlm.py#L686
I applied a change to pysmb, and its working now!
Not sure if this is an SMB1 vs SMB2 issue? But it does seem like SMB2 signing is broken at the moment.