Php注入點構造代碼

來源:互聯網
上載者:User

把下面儲存成 Test.asp

複製代碼 代碼如下:<?
$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);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Php Sql Injection Test </title>
</head>
<body>
<p align="center"><b><font color="#FF0000" size="5" face="華文行楷"> </font><font color="#FF0000" size="5" face="華文新魏">PHP
注入測試專用</font></b></p>
<table width="100%" height="25%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?=$row[0]?></td>
</tr>
<tr>
<td><?=$row[1]?></td>
</tr>
</table>
<p><u><font color="#0000FF">BY:孤狐浪子 QQ:393214425 </font></u></p>
<p><font color="#0000FF">Blog: Http://itpro.blog.163.com</font></p>
<p> </p>
</body>
</html>

建立資料庫代碼:儲存成test.sql 使用phpmyadmin執行就ok了

複製代碼 代碼如下:CREATE DATABASE `phpzr` ; //建立資料庫名稱

CREATE TABLE admin (
id int(10) unsigned NOT NULL auto_increment,
username char(10) NOT NULL default '',
password char(10) NOT NULL default '',
useremail char(20) NOT NULL default '',
groupid int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO admin VALUES (1, 'admin', 'itpro.blog.163.com','itpro@163.com', 1);
INSERT INTO admin VALUES (2, 'admin1', 'itpro.blog.163.com','itpro@163.com', 2);
INSERT INTO admin VALUES (3, 'admin2', 'itpro.blog.163.com','itpro@163.com', 3);
INSERT INTO admin VALUES (4, 'admin3', 'itpro.blog.163.com','itpro@163.com', 4);
INSERT INTO admin VALUES (5, 'admin4', 'itpro.blog.163.com','itpro@163.com', 5);

CREATE TABLE admin1 (
id int(10) unsigned NOT NULL auto_increment,
username char(10) NOT NULL default '',
password char(10) NOT NULL default '',
useremail char(20) NOT NULL default '',
groupid int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO admin1 VALUES (1, 'admin', 'itpro.blog.163.com','itpro@163.com', 1);
INSERT INTO admin1 VALUES (2, 'admin1', 'itpro.blog.163.com','itpro@163.com', 2);
INSERT INTO admin1 VALUES (3, 'admin2', 'itpro.blog.163.com','itpro@163.com', 3);
INSERT INTO admin1 VALUES (4, 'admin3', 'itpro.blog.163.com','itpro@163.com', 4);
INSERT INTO admin1 VALUES (5, 'admin4', 'itpro.blog.163.com','itpro@163.com', 5);

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.