1#
2# Test script/example for ntlm authentication
3#
4
5SET HOST=foo.bar
6SET HOST_HDR=foo
7SET PORT=80
8SET USER=user
9SET PASSWD=secret
10SET URI=/
11
12CLIENT
13
14  _REQ $HOST $PORT
15  __GET $URI HTTP/1.1
16  __Host: $HOST_HDR
17  __User-Agent: mozilla
18  __
19  _EXPECT . "WWW-Authenticate: NTLM"
20  _WAIT
21  _CLOSE
22
23  _MATCH EXEC "(.*)" B64MSG
24  _EXEC $TOP/src/htntlm --type=1 --write --flags="neg-oem neg-ntlm2-key req-target"
25
26  _REQ $HOST $PORT
27  __GET $URI HTTP/1.1
28  __Host: $HOST_HDR
29  __Authorization: NTLM $B64MSG
30  __User-Agent: mozilla
31  __
32  _MATCH headers "WWW-Authenticate: NTLM (.*)" MSG2
33  _WAIT
34
35  _MATCH EXEC "\nchallenge: (.*)" CHL
36  _EXEC $TOP/src/htntlm --read=$MSG2 --info
37
38  _MATCH EXEC "(.*)" B64MSG
39  _EXEC $TOP/src/htntlm --type=3 --write --challenge=$CHL --workstation=akira --domain=$DOMAIN --challenge=$CHL --user=$USER --password=$PASSWD --response="ntlm2-session"
40
41  _REQ $HOST $PORT
42  __GET $URI HTTP/1.1
43  __Host: $HOST_HDR
44  __Authorization: NTLM $B64MSG
45  __User-Agent: mozilla
46  __
47  _EXPECT . "200 OK"
48  _WAIT
49
50END
51
52