wget URL is forbidden, 403 error

refer to http://www.linuxquestions.org/questions/linux-software-2/wget-error-403-can-i-get-around-this-606755/

 

solution 1:

 

wget -U firefox http://xxx.xxx.com/

 

solution 2:

 

1) using firefox and command netcat to check the header,

 

2) wget -U xxx your.URL

 

If this is a problem related only to wget , but not other browsers, you may be able to spoof the site by using the wget '-U' option, giving it a user-agent description of another browser.

Code:
wget -U 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4' http://yourURL.com

To see what a working browser sends as a user-agent header, you can run netcat on your localhost, and have a browser try to fetch a page from it:

Code:
nc -l -p 8000 -v

Now, in your browser, go to 'http://localhost:8000'. Observe the user-agent header received by netcat . Cut and paste the string into the wget -U argument.

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值