Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 1881

Protect files from downloading

$
0
0

Hello,

first of all I hope I choosed good section for my problem, secondly I'm totaly new in IIS.

So my problem is that I have stream server, there are only videos. Then there is my page, where I stream those videos (it is not hosted on the same server). Stream server -> IIS, web -> shared hosting.

Now I controll hotlinking by http_referer, but it's not perfet, we all know, it's can be easily fake and newest mobile devices don't send referer at all. I control it by url rewrite module -> cfg file ->

<?xml version="1.0" encoding="UTF-8"?><configuration><system.webServer><staticContent><clientCache cacheControlMode="NoControl" /></staticContent><rewrite><rules><clear />  <rule name="Prevent Image Hotlinking"><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{HTTP_REFERER}" pattern="^$" negate="true" /><add input="{HTTP_REFERER}" pattern="^http://(.*\.)?domain\.tld/.*$" negate="true" /></conditions><action type="Rewrite" url="http://domain.tld" /></rule><rule name="RequestBlockingRule1" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_REFERER}" pattern="^http://(.*\.)?domain\.tld/.*$" /></conditions><action type="AbortRequest" /></rule><rule name="RequestBlockingRule2" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_REFERER}" pattern="^http://(.*\.)?domain\.tld/.*$" /></conditions><action type="AbortRequest" /></rule></rules></rewrite></system.webServer></configuration>

Now it is possible to download file directly from server, I would like to make it only streamamble from my page (working if I cut of piece of code which control empty referer) and it should work with mobile devices too. 

Thanks for any help :-)


Viewing all articles
Browse latest Browse all 1881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>