PHP Curl Forgery IP Source Example
PHP Curl is too powerful, it can not only imitate the user login, but also can imitate the user IP address Oh, for the forgery of IP source.
Curl makes the requested file fake_ip.php:
The requested target file target_ip.php:
The IP print order in the target file target_ip is the IP acquisition order of many open source systems at present.
Visit fake_ip.php and see the results:
58.68.44.61
58.68.44.61
127.0.0.1
Instance
Curl is really tough and can forge IP and source.
1.php request 2.php.
1.php Code:
2.php Code:
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//Www.jbxue.com$ip = "err"; return $IP; } echo "IP:". Getclientip (). ""; echo "Referer:". $_server["Http_referer"];
Forgery success, this is not to "brush ticket" friends provide a good solution for IP