Home php教程 php手册 php fsockopen 伪造 post和get方法

php fsockopen 伪造 post和get方法

May 25, 2016 pm 04:38 PM
fsockopen post method forgery

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

<?php

    //fsocket模拟post提交

    $purl = "http://localhost/netphp/test2.php?uu=rrrrrrrrrrrr";

    print_r(parse_url(http://pic1.phprm.com/2014/09/09/http://pic1.phprm.com/2014/09/09/http://pic1.phprm.com/2014/09/09/$url.jpg.jpg.jpg));

    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[&#39;path&#39;]."?".$info["query"]." HTTP/1.0 ";

       $head .= "Host: ".$info[&#39;host&#39;]." ";

       $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[&#39;path&#39;]."?".$info["query"]." HTTP/1.0 ";

       $head .= "Host: ".$info[&#39;host&#39;]." ";

       $head .= "Referer: http://".$info[&#39;host&#39;].$info[&#39;path&#39;]." ";

       $head .= "Content-type: application/x-www-form-urlencoded ";

       $head .= "Content-Length: ".strlen(trim($query))." ";

       $head .= " ";//开源代码phprm.com

       $head .= trim($query);

       $write = fputs($fp, $head);

       while (!feof($fp))

       {

        $line = fread($fp,4096);

        echo $line;

       }

    }

      

    

Copy after login

永久链接:

转载随意!带上文章地址吧。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)