前言:
做个简单的审计练练手,真的好久没审计了…KKCMS真的很适合新手入门审计,所以我就来审了,233
kindeditor编辑器 <= 4.1.5文件上传漏洞
目录中能注意到kindeditor.js ,在kindeditor.js 中也可以清楚看到版本号是4.1.10  
利用一:构造恶意代码
由于当dir 参数为file 时,允许上传html、htm、txt文件 ,即可构造的恶意HTML 代码,可以造成XSS漏洞、恶意跳转、甚至文件包含等 
利用二:信息泄露
此外还能曝出网站根目录,结合file_manager_json.php 即可,获取到网站路径在SQL注入写shell时有所帮助

前台SQL注入——stripslashes函数的不当使用
首先是library.php 会有对GET、POST、COOKIE、REQUEST变量的转义,许多地方都会引用这个文件  而在用户注册功能处,ucenter/reg.php 中却有stripslashes函数去除反斜杠,一来一回相当于没有过滤了,所以存在注入 
stripslashes(string)
stripslashes 函数会删除字符串string中的反斜杠,返回已剥离反斜杠的字符串
类似的还有active.php和repass.php,都是因为stripslashes函数的不当使用造成SQL注入 
前台SQL注入——未过滤
在特别推荐处发现URL中自带参数,加个引号发现内容消失了,说明有可能SQL注入 
首先是vlist.php 中引用了位于template/wapian/vlist.php 处的代码,首先关注的是他没有包含library.php ,其次他未对cid参数进行过滤而直接拼接进SQL语句中。可以看得出这是个数字型注入  直接SQLmap跑一下即可
python sqlmap.py -u "http://127.0.0.1/kkcms-master/kkcms-master/vlist.php?cid=1"
后台SQL注入——未过滤
admin/cms_book_edit.php admin/cms_ad_edit.php admin/cms_admin_edit.php 等等等等,全是一样的问题 保存下来SQLmap跑一下即可  全局搜索一下,还有很多:
后台反射型XSS——未过滤

?id="><script>alert(1)</script>
前台反射型XSS

后台存储型XSS

发现弹框1、3,说明名称和地址都能直接XSS,回看图片位置,只需要闭合一下即可XSS
"><script>alert(2)</script>

前台存储型XSS
位于book.php中 这里的正则[\x7f-\xff] 要求匹配到至少一个以上的中文!且会将这些内容存入数据库中,虽然可以看到存入前有addslashes()函数转义,但当从数据库中取出来时就没有了这层转义,所以形同虚设  此外会直接影响到后台管理员,当管理员查看留言信息时会遭到影响,因此可以通过XSS盗取cookie信息 
前台反射型XSS
直接echo一个可控变量,详细看看源码即可得出:
/wx_api.php?echostr=<script>alert(1)</script>&signature=da39a3ee5e6b4b0d3255bfef95601890afd80709

信息泄露
注意到这个重装目录下的data.sql文件存在数据库信息的泄露,除去乱码,一些表的结构都能一目了然。除了一些漏洞外,信息泄露还是需要多加注意的 
后记
开发者对于很多的数据传入都没有进行严格过滤,全局过滤的代码不够严谨,且有的地方加有的又不加,此外基本没有防御XSS漏洞…
|