• 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

    • Fun fact: There are more Warhammer 40k games than there are stars in the universe.
    • laughing is tedious. Elephants really are laughing lazy, y'all..
    • Agreed. And this is a great discount offer! It's a shame that there's no discount offer option for people who would be fine subscribing for a year-long term, but pay monthly.
    • A Warhammer 40K racing game and a chess roguelike are free to claim on the Epic Games Store by Pulasthi Ariyasinghe The Epic Games Store has returned to its standard giveaway procedures after weeks of mystery freebies. The latest drop is replacing last week's Rogue Waters and Songs of Conquest games and has brought in a double giveaway offering Warhammer 40K Speed Freeks and The Ouroboros King. As always, the game is yours to add permanently to your Epic Games Store library within the next seven days. From the duo, Warhammer 40K Speed Freeks lands from developer Caged Element, and it's a racing game that was only released last year. The title has you piloting Ork buggies, tanks, and aircraft modeled after the popular tabletop miniatures. The focus is on multiplayer mayhem, offering multiple game modes that have you fighting other players as everyone tries to survive and get across finish lines or destroy mechs. Crossplay support between PC and consoles has now arrived as part of a free update, too, giving a boost to matchmaking times for this multiplayer-focused title. If racing carnage isn't your thing, then The Ouroboros King offers tactics. The indie title is a mashup of chess and standard roguelike experience, letting players create their own armies to defeat an enemy faction, all on the familiar checkered board. There is a procedurally generated map, pieces with special abilities, relics that bend the game's rules to make overpowered builds, and more. The newly available Warhammer 40K Speed Freeks and The Ouroboros King giveaways on the Epic Games Store are set to run until June 11, giving PC gamers seven days to claim the latest offer. Once this closes out, a new freebie will take its place on the same day. Don't forget that mobile gamers can check out the Epic Game Store's weekly giveaways on Android and iOS to grab a freebie there as well.
    • Geforce Now is great! Playing with a 4080/5080 without spending over $1k Just for the Gpu..plus other componentes. Finished resident evil 9 (running rtx 5080) on a mac mini m2. The mini is the size of just the gpu. No more bulky Pc towers on my desk
  • Recent Achievements

    • Week One Done
      FBSPL earned a badge
      Week One Done
    • One Year In
      Jim Dugan earned a badge
      One Year In
    • One Month Later
      Tommi118 earned a badge
      One Month Later
    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      486
    2. 2
      PsYcHoKiLLa
      198
    3. 3
      +Edouard
      155
    4. 4
      Steven P.
      83
    5. 5
      ATLien_0
      69
  • Tell a friend

    Love Neowin? Tell a friend!