最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php fsockopen 伪造 post和get方法
时间:2022-07-02 09:25:27 编辑:袖梨 来源:一聚教程网
//fsocket模拟post提交
$purl = "http://loc*alh*ost*/netphp/test2.php?uu=rrrrrrrrrrrr";
print_r(parse_url($url));
sock_post($purl,"uu=55555555555555555");
//fsocket模拟get提交
function sock_get($url, $query)
{
$info = parse_url($url);
$fp = fsockopen($info["host"], 80, $errno, $errstr, 3);
$head = "GET ".$info['path']."?".$info["query"]." HTTP/1.0 ";
$head .= "Host: ".$info['host']." ";
$head .= " ";
$write = fputs($fp, $head);
while (!feof($fp))
{
$line = fread($fp,4096);
echo $line;
}
}
sock_post($purl,"uu=rrrrrrrrrrrrrrrr");
function sock_post($url, $query)
{
$info = parse_url($url);
$fp = fsockopen($info["host"], 80, $errno, $errstr, 3);
$head = "POST ".$info['path']."?".$info["query"]." HTTP/1.0 ";
$head .= "Host: ".$info['host']." ";
$head .= "Referer: http://".$info['host'].$info['path']." ";
$head .= "Content-type: application/x-www-form-urlencoded ";
$head .= "Content-Length: ".strlen(trim($query))." ";
$head .= " ";
$head .= trim($query);
$write = fputs($fp, $head);
while (!feof($fp))
{
$line = fread($fp,4096);
echo $line;
}
}
?>
相关文章
- 《穿越火线X》游戏预告片说明 展现无限可能的射击世界 08-21
- 小米路由器和荣耀路由器支持mesh组网吗(小米路由器和荣耀路由器支不支持mesh组网) 08-21
- 深空之眼快速冲 50 级超全攻略 轻松突破等级瓶颈 08-21
- 原神杜林圣遗物如何挑选 08-21
- 奇迹世界起源如何获取属性点 08-21
- 明日方舟终末地汤汤如何培养 08-21