前言
本来是想做两道简单的ctf解压,结果写笔记的时候联想到练习使用sqlmap和sql注入getshell这两件事,因此有了这篇文章。
手工注入
输入内容,打开burp抓包
直觉测试了下万能密码,能成
这里我们可以假设题目的sql语句为 where username=2 and password=3 or 1=1 ,由于SQL语句中,and优先级大于or,因此无论or左边为0或1,or右边为1,则结果为1
这里我在navicat测试了下:
用order by 语句测出该数据表有三列
那么我们可以使用联合查询,下图可见回显2所在的位置
爆表名
username=2&password=3' or 1=1 union select 1,(select group_concat( table_name) from information_schema.``TABLES`` where table_schema=database() limit 0,1),3 #
爆字段名,查询字段内容