SSL VPNs and OpenVPN – Part III

Outsmart Malicious Hackers


3. Brief How-to ….. OpenVPN and Site-to-Site Tunnels.

OpenVPN can be implemented either Site-to-site or client-server model. I will take example configurations of both models.

If you want to implement site-to-site configuration, the best way is to use static-keys instead of PKI. Using static keys, you can have your VPN tunnel up and running in a jiffy.

First, decide which Operating systems will be used for implementing VPN endpoints on your network. According to OS, download the OpenVPN software from these locations;

Linux: http://openvpn.net/download.html

I would recommend using Mathias Sundman’s “OpenVPN GUI for windows” for its sheer simplicity.

Windows: http://openvpn.se/download.html

Example of using static keys to create a site-to-site VPN:

In this example, a VPN tunnel will be created with a server endpoint of 10.33.66.1 and a client (peer) endpoint of 10.33.66.2. Encrypted communication between peers will occur over UDP port 1194, the default OpenVPN port.

First generate a static key using this command;

openvpn --genkey --secret static.key

Copy the static key to both peers over some secure channel. Heck, use a pen drive if you are paranoid and have access to both peers physically.

Copy the static key file in “config” directory of OpenVPN installation.

Create a configuration file named “server.ovpn” in the config directory of OpenVPN, and type this in the file;

dev tun

ifconfig 10.33.66.1 10.33.66.2

secret static.key

Now create a “client.ovpn” file in config directory of second peer which will effectively become a client for the server you created just now. Put the following in the client file;

remote remoteserverip

dev tun

ifconfig 10.33.66.2 10.33.66.1

secret static.key

The IP address of remote server will come in place of “remoteserverip” in the remote directive of client.ovpn.

Now start OpenVPN executables using these ovpn files that we created. If you get “Initialization Sequence Completed” in the window, most of your work is done. Now ping the other end of tunnel. If ping succeeds, you are done!

Always make sure that you have UDP port 1194 (or any port/transport protocol over which you plan to create a tunnel) open through the network. This may require manually opening the ports at the firewalls/routers at both ends.
If you want to access the networks behind the endpoint servers, there are two options. Either you use routing (TUN) mode or bridging (TAP) mode on your OpenVPN machines. For some obscure reasons if you want to allow non-routable protocols to be tunneled (like NetBIOS) then you will have to use OpenVPN in TAP mode. Bridging ensures that your VPN endpoints make a long reach Ethernet over your WAN.

If you decide that you want to use a routed (TUN) mode, then you must enable IP forwarding on the OpenVPN machine. The virtual interface can be made external interface and local area connection can be designated internal. It will basically become a router and you can do everything with this box that you could with Linux/windows based router.

Next: Creating OpenVPN tunnels for Clients-to-site scenario….

Read on in Part IV

Previously:

1. SSL VPNs and Using OpenVPN : What is an SSL VPN
2. SSL VPNs and OpenVPN – Part II : Why OpenVPN?

Posted in: Linux Hacking, Networking Hacking, Security Software

, , , , , ,


Latest Posts:


OSSIM Download - Open Source SIEM Tools & Software OSSIM Download – Open Source SIEM Tools & Software
OSSIM is a popular Open Source SIEM or Security Information and Event Management (SIEM) product, providing event collection, normalization and correlation.
What You Need To Know About KRACK WPA2 Wi-Fi Attack What You Need To Know About KRACK WPA2 Wi-Fi Attack
The Internet has been blowing up in the past week about the KRACK WPA2 attack that is extremely widespread and is a flaw in the Wi-Fi standard itself.
Spaghetti Download - Web Application Security Scanner Spaghetti Download – Web Application Security Scanner
Spaghetti is an Open-source Web Application Security Scanner, it is designed to find various default and insecure files, configurations etc.
Taringa Hack - 27 Million User Records Leaked Taringa Hack – 27 Million User Records Leaked
The Taringa hack is actually one of the biggest leaks of the year with 27 million weakly hashed passwords breached, but it's not often covered in the West.
A2SV - Auto Scanning SSL Vulnerability Tool For Poodle & Heartbleed A2SV – Auto Scanning SSL Vulnerability Tool For Poodle & Heartbleed
A2SV is a Python-based SSL Vulnerability focused tool that allows for auto-scanning and detection of the common and well-known SSL Vulnerabilities.
VHostScan - Virtual Host Scanner With Alias & Catch-All Detection VHostScan – Virtual Host Scanner With Alias & Catch-All Detection
VHostScan is a Python-based virtual host scanner that can be used with pivot tools, detect catch-all scenarios, aliases and dynamic default pages.


Comments are closed.