Browse All Articles
> Looking at the HTML source code doesn't show all the downloaded files, a proxy does
Happily, there is a trick to know every single file you download: if you have have access to the log files of a http proxy server, it will possible for you to know exactly which files have been downloaded.
Normally, you won't have access to such a proxy server, but it is very easy to configure your own logging proxy server
In this article, I will configure the squid
proxy server under GNU/Linux but Windows users can adapt the stuff here for their case, since squid
is open source software and runs also on MS platforms.
Installing squid under Ubuntu
is as easy as opening a terminal (Applications > Accessories > Terminal) and issuing
sudo aptitude install squid
You will have to provide your password.
Now, the trick is to configure squid for running in user mode, not as root. Create a directory in your home directory. My choice was to create the directory squid inside of a my home directory. Edit a file called squid.conf
in that directory by opening a terminal and typing:
In that file, you have to provide the content below:
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/32
http_access allow localhost
http_access deny all
cache deny all
cache_dir null /tmp
logformat custom %mt %<st %ru
access_log /home/_myname_/squid/access.log custom
Attention: where you see _myname_
in this configuration file, you have to provide the name of your home directory.
This will make squid listen to port 3128 of the local host and write the file name of all the files that pass through the proxy server into the log file /home/_myname_/squid/access.log
. We will only log the MIME type, the size and the URL of the file.
Starting and stopping squid
For starting the proxy server, you have to issue squid -f squid.conf -N -d 1
in the directory ~/squid
. For stopping, you just interrupt the proxy by hitting control-C in the same terminal where you launched squid
. You can also stop it by issuing squid -k shutdown -f ~/squid/squid.conf
in any other terminal.
When something goes wrong, the logfile cache.log
will give you more information. In some cases, you will need to stop squid
by killing it explicitly with its PID. If you don't understand how to do this, just issue:
sudo killall squid
Enable your browser to pass through the proxy server
For logging the activity of your browser, you now need to tell your browser to use your local proxy, by setting 127.0.0.1 as IP address of the proxy and 3128 as the port.
Once the proxy is running and your browser point to it, you will see a lot of lines appearing into the access.log
file, with the MIME type of the file, its size and its complete URL. Now you can scan that file to find the information you need. Enjoy.