Simple method of using Curl to forge IP in PHP, Phpcurl Forge ip_php Tutorial

Source: Internet
Author: User

Simple method of using Curl to forge IP in PHP, Phpcurl fake IP


About Curl:
Curl is a file transfer tool that works with URL syntax in the command line mode. It supports many protocols: FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE, and LDAP. Curl also supports HTTPS authentication, HTTP POST method, HTTP put method, FTP upload, HTTP upload, proxy server, cookies, username/password Authentication, download file breakpoint continuation and so on, the function is very powerful.
Features that are commonly used in PHP:
1. Realize remote acquisition and acquisition of content
2, the implementation of PHP Web version of the FTP upload download
3. Realize the simulation landing
4. Interface docking (API), data transmission, etc.
5. Realization of analog cookies, etc.

PHP uses the Curl feature
PHP does not support the Curl feature by default and requires this feature to be turned on in php.ini

Using Curl to forge IP


I found the IP copy into the txt file, then sed and awk dealt with it and shared my awk processing script:

#!/bin/awk-f      #运行前   BEGIN {     FS = "";     Count = 0;   }      #运行中   {     Iparr[count + +] = $;   }      #运行后   END {     printf ("<?php\n");     printf ("$iparr = array (\ n");     for (i = 0; i < count; i + +) {       printf ("'%s ' = '%s ', \ n", Iparr[i], iparr[i]);     }     printf ("); \ n");   

Curl uses

<?php   require_once dirname (__file__). "/iplib.php";      $req _url = "test.com";      foreach ($iparr as $forward = + $cip) {          $ch = Curl_init ();          curl_setopt ($ch, Curlopt_url, $req _url);     curl_setopt ($ch, Curlopt_httpheader, Array (         "x-forwarded-for: $forward",         "Client-ip: $cip"     ));     curl_setopt ($ch, Curlopt_referer, ' http://blog.csdn.net/');     curl_setopt ($ch, Curlopt_header, 1);          Curl_exec ($ch);          Curl_close ($ch);   


Defects
Many server-side generally use $_server[' remote_addr ' to get the real IP of the client, this is the address that has been decided on the transport layer, can not be modified by curl, well, it seems that I did not help friends do this thing, but still record

http://www.bkjia.com/PHPjc/1044859.html www.bkjia.com true http://www.bkjia.com/PHPjc/1044859.html techarticle a simple method of using Curl to forge IP in PHP, Phpcurl forged IP Curl Introduction: Curl is a file transfer tool that works with URL syntax in the command line mode. It supports many protocols: FTP,...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.