Swiss Cyber Storm II – Hack & Learn
VPN with Windows 7
and Linux strongSwan
using IKEv2
Prof. Dr. Andreas Steffen
Andreas Steffen, 19.04.2009, CyberStormII.pptx 2
•
Road Warriors sign on to their home network via IKEv2 with varying IP addresses assigned dynamically by the local ISP.The „Road Warrior“ Remote Access Case
Internet Home
Network IPsec Tunnel
VPN Gateway 77.56.157.76 10.10.0.0/23 Road Warrior x.x.x.x Dynamic IP Virtual IP 10.10.3.6
•
Authentication is preferably based on RSA public keys and X.509 certificates issued by the home network.•
Virtual IP and internal name server information assigned by the home network. Remote hosts thus become part of an extruded net.IKEv2 – Internet Key Exchange v2 (2005)
•
IKE_SA_INIT exchange pair•
IKE_AUTH exchange pairIKE Header
IKE
Header SA1SA1ii KEKEii NNii 1
2 IKE
Header
IKE
Header SA1SA1rr KEKErr NNrr
3 IKE Header IKE Header encrypted IDi IDi Cert i Certi Authi Authi IDr IDr SA2i SA2i TS i TSi TS r TSr 4 encrypted IKE Header IKE
Header IDIDrr CertCertrr AuthAuthrr
SA2r SA2r TS i TSi TS r TSr Responder Initiator UDP/500
Andreas Steffen, 19.04.2009, CyberStormII.pptx 4
Swiss Cyber Storm II – Hack & Learn
Client Authentication with
Machine Certificates
Windows 7 Machine Certificates
•
Machine certificates (*.p12) must be imported via the Microsoft management console (mmc) into the Local Computer section of the Windows 7 registry!Andreas Steffen, 19.04.2009, CyberStormII.pptx 6
Andreas Steffen, 19.04.2009, CyberStormII.pptx 8
Windows 7 VPN Client Configuration III
VPN gateway Arbitrary name
Windows 7 VPN Client Configuration IV
•
Username/Password information not used ifAndreas Steffen, 19.04.2009, CyberStormII.pptx 10
Windows 7 VPN Client Configuration VI
•
Alternatively EAP-MS-CHAPv2 username/password basedauthentication could be used with a Linux strongSwan gateway.
•
Unfortunately, Windows 7 Beta is prone to Man-in-the-Middle attacks since the gateway signature is not verified by the Windows 7 client!Andreas Steffen, 19.04.2009, CyberStormII.pptx 12
Windows 7 VPN Client Configuration VII
•
The Windows 7 Agile VPN Client supports the IKEv2 Mobility and Multihoming Protocol MOBIKE (RFC 4555).•
A change of the IP address or network interface on the client side is communicated via IKEv2 to the VPN gateway so that an existing IPsec tunnel is migrated automatically!Andreas Steffen, 19.04.2009, CyberStormII.pptx 14
Linux strongSwan Gateway Configuration
#/etc/ipsec.conf conn win7 keyexchange=ikev2 authby=rsasig left=%any leftsubnet=0.0.0.0/0 leftcert=koalaCert.pem [email protected] leftfirewall=yes right=%any rightsourceip=10.10.3.0/24 auto=add #/etc/ipsec.secrets : RSA koalaKey.pem #/etc/strongswan.conf charon { dns1 = 62.2.17.60 dns2 = 62.2.24.162 nbns1 = 10.10.1.1 nbns2 = 10.10.0.1 }
•
The strongSwan gateway could narrow the traffic selector to the local network but Windows 7 does not allow split-tunneling!Andreas Steffen, 19.04.2009, CyberStormII.pptx 16
Linux strongSwan Logfile
[NET] received packet: from 193.247.250.37[506] to 77.56.157.76[500] [ENC] parsed IKE_SA_INIT request 0 [SA KE No N(NATD_S_IP) N(NATD_D_IP)]
[IKE] 193.247.250.37 is initiating an IKE_SA [IKE] remote host is behind NAT
[ENC] generating IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ ]
[NET] sending packet: from 77.56.157.76[500] to 193.247.250.37[506] [NET] received packet: from 193.247.250.37[3226] to 77.56.157.76[4500]
[ENC] parsed IKE_AUTH request 1 [ IDi CERT CERTREQ AUTH N(MOBIKE_SUP) CP SA TSi TSr ]
[IKE] authentication of 'C=CH, O=Linux strongSwan, CN=bonsai.strongswan.org‘ with RSA signature successful
[IKE] IKE_SA win7[1] established between 77.56.157.76[koala.strongswan.org] ...193.247.250.37[C=CH, O=Linux strongSwan, CN=bonsai.strongswan.org] [IKE] assigning virtual IP 10.10.3.6 to peer
[ENC] generating IKE_AUTH response 1 [ IDr CERT AUTH CP SA TSi TSr N(MOBIKE_SUP) N(ADD_4_ADDR) N(ADD_4_ADDR) ]
[IKE] CHILD_SA win7{1} established with SPIs c97fa201_i e7d5941a_o and TS 0.0.0.0/0 === 10.10.3.6/32
Andreas Steffen, 19.04.2009, CyberStormII.pptx 18
Summary
•
The Windows 7 Agile VPN Client [and Windows Server 2008 R2] fully support version 2 of the Internet Key Exchange protocol(IKEv2, RFC 4306) as well as the IKEv2 Mobility and Multihoming protocol (MOBIKE, RFC 4555).
•
The Windows 7 Agile VPN Client is easy to set up and fully interoperates e.g. with an Open Source Linux strongSwan VPN gateway available from www.strongswan.org.•
The current Windows 7 Beta release does not implement theEAP-MS-CHAPv2 authentication properly: The secret derived from the user password is vulnerable to Man-in-the-Middle attacks
because the Windows 7 client ignores the server certificate and corresponding digital signature!