[Recommended] CURL spoofs IP addresses and sources. A good IP address change solution was provided to the ticket-Flushing friends. after checking the solution, CURL is really powerful and can forge IP addresses and sources. 1. php request 2.php. 1. php code: $ chcurl_init (); curl_seto provides a good IP address change solution for the "ticket swiping" friends. after checking the code, CURL is really powerful and can forge IP addresses and sources.
1. php requests 2.php.
1. php code:
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "http: // localhost/2. php ");
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('x-FORWARDED-FOR: 8.8.8.8 ', 'client-IP: 8.8.8.8'); // Construct an IP address
Curl_setopt ($ ch, CURLOPT_REFERER, "http://www.gosoa.com.cn/"); // Construct a path
Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
$ Out = curl_exec ($ ch );
Curl_close ($ ch );
2. the php code is as follows:
Function getClientIp (){
If (! Empty ($ _ SERVER ["HTTP_CLIENT_IP"])
$ Ip = $ _ SERVER ["HTTP_CLIENT_IP"];
Else if (! Empty ($ _ SERVER ["HTTP_X_FORWARDED_FOR"])
$ Ip = $ _ SERVER ["HTTP_X_FORWARDED_FOR"];
Else if (! Empty ($ _ SERVER ["REMOTE_ADDR"])
$ Ip = $ _ SERVER ["REMOTE_ADDR"];
Else
$ Ip = "err ";
Return $ ip;
}
Echo "IP:". getClientIp (). "";
Echo "referer:". $ _ SERVER ["HTTP_REFERER"];
Forged successfully. Is that true !!
Bytes. 1. php requests 2.php. 1. php code: $ ch = curl_init (); curl_seto...