Sign in to follow this  
Followers 0
Wvb

Proxy setting

17 posts in this topic

How can i get the proxy settings (server, user, password) which are defined on a system?

Do not give the registry solution because that does not work when users have a script which defines the proxy.

I wanted to get it thru wininet.dll but i cannot get out any information out it with dllcall.

Suggestions are welcome

Share this post


Link to post
Share on other sites



If a script is used, can't you just read the script for the info ?


> there are 10 types of people in the world, those who understand binary and those who don't.

Share this post


Link to post
Share on other sites

ask bill gates for the encryption info of internet explorer?


-jaenster

Share this post


Link to post
Share on other sites

The script can be different for every user and the script file is like a javascript with alot of if/else so it would be nicer if you can read it out.

You can read some value options out of wininit.dll, for example if a proxy is used but not what server.

Share this post


Link to post
Share on other sites

my guess (though I'm usually wrong, so don't take my word for it 8) ) is that the proxy enable setting is locally set on the computer. If it is set, internet explorer reads the script and uses it accordingly without setting anything locally.


> there are 10 types of people in the world, those who understand binary and those who don't.

Share this post


Link to post
Share on other sites

I am trying to get the proxy settings so i can use them in an external program to tunnel thru their proxy. Or does have autoit tunnel support?

Share this post


Link to post
Share on other sites

If I'm understanding you correctly, you'ld have to mess with the script that's defining the proxy for it. Depends on how it handles proxies.

Easier route: Ask your local administrator what the settings are?

Share this post


Link to post
Share on other sites

Well tthe script must always work and i work at 4 different locations :whistle:

Share this post


Link to post
Share on other sites

@Wvb

this give you some basic Proxy settings info.

It' s a start

$strComputer = "."
 $objWMIService = ObjGet("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & $strComputer & _
        "\root\cimv2\Applications\MicrosoftIE")

 $colIESettings = $objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_LANSettings")

For $strIESetting in $colIESettings
    ConsoleWrite ("Autoconfiguration proxy: " & $strIESetting.AutoConfigProxy &@CR)
    ConsoleWrite ("Autoconfiguration URL: " & $strIESetting.AutoConfigURL &@CR)
    ConsoleWrite ("Autoconfiguration Proxy detection mode: " & _
        $strIESetting.AutoProxyDetectMode()&@CR)
    ConsoleWrite ("Proxy: " & $strIESetting.Proxy &@CR)
    ConsoleWrite ("Proxy override: " & $strIESetting.ProxyOverride &@CR)
    ConsoleWrite ("Proxy server: " & $strIESetting.ProxyServer &@CR)
Next

Enjoy !!

ptrex

Share this post


Link to post
Share on other sites

Thank you very much ptrex, but if i use my PAC file to detect the proxy it does not give that back. A PAC is used when you set the AutoConfigURL and it is some sort of javascript to define a proxy.

Information: http://en.wikipedia.org/wiki/Proxy_auto-config

Share this post


Link to post
Share on other sites

What do you mean by "tunnel through their proxy"? Are you establishing a SSH connection or something? Or just downloading a file from the Internet?


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I guess I'm missing something here as usual... But isn't this information you need just stored in:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL (for auto proxy config script)

... and:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer (for fixed proxy settings)

?

/edit: stupid copypaste error :whistle:

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

I want to HTTP tunnel information outside the network but we use a proxy.

The uto proxy config script is a PAC file which is a javascript like file which decidese what proxy to use (evey location has is own proxy and at home i do not have one). So i know the URL and can download the file but then i need to do the same check as Internet Explorer does.

So i need the proxy which is used by the running Internet Explorer...

THanx for all the info so far

Share this post


Link to post
Share on other sites

So yeah, like I said... he needs to tinker with the program that sets the proxy. "If I'm understanding you correctly, you'ld have to mess with the script that's defining the proxy for it. Depends on how it handles proxies."

.. everyone just completely ignored me.. :whistle:

Is the Pac file located directly on the computer itself?

Share this post


Link to post
Share on other sites

Sorry i did not see your reply, a pac file can be localy but here it is an URL (example: http://www.domain.com/proxy.pac)

I hoped you could read it from wininet.dll because you can read if you are online and which connections is used...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0