IPsec VPN Penetration Testing With BackTrack Tools
IPsec VPN Penetration Testing With BackTrack Tools
IPsec VPN Penetration Testing With BackTrack Tools
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
Subscribe to Print Edition Search
HOME
REVIEWS
HOW-TOS
CODING
INTERVIEWS
FEATURES
OVERVIEW
BLOGS
SERIES
IT ADMIN
Search for:
Search
This article outlines the value of penetration-testing VPN gateways for known vulnerabilities and also shows you how to prevent a breach into the internal network.
IPsec is the most commonly used technology for both gateway-to-gateway (LAN-to-LAN) and host to gateway (remote access) enterprise VPN solutions. It offers complete data protection for tunnelled traffic, with confidentiality, integrity, data origin authentication and anti-replay services. IPsec uses a lot of components to achieve high-level security. The major protocols that IPsec uses are: ESP (Encapsulation Security Payload): ESP can provide data confidentiality and integrity, but cannot protect the IP header. The IP protocol number of ESP is 50. AH (Authentication Header): AH can provide the integrity service to the data packet, but cannot offer confidentiality to data packets like ESP. The IP protocol number of AH is 51. IKE (Internet Key Exchange): IKE provides support for the negotiation of parameters between end points or VPN peers and thus establishes, maintains and terminates security associations (SA). The SA termination can be based on time (seconds) or transfer (kilobytes) rate. Actually, IKE is a type of ISAKMP (Internet Security Association Key Management Protocol) implementation, which is a framework for authentication and key exchange. IKE establishes the security association (SA) between two endpoints through a three-phase process. IKE Phase 1: IKE Phase 1 sets up a secure channel between two IPsec endpoints by the negotiation of parameters like the encryption algorithm, integrity algorithm, authentication type, key distribution mechanism, life time, etc. IKE Phase 1 can either use the main mode or aggressive mode to establish the bidirectional security association. Main mode negotiates SA through three pairs of messages, while aggressive mode offers faster operations through the exchange of three messages. IKE Phase 2: IKE Phase 2 is used for data protection. The VPN peers negotiate the IPsec parameters needed for data security with ESP and AH. Finally, a unidirectional SA is built between pairs with a special mode known as Quick Mode. The establishment of the Phase 2 security association can use an entirely different algorithm from whats used by Phase 1 the Diffie Hellman Algorithm for more security. This concept is known as Perfect Forward Secrecy (PFS). IKE Phase 1.5: IKE Phase 1.5 or the Extended Authentication Phase is an optional phase and is commonly used in remote access VPN solutions. IKE Phase 1.5 will enhance security by adding end-user-level authentication. Commercial VPN gateways from different manufacturers like Cisco, Checkpoint, Juniper, Microsoft, etc., are readily available. Some of those vendors offer both hardware- and softwarebased solutions for IPsec implementations. Quite a few robust open source solutions like Openswan, StrongVPN, etc., can also be used for IPsec implementations.
Follow
+2,394
7/18/13
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
Find us on Facebook
protection?
VPN penetration testing will help the organisation to baseline (identify the loopholes that exist in the present implementation and modify the configuration accordingly to protect itself from known problems) its current VPN security posture, identify threats and weaknesses, and implement a new security policy that will mitigate risks.
Popular
Comments
Tag cloud
The same test lab setup can also be arranged with other solutions like Checkpoint SPLAT (Secure Platform or SPLAT is a software-based gateway solution from Checkpoint Software), Microsoft Server 2003 or 2008 (configured as an IPsec VPN gateway), etc.
7/18/13
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
A direct port-scan on the VPN gateway with this powerful open source scanner provides supplemental information on the presence of the VPN gateway. Nmap can later be used at the fingerprinting phase for version or OS identification.
r o o t @ b t : ~ #n m a ps Up5 0 01 7 2 . 1 6 . 2 1 . 2 0 0 S t a r t i n gN m a p5 . 5 1( h t t p : / / n m a p . o r g )a t2 0 1 1 1 1 2 61 0 : 5 6I S T N m a ps c a nr e p o r tf o r1 7 2 . 1 6 . 2 1 . 2 0 0 H o s ti su p( 0 . 0 0 0 3 6 sl a t e n c y ) . P O R T S T A T ES E R V I C E 5 0 0 / u d po p e n i s a k m p M A CA d d r e s s :0 0 : 1 B : D 5 : 5 4 : 4 D : E 4( C i s c oS y s t e m s ) N m a pd o n e :1I Pa d d r e s s( 1h o s tu p )s c a n n e di n0 . 1 7s e c o n d s
The options used were -sU for UDP scan, and -p to only scan the specified port. The scan output shows the ISAKMP port (UDP port 500) open.
Ike-scan
Ike-scan is a simple but powerful command-line tool that is used to find and fingerprint VPN gateways. It sends specially crafted IKE packets to target gateways and enlists any IKE responses that are received. By default, Ike-scan works in main mode, and sends a packet to the gateway with an ISAKMP header and a single proposal with eight transforms inside it. Each transform contains a number of attributes like DES or 3DES as the encryption algorithm, SHA or MD5 as the integrity algorithm, a pre-shared key as the authentication type, DiffieHellman 1 or 2 as the key distribution algorithm and 28800 seconds as the lifetime. Initial IPsec VPN discovery with Ike-scan is as shown below:
r o o t @ b t : ~ #i k e s c a nM1 7 2 . 1 6 . 2 1 . 2 0 0 S t a r t i n gi k e s c a n1 . 9w i t h1h o s t s( h t t p : / / w w w . n t a m o n i t o r . c o m / t o o l s / i k e s c a n / ) 1 7 2 . 1 6 . 2 1 . 2 0 0 M a i nM o d eH a n d s h a k er e t u r n e d H D R = ( C K Y R = d 9 0 b f 0 5 4 d 6 b 7 6 4 0 1 ) S A = ( E n c = 3 D E SH a s h = S H A 1G r o u p = 2 : m o d p 1 0 2 4A u t h = P S KL i f e T y p e = S e c o n d sL i f e D u r a t i o n = 2 8 8 0 0 ) V I D = 4 0 4 8 b 7 d 5 6 e b c e 8 8 5 2 5 e 7 d e 7 f 0 0 d 6 c 2 d 3 c 0 0 0 0 0 0 0( I K EF r a g m e n t a t i o n ) E n d i n gi k e s c a n1 . 9 :1h o s t ss c a n n e di n0 . 0 1 5s e c o n d s( 6 5 . 5 8h o s t s / s e c ) .1r e t u r n e dh a n d s h a k e ;0r e t u r n e dn o t i f y
The Mshows each payload in a line, so that the output will be neat and easy to understand. The output can be any of the following: 0 returned handshake; 0 returned notify: This means the target is not an IPsec gateway. 1 returned handshake; 0 returned notify: This means the target is configured for IPsec and is willing to perform IKE negotiation, and either one or more of the transforms you proposed are acceptable. 0 returned handshake; 1 returned notify: VPN gateways respond with a notify message when none of the transforms are acceptable (though some gateways do not, in which case further analysis and a revised proposal should be tried). In the example shown, the VPN gateway replies with one returned handshake and the acceptable transform set has these parameters:
E n c = 3 D E SH a s h = S H A 1G r o u p = 2 : m o d p 1 0 2 4A u t h = P S KL i f e T y p e = S e c o n d sL i f e D u r a t i o n = 2 8 8 0 0 C u s t o mt r a n s f o r ms e t sc a nb et r i e da g a i n s tt h et a r g e tw i t ht h e " t r a n s "s w i t c h : t r a n s = ( 1 = 1 , 2 = 2 , 3 = 1 , 4 = 2 )
where 1=Encryption Algorithm, 2=Hash Algorithm, 3=Authentication Method, 4=Group Description, and 5=Group Type. Kindly refer to RFC 2409 Appendix A for a complete understanding of transform set values. There are a number of other tools like i p s e c t r a c e ,i p s e c s c a n , etc., available for IPsec scanning, but undoubtedly Ike-scan is one of the best and a frequently updated tool. Vulnerability assessment tools like Nessus, Nexpose, etc, can be used to identify the vulnerabilities of VPN implementations. A full security audit on the target gateway with such types of tools will generate a detailed report with all identified problems and the mitigation steps available.
www.linuxforu.com/2012/01/ipsec-vpn-penetration-testing-backtrack-tools/
3/6
7/18/13
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
containing the acceptable transform set details. As the default IKE doesnt offer reliability for transmitted packets, VPN gateway vendors will use their own back-off algorithm to deal with the lost in transit traffic. The attacker sends an initial IKE proposal to the VPN gateway with an acceptable transform set. The attacker doesnt reply and carefully analyses the server response messages for some time. (The default time Ike-scan waits for back-off fingerprinting is 60 seconds.) By analysing the time difference between the received messages from the server and the matching response pattern, the pen tester can successfully fingerprint the VPN gateway vendor. Some VPN servers will use the optional Vendor ID (VID) payload with IKE to carry some proprietary extensions. This will really make fingerprinting easy for the attacker. Most of the time, VID is a hashed text string. Ike-scan can use the v e n d o rswitch to add the VID payload to outbound packets. The received VID payload can be displayed by Ike-scan directly, as shown below:
r o o t @ b t : ~ #i k e s c a nMs h o w b a c k o f f1 7 2 . 1 6 . 2 1 . 2 0 0 S t a r t i n gi k e s c a n1 . 9w i t h1h o s t s( h t t p : / / w w w . n t a m o n i t o r . c o m / t o o l s / i k e s c a n / ) 1 7 2 . 1 6 . 2 1 . 2 0 0 M a i nM o d eH a n d s h a k er e t u r n e d H D R = ( C K Y R = 4 f 3 e c 8 4 7 3 1 e 2 2 1 4 a ) S A = ( E n c = 3 D E SH a s h = S H A 1G r o u p = 2 : m o d p 1 0 2 4A u t h = P S KL i f e T y p e = S e c o n d sL i f e D u r a t i o n = 2 8 8 0 0 ) V I D = 4 0 4 8 b 7 d 5 6 e b c e 8 8 5 2 5 e 7 d e 7 f 0 0 d 6 c 2 d 3 c 0 0 0 0 0 0 0( I K EF r a g m e n t a t i o n ) I K EB a c k o f fP a t t e r n s : I PA d d r e s s 1 7 2 . 1 6 . 2 1 . 2 0 0 1 7 2 . 1 6 . 2 1 . 2 0 0 1 7 2 . 1 6 . 2 1 . 2 0 0 1 7 2 . 1 6 . 2 1 . 2 0 0 1 7 2 . 1 6 . 2 1 . 2 0 0 N o . R e c vt i m e D e l t aT i m e 1 1 3 2 2 2 8 6 0 3 1 . 7 4 4 9 0 4 0 . 0 0 0 0 0 0 2 1 3 2 2 2 8 6 0 3 9 . 7 4 5 0 8 1 8 . 0 0 0 1 7 7 3 1 3 2 2 2 8 6 0 4 7 . 7 4 5 9 8 9 8 . 0 0 0 9 0 8 4 1 3 2 2 2 8 6 0 5 5 . 7 4 6 9 7 2 8 . 0 0 0 9 8 3 I m p l e m e n t a t i o ng u e s s :C i s c oV P NC o n c e n t r a t o r
Note that the Ike-scan fingerprinting can be done without even using the t r a n soption, but adding it will make the process faster. So you have been successful in fingerprinting the vendor of the VPN gateway; in this case, it is a Cisco VPN Server like ASA or PIX.
Ike-probe or Ike-scan can be used to capture authentication data, as the following example shows:
r o o t @ b t : ~ #i k e s c a np s k c r a c ka g g r e s s i v ei d = p e e r1 7 2 . 1 6 . 2 1 . 2 0 0
S t a r t i n gi k e s c a n1 . 9w i t h1h o s t s( h t t p : / / w w w . n t a m o n i t o r . c o m / t o o l s / i k e s c a n / ) 1 7 2 . 1 6 . 2 1 . 2 0 0 A g g r e s s i v eM o d eH a n d s h a k er e t u r n e dH D R = ( C K Y R = 7 e b 5 9 f 4 3 7 b b c 5 4 4 5 )S A = ( E n c = 3 D E SH a s h = S H A 1G r o u p = 2 : m o d p 1 0 2 4A u t h = P S KL i f e T y p e = S e c o n
www.linuxforu.com/2012/01/ipsec-vpn-penetration-testing-backtrack-tools/
4/6
7/18/13
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
In some cases, the VPN gateway will have default user accounts, which the pen-tester can use for Xauth. If not, extensive social engineering or information gathering will do the trick. You may use a proper IPsec VPN client like the Cisco EasyVPN client for the final verification.
Related Posts:
Advanced Nmap: Scanning Firewalls Continued Advanced Nmap: Scanning Techniques Continued Advanced Nmap: FIN Scan & OS Detection Advanced NMap: Some Scan Types Advanced Nmap: A Recap
Tags: ARP spoofing, authentication header, authentication type, Backtrack, Cisco, data packets, encryption algorithm, enterprise VPN, IKE, Internet Key Exchange, IP addresses, IP header, IPsec, isakmp, Juniper, LFY January 2012, MAC address, Metasploit, metasploit framework, Nessus, NMap, origin authentication, Penetration testing, Perfect Forward Secrecy, protocol implementation, secure channel, VPN
www.linuxforu.com/2012/01/ipsec-vpn-penetration-testing-backtrack-tools/
5/6
7/18/13
Previous Post
IPsec VPN Penetration Testing with BackTrack Tools - LINUX For You
Next Post
What's this?
Don't Get Prostate Cancer: Know These Early Warning Newsmax Health Canada Turns to Temporary Foreign Workers Kelly OCG Roommates from Hell: Watch The Dead Kevin Show Comedy Central Morning Swim: Heidi Klum's unfortunate sunburn Sports Illustrated
What it Takes to be an Open Source Expert 1 comment PHP Development: A Smart Career Move 4 comments A Simple guide to building your own Linux Kernel 1 comment
Share
2 months ago
can u just elaborate this part "edit the output file to include only the hash value. (It should only include 9 colon-separated values.)"...in the psk offline cracking...any link to do this..or any method...i m facing extreme difficulty in this part...thnks in advance...
Reply Share
V INA Y GA MB HIR
a year ago
Please share the contact details of ARUN THOMAS , we are looking for an expert like him...
Reply
Share
a year ago
Mahat A garwal
Admin , please share the contact details of the author , we are looking for the services of an experienced penetration tester like this.
Reply dgfdg Share
7 days ago
@f2f74378649d2fc27a3e465f04f29954
r
C o m m e n t fe e d
Su b s cri b e vi a e m a i l
Reviews
How-Tos
Coding
Interviews
Features
Overview
Blogs
Search
Popular tags
Linux , ubuntu, Java, MySQL, Google, python, Fedora, Android, PHP, C, html, w eb applications , India, Microsoft, unix , Window s , Red Hat, Oracle, Security , Apache, xml, LFY April 2012, FOSS, GNOME, http, JavaScript, LFY June 2011, open source, RAM, operating systems
All published articles are released under Creative Commons Attribution-NonCommercial 3.0 Unported License, unless otherw ise noted. LINUX For You is pow ered by WordPress, w hich gladly sits on top of a CentOS-based LEMP stack.
www.linuxforu.com/2012/01/ipsec-vpn-penetration-testing-backtrack-tools/
6/6