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

radexecd.txt

radexecd.txt
Posted Jun 18, 2005
Authored by John Cartwright

Multiple buffer overflow vulnerabilities exist in the HP Radia Notify daemon. Versions tested were 3.1.2.0 and 3.1.0.0. Detailed exploitation provided.

tags | advisory, overflow, vulnerability
SHA-256 | c57710ce4ce013e2bdbf66952de94185cf52b770928514767314d2bc8ad42192

radexecd.txt

Change Mirror Download
HP Radia Notify Daemon: Multiple Buffer Overflow Vulnerabilities
John Cartwright <johnc@grok.org.uk>
1st June 2005

Introduction
------------
Hewlett-Packard's (formerly Novadigm) Radia contains a component known
as the Radia Notify Daemon. This RADEXECD component is a small server
process that listens for commands via a TCP socket and executes them
on behalf of an administrator or other Radia process. A total of three
remotely-exploitable overflows have been found in various versions of
this software.

Overview
--------
The 'nvd_exec' function contains two remotely-exploitable stack-based
overflows in version 3.1.2.0. The vulnerability occurs when a crafted
command is sent to a RADEXECD process with parameters of a greater
length than the buffer used to store them via an unbounded strcpy
operation. In a typical configuration this vulnerability may be
exploited remotely by an unauthenticated attacker to gain the
privileges of the RADEXECD component, observed to be
NT_AUTHORITY\SYSTEM during testing.

In addition, the earlier version of 3.1.0.0 has a similar flaw
involving a malformed file extension. This bug was reported via
development contacts to Novadigm (pre-HP) approximately 12 months ago
but the status and availability of the fix was unknown at the time of
writing.

Analysis
--------
The nvd_exec (as labelled in disassembly from embedded 'comments')
function is designed as a wrapper to the Windows CreateProcess API
call. Upon validation of its arguments, nvd_exec creates the relevant
StartupInfo structures, executes the target process, and waits for
it to terminate. This function accepts five parameters, beginning with
the application name to execute and its parameters.

Although generic restrictions on string lengths exist in the protocol
definition (see below), there is no specific check for an overly-long
parameter string at this stage in execution. A stack-based parameter
buffer of approximately 512 characters is used to store this
information during parsing, which can be overrun by one of two
unbounded strcpy calls inside nvd_exec:

.text:00406193 mov ecx, [ebp+arg_params] ; attacker-supplied
.text:00406196 push ecx ; char *
.text:00406197 lea edx [ebp+parambuf] ; actually 516 chars
.text:0040619D push edx ; char *
.text:0040619E call _strcpy ; overflow here

The second instance has the same bug:

.text:004061AE mov ecx, [ebp+arg_params] ; attacker-supplied
.text:004061B1 push ecx ; char *
.text:004061B2 lea edx, [ebp+parambuf] ; actually 516 chars
.text:004061B8 push edx ; char *
.text:004061B9 call _strcpy ; overflow here

Due to the positioning of the stack variables it is possible to
overwrite the return address of the function by overflowing the buffer:

FFFFFDF0 parambuf db 516 dup(?) ; buffer to overflow
FFFFFFF4 rc dd ;
FFFFFFFC pBuf dd ;
00000000 s db 4 dup(?) ; saved stack ptr
00000004 r db 4 dup(?) ; return address
00000008 arg_app dd ? ; application name
00000008 arg_params dd ? ; parameter information

By default, nvd_exec can be accessed by unauthenticated users by
crafting an appropriate request and submitting it to the RADEXECD port.

The older version of this software is vulnerable to a sprintf-based
overflow caused by poor error handling logic: in this instance it is
the extension of the command variable which causes the problem:

.text:00405B46 cmp [ebp+ext_ptr], 0 ; have we found the '.' ?
.text:00405B4D jz short loc_405B9F ; no extension (safe)
.text:00405B4F mov edx, [ebp+ext_ptr] ;
.text:00405B55 push edx ; char *
.text:00405B56 call _strlen ; calc extension length
.text:00405B5B add esp, 4 ;
.text:00405B5E cmp eax, 4 ; should be 4 eg '.foo'
.text:00405B61 jz short local_405B9F ; OK, continue
.text:00405B63 mov eax, [ebp+arg_app] ; the *complete* argument
.text:00405B66 push eax ;
.text:00405B67 push offset aFileExtMsg ; "File extension ... %s"
.text:00405B6C lea ecx, [ebp+buffer] ; fixed size buffer
.text:00405B72 push ecx ;
.text:00405B73 call _sprintf ; overflow here

Therefore supplying a string of the form ".AAAAAAAAAAAAAA..." is
sufficient to overflow this fixed-size buffer.

Exploitation
------------
Exploitation requires that the following steps be followed:

1) Attacker connects to RADEXECD port on target host
2) Attacker sends crafted remote execution request
3) Target host connects back to callback port on attacker
4) Target overflows buffer and executes shellcode

In order to craft a remote execution request, the protocol must be
analysed. RADEXECD employs a text-based protocol with requests
taking the form of:

<callback port>\0<username>\0<password>\0<command>\0
(where \0 is a NULL delimiter/terminator).

<callback port> is an attacker-supplied port which must be ready to
accept incoming connections. Testing has not revealed the purpose of
this port, and no data has been observed to travel over the connection
once established. Therefore from an exploitation point of view, it is
sufficient to place a netcat listener or similar on this port.

<username> and <password> are only checked if the corresponding global
configuration has specifically enabled security. Therefore in a typical
setup the strings 'user' and 'pass' are sufficient for exploitation
purposes.

<command> is a NULL-terminated ASCII string that contains the actual
command to be executed, with parameters. In order to exploit this
particular vulnerability, the command itself is not important, but we
use this part of the buffer to hold our return address and shellcode.
This must contain a '.' character to denote the extension portion of
the parameter.

So, in summary, a crafted request of this form is sufficient to exploit
this vulnerability:

<callback port>\0<username>\0<password>\0
"LIST " . (0x90 x <offset>) . <ret_addr> . "." . <shellcode>

Shellcode cannot include NULLs, dots, newlines, path components, etc.
In the test environment, <offset> was found to be 532 bytes for the
strcpy-based overflow and 454 bytes for the sprintf-based one.

When successfully overflowed, esp points to the extension component, so
<ret_addr> should be the address of a 'jmp esp' or 'call esp'
instruction. In a test XPSP1 environment, address 0x77E2EF63 was used
('call esp' from ADVAPI32.DLL.)

Workaround
----------
Disabling RADEXECD is impractical as it is essentially a core component
of the Radia suite. Access control lists on network devices should be
used to filter access to the configured RADEXECD port to mitigate this
attack vector until a patch is available.

Timeline
--------
3rd May 2005
- Vulnerabilities disclosed to Hewlett Packard.
- HP confirm and log as 'SSRT5962 Radia Notify Daemon buffer overflows'

17th May 2005
- HP reports that patches are under development.

1st June 2005
- Co-ordinated release.

Notes
-----
Versions under test (from .exe version resource) were RADEXECD.EXE
3.1.2.0 (strcpy-based overflow) and 3.1.0.0 (sprintf-based overflow)

This advisory will be archived at
http://www.grok.org.uk/advisories/radexecd.html
Login or Register to add favorites

File Archive:

August 2024

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