Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Thursday, February 11, 2010

cntlm: NTLM Authentication Proxy

cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy. It can run as a windows service (under cygrunsrv control) or in the foreground.

Configuration:
* Username - your domain/proxy account name
* Domain - the actual domain name of the user account
* Workstation - NetBIOS name of your workstation; Cntlm tries to autodetect it, but you might want to set it explicitly should dialect detection fail (see below)
* Proxy - IP address (or ping-able hostname) of your proxy; if you use several alternative proxies or know of backup ones, use this option multiple times; if one stops working, Cntlm will move on to the next
* Listen - local port number which Cntlm should bind to; the default is OK, but remember you can't have more than one application per port; you can use netstat to list used up ports (lines with LISTEN)

Save the configuration and run the following command; when asked, enter your proxy access password:

cntlm -c cntlm.ini -I -M http://test.com

Config profile 1/11... OK (HTTP code: 200)
...
Config profile 6/11... Credentials rejected
...
Config profile 11/11... OK (HTTP code: 200)
----------------------------[ Profile 0 ]------
Auth NTLMv2
PassNTLMv2 4AC6525378DF8C69CF6B6234532943AC
------------------------------------------------

When you get your options (might be more than just Auth and Pass* here), remove all previous password settings and paste the profile into the configuration file and save it. (Re)start Cntlm and it should work. To use it in your applications, replace the old proxy settings with "localhost", port same as you chose for Listen.