php fsockopen 捏造 post和get方法
发布时间:2023-08-18 12:30:29 所属栏目:PHP教程 来源:
导读:php fsockopen 伪造 post和get方法
<?php
//fsocket模拟post提交
$purl = "http://localhost/netphp/test2.php?uu=rrrrrrrrrrrr";
print_r(parse_url($url));
sock_post($purl,"uu=55555555555555555");
<?php
//fsocket模拟post提交
$purl = "http://localhost/netphp/test2.php?uu=rrrrrrrrrrrr";
print_r(parse_url($url));
sock_post($purl,"uu=55555555555555555");
php fsockopen 伪造 post和get方法 <?php //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 .= " ";//开源代码Cuoxin.com $head .= trim($query); $write = fputs($fp, $head); while (!feof($fp)) { $line = fread($fp,4096); echo $line; } } ?> (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐