Computers

Creating a VPN server for secure browsing

posted 6 Aug 2010 04:03 by James Gibbard   [ updated 8 Aug 2010 17:42 ]

While connected to a public network, such as a free wifi hotspot, it is worryingly easy to intercept other user's web traffic including login details, sites visited and the contents of emails. I will shortly be writing a post describing how to actually perform this attack, but first here is how to protect yourself .

The idea behind a virtual private network (VPN) is to securely connect a remote user to a company's network, in order to access to resources and offer the security of browsing the web behind the organisation's firewall. This is of course a a simplistic description, if you are interested wikipedia is a good place to start.

By setting up a VPN server at home you can remotely connect to this over the internet, allowing you to encrypt all your web traffic between your current location and your home computer.

Note: This does not encrypt the traffic between you and the internet, only between you and your home network, where the data is then sent on like normal. A quick example of where this would be useful is if you were in a coffee shop, where there is free wifi, you can browse safely, even if someone else at the coffee shop is trying to intercept web traffic.

Setting up the server
There are many ways to set up a VPN server, using both windows and linux. For this tutorial I will use a linux operating system running OpenVPN access server. The first step is to install linux on a computer, almost any distribution will do. For this tutorial I have chosen to use Ubuntu Server 10.04 (32bit) which at the time of writing is the most recent version. If you do not have a spare computer to use as a server you can use a virtual machine, [LINK TO VIRTUAL MACHINE PAGE]

Note: Installing Ubuntu using the method described below will wipe the computers hard drive. Please ensure that there is nothing saved on that computer that you wish to keep. There are ways to dual boot with linux and windows, however this is outside the scope of this article.

Installing Ubuntu server is pretty straight forward. How to Forge have a great guide but only follow Page 1 and Page 2 as the rest of the tutorial is surplus to requirements for the server we are creating.

Once the server is up and running it is time to give it a static IP address. Log in to the account you created during the setup and type:
sudo nano /etc/network/interfaces
You will be asked for your password and then you will be shown the contents of a text file which will look roughly like this:

auto eth0
iface eth0 inet dhcp


Change the file so that it is like the example below, remembering to replace the values for address, netmask and gateway with the correct ones for your network.

auto eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1


Save the file by pressing Ctrl-x, then typing y to confirm the changes and finally pressing enter.
Next restart the networking by typing:
sudo /etc/init.d/networking restart

Type ifconfig to check that you now have the IP address that you set.

Ubuntu server is now correctly set up so it's time to install OpenVPN access sever. First go to their website and register for an account. This will give you a licence key that allows 2 concurrent users to connect to your VPN server. More user licence can be purchased if required however if it's only you using the server, it's completely free.

Once registered download the software to your server by typing:
wget http://swupdate.openvpn.net/as/openvpn-as-1.5.4-Ubuntu9.i386.deb
(This is the latest version at the time of writing, visit here to check for updates)

Next install the software by typing:
sudo dpkg -i  openvpn-as-1.5.4-Ubuntu9.i386.deb
After it finishes it should look look similar to the screen below (Click to enlarge).

The next step is to run the configuration program by typing:
sudo /usr/local/openvpn_as/bin/ovpn-init

Accept the terms and conditions by typing yes and then pressing enter, as shown below.
Press enter to set as the primary server.
Press enter to select default network interface.
Press enter to select the default port of 943.
Press enter to select the default tcp port of 443.
Press enter to allow client traffic to be sent through the VPN.
Press enter to allow private subnets to be accessible.
Press enter to use 'root' as the login.
Type in the licence key that you got when you registered and press enter.

Once you have done this you should see a screen like the one below.


This completes the installation, before we can login to the VPN's web interface we need to set up a root password. (This is because in Ubuntu you can't log in to the root account by default.)
This is done by typing: sudo passwd root
Type in your normal password, hit enter, then type the new root password, hit enter and type it in again. (Make sure it's very secure!)

Got to another computer on your network and go to https://YourServer'sIPAddress:943/admin
You will probably told by your web browser that the connection is untrusted, or words to that effect. This is because we are using a self signed ssl certificate. It is fine to continue through since we own the server and we know it is safe to connect to.

Log in using the root account and you will be presented with the web interface of the VPN server. From here you can configure the VPN server just the way you want it.

For this tutorial the only setting that needs changing is the "Hostname or IP Address" setting, which can be found under the "Server Network Settings" section. This should be changed to your external IP address (this can be found by visiting here). If you have a dynamic IP address visit http://www.dyndns.com/ which is a service that provides you with a web address which always points to your correct IP address. Once this is entered go to the bottom of the page and click "Save Settings".

Finally go back to the "Status overview" page and click "Start Server".

The server should now be fully operational.

In order to access the server from outside you home network you will need to forward the correct ports to the internal IP address of your server. By default the OpenVPN uses:
TCP 443
UDP 1194
TCP/UDP 943
http://portforward.com/ has instructions on how to do this for most routers.


Connecting to the VPN
Now the server is all set up you are ready to connect to the VPN from a remote client. Using your web browser got to https://YourIPAddress:943 and login with your user name and password (not the root account). You will then be presented with a page that allows you to download a client for your operating system. If you are using a Windows computer to connect to the server, download the file openvpn-client.msi in the "Auto Login" row of the table.


Run the openvpn-client.msi installer and once that has finished start the client by clicking on the desktop shortcut. Click on the grey square, with the IP of your server written inside of it, to start the VPN connection.

Your web traffic is now being securely tunnelled between the client and the server.

You can now browse the internet on untrusted networks and public wifi hotspots in relative safety.

Speed up tagging photos on Facebook

posted 23 Jan 2010 12:49 by James Gibbard   [ updated 23 Jan 2010 15:39 ]

Tagging photos on Facebook can be a laborious process. Normally if I upload a large set of photos I will tag  all the people in the album, in one photo each, and then allow them to tag themselves in the rest.  I will then go through and tag myself in all the ones in which I appear.

As anyone who uses Facebook knows to tag a photo you click on the person in the photo, type the first few letters of their name and then hit enter. This takes a while, and if you are only tagging yourself you find that you are constantly going from the keyboard to the mouse over and over again.

To stop this I made a small program in AutoHotKey to partially automate the process and consequently greatly speed it up.


The program allows entry of the names of the two people that you wish to tag quickly (For example you and your other half).



Instructions
  • Double click on the .exe file
  • Click ok and press the windows key and z to set the two names (Or one name)
  • Once entered, simply go to the first photo in the Facebook album and click "Tag this photo".
  •  Hold the control key and left click to tag the first person and control and right click to tag the second person.
  • To go to the next photo double press control
  • Once all the photos have been tagged click finish tagging.
  • Press the windows key and x to exit the program.
Important
This won't work if you are trying to tag a person who has the same name as someone else in your Facebook contacts (i.e. two John Smith's).
Secondly you must enter their name as it appears on their Facebook account. If you do not do this then the person will be tagged but the tag will not be linked to their profile.

I made this program for my own use therefore its not very user friendly but I'm sharing it in the hope that someone else might find it useful!

Click here to download the program.
See below to download the source code.
(Feel free to edit and redistribute it as you wish.)

Play sound through the line-in jack on Windows 7

posted 22 Jan 2010 11:56 by James Gibbard   [ updated 22 Jan 2010 12:43 ]

Windows 7 comes with the ability play the sound inputed from the line in jack. This allows you to play a friends mp3 player through your computers speakers. This is especially useful if you have a laptop, as it means that it can be used as a portable speaker system.

1. Right click on the sound icon in the bottom right of the screen and select recording devices.


2. Select your line in device from the list and click properties.

3.Tick the "listen to this device" box then click ok and ok again.

4. Finally plug the mp3 player in the the line-in socket using a 3.5mm male to 3.5mm male audio cable.



Online backup with Mozy

posted 22 Jan 2010 05:29 by James Gibbard   [ updated 15 Jun 2010 12:29 ]

While working in a small computer repair shop I regularly saw cases where people lost every digital picture, document and file they owned. Whether it was due to hard drive failure or a particularly nasty virus, it was very rare to find that they kept an up to date backup of thier files. 

Realizing how priceless my digital files are I've been doing a weekly back up to an external hard drive for several years. Recently I discovered that the hard drive on which I store the back ups of both my desktop and laptop on, had itself suffered from hardware failure. I decided that I needed a more robust back system.

After reading lifehacker's hive five about online backup services I decided to go with Mozy. My decision was mainly based on the fact that Mozy is owned by a large and respected backup company and therefore less likely to disappear after a few months like many internet companies.

For home users there are two account types, a free account with 2GB of storage and a paid account with unlimited storage.


The Mozy software allows you to be very specific in what you back up, therefore if you are only worried about keeping remote copies of all your word documents this can be easily configured in the options. 

At first I started using the free account to back up documents but not pictures and music. I quickly forgot that it was running until an important word document I was working on became corrupted. Mozy attaches a virtual hard drive to your computer that when browsed shows all current files as well as files that have been deleted up to 30 days ago. It is also possibe to see all revisions of each file over the past 30 days. Restoring a file is as simple as right clicking and selecting restore. Since then I have upgraded to the unlimited paid account so that I can back up all everything.

The obvious disadvantage with  an online back up is that your files need to be uploaded over the internet. Despite having a relatively fast connection this still took nearly a week. Mozy does a good job of doing this in the background so that it does not disrupt your computer use. 



Download Mozy for here

1-4 of 4