• 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

    • I totally agree no one should trust governments AND big tech companies that have near monopolies in certain market segments. The difference is of course citizens at least have some say in government. Yes, requiring Apple to open up Sirsi to other AI backends is in the interest of EU customers and certainly "opens" up the platform a crack. What are you saying? I wish the US would regulate tech companies more here and even break them up in some cases. Granted trusting the government to do it right is a crap shot at best but what is the alternative? To allow a few tech companies to continue to run everything and just print money? It's crazy to me for example that in most of the world 99% of communications go thru Facebook servers via WhatsApp. What kind of dystopian world are we living in?
    • You can.. make sure you have ADB tools on whatever OS you are running, plug your phone into your PC give it approval to talk to the phone then run this command. adb shell pm uninstall -k --user 0 com.android.chrome So long as you leave Android Webview untouched it wont break anything on your Phone to do this. I have been using exclusively Firefox mobile since it was released.
    • If it ain't broke, don't fix it. One Commander Free also available in the Store has been my goto Files Manager for years. It does what I need at a more than reasonable speed. I do occasionally use Files Explorer just because it is there and does what I need without any problems when I use it.
    • I think you missed his point. He wasn't saying that cloud storage isn't possible on GNU/Linux, clearly it is. He was pointing out that you are commenting about your dislike of Windows on an article about OneDrive (not Windows) for Mac (also not Windows). Its about as off topic as coming to an article about Sony improving something on the PlayStation and saying that you hate Sony TVs and prefer LG.
    • Nvidia's GeForce NOW summer sale drops prices for Ultimate and Premium memberships by Pulasthi Ariyasinghe Nvidia has a fresh update for GeForce NOW subscribers today, bringing in more games to add to its ever-growing supported titles list. At the same time, the company announced the kick-off for its summer sale for the streaming subscription service, dropping the prices for both its premium packages for anyone looking to upgrade or join. The offer is for the 12-month membership options that the company offers. This drops the 12-month Performance membership from $99.99 to $64.99, saving members $35. Next, the 12-month Ultimate membership is currently going for $129.99, dropping prices by $70 from the original $199.99. "The Performance membership delivers smooth, high-quality cloud gaming across devices, with streaming up to 1080p at 60 frames per second (fps) and access to RTX-powered servers for supported games," says Nvidia, describing its tiers. "The Ultimate membership steps things up with RTX 4080‑ or 5080‑class performance in the cloud, supporting up to 4K and beyond on ultrawide displays, up to 120 fps, and advanced features like ray tracing, NVIDIA DLSS and NVIDIA Reflex for a more responsive, visually rich experience." With the sales out of the way, here are the games joining GeForce NOW's supported list this week: NBA THE RUN (New release on Steam, available on June 9) Witchspire (New release on Steam, available on June 10) SpaceCraft (New release on Steam, available on June 11) Duet Night Abyss (Launcher) DOOM Eternal (Epic Games Store) The Elder Scrolls Online (Xbox, available on Game Pass) Farever (Steam) World of Tanks: HEAT (Wargaming) Nvidia plans to add support for a bunch of more games during the rest of June. Find the full announcement from last week over here. Keep in mind that, unlike subscription services like Game Pass or EA Play, a copy of a game must be owned by the GeForce NOW member (or at least have a license via PC Game Pass) to start playing via Nvidia's cloud servers. There is also a limit to how many hours subscribers can use the service per month.
  • Recent Achievements

    • 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
    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      PsYcHoKiLLa
      208
    3. 3
      +Edouard
      155
    4. 4
      Steven P.
      83
    5. 5
      FloatingFatMan
      73
  • Tell a friend

    Love Neowin? Tell a friend!