Foiling An Attack Defeating IPSec Tunnel
Foiling An Attack Defeating IPSec Tunnel
ABSTRACT
This paper addresses some of the discriminants that make IPSec tunnel finger-
printing possible. Fingerprinting of VPN-tunnel endpoints may be desirable for
forensic purposes, but in the hands of individuals of ill-intent, it undermines an en-
terprise network’s perimeter security. Three ways of preventing the ill-use of this
type of fingerprinting are presented. The first two, apply to enterprises wishing to
make their VPN tunnels immune to fingerprinting. The third delves deeper into
the conceptual, and is directed at the standards definition process, as used by the
Internet Engineering Task Force (IETF) and to authors of security-related RFCs
in particular. It addresses aspects in the Internet Key Exchange version 1 (IKEv1)
RFC that have led to misinterpretations on the part of IPSec implementers, and de-
scribes the use of a form of process algebra known as Communicating Sequential
Processes (CSP) in defining security-related standards to overcome RFC-related
ambiguities.
KEY WORDS
Fingerprinting, IPSec tunnel, network forensics, CSP, obfuscation, IKE, RFC.
INTRODUCTION
The IPSec standard, and the Internet Key Exchange version 1 (IKEv1) in particu-
lar, has been the subject of several analyses [1, 2, 3], and has endured a fair amount
of disapproval due to its complexity. Recent research has further shown that the
IKEv1 (hereafter ‘IKE’) Phase 1 and Phase 2 tunnel-setup leaks characteristic
information which can be used by an attacker to identify, or compose a ‘finger-
print’, of the systems establishing the tunnel [4]. In addition to the information
leaked during tunnel-establishment, [4] showed that studying the ESP-protected
(encrypted) traffic also reveals ICMP ECHO REQUEST and ECHO REPLY mes-
sages, and—most interestingly—the messages involved in a TCP Open and a TCP
Close. Section 1 provides further background on fingerprinting in general, and
VPN-tunnel fingerprinting in particular.
These findings bring to the fore a series of security-related questions: What
happens when technology thought to be secure is found to reveal enough informa-
tion for an attacker to strike? Is the solution to various passive and active finger-
printing techniques the all too familiar approach of strengthening the perimeter
defence? When can a step taken to improve the security of a network, be deemed
provably adequate?
Of immediate importance is the task of strengthening the perimeter defence, in
order to thwart an attack that would make use of VPN-tunnel fingerprinting: this
will be dealt with in Section 2. Section 3 proposes a method of countering this type
of fingerprinting that does not follow the common pattern of ‘reactionary defence’.
The method proposed in section 3 can also be extended to prevent other types of
Operating System (OS) fingerprinting, such as those described in [5, 6, 7, 8, 9].
Section 4 closes with a digest of the ideas presented in this paper.
1 BACKGROUND
1.1 OS Fingerprinting
In the arena of network forensics, fingerprinting refers to a method whereby any
operating system can be identified based on its responses to targeted probes (ac-
tive fingerprinting) or based on the observation of its network etiquette (passive
fingerprinting). A machine’s OS can be fingerprinted through a variety of means.
Initially this was done in a rudimentary fashion, by ‘banner-grabbing’: that is,
making an FTP, HTTP, or telnet connection to the target machine, and ‘grabbing’
the banner that was displayed (as defined in /etc/banner in UNIX variants)
[10]. More advanced methods were then developed by Yarochkin [9] and Arkin
[5]. nmap, a tool developed by Yarochkin runs tests against the remote system’s
TCP/IP implementation, and determines the OS based on the response to these
tests. Xprobe2, a tool developed by Arkin, fingerprints by observing ICMP re-
sponses from target hosts, and contrasts them to the RFC-defined standard, the
fingerprint being the results of the vendor’s non-adherence to the RFC.
These forms of fingerprinting can determine, with varying degrees of preci-
sion, what operating system the target is running. This knowledge can enable an
attacker to identify weaknesses on the target system, and by consulting a database
of well-known vulnerabilities, make use of rogue code and gain privileged access
to the system, and potentially also to the network.
The abovementioned fingerprinting methods and tools are examples of active
fingerprinting. Since the method of fingerprinting depends on a series of tests or
probes targeting the end system, it can be argued that measures can be taken to
detect and counter these tests, thus preventing the fingerprinting from taking place.
Zalewski’s tool p0f performs passive fingerprinting, that is fingerprinting without
generating any network traffic of its own. It determines what OS is running on the
target system by observing its behaviour on the network [11].
2 TRAFFIC OBFUSCATION
One manner in which to address the potential vulnerability that (this type of) fin-
gerprinting poses, is by obfuscating the network traffic, so that even if an attacker
were to fully observe the key exchange between IPSec peers, no uniquely iden-
tifiable trait could be discerned. Two types of traffic obfuscation are presented
below: the first, traffic normalisation obfuscates traffic by bringing its character-
istics in line with that of a pre-determined mean (such as an RFC). The second,
traffic dissimulation obfuscates traffic by randomly changing its characteristics to
make it appear to be something that it is not (a different OS, for example). Both
these methods assume an extra processing step; be it an extra machine (the log-
ical next-hop), or a process within the sending machine itself, which performs
the obfuscation. In Linux, this can be done with the Netfilter (iptables) userspace
packet queuing library libipq, which allows packets to be passed to userspace for
manipulation before being passed back to the kernel.
4 CONCLUSION
References
[2] R. Perlman. How to Build an Insecure System out of Perfectly Good Cryp-
tography, 2002.
[6] O. Arkin and F. Yarochkin. ICMP Based Remote OS TCP/IP Stack Finger-
printing Techniques. Phrack Magazine, 11(Issue 57, File 7 of 12), 2001.
[8] R. Hills. NTA Monitor UDP Backoff Pattern Fingerprinting White Paper.
Technical report, NTA, 2003.
[12] J. Girard. Magic Quadrant for SSL VPNs, 1H04. Technical report, Gartner
Research, 2004.
[13] F. Linder. Routing & Tunneling Protocol Attacks, 2001. Presented at Black-
Hat briefings, November 2001, Amsterdam.
[15] J. Postel. RFC 792 - Internet Control Message Protocol. Technical report,
IETF, 1981.
[16] S. Bradner. RFC 2119 - Key Words for use in RFCs to Indicate Requirement
Levels. Technical report, IETF, 1997.
[17] D. Harkins and D. Carrel. RFC 2409 - The Internet Key Exchange (IKE).
Technical report, IETF, 1998.
[18] S. Schneider. Security properties and csp. In Proceedings of the 1996 IEEE
Symposium on Security and Privacy, page 174. IEEE Computer Society,
1996.
[20] C. Meadows. Analysis of the internet key exchange protocol using the nrl
protocol analyzer. In Proceedings of the IEEE Symposium on Security and
Privacy, pages 216–231. IEEE Computer Society, 1999.
[21] Jeff Magee and Jeff Kramer. Concurrency: State Models & Java Programs.
John Wiley & Sons, 1999.