最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php fsockopen 伪造 post和get方法
时间:2022-07-02 09:25:27 编辑:袖梨 来源:一聚教程网
//fsocket模拟post提交
$purl = "http://localhost/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;
}
}
?>
相关文章
- Hyperliquid 价格能否在 2025 年第三季度创新高 07-01
- 标普500指数上链!Centrifuge 和 S&P DJI 共同宣布「24/7交易」来了 07-01
- 金铲铲之战s14超频源计划纳亚菲利阵容攻略 07-01
- 燕云十六声金妙音石归鸿速刷攻略 07-01
- 崩坏星穹铁道3.2末日幻影打法技巧指南 07-01
- 怪物猎人荒野特产采集路线分享 07-01