[jcifs] jCIFS, non encrypted password and Samba 3 failure

Fabrice Jammes fjammes at univ-paris1.fr
Thu Jun 30 12:25:28 GMT 2005


jCIFS doesn't seem to work with Samba 3 with option :
encrypt password = no
: the problem add already been reported here

http://article.gmane.org/gmane.network.samba.java/4345/match=++authenticate

For next tests i use jcifs-1.2.0.jar (prior versions give same results).

I capture network packets from jCIFS client and i compare them to  the 
ones generated by smbclient during an authentication :

With smbclient (authentication successfull)

0000 00 00 00 01 00 06 00 03 47 25 f9 8b 00 00 08 00 ........ G%......
0010 45 00 00 d0 ec af 40 00 40 06 0a 91 c1 37 60 2e E..... at . @....7`.
0020 c1 37 60 4a 0c e8 01 bd bf fd 37 f4 b0 7f f1 92 .7`J.... ..7.....
0030 80 18 05 b4 89 ce 00 00 01 01 08 0a 57 ae e6 d0 ........ ....W...
0040 00 5f 29 b8 00 00 00 98 ff 53 4d 42 73 00 00 00 ._)..... .SMBs...
0050 00 08 01 c8 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0060 00 00 ce 16 00 00 02 00 0d ff 00 00 00 ff ff 02 ........ ........
0070 00 ce 16 b1 1f 00 00 00 00 15 00 00 00 00 00 5c ........ .......\
0080 c0 00 00 5b 00 00 50 00 63 00 65 00 63 00 37 00 ...[..M. o.t.d.e.
0090 35 00 30 00 31 00 33 00 00 00 66 00 6a 00 61 00 p.a.s.s. ..f.j.a.
00a0 6d 00 6d 00 65 00 73 00 00 00 00 00 55 00 6e 00 m.m.e.s. ....U.n.
00b0 69 00 78 00 00 00 53 00 61 00 6d 00 62 00 61 00 i.x...S. a.m.b.a.
00c0 20 00 33 00 2e 00 30 00 2e 00 31 00 34 00 61 00 .3...0. ..1.4.a.
00d0 2d 00 44 00 65 00 62 00 69 00 61 00 6e 00 00 00 -.D.e.b. i.a.n...

With jCIFS

0000 00 00 00 01 00 06 00 03 47 25 f9 8b 00 00 08 00 ........ G%......
0010 45 00 01 0e b3 42 40 00 40 06 43 c0 c1 37 60 2e E....B at . @.C..7`.
0020 c1 37 60 4a 0a 83 01 bd cb 08 2b 4d bd 02 21 6a .7`J.... ..+M..!j
0030 80 18 05 b4 27 7c 00 00 01 01 08 0a 57 b1 98 5b ....'|.. ....W..[
0040 00 61 e6 46 00 00 00 d6 ff 53 4d 42 73 00 00 00 .a.F.... .SMBs...
0050 00 18 03 c0 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0060 00 00 67 c2 00 00 02 00 0d 75 00 7e 00 04 41 0a ..g..... .u.~..A.
0070 00 01 00 00 00 00 00 00 00 14 00 00 00 00 00 54 ........ .......T
0080 00 00 00 41 00 50 00 63 00 65 00 63 00 37 00 35 ...A.M.o .t.d.e.p
0090 00 30 00 31 00 33 00 00 00 00 66 00 6a 00 61 00 .a.s.s.. ..f.j.a.
00a0 6d 00 6d 00 65 00 73 00 00 00 3f 00 00 00 4c 00 m.m.e.s. ..?...L.
00b0 69 00 6e 00 75 00 78 00 00 00 6a 00 43 00 49 00 i.n.u.x. ..j.C.I.
00c0 46 00 53 00 00 00 04 ff 00 00 00 00 00 01 00 4d F.S..... .......M
00d0 00 00 5c 00 5c 00 6a 00 6f 00 65 00 64 00 61 00 ..\.\.j. o.e.d.a.
00e0 6c 00 74 00 6f 00 6e 00 2e 00 75 00 6e 00 69 00 l.t.o.n. ..u.n.i.
00f0 76 00 2d 00 70 00 61 00 72 00 69 00 73 00 31 00 v.-.p.a. r.i.s.1.
0100 2e 00 66 00 72 00 5c 00 46 00 4a 00 41 00 4d 00 ..f.r.\. F.J.A.M.
0110 4d 00 45 00 53 00 00 00 3f 3f 3f 3f 3f 00 M.E.S... ?????.

There is a space in my password "Mo tdepass" (my good password is 
"Motdepass")

I try to use  different values for jcifs.smb.lmCompatibility (from 0
to 4) without success.

Here are Samba logs for a jCIFS authentication :

Get_Pwnam_internals did find user [fjammes]!
[2005/06/30 10:54:26, 4] auth/pass_check.c:pass_check(621)
pass_check: Checking (PAM) password for user fjammes (l=24)
[2005/06/30 10:54:26, 4] auth/pampass.c:smb_pam_start(459)
smb_pam_start: PAM: Init user: fjammes
[2005/06/30 10:54:26, 4] auth/pampass.c:smb_pam_start(476)
smb_pam_start: PAM: setting rhost to: 193.55.96.46
[2005/06/30 10:54:26, 4] auth/pampass.c:smb_pam_start(485)
smb_pam_start: PAM: setting tty
[2005/06/30 10:54:26, 4] auth/pampass.c:smb_pam_start(493)
smb_pam_start: PAM: Init passed for user: fjammes
[2005/06/30 10:54:26, 4] auth/pampass.c:smb_pam_auth(510)
smb_pam_auth: PAM: Authenticate User: fjammes
[2005/06/30 10:54:28, 2] auth/pampass.c:smb_pam_auth(514)
smb_pam_auth: PAM: Athentication Error for user fjammes
[2005/06/30 10:54:28, 2] auth/pampass.c:smb_pam_error_handler(73)
smb_pam_error_handler: PAM: Authentication Failure : Authentication failure
[2005/06/30 10:54:28, 0] auth/pampass.c:smb_pam_passcheck(810)
smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User fjammes !
[2005/06/30 10:54:28, 4] auth/pampass.c:smb_pam_end(440)
smb_pam_end: PAM: PAM_END OK.
[2005/06/30 10:54:28, 3] smbd/sec_ctx.c:pop_sec_ctx(386)
pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/06/30 10:54:28, 5] auth/auth.c:check_ntlm_password(271)
check_ntlm_password: unix authentication for user [fjammes] FAILED with 
error NT_STATUS_WRONG_PASSWORD
[2005/06/30 10:54:28, 2] auth/auth.c:check_ntlm_password(312)
check_ntlm_password: Authentication for user [fjammes] -> [fjammes] 
FAILED with error NT_STATUS_WRONG_PASSWORD
[2005/06/30 10:54:28, 5] auth/auth_util.c:free_user_info(1380)
attempting to free (and zero) a user_info structure
[2005/06/30 10:54:28, 10] auth/auth_util.c:free_user_info(1383)
structure was created for fjammes
[2005/06/30 10:54:28, 3] smbd/error.c:error_packet(105)
error string = Inappropriate ioctl for device
[2005/06/30 10:54:28, 3] smbd/error.c:error_packet(129)
error packet at smbd/sesssetup.c(899) cmd=115 (SMBsesssetupX) 
NT_STATUS_LOGON_FAILURE
[2005/06/30 10:54:28, 0] smbd/process.c:smb_dump(841)
created /tmp/SMBsesssetupX.9.resp len 39
[2005/06/30 10:54:28, 5] lib/util.c:show_msg(464)
[2005/06/30 10:54:28, 5] lib/util.c:show_msg(474)

With next file :

File /tmp/SMBsesssetupX.9.req
u~AMBs▒ÀgÂ
TAMotdepassfjammes?LinuxjCIFSÿM\\joedalton.univ-paris1.fr\FJAMMES?????

Former file becomes this with a successfull smbclient authentication :

ÿÿÿà¾\À[MotdepassfjammesUnixSamba 3.0.14a-Debian

I didn't test with Samba 2 (we don't use it no more)

Could somebody help me ?? jCIFS does not seem to work
with Samba 3 and next setting :

encrypt password = false

Unfortunately we need this setting ;-)

Thanks for your help.



More information about the jcifs mailing list