ASP NET PHP 注入頁面構造
Mssql:
<!--#include file="conn.asp"-->
<%
hid=request.QueryString("id")
sql="select * from admin where id="&hid
set rs=conn.execute (sql)
%>
Access:
<%
db="aspzhuru.mdb"'這里修改數據庫路徑或名稱
Set conn = Server.CreateObject("ADODB.Connection")
dbpath="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open dbpath
%>
Php:
<?
$mysql_server_name = "localhost";
$mysql_username = "root";
$mysql_password = "password";
$mysql_database = "phpzr";
$conn=mysql_connect( $mysql_server_name, $mysql_username, $mysql_password );
mysql_select_db($mysql_database,$conn);
$id=$_GET['id'];
$sql = "select username,password from admin where id=$id";
$result=mysql_db_query( $mysql_database, $sql,$conn );
$row=mysql_fetch_row($result);
?>
.net (放到代碼文件.cs里面):
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings["StudyConnectionString"].ToString();
conn.Open();
SqlCommand cmd = new SqlCommand("select * from [table] where id= " + this.Page.Request.Params["getid"], conn);
cmd.ExecuteNonQuery();
this.Page.RegisterClientBlock("", "<>alert('注射成功')</>");
}
}
關健詞:ASP NET PHP
新文章:
- CentOS7下圖形配置網絡的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統后丟失windows啟動項
- CentOS單網卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網打印機IP講解
- CentOS7使用hostapd實現無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網絡重啟出錯
- 解決Centos7雙系統后丟失windows啟動項
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統有什么不同呢
- Centos 6.6默認iptable規則詳解