php fsockopen 伪造 post和get方法
发布:smiling 来源: PHP粉丝网 添加日期:2014-09-09 17:16:02 浏览: 评论:0
- <?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 .= " ";//开源代码phpfensi.com
- $head .= trim($query);
- $write = fputs($fp, $head);
- while (!feof($fp))
- {
- $line = fread($fp,4096);
- echo $line;
- }
- }
- ?>
Tags: fsockopen 伪造 post方法
- 上一篇:php站内搜索关键词变亮方法
- 下一篇:php 生成excel xls文档
相关文章
- ·php fsockopen邮箱发送实例代码(2014-01-22)
- ·php中fsockopen模仿post与get详解(2014-08-27)
- ·php中fsockopen采集网页内容实例(2014-08-28)
- ·PHP利用socket模拟post之fsockopen发送数据(2014-09-05)
- ·php中fsockopen详细实例代码(2014-09-09)
- ·php fsockopen解决办法 php实现多线程(2020-08-28)
- ·php定时计划任务与fsockopen持续进程实例(2021-01-10)
- ·php curl 伪造IP来源程序实现代码(2014-01-07)
- ·PHP怎么CURL伪造IP和来源实现程序(2014-07-29)
- ·php漏洞之跨网站请求伪造与防止伪造方法(2014-08-22)
- ·PHP伪造页面referer来源地址几种方法(2014-08-26)
- ·php CURL伪造IP和来源实现程序(2014-08-28)
- ·php下通过伪造http头破解防盗链的代码(2014-09-09)
- ·php curl伪造referer与来源IP实例(2015-04-04)
- ·PHP curl伪造IP地址和header信息代码实例(2021-05-23)
- ·PHP伪造来源HTTP_REFERER的方法实例详解(2021-06-08)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)