Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange packet-signature failure #439

Closed
burkolter opened this issue Mar 11, 2019 · 6 comments
Closed

Strange packet-signature failure #439

burkolter opened this issue Mar 11, 2019 · 6 comments

Comments

@burkolter
Copy link

burkolter commented Mar 11, 2019

Hi All

I see strange errors with the PacketSignatory (see log below). There seems to be a mismatch. The connection is closed afterwards.

We are using build 0.9.1 on debian linux to connect to a Windows-Share. The connection details are:

08.03.2019 13:50:41,026 DEBUG Connection.negotiateDialect - Negotiated the following connection settings: ConnectionInfo{
  serverGuid=ae95e245-d7a8-4760-93cd-fc047f3e7b29,
  serverName='10.3.248.142',
  negotiatedProtocol=NegotiatedProtocol{dialect=SMB_2_1, maxTransactSize=8388608, maxReadSize=8388608, maxWriteSize=8388608},
  clientGuid=0284918e-7895-49e1-b930-19f62180743b,
  clientCapabilities=[SMB2_GLOBAL_CAP_DFS],
  serverCapabilities=[SMB2_GLOBAL_CAP_DFS, SMB2_GLOBAL_CAP_LEASING, SMB2_GLOBAL_CAP_LARGE_MTU],
  clientSecurityMode=0,
  serverSecurityMode=3,
  server='null'
}

I'm using your library as in your examples except that I'm reusing the established share.

I'm stuck in the analysis. Do you have any recommendations for any futher analysis?

08.03.2019 13:50:45,752 DEBUG Connection.send - Granted 1 (out of 537) credits to SMB2_CREATE with message id << 30 >>
08.03.2019 13:50:45,753 DEBUG DirectTcpTransport.write - Writing packet SMB2_CREATE with message id << 30 >>
08.03.2019 13:50:45,753 DEBUG Promise.tryRetrieve - Awaiting << 30 >>
08.03.2019 13:50:45,754 DEBUG PacketReader.readPacket - Received packet SMB2_CREATE with message id << 30 >>
08.03.2019 13:50:45,755 DEBUG Connection.handle - Server granted us 2 credits for SMB2_CREATE with message id << 30 >>, now available: 538 credits
08.03.2019 13:50:45,755 DEBUG Promise.deliver - Setting << 30 >> to `SMB2_CREATE with message id << 30 >>`
08.03.2019 13:50:45,755 DEBUG Connection.send - Granted 128 (out of 538) credits to SMB2_READ with message id << 31 >>
08.03.2019 13:50:45,756 DEBUG DirectTcpTransport.write - Writing packet SMB2_READ with message id << 31 >>
08.03.2019 13:50:45,757 DEBUG Promise.tryRetrieve - Awaiting << 31 >>
08.03.2019 13:50:46,148 DEBUG PacketReader.readPacket - Received packet SMB2_READ with message id << 31 >>
08.03.2019 13:50:46,149 DEBUG Connection.handle - Server granted us 256 credits for SMB2_READ with message id << 31 >>, now available: 666 credits
08.03.2019 13:50:46,162 ERROR PacketSignatory.verify - Signatures for packet SMB2_READ with message id << 31 >> do not match (received: [32, 58, -110, 79, -93, 99, -100, 0, 38, -84, 114, 117, 114, -81, -33, 36], calculated: [96, 125, -104, 121, 125, 42, -23, 39, 94, -70, -70, -75, -102, -111, -93, -41, 40, -10, -73, -81, -90, 31, -37, -34, -113, -117, -2, 22, -56, -126, -68, -90])
08.03.2019 13:50:46,162 WARN  Connection.verifyPacketSignature - Invalid packet signature for packet SMB2_READ with message id << 31 >>
08.03.2019 13:50:46,163 INFO  PacketReader.run - PacketReader error, got exception.
com.hierynomus.protocol.transport.TransportException: Packet signature for packet SMB2_READ with message id << 31 >> was not correct
	at com.hierynomus.smbj.connection.Connection.verifyPacketSignature(Connection.java:421)
	at com.hierynomus.smbj.connection.Connection.handle(Connection.java:409)
	at com.hierynomus.smbj.connection.Connection.handle(Connection.java:66)
	at com.hierynomus.smbj.transport.PacketReader.readPacket(PacketReader.java:71)
	at com.hierynomus.smbj.transport.PacketReader.run(PacketReader.java:47)
	at java.lang.Thread.run(Thread.java:745)
08.03.2019 13:50:46,164 INFO  Session.logoff - Logging off session 149633842023949 from host 10.3.248.142
08.03.2019 13:50:46,164 DEBUG Connection.send - Granted 1 (out of 666) credits to SMB2_TREE_DISCONNECT with message id << 159 >>
08.03.2019 13:50:46,164 ERROR Promise.tryRetrieve - << 31 >> woke to: com.hierynomus.smbj.common.SMBRuntimeException: com.hierynomus.protocol.transport.TransportException: Packet signature for packet SMB2_READ with message id << 31 >> was not correct
08.03.2019 13:50:46,165 DEBUG DirectTcpTransport.write - Writing packet SMB2_TREE_DISCONNECT with message id << 159 >>
08.03.2019 13:50:46,170 DEBUG Promise.tryRetrieve - Awaiting << 159 >>

I'm looking forward to any recommendation for further analysis!

@hierynomus
Copy link
Owner

If you could get a wireshark capture of the packet it would be interesting to dissect. That would be the only way to know what went wrong.

@burkolter
Copy link
Author

OK. Still trying to grab the wireshark as I can't redo the error intentionally... :-)

@hierynomus
Copy link
Owner

@burkolter Can you try with the latest master? I've merged #458 which should fix this.

@burkolter
Copy link
Author

@hierynomus This looks good so far on my local test system. A quick test on the production system's only possible in July due to restrictions on service windows… The customer's really reluctant to even allow network connection from my local laptop to the "buggy" server… Sorry for this!

Thank you for your work!

@nddipiazza
Copy link
Contributor

@burkolter can you close this issue then?

@burkolter
Copy link
Author

Sure and Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants