找回密码
 加入
搜索
查看: 3564|回复: 2

[网络通信] post问题 Referer为什么失效

[复制链接]
发表于 2011-4-2 15:33:16 | 显示全部楼层 |阅读模式
本帖最后由 benz1979 于 2011-4-2 15:55 编辑

我今天用抓包工具抓一个网站的包,抓到的数据如下
(Request-Line):POST /submit HTTP/1.1
Accept:*/*
Accept-Language:zh-cn
Referer:http://www.xxxx.com/doc/4598135.html
x-request-by:xxx.ajax
Content-Type:application/x-www-form-urlencoded
Accept-Encoding:gzip, deflate
User-Agent:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
Host:www.xxxx.com
Content-Length:54
Connection:Keep-Alive
Cache-Control:no-cache
Cookie:XXXID=93947AE0FFB5A17C8432F67BA186FD02:FG=1; XXSS=HVQUVMwR21VbzRPMkZvUVMza1Y1WkZ0WDR1UX4yVU5wdEZrd0VzTFdxcEVYcnBOQVFBQUFBJCQAAAAAAAAAAAokNx-JljMBYmVuejE5NzkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgusRwAAAAAOC6xHAAAAAAcF1CAAAAAAAxMC42NS40NETRkk1E0ZJNW; USERID=8fcebb34524949c94c8ebda2

我写的代码如下:
$oHTTP = ObjCreate("microsoft.xmlhttp")
$oHTTP.Open("post","http://www.xxxx.com/submit",False)
$oHTTP.setRequestHeader("Accept","*/*")
$oHTTP.setRequestHeader("Accept-Language","zh-cn")
$oHTTP.setRequestHeader("x-request-by","XXXX.ajax")
$oHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded") 
$oHTTP.setRequestHeader("Accept-Encoding","gzip, deflate")
$oHTTP.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)")
$oHTTP.setRequestHeader("Host","www.xxxx.com")
$oHTTP.setRequestHeader("Content-Length","54")
$oHTTP.setRequestHeader("Connection","Keep-Alive")
$oHTTP.setRequestHeader("Cache-Control","no-cache")
$oHTTP.setRequestHeader("Referer","http://www.xxxx.com/doc/4598135.html")
$oHTTP.setRequestHeader("Cookie","XXXID=93947AE0FFB5A17C8432F67BA186FD02:FG=1; BDUSS=HVQUVMwR21VbzRPMkZvUVMza1Y1WkZ0WDR1UX4yVU5wdEZrd0VzTFdxcEVYcnBOQVFBQUFBJCQAAAAAAAAAAAokNx-JljMBYmVuejE5NzkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgusRwAAAAAOC6xHAAAAAAcF1CAAAAAAAxMC42NS40NETRkk1E0ZJNW; USERID=8fcebb34524949c94c8ebda2")
$oHTTP.Send("wp=20009&doc_id=4598135&value_score=5")
执行上面的代码抓包,发现Referer无法执行到底是什么原因

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2011-4-2 15:35:48 | 显示全部楼层
执行后再抓包发现没有Referer:http://www.xxxx.com/doc/4598135.html
发表于 2011-4-2 17:03:52 | 显示全部楼层
与POST无关,XMLHTTP的问题。

换用更高版本的Obj对象或是Winhttp,WinInet。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 10:16 , Processed in 0.076895 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表