ASP注入靶机
ASP:
<%
Dim Db,MyDbPath
dim conn
'可修改设置一:========================定义数据库类别,1为SQL数据库,0为Access数据库=============================
Const IsSqlDataBase =0
MyDbPath = ""
'================================================================================================================
If IsSqlDataBase = 1 Then
'必修改设置二:========================SQL数据库设置=============================================================
'sql数据库连接参数:数据库名(SqlDatabaseName)、用户密码(SqlPassword)、用户名(SqlUsername)、
'连接名(SqlLocalName)(本地用local,外地用IP)
Const SqlDatabaseName = "dvbbs"
Const SqlPassword = ""
Const SqlUsername = "sa"
Const SqlLocalName = "localhost"
'================================================================================================================
Else
'必修改设置三:========================Access数据库设置==========================================================
'免费用户第一次使用请修改本处数据库地址并相应修改data目录中数据库名称,如:将dvbbs6.mdb修改为dvbbs6.asp
Db = "z.mdb"
'================================================================================================================
End If
Dim ConnStr
If IsSqlDataBase = 1 Then
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Else
ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & db)
End If
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
'-----------------------------------------------------------------------------------------------------
%>
<%
lg_id=Request("id")
If Request("id") = "" Then
lg_id=1
Set rs=conn.Execute("Select * From dv_help Where h_id ="& lg_id )
else
//提交变量
Set rs=conn.Execute("Select * From dv_help Where h_id=" & lg_id )
End If
%>
<div align="center">
<p> </p>
<p>SQL Injection</p>
<p>数据库可自带,替换表名。</p>
<p>提交参数为a.asp?id=1</p>
<p>id默认为1</p>
</div>
<div align="center">
<table width="754" height="259" border="1">
<tr>
<td width="744" bgcolor="#CCCCCC"><%=rs("h_content")%></td>
</tr>
</table>
</div>
By:珍惜少年时博客:http://www.cnblogs.com/xishaonian/
*-------------------------------------------*