Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
常用的热链接保护方法检查"Referrer" HTTP 标头 与原始网站的域名匹配。
您可以通过手动设置该标头以指向网站中的页面来轻松绕过该问题。
The usual hotlink-protection method checks if the "Referrer" HTTP Header matches the domain name of the original website.
You can easily bypass that by setting that header manually to point to a page in the website.
您需要传递 Referrer http 标头。您可以在大多数 UNIX 系统上使用 wget 执行此操作,如下所示:
wget --referer=http://www.google.com/ http://www.google.com/intl/en_ALL/images/logo.gif
这是一种原始方法,以便您准确了解发生了什么:
telnet google.com 80 GET /intl/en_ALL/images/logo.gif HTTP/1.1 REFERER: http://www.google.com/ HOST: www.google.com
You need to pass the referrer http header. You can do this with wget on most unix systems as follows:
Here a raw way to do it so you see exactly what is going on:
您可以使用以下代码下载受热链接保护的图像:
URL url = new URL("http://www.somesite.com/picture.jpg"); URLConnection urlCon = url.openConnection(); urlConn.setRequestProperty("Referer", "http://www.somesite.com"); urlConn.connect(); InputStream urlStream = urlCon.getInputStream(); Image image = ImageIO.read(urlStream);
You can download hotlink protected images by using the following code:
Chrome 的 Postman 扩展允许您发出自定义 http 请求。我发现了一个被热链接阻止的图像,复制了它的 url 并将其输入到 Postman 中以获取它。
The Postman extension for Chrome lets you make custom http requests. I found a hotlink-blocked image, copied it's url and entered it into Postman to GET it.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(4)
常用的热链接保护方法检查"Referrer" HTTP 标头 与原始网站的域名匹配。
您可以通过手动设置该标头以指向网站中的页面来轻松绕过该问题。
The usual hotlink-protection method checks if the "Referrer" HTTP Header matches the domain name of the original website.
You can easily bypass that by setting that header manually to point to a page in the website.
您需要传递 Referrer http 标头。您可以在大多数 UNIX 系统上使用 wget 执行此操作,如下所示:
这是一种原始方法,以便您准确了解发生了什么:
You need to pass the referrer http header. You can do this with wget on most unix systems as follows:
Here a raw way to do it so you see exactly what is going on:
您可以使用以下代码下载受热链接保护的图像:
You can download hotlink protected images by using the following code:
Chrome 的 Postman 扩展允许您发出自定义 http 请求。我发现了一个被热链接阻止的图像,复制了它的 url 并将其输入到 Postman 中以获取它。
The Postman extension for Chrome lets you make custom http requests. I found a hotlink-blocked image, copied it's url and entered it into Postman to GET it.