{"action":"created","issue":{"url":"https://api.github.com/repos/hierynomus/smbj/issues/216","repository_url":"https://api.github.com/repos/hierynomus/smbj","labels_url":"https://api.github.com/repos/hierynomus/smbj/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/hierynomus/smbj/issues/216/comments","events_url":"https://api.github.com/repos/hierynomus/smbj/issues/216/events","html_url":"https://github.com/hierynomus/smbj/issues/216","id":264902944,"number":216,"title":"Anonymous user not working for SMBv2","user":{"login":"debarghya85","id":29731370,"avatar_url":"https://avatars1.githubusercontent.com/u/29731370?v=4","gravatar_id":"","url":"https://api.github.com/users/debarghya85","html_url":"https://github.com/debarghya85","followers_url":"https://api.github.com/users/debarghya85/followers","following_url":"https://api.github.com/users/debarghya85/following{/other_user}","gists_url":"https://api.github.com/users/debarghya85/gists{/gist_id}","starred_url":"https://api.github.com/users/debarghya85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debarghya85/subscriptions","organizations_url":"https://api.github.com/users/debarghya85/orgs","repos_url":"https://api.github.com/users/debarghya85/repos","events_url":"https://api.github.com/users/debarghya85/events{/privacy}","received_events_url":"https://api.github.com/users/debarghya85/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-10-12T11:18:17Z","updated_at":"2017-10-16T12:44:10Z","closed_at":null,"author_association":"NONE","body":"Code:\r\n---------\r\n```\r\nAuthenticationContext authContext = null;\r\nif(!username.trim().equals(\"\"))\r\n\tauthContext = new AuthenticationContext(username, password.toCharArray(), domain);\r\nelse\r\n\tauthContext = AuthenticationContext.anonymous();\r\n\r\ntry {\r\n    Session session = connection.authenticate(authContext);\r\n    DiskShare share = (DiskShare) session.connectShare(sambaSharedPath); // giving exception in this line\r\n}catch(Exception ex){\r\n\tex.printStackTrace();\r\n}\r\n```\r\n\r\nThis is the exception trace:\r\n--------------------------------\r\n```\r\ncom.hierynomus.smbj.common.SMBApiException: STATUS_ACCESS_DENIED(3221225506/3221225506): Could not connect to [Share_Location]\r\n\tat com.hierynomus.smbj.session.Session.connectTree(Session.java:102)\r\n\tat com.hierynomus.smbj.session.Session.connectShare(Session.java:87)\r\n```\t\r\n\t\r\n\t\r\nDetails log:\r\n------------------\r\n```\r\n[main] INFO com.hierynomus.protocol.commons.socket.ProxySocketFactory - Connecting to Share_IP/Port\r\n[main] INFO com.hierynomus.smbj.transport.PacketReader - Starting PacketReader on thread: Packet Reader for Share_IP\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Negotiating dialects [SMB_2_0_2, SMB_2_1] with server Share_IP\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Granted 1 (out of 1) credits to SMB2_NEGOTIATE with message id << 0 >>\r\n[main] INFO com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport - Writing packet SMB2_NEGOTIATE with message id << 0 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.transport.PacketReader - Received packet SMB2_NEGOTIATE with message id << 0 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.connection.Connection - Server granted us 1 credits for SMB2_NEGOTIATE with message id << 0 >>, now available: 1 credits\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Negotiated the following connection settings: ConnectionInfo{\r\n  serverGuid=serverGuid,\r\n  serverName='Share_IP',\r\n  negotiatedProtocol=NegotiatedProtocol{dialect=SMB_2_1, maxTransactSize=1048576, maxReadSize=1048576, maxWriteSize=1048576},\r\n  clientGuid=clientGuid,\r\n  clientCapabilities=null,\r\n  serverCapabilities=[SMB2_GLOBAL_CAP_DFS, SMB2_GLOBAL_CAP_LARGE_MTU],\r\n  clientSecurityMode=0,\r\n  serverSecurityMode=1,\r\n  server='null'\r\n}\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Successfully connected to: Share_IP\r\n[main] INFO com.hierynomus.smbj.auth.NtlmAuthenticator - Initialized Authentication of  using NTLM\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Granted 1 (out of 1) credits to SMB2_SESSION_SETUP with message id << 1 >>\r\n[main] INFO com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport - Writing packet SMB2_SESSION_SETUP with message id << 1 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.transport.PacketReader - Received packet SMB2_SESSION_SETUP with message id << 1 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.connection.Connection - Server granted us 1 credits for SMB2_SESSION_SETUP with message id << 1 >>, now available: 1 credits\r\n[main] INFO com.hierynomus.smbj.connection.Connection - More processing required for authentication of  using com.hierynomus.smbj.auth.NtlmAuthenticator@2fc2534f\r\n[main] INFO com.hierynomus.smbj.auth.NtlmAuthenticator - Received token: a1 81 96 30 81 93 a0 03 0a 01 01 a1 0c 06 0a 2b 06 01 04 01 82 37 02 02 0a a2 7e 04 7c 4e 54 4c 4d 53 53 50 00 02 00 00 00 0c 00 0c 00 30 00 00 00 15 82 8a e0 f5 d2 c5 10 14 13 3d 58 00 00 00 00 00 00 00 00 40 00 40 00 3c 00 00 00 43 00 45 00 4e 00 54 00 4f 00 53 00 02 00 0c 00 43 00 45 00 4e 00 54 00 4f 00 53 00 01 00 0c 00 43 00 45 00 4e 00 54 00 4f 00 53 00 04 00 00 00 03 00 14 00 67 00 6f 00 6f 00 67 00 6c 00 65 00 61 00 70 00 70 00 73 00 00 00 00 00\r\n[main] INFO com.hierynomus.smbj.auth.NtlmAuthenticator - Received NTLM challenge from: CENTOS\r\ncom.hierynomus.smbj.common.SMBApiException: STATUS_ACCESS_DENIED(3221225506/3221225506): Could not connect to \\\\Share_IP\\ShareFolderWithAnonymousAccess[main] INFO com.hierynomus.smbj.connection.Connection - Granted 1 (out of 1) credits to SMB2_SESSION_SETUP with message id << 2 >>\r\n[main] INFO com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport - Writing packet SMB2_SESSION_SETUP with message id << 2 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.transport.PacketReader - Received packet SMB2_SESSION_SETUP with message id << 2 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.connection.Connection - Server granted us 33 credits for SMB2_SESSION_SETUP with message id << 2 >>, now available: 33 credits\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Successfully authenticated  on Share_IP, session is 164396731\r\n[main] INFO com.hierynomus.smbj.session.Session - Connecting to \\\\Share_IP\\ShareFolderWithAnonymousAccess on session 164396731\r\n[main] INFO com.hierynomus.smbj.connection.Connection - Granted 1 (out of 33) credits to SMB2_TREE_CONNECT with message id << 3 >>\r\n[main] INFO com.hierynomus.smbj.transport.tcp.direct.DirectTcpTransport - Writing packet SMB2_TREE_CONNECT with message id << 3 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.transport.PacketReader - Received packet SMB2_TREE_CONNECT with message id << 3 >>\r\n[Packet Reader for Share_IP] INFO com.hierynomus.smbj.connection.Connection - Server granted us 33 credits for SMB2_TREE_CONNECT with message id << 3 >>, now available: 65 credits\r\n[Packet Reader for Share_IP] ERROR com.hierynomus.smbj.session.PacketSignatory - Signatures for packet SMB2_TREE_CONNECT with message id << 3 >> do not match (received: [102, 42, 37, 4, -72, 14, -20, 14, -118, 97, 106, -5, -119, -7, 125, -81], calculated: [-89, 42, -27, 11, 74, -56, -6, -96, 87, 124, -6, -68, 15, -38, 86, -107, -71, 88, 55, 88, 92, -62, 52, 116, 106, -84, 68, -88, 126, -17, -27, 17])\r\n[Packet Reader for Share_IP] WARN com.hierynomus.smbj.connection.Connection - Invalid packet signature for packet SMB2_TREE_CONNECT with message id << 3 >>\r\n[main] INFO com.hierynomus.smbj.session.Session - dialect=null, creditCharge=1, creditRequest=0, creditResponse=33, message=SMB2_TREE_CONNECT, messageId=3, asyncId=0, sessionId=164396731, treeId=0, status=STATUS_ACCESS_DENIED, statusCode=3221225506, flags=9, nextCommandOffset=0\r\n```\r\n                \r\n"},"comment":{"url":"https://api.github.com/repos/hierynomus/smbj/issues/comments/336875238","html_url":"https://github.com/hierynomus/smbj/issues/216#issuecomment-336875238","issue_url":"https://api.github.com/repos/hierynomus/smbj/issues/216","id":336875238,"user":{"login":"hierynomus","id":117667,"avatar_url":"https://avatars0.githubusercontent.com/u/117667?v=4","gravatar_id":"","url":"https://api.github.com/users/hierynomus","html_url":"https://github.com/hierynomus","followers_url":"https://api.github.com/users/hierynomus/followers","following_url":"https://api.github.com/users/hierynomus/following{/other_user}","gists_url":"https://api.github.com/users/hierynomus/gists{/gist_id}","starred_url":"https://api.github.com/users/hierynomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hierynomus/subscriptions","organizations_url":"https://api.github.com/users/hierynomus/orgs","repos_url":"https://api.github.com/users/hierynomus/repos","events_url":"https://api.github.com/users/hierynomus/events{/privacy}","received_events_url":"https://api.github.com/users/hierynomus/received_events","type":"User","site_admin":false},"created_at":"2017-10-16T12:44:10Z","updated_at":"2017-10-16T12:44:10Z","author_association":"OWNER","body":"Can you capture a TCP dump from the windows attempt to connect to the share, and the SMBJ attempt? ANalyzing those should point to where they're different."}}
{"actor":{"display_login":"hierynomus"}}