Networking Web Proxie

Lab overview

I have written a partially working web proxy. You will complete the proxy, and add several features.. A web proxy is a program that runs as a service on a port, waiting for connections. Every connection it gets, it relays the connection by opening a connection to a known address/port, and then passes on the data to that port. The proxy will then read back any response, and pass it back to the original sender. Such a program allows you to:

  1. Provide connectivity to an otherwise hidden system.
  2. Hide the address of sender.
  3. Monitor /record the session.
  4. Provide filtering.
You can use the code reviewed in class as a starting point, but do not simply hack the code to achieve functionality. You will expect you to create a set of useful, reusable, network functions using sockets, and then to create well designed, structured code to achieve the required functionality.

In order to use a proxy you must edit the web browser preferences to go through a proxy. Currently it is set up to run on port 9000. If it is on the same machine, you can run it by pointing your browser to localhost:9000. You should also experiment with running on a different system.

Sample Code

Lab tasks:

The lab is worth 100 points total. Below I give you a set of requirements and options. You may do as many or few – this is a chance to get extra credit. However, no matter what you do, you will not get higher then a 100 if you do not have good clean code.

  1. Well Designed/Written Code – 20 Points total
  2. TCP Application (Simply Proxy)
    • (30 points) Complete the given code to work correctly on at least the following sites:
    1. (currently only works sometimes, or partially)
    2. (XML error)
    3. (must exit program before anything is seen)
    4. (Bad request)
For each of these, explain what was wrong, and what you did to fix it. Referring to may be helpful. You will almost certainly have to use WireShark to figure things out.

  • (15 points) Usage Monitor – send real time data to a separate monitor program (on a different system) about the source and size of each connection. Another option could be to provide data on number of times a given page is access to another program (on a different machine) which will draw a graph or pie chart of results in real time.
  • (65 points) Realtime monitor - Clone all return traffic, and send to another (monitoring) browser. A separate user would connect, and then actually see what the main user is doing on their screen.
  • (10 points) URL are checked agains a "black list". Connections to those addresses will be redirected to a screen that tell them the connection has been disallowed.
  • (15 points) Filter. Provide a file parameter with a list “banned” strings. If that string appears, drop the connection.
  • (15 points) Redactor – checks for certain strings coming from server and in the data (not in header), and changes it to “XXXXX”. The list of strings should be in a file, provided as a parameter to the proxy.
  • (15 points) Notifier – emails a message to a email address (supplies as a parameter) every time a page from a given list is accessed (list is in a file, supplied as parameter)
  • (15 points) Redirector – monitors requests, and checks against a list (in a supplied file) of (destination, redirect) pairs. When a given destination matches, the associated URL is substituted.
  • Other features as approved– 1-20 points each
Turn in all programs to Moodle, list options completed, and demonstrate for instructor.
Topic revision: r1 - 2013-11-05 - JimSkon
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback