有人會說:IP驗證是在TCP層完成的,不是HTTP層完成的,如果偽造IP的話可能連TCP的三次握手都完不成。我這里說的不是完全意義的偽造。如果你使用透明代理上網,那么在透明代理發送給服務器端的HTTP請求中會包含x-forward-for信息。例如:X-Forwarded-For: 162.150.10.16
那么我們只要在發給服務器端的http請求中加入X-Forwarded-For: 162.150.10.16信息即可。
例如下邊一個請求:
GET http://www.ahjinzhai.gov.cn/sdyxnx/vote.php?id=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.ahjinzhai.gov.cn/sdyxnx/
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; TencentTraveler )
Host: www.ahjinzhai.gov.cn
Cookie: PHPSESSID=1847fc15020bc16b47ce250f457daab4
Cache-Control: no-cache
X-Forwarded-For: 162.150.10.16
Pragma: no-cache