• 0

Anti Leech PHP Download


Question

Hey everyone,

just wondering can any1 help me out with this.. im trying to protect downloads on my site so people cant easily (without a download manager) get the url of my files. i want people to visit my site rather then download from links all over the net.

i have only got 1 script to work out of the many i have tried. that being Download Lite 1.4 www.stadtaus.com but that puts that persons url in the download file as an advertisment and i cant find a way to remove that. so im back to square one. needing to find a script.

i have no ability in php at all, otherwise i wouldnt be asking i guess. can some1 help me out. i have sspent probably 24hours of total time jsut sitting here installing different scripts and getting nowhere, so many tried so many failed and its frustrating.

if some1 knows a good script and can help me through getting it working on my site i would really appreciate it.

cheers

Fizical

Link to comment
https://www.neowin.net/forum/topic/284625-anti-leech-php-download/
Share on other sites

Recommended Posts

  • 0

Could I get some advice here...

I have a website that isn't hosting pictures, music, or video, but I am still concerned that some ass might run a download manager on my site just to mess with me, eating away at my bandwidth. Because of this I think the easiest way to prevent this problem would be to use .htaccess, since I am just using .html and .jpgs, and this way I can protect those images from over downloading. However, I ran accross this warning about using .htaccess, so i am unsure what I should use at this point

htaccess warning

Using the .htaccess method of anti-leech control is Pretty Wortthless and can often cause many problems for your website.

You may see htaccess code such as this claiming to provide anti-leech control for, in this case, gif jpg and png files.  What this code does is stop any request that was not referred from the yoursite.com domain name.

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com

RewriteRule [^/]+.(gif|jpg|png)$ http://www.yourdomain.com/error.gif [L]

The problem is this method relies on the http-referer code.  The referrer is sent by the client (browser).  That is the problem. Referrer is blocked by many firewalls and is not sent by many configurations.  So you may think you have stopped leeching problems, when what you have really done is block many people from seeing your website.

You can kid yourself into thinking it works, and run a test that shows it does.  But it only blocks people who are sending you can invalid referrer code.  Maybe better than nothing, but not much better.  All those people who get blockled will just go somewhere else assuming your website has too many errors since your images will not show.

To solve this problem, you see many examples like this:

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com

RewriteRule [^/]+.(gif|jpg|png)$ http://www.yourdomain.com/error.gif [L]

The above example adds a line to let through any request which does not have a referrer code.  Yes, this does allow all those configurations which block referrer code to see your images.  However, if you open the door to allow anyone in with no referrer then you are watering down the protection to near worthless.

Then, to make matters worse, the referrer code can be easily faked anyway.

The htaccess anti-leech method is just plain Pretty Worthless.  Do not use it.

If you want to protect your images, consider using a watermark and denying access to the original unwatermarked copy.  You can find a watermark script and associated access control instructions this Tips & Scripts page.

If you are having trouble with a site leeching taking too much bandwidth, block that site.  You can find instructions for blocking traffic to your website on this Tips & Scripts page.

  • 0

Well unless there is a better solution im just going to direct invalid referals to an error.html which explains why they cant download the file. explain why i have done so and what they can do to get around it (turning firewall of, using another browser or something) but then again im not trying to block images which would be a problem for you because people wouldnt see the graphics on your site just text

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • The problem of course is simply that government does not always know best. My point is that agency is taken away from the EU consumer in these cases. I'm sorry, but I do not believe that governments (politicians) are inherently good, and "looking out for me." Primarily they look to themselves and their own personal desires first, foremost, and always. When the EU or the DOJ fines these companies, claiming to "represent the welfare of the consumer," how much of these billion-dollar judgments are handed to the consumers they claim to represent? Not even a dollar, as I've seen. Yet the EUC lawyers who are paid to sit around and dream up these suits make huge commissions on the fines the EUC adjudicates, which is an ironclad fact I hope everyone is aware of. It's also rank corruption, of course, but that's another topic. Last, when the EU inflicts these judgments, or the DOJ, take your pick, the costs are bundled right along in the cost of the goods and services these companies provide the consumers they are "looking out for." If you are someone who believes his government is his savior then you have my condolences. I think Apple is right here, because the whole scheme of consumer choice is that consumers pick and choose among the products companies offer. Microsoft Windows is more compatible with third party software and hardware than any desktop OS on Earth, which is my sole reason for choosing it. Just because the EUC forces companies do certain things it knows the companies do not want to do, "or else", has no bearing on consumer benefit. This Siri thing is almost idiotic it's so infantile. But this is what the EUC does when the EU in Brussels becomes cash-strapped and needs a big infusion of cash. Some people get upset by "big companies" but it's the opposite when governments dwarf the size and scope of these companies, which is so obvious it hurts.... I mean you can't honestly believe that forcing Apple to do things with Siri it has its own reasons to decline is something that "opens up" Apple, do you? Say it aint' so...
    • Looks like many years since the request was made, a directory tree view finally may be added. https://github.com/files-community/Files/pull/18537
    • There's this from last year https://gist.github.com/threat...364659a8887841aa43deca4efd9 but nothing about a buffer overflow that MS somehow can't code against. No matter what, it makes sense to take a "protected by default" approach.
  • Recent Achievements

    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
    • Reacting Well
      Techinmay earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      PsYcHoKiLLa
      214
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      84
    5. 5
      FloatingFatMan
      72
  • Tell a friend

    Love Neowin? Tell a friend!