i need an open source app (c# or c++ ) that grab all windows http traffic and forward to an http proxy
there is an app name Proxifier do this but i want open source project to embed to my app or at least a free commandline program that do this
thanks so much
You can use Fiddler2 to first intercept web traffic and force it to your own proxy.
Tools > Options > Gateway and set your proxy.
Or consume FiddlerCore in your own app.
Commandline wise I can recommend proxychains.
http://proxychains.sourceforge.net/
For a full blown proxying solution you might want to look into Privoxy.
http://www.privoxy.org/
There is also squid proxy for instance and many other solutions. The solutions I mentioned are rather unix/linux centric so you might need cygwin or similar to drive this.
The last time I needed something like this I used the mentalis proxy, which has a BSD style license.
Related
How would I go about creating an application that can somehow see URLs I am viewing in most popular browsers?
Can it be done out of process?
In what ways can this be done?
Can it be done without browser plugins?
The simplest answer is use a proxy server.. prevent html access out except from the proxy server so they have to use it, then all url requests go to the proxy server, even if you choose to make it yourself, then you can collect the URLS either from logs or something and off you go.
You will have to install something in your network infrastructure and then collect data from it.
That could be a proxy server (eg Fiddler) or you can look at tools like WireShark (pcap).
I am thinking an HttpModules for IIS, a Pre and Post request handler and some custom module for Apache.
Please only suggest Open Source, we will need to modify the projects.
We want to run these on our high volume production systems so tools that emphasise debugging is not what we are looking for. We want the simplest capture paradigm.
We want to capture data for particular web sites, not for interfaces so I am not looking at packet sniffers.
We would prefer an in-process solution which means avoiding wire-shark, squid or other proxy based solutions.
A nice to have would be the ability to replay a stream of requests in another environment, but I am confident we can build this ourselves if we can capture the requests in a sensible manner.
Any ideas, suggestions and questions will gladly be entertained.
A proxy server that logs is best, but you've already ruled that out. Outside of that, you need a product per web server. For IIS, yes, an HttpModule is the way to go. To replay them, that's likely a carefully crafted log viewer. This is typically a feature of a proxy server. Even Fiddler has the ability to capture and replay.
I've some fishy application that makes HTTP requests to a website, i would like to intersect that request and send other data to the server. Is that possible in C#,java or C++?
EDIT: The application isn't mine, i just know the endpoint that it sends http requests
Fiddler might provide the functionality you need. At the very least it may enable you to see what is being sent to the web site.
in Java You can intercept request from Filter
You may want to look into using an HttpModule, whose purpose is to intercept incoming HTTP requests.
The ASP Column: HTTP Modules
Firstly are you aware of how it is connecting to the internet? For example, is it using the settings from Internet Explorer, or is it establishing a direct connection? If the latter, this may be tricky, there is no direct port forwarding as there in Linux, so you'll need some third-party tools to redirect the traffic to a server (which you can write in Java, C++ or C#, I would go for C# if you know it for pure speed of development) In that server you can intercept the request, and then create your own to actually send to the real destination.
Sounds like a cludge, but I think you're stuck with this approach due to the lack of direct port forwarding. You'll have to configure the third-party tool that you use to forward someother well known port to 80, and your server should write to this.
I want to check which web sites is open in browsers ( IE, Firefox, Chrome ) to write a program in C# which can block web site which is in list of forbidden web site. Is there some API of browsers?
The better solution can be to write a TCP/IP filter, like most firewalls do.
UPD: this topic can be relevant: How do I hook the TCP stack in Windows to sniff and modify packets?
There is no generic "browser API" that allows access to this kind of information across all browsers.
I'm pretty sure the idea of doing this by accessing the browsers is doomed from the start. It is going to be almost impossible to implement, require frequent updates, and always extremely easy to circumvent (there are dozens and dozens of browsers that your program will not know.).
The only reliable way is to filter traffic on network level. I would recommend looking into using an existing proxy server or TCP filtering program. There are several Open Source ones that I'm sure you can use as a basis to rewrite or hook into.
The easier solution is to write an http listener that logs the requests.
Fiddler2 is one of these, you can check it out. it logs all incomming and outcomming http content.
I have some shared server web hosting in the States (I'm from the UK), which allows me to publish PHP and .NET applications. I cannot install my own software onto the remote server, but I'd like to set up a web forwarding proxy for accessing sites that serve different content depending on what country you're from.
My C# and ASP.NET skills are OK, but my PHP is very limited. Are there any solutions that anyone would recommend for this sort of problem? The proxies I've investigated all seem to require installation on the server machine itself, whereas I'm just looking for something that's accessible from a URL.
Obviously, as the requests are coming from the UK, the headers will have to be manipulated by the proxy before forwarding them on. I was going to code my own HTTP handler in C#, but I don't want to reinvent the wheel if there's something out there already ;)
Although quite old, the Org.Mentalis.Proxy could be a good starting point for an example proxy implementation in C#. You can find it here: http://www.mentalis.org/soft/projects/proxy/
maybe this script is helping you? phproxy