伪造 X_FORWARDED_FOR IP

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://localhost/ip.aspx"); 
request.Headers.Add("X_FORWARDED_FOR", "0.0.0.0");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader stream = new StreamReader(response.GetResponseStream());
string IP = stream.ReadToEnd();
stream.Close();
response.Close();
request = null;



这样如果投票程序想使用X_FORWARDED_FOR来判断使用代理访问者的真实IP,那它就会读到0.0.0.0
你把这个IP使用一个随机方式生成就行了。

 

from :http://topic.csdn.net/u/20080122/09/96320e9d-ffd8-4b2f-a1f9-23b569bafe1f.html

你可能感兴趣的:(Stream,String,null)