赞
踩
0x00前言:
昨天刚刚看完小迪老师的sql注入篇的第一章
所以有了新的笔记。
0x01笔记:
sql注入原理:
网站数据传输中,接受变量传递的值未进行过滤,导致直接带入数据库查询执行的操作。
sql注入对渗透的作用:
获取数据
sql注入特性:
攻击方法由数据库类型决定
攻击结果由数据库决定
漏洞代码:
sql.php
$id=$_GET['x'];
$sql="select * from news where id=$x";
还没完
?>
当我们在网页执行访问了:
http://127.0.0.1/sql.php?x=1
在数据库其实是这样的
$id=1
select * from news where id=1
注入语句
http://127.0.0.1/sql.php?x=1 and 1=1 真
select * from news where id=1 and 1=1
返回正常页面
http://127.0.0.1/sql.php?x=1 and 1=2 假
select * from news whsere id=1 and 1=2
返回错误页面
and or xor
且 或 非
sql语句中逻辑运算符:
and 1=1 真且真
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。