连接 curl 脚本输出"* Empty reply from server",但 Fiddler 获取数据是可以的



当我使用小提琴手4时可以捕获以下链接:

URL

带有以下RAW标头:

GET http://'URL' HTTP/1.1
Host: 'URL'
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: */*
Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: 'URL'
Connection: keep-alive
Cookie: win007BfCookie=null; bfWin007FirstMatchTime=2019,7,13,08,00,00; UM_distinctid=16c8b3edbf14fc-062d46919e565-14367b40-190140-16c8b3edbf22e7; win0168BfFavoriteCookie=1

小提琴手 4 的输出

sData[1743630]=[[0.98,0,0.86,0.82,0.25,1.04,,,],[2.55,3.20,2.40,2.07,3.35,3.15,,,],[0.88,2.25,0.94,1.03,2.5,0.81,,,],[0.90,0,0.94,1.23,0.25,0.67,,,],[1.06,1.00,0.76,1.04,1,0.80,,,],[3.15,2.03,3.20,2.69,2.08,3.70,,,]];

但是当我使用 curl 执行以下脚本时:

curl -vvv 'URL' -H 'Referer: 'URL'

Curl(Windows CMD shell(的输出:

curl -vvv 'URL' -H 'Referer: 'URL'
* Could not resolve host: 'http
curl: (6) Could not resolve host: 'http
*   Trying 47.75.149.10:80...
* TCP_NODELAY set
* Connected to 'URL' (47.75.149.10) port 80 (#1)
> GET /' HTTP/1.1
> Host: 'URL'
> User-Agent: curl/7.65.3
> Accept: */* 
>
* Recv failure: Connection was reset
* Closing connection 1
curl: (56) Recv failure: Connection was reset

Curl(Linux shell(的输出:

root@xxxxx:~# curl -vvv 'URL' -H 'Referer: 'URL'
*   Trying 47.52.91.249...
* TCP_NODELAY set
* Connected to www.win0168.com (47.52.91.249) port 80 (#0)
> GET 'URL' HTTP/1.1
> Host: 'URL'
> User-Agent: curl/7.58.0
> Accept: */*
> Referer: 'URL'
>
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

win0168.com 块 curl。 该块通过用户代理标头检测实现。 要么使用 WGET,要么设置一个不包含短语"curl"的虚假用户代理。 作为记录,您的 curl 的用户代理是

User-Agent: curl/7.65.3

但是如果你的 curl 名称相反,你会得到响应,

curl -A 'lruc' -H 'Referer: http://www.win0168.com/' 'http://www.win0168.com/vbsxml/goalBf3.xml?r=0071565705912000'

(lruccurl倒写。

最新更新