Jump to content

AutoProxy


erifash
 Share

Recommended Posts

can you make this an actual proxy that you can use like The Proxomitron? or similer? Im looking for some code that can be used as a transperent proxy that sits on your computer and hooks requests for sertin webpages.

well, If I could get this to work online then yes. Is it possible?

I know there was a webserver built from this that I assume can go through WAN

any one???

I did port forwarding and still nothing?

Check out ConsultingJoe.com
Link to comment
Share on other sites

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

well, If I could get this to work online then yes. Is it possible?

I know there was a webserver built from this that I assume can go through WAN

any one???

I did port forwarding and still nothing?

@zerocool60544

I got this script working as a proxy server( whitelist at the moment). There is still some work needed to be done on the transfer side as the INetGet function doesn't always get the graphics or js. Anyway, I need to see if it can be accessed outside of my lan.

If your interested, pm me and we'll give it a try.

eltorro

Link to comment
Share on other sites

Here's erifash's script set up to be a very simple proxy server (ment to be a filter). Just a proof of concept.

It is setup as a whitelist server but is very easily set up as a blacklist server. There is some comments in the script, Please read them.

AutoItWebProxy.zip

Link to comment
Share on other sites

Yeah... I have pretty much abandoned this at the moment, as there are different programs out there based off this idea. Check out nfwu's web server if you need a great example! :D

Edited by erifash
Link to comment
Share on other sites

@codemyster

That doesn't matter as long as the router is forwarding the port your server is listening on to your computer's network ip.

Typically the ip's behind the router are either 192.168.0.x or 192.168.1.x depending on the router.

Say your computer ip is 192.168.0.4. Then you are going to want the server to listen on 192.168.0.4.

Web servers typically use port 80. So in your router confiuration you want to forward port 80 to 192.168.0.4. It is better to make sure your computer server always has the same address by setting it to a static (non-changing address) in control panel. Just make sure that the address you use for a static address matches the address you configure the router to forward to.

If you need help setting this up pm me and let's see if we can get it going.

@erifash

Thank you for the reply, I am aware of Wood's web server and I contributed some code months ago to fix a problem with the page rendering with Firefox. I actually used that code to make the proxy first. I came across you code and decided to use it as is was more compact and better suited. Would you like to push this forward? If so contact me. I would be willing.

@Everyone

You can use google to test if your website is accessable from the outside world by using google language tools.

Here's how:

In the code below, replace YOUR.WEB.SITE with your ip address. paste into your browsers address bar.

http://translate.google.com/translate?u=http%3A%2F%2FYOUR.WEB.SITE&langpair=en%7Cen&hl=en&safe=off&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools

Be careful of the capital F before the address :D

Regards,

eltorro

Edit: Added google translation tip.

Edited by eltorro
Link to comment
Share on other sites

Would you like to push this forward?

Yes. A while ago I made a program called AutoServer but I don't believe I actually released it. It was a large improvement over AutoProxy. After finishing AutoServer I began working on the next step which I called AutoServer Plugin. It allows support for different server-side languages like PHP to be executed by the server. This is the version that I will release now.

PHP Setup:

Please copy php5ts.dll and php-cgi.exe to the \plugin\php directory of the attached zip archive. In order to obtain these files you must download php-5.1.4-Win32.zip. The two files you need will be right in there for you.

There is one flaw with the PHP/Plugin system though. If the executable returns a header the server won't know what to do with it and will just treat it like the MIME type of the file you are viewing.

Well, I hope that's it! If anyone could help me figure out the header issue that would be great as I haven't seen the code in a month or two. :D

AutoServer_Plugin.zip

Link to comment
Share on other sites

Yes. A while ago I made a program called AutoServer but I don't believe I actually released it. It was a large improvement over AutoProxy. After finishing AutoServer I began working on the next step which I called AutoServer Plugin. It allows support for different server-side languages like PHP to be executed by the server. This is the version that I will release now.

PHP Setup:

Please copy php5ts.dll and php-cgi.exe to the \plugin\php directory of the attached zip archive. In order to obtain these files you must download php-5.1.4-Win32.zip. The two files you need will be right in there for you.

There is one flaw with the PHP/Plugin system though. If the executable returns a header the server won't know what to do with it and will just treat it like the MIME type of the file you are viewing.

Well, I hope that's it! If anyone could help me figure out the header issue that would be great as I haven't seen the code in a month or two. :D

I download the zip and changed the plugin.ini to reflect a previous installation of php 5.0.5 from when I ran a server on this computer before switching the server over to dedicated debian system. I get the phpinfo page. That is good.

Do you have a php page that doesn't work I could use to test with?

Link to comment
Share on other sites

Don't you see this at the top of the phpinfo page?

X-Powered-By: PHP/5.1.4 Content-type: text/html

That is the header not being correctly processed by the server.
Link to comment
Share on other sites

yes in your plugin.ini it should read this

[php]
cmd=php-cgi.exe -q "%FILE%"

that will get rid of that header.

Now a better question. If you want ot use this only for loopback on localhost(127.0.0.1) and you are not online if you try to view anything with ie you well get a you are not cennected do you want to connect error box.

With the new udf ie.au3 it isw even worse you will not get any error at all it will only freeze the gui untill you kill the process.

Is there a way to check if you are working online or offline and if the system is working online then to switch it to online.

By the same token to then turn it to offline when you shut it down again?

Link to comment
Share on other sites

  • Moderators

yes in your plugin.ini it should read this

[php]
cmd=php-cgi.exe -q "%FILE%"

that will get rid of that header.

Now a better question. If you want ot use this only for loopback on localhost(127.0.0.1) and you are not online if you try to view anything with ie you well get a you are not cennected do you want to connect error box.

With the new udf ie.au3 it isw even worse you will not get any error at all it will only freeze the gui untill you kill the process.

Is there a way to check if you are working online or offline and if the system is working online then to switch it to online.

By the same token to then turn it to offline when you shut it down again?

Guess you could always do a simple ping before hand to tell?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It should work through the internet just fine. Using my own applications (basic http server in C# with sockets) through a router has worked. My local IP is a 192.168.. address while my router has our house's public address. If you went to the house's IP, it would find my computer listening on port 80 and take it.

Link to comment
Share on other sites

Don't you see this at the top of the phpinfo page?

That is the header not being correctly processed by the server.

Sorry for the late reply.

Php is echoing that

Try using this for cmd in plugin.ini.

php-cgi.exe -q "%FILE%"

C:\>C:\php\php-cgi.exe -h

Usage: php [-q][-h] [-s] [-v] [-i] [-f <file>]

php <file> [args...]

-a Run interactively

-C Do not chdir to the script's directory

-c <path>|<file> Look for php.ini file in this directory

-n No php.ini file will be used

-d foo[=bar] Define INI entry foo with value 'bar'

-e Generate extended information for debugger/profiler

-f <file> Parse <file>. Implies `-q'

-h This help

-i PHP information

-l Syntax check only (lint)

-m Show compiled in modules

-q Quiet-mode. Suppress HTTP Header output.

-s Display colour syntax highlighted source.

-v Version number

-w Display source with stripped comments and whitespace.

-z <file> Load Zend extension <file>.

C:\>

There is still further testing to do. :D
Link to comment
Share on other sites

Guess you could always do a simple ping before hand to tell?

yes I can do that how do you turn it on automaticly with autoit?

Or I should say I have found some scripts to connect lan's and stuff but nothing specificly dealing with when windows thinks you are working offline.

Eltorro I already gave that answer above.

Link to comment
Share on other sites

I have php working with GET data. It doesn't look like there is a way to use POST data with php_cgi.exe.

If someone knows how, please post.

The current working code is here: AutoServer.zip

Please change the path in plugin.ini for your installation.

Eltorro I already gave that answer above.

I didn't see that. :

Actually I think php-cgi.exe -f "%FILE%" would work too.

Link to comment
Share on other sites

yes I'm one of the linux guys that writes cli programs in php. So you always have to suppress the headers for that.

It would seem this si the same thing.

As far as post data from what I can tell it is an issue with autoit. Set up a log and log all the header data you recieve And you will see that post data is simply not recieved.

I was doing this for a while and I was not getting anything at all as far as post data goes.

Maybe my logging was not set up correctly but I dont think so.

I'll do some further checking to make sure.

Link to comment
Share on other sites

yes I'm one of the linux guys that writes cli programs in php. So you always have to suppress the headers for that.

It would seem this si the same thing.

As far as post data from what I can tell it is an issue with autoit. Set up a log and log all the header data you recieve And you will see that post data is simply not recieved.

I was doing this for a while and I was not getting anything at all as far as post data goes.

Maybe my logging was not set up correctly but I dont think so.

I'll do some further checking to make sure.

As far as post data from what I can tell it is an issue with autoit. Set up a log and log all the header data you recieve And you will see that post data is simply not recieved.

I'm not sure what you mean here. the POST data is in the headers as near as I can tell.

POST /Test_Page.php HTTP/1.1
Host: 192.168.0.10:65000
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://192.168.0.10:65000/Extra_credit.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 61
firstname=Jose&lastname=Quervo&hours=40&rate=15&submit=Submit

I opened a dos box and ran (several) different ways of passing the POST data to php_cgi.exe. I don't know how the interface is supposed to work. If I pass the data to the exe and the page is looking for POST then I don't get the values in the page. If I pass the data to the exe and the page is looking of GET then the page does what it should. I guess the hundred dollar questions are how does php_cgi.exe expect to receive POST data and how does it pass the POST data to the page.

Edited by eltorro
Link to comment
Share on other sites

could you convert this into a proxy server?

Yes, you can.

I opened a dos box and ran (several) different ways of passing the POST data to php_cgi.exe. I don't know how the interface is supposed to work. If I pass the data to the exe and the page is looking for POST then I don't get the values in the page. If I pass the data to the exe and the page is looking of GET then the page does what it should. I guess the hundred dollar questions are how does php_cgi.exe expect to receive POST data and how does it pass the POST data to the page

Searched the PHP documentations and there is nothing useful for webserver developers!!! Oh well, the hard path is here.

I have currently stopped work on my own webserver as I am rather busy at the moment. Congratulations with what you have done so far!

#)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...