Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Proxy using Python to pass NTLM credentials to another Proxy

I have an issue where we have setup a NTLM proxy on the corporate level, but we have some code that we do not own that does not support NTLM proxies. Is there a way to create a proxy to automatically pass the NTLM information needed using Python?

I would prefer to be able to just stand up the proxy as needed when the script is run at given times.

Is this possible to do? Can anyone provide a sample on how to do this? Samples can be given in Python 3.4 or 2.7.

Thanks for reading!

like image 665
code base 5000 Avatar asked Nov 24 '15 12:11

code base 5000


People also ask

How to configure explicit proxy and authenticate users using NTLM protocol?

- Fortinet Community This article describes how to configure explicit proxy and authenticate users using NTLM protocol. 1) Enable web proxy. 2) Add a LDAP server. 3) Configure authentication scheme. Create new domain controller by selecting '+ Create tab'. 4) Configure authentication Rule. Select protocol to HTTP.

How do I use a proxy in Python?

To use a proxy in Python, first import the requests package. Next create a proxies dictionary that defines the HTTP and HTTPS connections. This variable should be a dictionary that maps a protocol to the proxy URL. Additionally, make a url variable set to the webpage you're scraping from.

How to configure NTLM authentication scheme?

3) Configure authentication scheme. Create new domain controller by selecting '+ Create tab'. 4) Configure authentication Rule. Select protocol to HTTP. Then select the NTLM method previously configured and disable IP-based authentication.

What happens if the browser is closed after authenticating NTLM credentials?

However, if the browser is closed after successfully authenticating NTLM credentials and kept the session idle for more than 5 minutes (Default proxy session timeout 5 min), then an authentication timed-out under User Events will appear. auth_method = 2 <----- Means the user has been authenticated using NTLM method.


1 Answers

Have you looked at these:

NTLM Authorization Proxy Server

Python NTLM

like image 129
ctrl-alt-delete Avatar answered Sep 30 '22 11:09

ctrl-alt-delete