![]() ![]() |
|||
![]() AUTHORS NEWS PRODUCTS CONTENTS ERRATA FOREWORD LINKS REVIEWS TOOLS HOME HE W2K3 HackingExposed.com |
Integrated Windows authentication (formerly known as NTLM authentication and Windows NT challenge/response authentication) uses Microsoft's proprietary NT LAN Manager (NTLM) authentication algorithm over HTTP. It is implemented primarily by Microsoft's Internet Explorer browser and IIS Web servers, but is also available in other popular software like Mozilla's Firefox browser through it's support of the Simple and Protected GSS-API Negotiation Mechanism (SPNEGO) internet standard (RFC 2478) to negotiate Kerberos, NTLM, or other authentication protocols supported by the operating system (for example, SSPI on Microsoft Windows, GSS-API on Linux, Mac OSX, and other UNIX-like systems implement SPNEGO). Many Web security assessment tools do not support NTLM or SPNEGO. Consequently, in order to assess a Web application the implements NTLM, you need to use a utility like The NTLM Authorization Proxy Server (APS) by Dmitry Rozmanov, which enables you to use standard HTTP analysis tools to examine applications protected by NTLM-authenticated Web applications. Web security tools like Achilles, whisker, nikto, and many others do not support the NTLM authentication scheme. Consequently, whenever an application relies on this proprietary authentication scheme, your toolkit could be severely hampered. With APS installed, these tools work quite well against NTLM sites. You will also need a working install of the Python language. The tool does not require any compilation or additional modules that do not come with the standard Python distribution. TIP: Cygwin's version of Python does not support a specific threading module used by APS. On the Windows platform, you'll have to use the ActivePython distribution from http://www.activestate.com/. Before you execute the proxy, you must first customize the server.cfg file. Table 4-1 describes some of the available options and their purpose. Another benefit of using this proxy is that you can rewrite or add new HTTP headers. Specify new headers in the [CLIENT_HEADER] section of server.cfg. By default, APS sets the "Accept:" and "User-Agent:" headers. The User-Agent header is useful when you are running such tools as wget, lynx, or whisker behind the proxy. On the other hand, each of these tools lets you customize the User-Agent string anyway. A more useful example might be sites that rely heavily on cookies for session management or authorization. You could hard-code a cookie value in this section in order to spoof or impersonate another's session. Server.cfg Options: The final section of the server.cfg file, [DEBUG], contains debugging directives for the tool. These are more useful for developing and improving APS as opposed to security testing for a Web application. However, the DEBUG and BIN_DEBUG options can be helpful for tracking a Web session in order to go back through the contents at a later time as part of the source-sifting phase. At this point, you should have a properly configured server.cfg file. Running APS is simple: $ python main.py Now, you can use any tool that normally breaks against NTLM authentication. For example, here's how you would run wget through the proxy. In this example, APS is listening on port 80 on the host at 192.168.10.23 and the target application that uses NTLM authentication is at www.victim.com: $ export http_proxy=http://192.168.10.23:80/ It's honestly that simple! TIP: Wget supports the http_proxy environment variable by default. Setting this variable depends on your command shell, but most likely uses the export or setenv command. Use "--proxy=on" to make sure wget uses the proxy. NTLM Authorization Proxy Server and SSL $ stunnel -p clientcert.pem -f -d 80 -r www.victim.com:443 -c Here is the APS configuration of the server.cfg file: And the command to start APS: Finally, you set your tool's proxy setting to port 80 on 192.168.10.10 and you can run it against the NTLM application transparently! If the browser forces you to start off with HTTPS, then you will also need to run a second stunnel so that you can downgrade SSL traffic from your Web browser to cleartext so it will be acceptable by APS. This command is almost exactly like the previous stunnel, only you omit the -c option. Notice that you point the stunnel command to the proxy server: $ stunnel -p clientcert.pem -f -d 443 -r 192.168.10.10:80 There's a final step to this second stunnel requirement. You have to
modify your system's /etc/hosts or winnt/system32/drivers/etc/hosts file
so that www.victim.com's IP address points to 127.0.0.1. You must do this
so that the tool's initial request is sent through the stunnel listening
on port 443. After this, each of the proxies will handle the hostname
properly. Admittedly, this is a drawn-out process and it would be much
easier if APS supported SSL natively, but that's where you have the advantage
of open source code. Use the source, Luke! |
![]()
|
|
| Copyright © 2003. All Rights Reserved. Designed by HTMLfx | |||