I found many methods on the internet to use Curl to forge the client source IP address, almost all of which use the curl function. later I verified that this function is powerful, not only can the client source IP address be forged, but also the proxy IP address be forged. let's look at the code. General server acquisition... I found many methods on the internet to use Curl to forge the client source IP address, almost all of which use the curl function. later I verified that this function is powerful, not only can the client source IP address be forged, but also the proxy IP address be forged. let's look at the code.
Generally, the server can obtain the client IP address in three cases.
1. if no proxy is used:
# Http://www.phprm.com
REMOTE_ADDR = customer IP
HTTP_VIA = null
HTTP_X_FORWARDED_FOR = null
2. when the proxy is used and the proxy server has the IP address of the forwarding client configured:
REMOTE_ADDR = proxy server IP address
HTTP_VIA = proxy server IP address
HTTP_X_FORWARDED_FOR = customer IP
The HTTP_VIA and HTTP_X_FORWARDED_FOR values can be customized by adding the Header to hide the client IP, provided that X_FORWARDED_FOR is enabled on the server.
Test results: Create a PHP program on the server.
Example code 1: The code is as follows:
Example code 2: php code:
Forged successfully. does this provide a good IP address change solution for "fake tickets"? haha.
Result:
HTTP/1.1 200 OK Date: Wed, 03 Apr 2013 06:20:42 GMT Server: Apache/2.2.22 (Win32) PHP/5.3.13 X-Powered-By: PHP/5.3.13 Content-Length: 44 Content-Type: text/html IP: 8.8.8.8 referer: http://www.phprm.com/
The following describes the curl function.
List of curl-related functions:
Curl_init-initialize a CURL session curl_setopt-set an option for CURL call curl_exec-execute a CURL session curl_close-close a CURL session curl_version-return the current CURL version 1> curl_init-initialize a CURL session