• 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

thanks for your reply mr magoo,

from the website it appears the hosting service should supply this for me to use it, not something i can add myself, is that correct? because if so then im reasonably sure my hsot doesnt ahve anything.. the scripts they have in their management section are pretty useless, 2 i think in total. i got this host to start off because they are well prices and 100gb bandwidth is enough for starting for me.

thanks in advance for any help that comes my way :)

  • 0

yes i want a script like that _Dom_

@ Fr0stbite1 i tried many of them at php Resrouces site which has a lot and a few from another script site but for some reason i couldnt get any right.. maybe im doing something wrong in the instructions i dont know.

there was one called download protector which seemed good because if some1 got the link to the download from another site they would get directed to whatever page i liked, so i could put up a page saying they havent accessed the download from my site adn then direct them to my sites homepage.

however whenever i set the allowed urls nothing would work so it would keep taking me back to my homepage rather then allow me to download. im sure i followed the instructions correctly but i must be doing something wrong.

so if some1 knows a script and is willing to help me out to get it working, which can be done right ehre in this topic, i would appreciate it... atleast if some1 knows the script im using they can help find what im doing wrong. so yeah whatever script you think is good then let me know and please help me through getting it working.

thank you a lot!

  • 0

a fairly easy solution to that would be to use the $_GET('id') function in your page "download.php" and then call a mysql table that would have the actual url saved in correllation with the id, get the url, save it in a string and call it,.

I just picked up PHP yesterday though, so there may be an easier way

  • 0

May I ask what all the fuss is about anti-leeching? Having never hosted anything like what the original poster does, i have no idea what the fuss is all about.

Some people just want to download stuff, and not have to go through all the hassel (in some cases) of signing up on a website, trolling through all the crap on the site etc...just to download what they want

What am i missing??

  • 0

@blindsleeper you went right over my head with that talk, lol. sorry but im total n00b at this..

@ Harsh! my site will consist of about 4 pages in total.. tehre isnt much to go through,

a news page, an msn skin download page a guireplacer module download page and a contact page.

i want people to visit my site so they know who to contact with problems.. they can comment on the download with problems or praise if they wish, the commetn system etc is already working. also i want people to know what else i have released.

and another things is that i will have some files 10mb in size and with 100gb bandwidth i cant have everyone getting the files from me all over the net and i will direct them to a deviantart mirror if i've used up too much bandwidth on that file.

im planning on have 3 msn skins ready in the near future and the snowe2 guir module and that will take a bit of bandwidth.. Rolando who makes msn skins has pretty small files really yet he uses 80gb or so a month.. so if a download is put down and a mirror is put up people will know because they visited my site and found out this information.

with the guir modules its important people can contact me ebcause if things go wrong their system could be stuffed and not able to start. there will be no registering needed or anything like that. i think its rpetty hassle free myself.

  • 0

Have a look at here:

http://www.hotscripts.com/PHP/Scripts_and_...tems/index.html

basically what you do is check the referrer to see if it's from your site, then look for the correct URL in a Database, calculate filesize and send the headers to the browser then read your file and echo it in parts, that will give you a antileech download :cool:

  • 0

i have tried quite i few of the scripts there.. my hsitory shows i've browsed the first 4 or 5 pages there.. i've tried the ones that seem to match my needs but couldnt get them working... i guess in a summary this is what i would like:

hide actual location

no need for mysql, although i have that on my server

no download center or anything like that.. i want freedom of simply pointing the link on my download page to say download.php?id=1

i think on top of that a nice feature would be to be able to limit toal bandwidth used.. or atleast keep track of it in the file on my server that only i can access. but this isnt that important but would be nice.

so far quite a lot of scripts seem to do what i want but i cant get them working.

http://www.hotscripts.com/Detailed/9194.html that is the script i have tried most recently.. but it kepts taking me back to my home page then letting me download the file.

if some1 can look over the script and i send them my download.php file maybe they can solve the problem for me. thanks a lot :)

  • 0

To have a bandwidth limit, you'd need a login system. Otherwise you'd have to go by ip or cookies. Tracking ip addresses you would end up allowing only one person from a dorm/school/etc. to reach the limit and cookies can be easily deleted.

And if you had a login system, you wouldn't have a leech problem to worry about. I'm just not sure there will be enough on the site that people will want to spend time signing up for.

  • 0

well from the description of this scripts i have seen, mostly pay for ones do it best, you dont need people logging in to have a bandwidth limit.. because it would calculate the downloads from the site, add them up adn when it reaches the limit of your bandwidth you set then it stops downloads from being allowed... there are many scripts i ahve seen that will count your downloads.. so i cant see why you would need a login system for end users..

anyway thats not the important aspect i want.. that is just something that would be nice. i would simple like some help so if any1 is willing to help with the scripts i linked to in my above post.. then i can post my php file and they can see what im doing wrong. :) or alternatively help me with a script they use on their own site that they are familiar with, anything would be great.

  • 0

heres a small script i wrote a few weeks ago: http://www.hfbgaming.com/~hitech/image.php.txt

it would take input like 'image.php?file=whatever' the whatever would be the filename without the .jpg and all you have to do it put in a folder that you dont make public and set it in the file

also just change the referer to your site

hope this helps :)

edit: heres what it would look like (click it and copy and paste it into a new window to see the effects): http://www.hfbgaming.com/~hitech/imagenw.php?file=test

and here is the src: http://www.hfbgaming.com/~hitech/imagenw.php.txt

Edited by hitechoutlaw
  • 0

I thought you meant a limit for individuals downloading from you :)

That last script you posted looks like it expects you to already have the "?id=" part set up, and just checks for the referer and redirects users based on that. But lets see what you've got right now.

Edit: didn't see hitech's post. My reply was to Fizical. That code looks short and to the point, though. Only a couple changed needed.

  • 0

so what do i need to change to that script to make it allow other formats.. eg *.exe, *.rar *.zip most of my files will be *.exe

then i will give this a script a go and see how it works :) thanks everyone for the help so far its been great to see so many reply :)

  • 0

Two good links:

STOP HOTLINKING AND BANDWIDTH THEFT WITH HTACCESS

PHP.net - Header

Using both together should get you want you need, from what I can tell after reading this thread.

Or just edit the other guys:

<?php
	$referer = explode('/',$_SERVER['HTTP_REFERER']);
	$filename = "./some_folder/".$_REQUEST['file'].".jpg";
	if ($referer[2] == "s6.invisionfree.com" && $referer[3] == "Scream_Radio" ) {
  header("Cache-Control: no-store, no-cache");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=$filename");
  readfile($filename);
	} else {
  echo "You are not allowed to hotlink this image.";
	}
?>

Note: Still needs work (more code added) to it, but that's the jist of things.

  • 0
There's nothing wrong with your code. He's just not serving .jpg files is all.

585467281[/snapback]

ahh ok, i must have missed that part in his posts

so what do i need to change to that script to make it allow other formats.. eg *.exe, *.rar *.zip? most of my files will be *.exe

then i will give this a script a go and see how it works:))? thanks everyone for the help so far its been great to see so many repl:):)

585468526[/snapback]

it doesnt work but i have to get to school and dont have to work on it but its a start.

http://www.hfbgaming.com/~hitech/test.php?...st.exe&type=exe

http://www.hfbgaming.com/~hitech/test.php.txt

http://us2.php.net/manual/en/function.header.php for more info

edit: heh was typing when blackice posted

  • 0

@ King Raa i havent given any1 the URL to my website yet...

the link in my sig goes to DeviantArt and the other one goes to Modblog a blogging service.

Search the customizing sectiong of this forum for information of GUIReplacer.. bascially its like a shell pack program but it handles themes and i make the themes for it.. easier then updating shell packs all the time.. cause works on all windows xp systems and languages.

Now back on topic....

going from blackice's first link.. it i was to change the code like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com/ [NC
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(exe|rar|zip|cab)$ images/nohotlink.jpg [L] 

and obviously changed the url.. would that work? i looked around my site directories and couldnt find an .htaccess file.. but as im at work i was jsut using my browser to look at my ftp.

so lets say i dont have one.. would i:

make one and place it in my /www/ folder?

my server is a unix server and my files are stored in /www/files/

and obviously my website is stored in /www/

i'll have a look over at the php header page in my lunch break..

EDIT i just looked and saw you cant redirect to html files from .htaccess so this probably wouldnt be a good solution because people wouldnt know where to go from there would they? i guess i could always do an image with my site address in it.

Edited by Fizical
  • 0

http://www.htmlbasix.com/disablehotlinking.shtml

that stopped linknig to my file following the instructions there.. however if i enter the link directly into my browser it will still download. so people can just copy and past the link into their browser... this is good progress but i still would like it to not be able to download copy and paste because i want people to visit my site.. so is there a way that works

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

    • No registered users viewing this page.
  • Posts

    • The heading states that "Edge and Opera to follow". Neither have indicated that yet.
    • it would've been better to just have a screenshot with claude running instead of using a generic thumbnail that doesn't fit the narrative.
    • Helium Browser 0.13.2.1 by Razvan Serea Helium is a private, fast, and honest Chromium-based web browser — built for people, with love. It offers the best privacy by default, unbiased ad-blocking, and a clean experience free from bloat and noise. Proudly based on Ungoogled-Chromium, Helium removes Google’s clutter while keeping a fast, efficient development pipeline. With thoughtful touches like native !bangs and split view, Helium is a people-first, fully open-source browser that puts control back in your hands. Privacy, security, and control come first. Ads, trackers, and third-party cookies are blocked automatically, HTTPS is enforced everywhere, and all Chromium extensions work seamlessly — while Google can’t track your activity. Helium’s 13,000+ offline-ready !bangs let you jump straight to sites or AI tools like ChatGPT instantly. Open-source, people-first, and unbiased, Helium delivers a browsing experience that’s fast, secure, and free from noise, ads, and compromises. Helium Browser key features: Performance Fast, efficient, and lightweight — built on Chromium’s optimized engine. Energy-saving and consistent — stays fast over time without slowing down. No bloat — stripped of unnecessary components for maximum speed. Minimalist interface — compact, clean, and distraction-free. Customizable toolbar — hide elements you don’t need. Smooth and stable — no flicker, lag, or animation glitches. Comfort-focused experience — intuitive and unobtrusive. Privacy & Security Best privacy by default — blocks ads, trackers, phishing, and third-party cookies. Unbiased ad-blocking — powered by community filters and uBlock Origin. No telemetry or analytics — zero background web requests on first launch. Strict HTTPS enforcement — warns for insecure sites. Passkeys supported — modern authentication made simple. No built-in password manager or cloud sync — your data stays yours. Extension Compatibility Full Chromium extension support — including MV2 extensions. Anonymized Chrome Web Store requests — Google can’t track extension installs. Extended MV2 support — maintained for as long as possible. Smart Features Native !bangs — browse faster using 13,000+ offline-ready shortcuts. AI integration — use !chatgpt and others directly from the address bar. Offline functionality — bangs work without an Internet connection. Philosophy People-first design — open source, transparent, and community-driven. No ads, no noise, no bias — privacy and honesty over profit. Helium Browser 0.13.2.1 changelog: 6b6fbd0f revision: bump to 2 (#1907) cb3f77bd helium/ui/zen: fix cmd+s shortcut sidebar preference in zen mode (#1849) e3980159 deps: bump onboarding (#1905) c99531d5 helium/core: add an option to copy URLs from tab context menu (#1904) c1aba0ea helium/search: add kagi image search params (#1899) eb6711f4 helium/core/hibernate: add an option to hibernate other tabs (#1901) 425306f5 merge: update to chromium 149.0.7827.102 (#1897) ae94c3c8 helium/core/update-pref: improve auto updates strings (#1896) 06897c1d patches & domain_substitution: refresh for chromium 149.0.7827.102 d09826d0 merge: update ungoogled-chromium to 149.0.7827.102 9aeb58da helium/search-engine: reject default engine urls without %s (#1893) 4d7bb965 Update to Chromium 149.0.7827.102 fa67665c i18n: fix "add shortcut" string collision (#1891) 6894bd30 devutils/i18n: parse meaning into source.gen.json dc3fe739 helium/kb-shortcuts: disambiguate "Add shortcut" string cbf38eb4 i18n/apply: pass meaning to fingerprint generator 53ea9920 extra/disable-jit-flag: build drumbrake only if supported Download: Helium 64-bit | Portable 64-bit |~100.0 MB (Open Source) Download: Helium ARM64 | Portable ARM64 Links: Helium Home Page | macOS | Linux | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • ExplorerPatcher 26100.8457.70.2 by Razvan Serea ExplorerPatcher is a versatile and free tool that allows you to tweak and enhance the Windows Explorer. It comes with a range of useful features, including the ability to add new context menu items, change file name colors, and enable hidden features. Feature summary Choose between Windows 11 or Windows 10 taskbar (with labels support, small icons and lots of customization). Disable Windows 11 context menu and command bar in File Explorer and more. Open Start to All apps by default, choose number of frequent apps to show, display on active monitor and more. Choose between the Windows 11, Windows 10 and Windows NT Alt-Tab window switcher with customization. Lots of quality of life improvements for the shell, like: Skin tray menus to match Windows style, make them behave like flyouts and center them relative to the icon. Choose action when left and/or right clicking the network icon. Revert to the Windows 7 search box in File Explorer, or disable Windows Search altogether. Disable immersive menus and use mitigations that help you run the real classic theme without glitches. Discover the program's full range of features by reading this wiki article. ExplorerPatcher 26100.8457.70.2 changelog: Tested on OS builds 22621.4317, 22631.7079, 26100.6899, 26100.8037, 26200.8246, 26200.8457, 26300.8493, and 28000.2113. TIP: Windows Defender no longer flags ExplorerPatcher. It is no longer needed to configure Defender exclusions. Enjoy! Important Fixed Windows 10 taskbar and Start menu crashes on builds 26220.8474 (Beta) and 26300.8493 (Experimental). Update ExplorerPatcher as soon as possible. Without this update, Explorer and the Windows 10 Start menu may stop working on future builds. Microsoft removed Windows 10 Start menu components from StartTileData.dll on these builds, so the Windows 10 Start menu option has been removed where it is no longer supported. Temporary workaround: replace C:\Windows\System32\StartTileData.dll with the version from build 26xxx.8457 (x64/ARM64). This may stop working in future builds. Work is ongoing to restore Windows 10 Start menu support. Highlights Fixed Windows 10 battery flyout crashes on build 25951+. Network flyout buttons reverted to pre-24H2 behavior as a side effect. Taskbar location changes now apply instantly. Windows 11 taskbar auto-hide is no longer modified when Explorer starts. "Open Start in All apps by default" is now hidden when using the new Windows 11 Start menu. Fixed Windows 10 Start menu crashes on builds 21996–22000.51. Fixed Regedit crashes when switching to thumbnail view in registry import/export dialogs. Improved compatibility with recent Windows builds, including 26H1 ARM64. Improved ARM64 performance. Added Greek translations. ep_taskbar Now supports all 43 Windows 11 languages. Fixed issues in the system tray and other components. Updated DLL naming scheme for mod developers. Improved TrayUI compatibility and vtable stability on builds with multiple ITrayUI revisions. Fixed a taskbar initialization deadlock. Windows 10 Start Menu Added a new tile layout engine to restore support removed in build 26xxx.8474. Restoration is currently partial: Tiles may overlap when pinned using "Pin to Start". Restarting StartMenuExperienceHost.exe or explorer.exe fixes the layout. Further improvements are planned. Other Changes Added an executable blacklist to prevent shell extensions from loading in selected applications. Updated Windows 10 Start menu animation support for ARM64 builds 28xxx.2149+. Please consult the README for more details. Download: ExplorerPatcher 26100.8457.70.2 | ARM64 | ~11.0 MB (Open Source) View: ExplorerPatcher Home Page | Features | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Microsoft: Windows 11 KB5094126, KB5093998 finally stops trusting a critical system threat by Sayan Sen This week Microsoft released the Patch Tuesday updates for June 2026 with KB5094126 on Windows 11 25H2, 24H2, and KB5093998 on Windows 11 23H2. On Windows 10 22H2 it's under KB5094127. Alongside the announced release notes for the new builds, Microsoft has revealed another change that is coming to Windows with these new releases. It has been confirmed that custom folders are getting a significant change with the June 2026 updates as such folders or folder names defined by desktop.ini will no longer appear after this update is successfully installed. While you may inititally think this is a bug with the new release, Microsoft has stated that this is in fact "expected behaviour" in its new support article regarding this which Neowin spotted today while browsing. Essentially it's a security hardening measure such that custom folder presentations are treated as potentially unsafe whenever Windows is not sure about their origin and whether that desktop.ini folder can be trusted or not. Here is list of such untrusted files and folders: Files downloaded from the internet that carry Mark-of-the-Web (MOTW). Files copied from certain remote locations, such as some WebDAV or HTTP-based locations. Files on network paths that are not classified as intranet or trusted by zone policy. For those who may not be familiar, Desktop.ini is a special configuration file used by Windows to customize the appearance and behavior of individual folders. Basically Windows can read specific instructions stored in Desktop.ini instead of displaying every folder with the same default settings. This can be used to apply custom icons, thumbnail images, localized folder names, and such informational tooltips (infotip). The file can also influence certain folder-specific behaviors and properties. It is typically stored as a hidden system file within a folder that has been designated to support Desktop.ini customization. However, because Windows Shell automatically reads and applies these attributes whenever a customized folder is opened, they have historically (since the Windows XP days) presented an attack surface as a result of an unchecked buffer in the Shell component responsible for extracting custom attributes from Desktop.ini files. As such an attacker could create a specially crafted Desktop.ini containing a malicious or corrupted attributes and place it on a network share. So if a user were to browse that folder, Windows would automatically process the file, potentially triggering a buffer overflow. This could allow arbitrary code to run with the same permissions as the logged-in user. Hence a seemingly harmless folder could become a security risk when their contents are not properly validated. For admins and users alike looking to manage this behaviour, Microsoft has shared a few ways. One of them is to assign a trusted mark on the folder in case you are sure of its source. Secondly a policy can be used to revert back to the previous state. Finally, the MOTW can be removed too to indicate to Windows that this is a safe file. The company explains: Option 1: Add the source to Trusted Sites (Recommended) If the affected content is stored on a known internal or managed source, add that source to the Trusted Sites list. Once the source is treated as trusted, Windows processes desktop.ini from that source normally. This keeps the protection in place for other locations and is the lower-risk option. Option 2: Use policy to restore previous behavior Organizations that need broader compatibility can enable the policy Allow the use of remote paths in file shortcut icons.Enabling this policy restores the pre-June 2026 behavior for affected remote or untrusted scenarios. Option 3: Check for and remove the Mark of the Web (MotW) If the desktop.ini file has a Mark of the Web (MotW), Windows may treat it as coming from an untrusted source and block customization. Verify whether MotW is present and, if appropriate, remove it from the desktop.ini file. This can restore expected behavior, but should only be done for trusted content, as it removes the associated security protection. To remove the MotW tag, open PowerShell and run one of the following commands: For a single desktop.ini file: Unblock-File "C:\Your\Folder\Path\desktop.ini" For all desktop.ini files in a folder: Get-ChildItem "C:\Your\Folder\Path" -Recurse -Filter desktop.ini -Force | Unblock-File Microsoft has warned though against using a broad opt-out using the provided policy as it reduces protection against potentially malicious remote folder-customization content. As such the tech giant recommends trusting only controlled internal sources and keeping trust settings as strict as possible. You can check out the official support article here on Microsoft's website.
  • Recent Achievements

    • One Month Later
      Sopa flores earned a badge
      One Month Later
    • First Post
      StaticMatrix earned a badge
      First Post
    • Week One Done
      StaticMatrix earned a badge
      Week One Done
    • Rookie
      lamborghiniv10 went up a rank
      Rookie
    • One Month Later
      pinnclepd earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      506
    2. 2
      PsYcHoKiLLa
      207
    3. 3
      +Edouard
      156
    4. 4
      Steven P.
      88
    5. 5
      ATLien_0
      79
  • Tell a friend

    Love Neowin? Tell a friend!