Http-referer This variable has become increasingly unreliable, is completely can be forged out of the Dongdong.
The following is a forgery method:
Asp:
Copy Code code as follows:
Dim http
Set Http=server.createobject ("MSXML2. XMLHTTP ") '//msxml2.serverxmlhttp can also
Http.open "Get", Url,false
Http.setrequestheader "Referer", "http://www.dc9.cn/"
Http.send ()
PHP (provided the curl is installed):
Copy Code code as follows:
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, "http://www.dc9.cn/xxx.asp");
curl_setopt ($ch, Curlopt_referer, "http://www.dc9.cn/");
Curl_exec ($ch);
Curl_close ($ch);
PHP (not installed curl with sock)
Copy Code code as follows:
$server = ' www.dc9.cn ';
$host = ' www.dc9.cn ';
$target = '/xxx.asp ';
$referer = ' http://www.dc9.cn/'; Referer
$port = 80;
$fp = Fsockopen ($server, $port, $errno, $errstr, 30);
if (! $fp)
{
echo "$errstr ($errno) <br/>\n";
}
Else
{
$out = "Get $target http/1.1\r\n";
$out. = "Host: $host \ r \ n";
$out. = "cookie:aspsessionidsqtbqsda=dfcapklbbficdafmhnkigkeg\r\n";
$out. = "Referer: $referer \ r \ n";
$out. = "connection:close\r\n\r\n";
Fwrite ($fp, $out);
while (!feof ($FP))
{
Echo fgets ($FP, 128);
}
Fclose ($FP);
}
Vb.net/c#.net
Copy Code code as follows:
Dim Oxmlhttp as MSXML2. XMLHTTP30 = New MSXML2. XMLHTTP30 ()
Or
MSXML2. XMLHTTP30 oxmlhttp = new MSXML2. XMLHTTP30 ();
Oxmlhttp.open (.....)
Oxmlhttp.setrequestheader (.....)
Oxmlhttp.send (..
Javascript
Xmlhttp.setrequestheader ("Referer", "Http://URL");/??? Oh ~ fake ~
JS does not support ^_^
The principle is that sock constructs HTTP headers to SendData. Other languages, like Perl, you know,
At present, the simpler way to defend against forgery Referer is to use the verification Code (session).
Now there are some commercial companies that can use anti-theft chain software, such as Uudog,linkgate,virtualwall, are the DLLs that are developed to be applied to IIS.
Some use cookies to verify, thread control, some can randomly generate file names and do URL rewrite. Some methods can indeed achieve a good result.
However, while, outsmart, these tricks after all, there is a way to crack.