<?php header('Content-type: image/jpg'); $url = $_GET['url']; $refer = "目标站"; $ip = rand(1, 254) . '.' . rand(1, 254) . '.' . rand(1, 254) . '.' . rand(1, 254); $opt = [ 'http'=>[ 'header'=>["Referer: " . $refer,"X-Forwarded-For:" . $ip] ] ]; $context = stream_context_create($opt); $file_contents = file_get_contents($url,false, $context); echo $file_contents; ?>
主要就是伪造header头