Man-in-the-Middle?

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please visit (and READ) the OpenVPN HowTo http://openvpn.net/howto prior to asking any questions in here!
Post Reply
shinjikenny
OpenVPN User
Posts: 25
Joined: Fri Jul 29, 2011 5:32 am

Man-in-the-Middle?

Post by shinjikenny » Mon May 28, 2012 10:49 pm

I found this guide to avoid possible man-in-the-middle attack...
[OpenVPN 2.0 and below] Build your server certificates with the build-key-server script (see the easy-rsa documentation for more info). This will designate the certificate as a server-only certificate by setting nsCertType=server. Now add the following line to your client configuration:


ns-cert-type server
I was wondering what will happen if the client erase "ns-cert-type server" in his ovpn config? Will he be vulnerable to man-in-the-middle attack?

Can I use these both together on the client config? Do I only need to specify it at the client config? Or I need to include it too in the server config?
remote-cert-tls server
ns-cert-type server
==============

Also, most of the openvpn install instruction I see over the web says keep the "common name" as server when doing build-key-server server?
Which name are they referring to? This one:
./build-key-server server
or the common name that is asked after issuing the ./build-key-server command ?

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Man-in-the-Middle?

Post by janjust » Tue May 29, 2012 9:54 am

I was wondering what will happen if the client erase "ns-cert-type server" in his ovpn config? Will he be vulnerable to man-in-the-middle attack?
yes the client is - in theory - vulnerable to MitM attacks. For such an attack to work, however, the attacker would need to have access to a (client) certificate and private key used by your openvpn setup. If the attacker has these then {s}he can pose as an alternative openvpn server.
Can I use these both together on the client config? Do I only need to specify it at the client config? Or I need to include it too in the server config?
Quote:
remote-cert-tls server
ns-cert-type server
yes you can use them both ; they need to be specified in the client configuration file.
Also, most of the openvpn install instruction I see over the web says keep the "common name" as server when doing build-key-server server?
Which name are they referring to? This one:
Quote:
./build-key-server server

or the common name that is asked after issuing the ./build-key-server command ?
seems like they're referring to that, but the advice is bogus - you can use any name when building the server key using ./build-key-server. It IS advisable to keep the server common name (the /CN= part of the certificate subject) to something logical/sensible/obvious. I would advise to stick the word 'server' in the name somewhere, but naming your openvpn server "server" is for sissies :lol:

shinjikenny
OpenVPN User
Posts: 25
Joined: Fri Jul 29, 2011 5:32 am

Re: Man-in-the-Middle?

Post by shinjikenny » Tue May 29, 2012 11:26 pm

What about the ca.key file? Does it have any purpose or I could just delete it after generating the ca.crt file?
Same with the *.csr files? Is it still needed?

Is there a list for active and revoked users?

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Man-in-the-Middle?

Post by janjust » Wed May 30, 2012 8:30 am

do NOT delete the ca.crt or ca.key files - they are crucial for your entire PKI.
Keep the ca.key file on a separate disk/machine for security reasons.
The *.csr files can be deleted after the corresponding .crt file are generated.
Inside $KEY_DIR you will find all the files for your PKI; it also contains the "database" (index.txt) that is used to generate revocation lists etc. You can use the 'revoke-full' script to revoke a certificate. Note that you will need the ca.crt and ca.key files to generated a CRL (Certificate Revocation List).

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Man-in-the-Middle?

Post by maikcat » Wed May 30, 2012 1:35 pm

ca.key file MUST be remain SECRET and DONT delete it....

if you check the cert creation process you will notice that
first the .csr is created and then the .crt

.csr as janjust said can be deleted AFTER crt is made.

(CSR Certificate Signing Request)

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

Post Reply