views:

32

answers:

2

Can anyone help me how to get (or log) all URLs accessed by web browsers in a computer. Together with its response time?

Note: visual C++ will be the Programming language to be use and this will run under windows platform.

A: 

You should try Wireshark. It has logging abilities too.

Edit: And it is opensource :-) I think the answer is somewhat bigger than you might think.

Notinlist
http://www.wireshark.org/
Notinlist
That will miss `data:` URLs, `file:` URLs and possibly `javacript:` URLs (if you consider the latter URLs)
MSalters
A: 

A solution would be to implement a packet filter driver, but it's quite complicated (kernel-mode code is difficult to write and to debug, and you can easily crash the whole system if you do something wrong); on the other hand you could easily use a third-party driver (e.g. WinPCap) to do the dirty job and use the data retrieved from it to do your computations/logging/...
Another solution could be writing a simple proxy that the browser would use to connect to internet; your application would just be a pass-through that logs the requests and do its statistic with them. You could also use an existing proxy (e.g. Squid) and work on the data provided by its logging capabilities.

Matteo Italia
Yes. And also, you can redirect the outgoing 80 port communication to a Squid or anything which is configured to be a "transparent proxy" and configure it to log the stuffz for you.
Notinlist
It would be quite a smart solution, but can you do that even for the local machine? I've always done it on Linux to build transparent proxies, that were used as gateways by other machines; still, I don't know if you can set a machine to be the gateway of itself, maybe you have to use some routing trick...
Matteo Italia