Project 16 for CNIT 122 - SOCKS Proxy (15 pts.)

What You Need

Purpose

We will create a SOCKS proxy on the Linux machine, so the Windows machine can surf the Web safely. This will also bypass Web content filtering.

Starting the Windows Machine

Start your Windows machine and make sure it is connected to the Internet.

Starting the Linux Machine

Start your Linux machine and make sure it is connected to the Internet.

PING from the Linux machine to the Windows machine and make sure you are getting replies. If you are using Virtual machines, make sure they are both on the same subnet--either both Bridged or both NAT. If you are using a Linux VM and the Windows host, use Bridged networking for the Linux VM.

Starting SSH

On the Linux machine, in a Terminal window, enter these commands, pressing Enter after each one:
sshd-generate

/etc/init.d/ssh start

update-rc.d ssh defaults

ifconfig

Note the IP address of your Linux machine.

Downloading Putty on the Windows Machine

On the Windows machine, open a browser and go to

http://www.chiark.greenend.org.uk/~sgtatham/putty/

Click Download

In the "Binaries" section, in the "For Windows..." section, click putty.exe as shown below:

Configuring PuTTY on the Windows Machine

Double-click the downloaded putty.exe file.

Putty opens.

In the "Host Name (or IP address)" box, enter your Linux server's IP address, as shown below:

In the left pane of the PuTTY Configuration window, expand the SSH container.

In the left pane of the PuTTY Configuration window, click Tunnels.

In the right pane of the PuTTY Configuration window, enter a "Source port" of 8080 and a "Destination" of localhost. Also make sure the "Dynamic" and "Auto" buttons are selected, as shown below:

Click the Add button.

"D8080" appears in the "Forwarded ports" box, as shown below:

Click the Open button.

A "PuTTY Security Alert" box opens, as shown below:

Click Yes.

Log in as root with the password toor

Observing the Listening Port on the Windows Machine

On the Windows machine, press Logo+R to open a Run box. Enter the command CMD and press Enter to open a Command Prompt window.

On the Windows machine, in the Command Prompt window, type this command, and then press the Enter key:

netstat -an | more
If necessary, press the SPACEBAR to scroll down a screen. You should see a TCP port of 127.0.0.1:8080 in the LISTENING state, as shown below:

Configuring Firefox to Use the SOCKS Proxy

On the Windows machine, launch Firefox. If you don't have Firefox, download it from http://getfirefox.com

From the Firefox menu, click Tools, Options. In the Options box, click the Network tab. Click the Settings button.

In the "Connection Settings" box, select "Manual proxy configuration".

Enter a "SOCKS Host" of localhost, on port 8080

Click the SOCKSv5 button.

Your screen should look like the image below:

Click OK. Click OK.

Observing the Connections on the Windows Machine

On the Windows machine, in Firefox, go to http://www.ccsf.edu

On the Windows machine, in the Command Prompt window, type this command, and then press the Enter key:

netstat -an | more
If necessary, press the SPACEBAR to scroll down a screen. You should see several connections to destinations of 127.0.0.1:8080, as shown below:

Observing the Connections on the Linux Machine

On the Linux machine, make sure Firefox is not running, so this machine is not using the Internet for any local purpose.

On the Linux machine, in a Terminal window, type this command, and then press the Enter key:

netstat -an | grep 147.144
You should see several connections to destinations of 147.144.1.212:80, as shown below. If you don't see any connections, refresh the Web page on the Windows machine in Firefox.

Saving the Screen Image

Make sure the connections to destinations of 147.144.1.212:80 are visible, as shown above.

Save a screen capture with a filename of "Proj 16 from YOUR NAME".

Turning In Your Project

Email the image to cnit.122sam@gmail.com with a subject of "Project 16 from YOUR NAME".


Sources

http://articles.slicehost.com/2009/1/6/ssh-socks-proxy


Last modified 11-14-11 1:30 pm