tags:

views:

116

answers:

4

I wanted to know is there any way programmatically in win32, where I can get the URL being fetched from browser.

Like for example as we have MIB table, which shows data sent and received from Ethernet card, can we get the URL being fetched from system

Thanks in advance.

A: 

Look into wininet hooking. Might be what you're looking for.

eran
A: 

There is no simple way to do this. The main problem you will encounter is that each browser on your system will independently connect to a webserver. That's just a straightforward HTTP connection, usually on port 80. The browser will send the URL in an HTTP request, possibly in multiple TCP packets. So, unless you are going to inspect and reassemble those TCP packets, you're not going to get this information. Even if you did, you'd miss out on the URLs of HTTPS fetches (by design).

An easier solution is to set up a proxy, and hope that the webbrowser doesn't bypass it.

MSalters
+1  A: 

This is an IE-only solution, but if you write a browser helper object, it will be notified before IE navigates to a new URL.

Michael Dunn
A: 

You could try using WinPCap, which is what's utilized by Wireshark. What this would allow you to do is put the network interface into "promiscuous mode," and from there you could just look for HTTP traffic. From there, you could extract the URLs that are being requested, no matter which browser's being used.

Jacob