File: ntlm.htt

package info (click to toggle)
httest 2.2.6-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 4,188 kB
  • sloc: ansic: 17,134; sh: 10,389; makefile: 490; lisp: 145
file content (50 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
# Test script/example for ntlm authentication
#

SET HOST=foo.bar
SET PORT=80
SET USER=user
SET PASSWD=secret
SET URI=/

CLIENT

_REQ $HOST $PORT
__GET $URI HTTP/1.1
__Host: $HOST
__User-Agent: mozilla
__
_EXPECT . "WWW-Authenticate: NTLM"
_WAIT
_CLOSE

_MATCH EXEC "(.*)" B64MSG
_EXEC $TOP/src/htntlm --type=1 --write --flags="neg-oem neg-lm-key"

_REQ $HOST $PORT
__GET $URI HTTP/1.1
__Host: $HOST
__Authorization: NTLM $B64MSG
__User-Agent: mozilla
__
_MATCH headers "WWW-Authenticate: NTLM (.*)" MSG2
_WAIT

_MATCH EXEC "\nchallenge: (.*)" CHL
_EXEC $TOP/src/htntlm --read=$MSG2 --info

_MATCH EXEC "(.*)" B64MSG
_EXEC $TOP/src/htntlm --type=3 --write --challenge=$CHL --user=$USER --password=$PASSWD --response="lm"

_REQ $HOST $PORT
__GET $URI HTTP/1.1
__Host: $HOST
__Authorization: NTLM $B64MSG
__User-Agent: mozilla
__
_EXPECT . "200 OK"
_WAIT

END