2005-06-17 15:48:01 +04:00
#!/bin/sh
if [ $# -lt 4 ] ; then
cat <<EOF
2006-05-04 14:03:41 +04:00
Usage: test_session_key.sh SERVER USERNAME PASSWORD DOMAIN NETBIOSNAME
2005-06-17 15:48:01 +04:00
EOF
exit 1;
fi
server = " $1 "
username = " $2 "
password = " $3 "
domain = " $4 "
2006-05-04 14:03:41 +04:00
netbios_name = " $5 "
shift 5
2005-06-17 15:48:01 +04:00
incdir = ` dirname $0 `
. $incdir /test_functions.sh
failed = 0
transport = "ncacn_np"
2006-11-07 02:17:48 +03:00
for bindoptions in bigendian seal; do
2006-02-12 17:19:31 +03:00
for keyexchange in "yes" "no" ; do
for ntlm2 in "yes" "no" ; do
for lm_key in "yes" "no" ; do
2005-06-17 15:48:01 +04:00
for ntlmoptions in \
2006-02-12 17:19:31 +03:00
"-k no --option=usespnego=yes" \
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no" \
"-k no --option=usespnego=yes --option=ntlmssp_client:56bit=yes" \
2006-07-12 06:05:08 +04:00
"-k no --option=usespnego=yes --option=ntlmssp_client:56bit=no" \
2006-02-12 17:19:31 +03:00
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
"-k no --option=usespnego=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=no" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no" \
"-k no --option=usespnego=yes --option=clientntlmv2auth=yes --option=ntlmssp_client:128bit=no --option=ntlmssp_client:56bit=yes" \
"-k no --option=usespnego=no --option=clientntlmv2auth=yes" \
2006-03-06 02:06:37 +03:00
"-k no --option=gensec:spnego=no --option=clientntlmv2auth=yes" \
2006-05-04 14:03:41 +04:00
"-k no --option=usespnego=no" ; do
2006-11-15 20:01:26 +03:00
name = " RPC-SECRETS on $transport with $bindoptions with NTLM2: $ntlm2 KEYEX: $keyexchange LM_KEY: $lm_key $ntlmoptions "
2007-01-26 16:33:06 +03:00
testit " $name " bin/smbtorture $TORTURE_OPTIONS $transport :" $server [ $bindoptions ] " --option= ntlmssp_client:keyexchange= $keyexchange --option= ntlmssp_client:ntlm2= $ntlm2 --option= ntlmssp_client:lm_key= $lm_key $ntlmoptions -U" $username " %" $password " -W $domain --option= gensec:target_hostname= $netbios_name RPC-SECRETS " $* "
2005-06-17 15:48:01 +04:00
done
2006-02-12 17:19:31 +03:00
done
done
done
2006-11-15 20:01:26 +03:00
name = " RPC-SECRETS on $transport with $bindoptions with Kerberos "
2007-01-26 16:33:06 +03:00
testit " $name " bin/smbtorture $TORTURE_OPTIONS $transport :" $server [ $bindoptions ] " -k yes -U" $username " %" $password " -W $domain " --option=gensec:target_hostname= $netbios_name " RPC-SECRETS " $* "
2006-11-15 20:01:26 +03:00
name = " RPC-SECRETS on $transport with $bindoptions with Kerberos - use target principal "
2007-01-26 16:33:06 +03:00
testit " $name " bin/smbtorture $TORTURE_OPTIONS $transport :" $server [ $bindoptions ] " -k yes -U" $username " %" $password " -W $domain "--option=clientusespnegoprincipal=yes" " --option=gensec:target_hostname= $netbios_name " RPC-SECRETS " $* "
2006-02-12 17:19:31 +03:00
done
2006-11-15 20:01:26 +03:00
name = " RPC-SECRETS on $transport with Kerberos - use Samba3 style login "
2007-01-26 16:33:06 +03:00
testit " $name " bin/smbtorture $TORTURE_OPTIONS $transport :" $server " -k yes -U" $username " %" $password " -W $domain "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" " --option=gensec:target_hostname= $netbios_name " RPC-SECRETS " $* "
2006-11-15 20:01:26 +03:00
name = " RPC-SECRETS on $transport with Kerberos - use Samba3 style login, use target principal "
2007-01-26 16:33:06 +03:00
testit " $name " bin/smbtorture $TORTURE_OPTIONS $transport :" $server " -k yes -U" $username " %" $password " -W $domain "--option=clientusespnegoprincipal=yes" "--option=gensec:fake_gssapi_krb5=yes" "--option=gensec:gssapi_krb5=no" " --option=gensec:target_hostname= $netbios_name " RPC-SECRETS " $* "
2005-06-17 15:48:01 +04:00
testok $0 $failed