Lab 10
Lab 10
9.1 Details
Aim: The aim of this lab is to investigate proxy servers, including the installation and
configuration of a HTTP Proxy Server on Linux.
Bobs Ilusion
Trusted, Internal
Network
Actual
Connection
Policy
Actual violations,
Bob
Connection Active
content –
HTTP Web ActiveX,
Proxy JavaScript
Proxy Server Server
Policy
violations,
Blacklist
URLs
DESKTOP
Host OS - Windows7
VM Workstation
Virtual NIC
192.168.
VMNet Gateway
Physical NIC 192.168. .2 VM Workstation
146.176. HOST machine
PROXY
Linux VM
From VM Workstation open the two VMs, run command windows, and complete the lab IP
Addressing diagram above, using the ipconfig or ifconfig commands.
9.4 Activities
9.2.1 Host Web Client
From HOST test that the networking and web connection is working. Using a command
shell check you have connectivity to the Internet.
Edit the squid.config file using vi or gedit, with sudo as root owns the file.
sudo vi squid.conf
This file is rather large, but only a few changes are needed to configure a basic HTTP proxy.
In vi, to check where you are in the file you can use CTRL+G, as shown below. In vi CTRL+F
and CTRL+B can be used to page forward and back.
The sections of this configuration file are in the format TAG: sectionname. In vi the search
command /TAG: acl command can be used.
In the acl section add a rule to allow access from our internal network of hosts, with a rule
such as the following: (using your internal virtual network range)
acl localnet src 192.168.80.0/24
To allow web traffic proxying from our localnet hosts, we need to add a rule for that to
the http_access section. Find this section in the file:
It’s a good idea to give the proxy a unique name, so if there are any problems, we can
identify the proxy (youmay have many proxies). This is done in the visible_hostname
section, with a command such as:
visible_hostname proxy_1
To check which port the proxy server is listening on by default search for the http_port
section of the configuration file.
Save and exit the configuration file. This can be done with the :wq command in vi.
The squid proxy should be running straight from the installation. Use netstat to check if it I
srunning:
Questions
From the Firefox browser we can set up the machine to sue the Proxy server. Run Firefox
and From the Preferences dialog select the Advanced tab.
Test Proxy
From HOST, using Firefox, try to access an Internet server such as www.google.com.
You should get an error, as the Proxy Server still has default configurations set.
Questions
From the HOST machine, from Firefox configure the new port number for the proxy.
Test Proxy
From HOST, using Firefox, try to access an Internet server such as www.google.com.
Questions
Questions
Q: What is the downside to having to configure the host machines like this?
Blacklist Webpages/Sites
To blacklist webpages we can add rules to the http proxy.
One of the most common reasons for using a http proxy server is to block access to certain
websites. This may be to enforce policy such as to prevent employees watching YouTube
videos or chatting on Facebook instead of working. It may also be a safeguard against
liability issues in cases of illegal activities by employees, such as watching pornography on
the corporate network.
There are various ways to blacklist specific sites or domains by configuration in squid.conf.
A good way is to create a black list of blocked domain names in a separate file of patterns to
match against and point to it from squid.conf using these two config lines:
For example, we may want to use the label "blacklist" to refer to the access control list rule
that we are creating, and we may want to use the name "blacklist_URLs" for the file that will
contain the banned domain names, using:
e-Security Network Security –Rich Macfarlane 9
acl blacklist url_regex "/etc/squid/blacklist_URLs"
http_access deny blacklist
If we want to block access to Facebook add the following pattern to the blacklist_URL file:
.facebook.com
This would match any domain name containing these strings, such as "www.facebook.com"
or "facebook.com/login.php."
Make sure to start domain name patterns with a dot if you want to block all sub-domains
belonging to that domain. For instance, ".youtube.com" will block "www.youtube.com"
while "youtube.com" will only block "youtube.com" and no sub-domains of it.
Try adding this URL facebook filter to your Proxy server. (Remember to restart the quid
server)
Questions
The following patterns could be used to block any URLs with the strings "hacking", "porn"
or in them:
hacking
porn
Questions
Try blocking some sites (which you have access to already) from your own Proxy server
using string patterns. Try asecuritysite.com and some general sites such as all bbc related
sites.