vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Anti-Leech Attachments - prevent hotlinking and bandwidth theft! (https://vborg.vbsupport.ru/showthread.php?t=149666)

Sandy-XXX 03-05-2008 02:13 PM

Im install but i think if not working.

I have 3.6.8 level 2, and the watermark mod (maybe if a conflict with this mod).

steadicamop 03-11-2008 07:49 PM

Quote:

Originally Posted by Sandy-XXX (Post 1457631)
Im install but i think if not working.

I have 3.6.8 level 2, and the watermark mod (maybe if a conflict with this mod).

It's a possible conflict, but I don't have that mod installed so I can't confirm or deny this, I will look into it when I get a few mins spare

COBRAws 03-15-2008 04:19 AM

It would be great if we had the ability to add some URL's in a whitelist :D

steven s 06-28-2008 03:04 PM

Are there any settings I need to do?
Does this work with 3.7.2?

Snookieboy 08-20-2008 06:51 PM

This works in 3.7.2 and with vBSEO 3.2.0 :)

For those who want to see an example, Guests can download so here you go:

http://insanenutter.com/leech.html
Click the Leech Link there :)

The only problem I have with this script is it doesn't allow people with no referer field to download. This is a problem because users with rubbish security packages like Norton Internet Security which blocks the referer field, cannot download either. If that was fixed, it would be perfect :)

Paul M 01-10-2009 11:32 AM

Moved to 3.8 section.

tlwwolfseye 01-12-2009 11:26 AM

Quote:

v1.1 - Added enable/disable option, tested on VB 3.8
So that means that option is only working in 3.8 ? Because in my 3.7.5 i don?t find anything after I installed that mod. Where would i have to search for it ?

steadicamop 01-12-2009 03:29 PM

The option will be in the AdminCP -> VBulletin Options -> Anti-Leech Settings, at the bottom ... it's just enable/disable, no other available options.

alik4277 01-14-2009 05:29 PM

Quote:

Originally Posted by steadicamop (Post 1709806)
The option will be in the AdminCP -> VBulletin Options -> Anti-Leech Settings, at the bottom ... it's just enable/disable, no other available options.

In my 3.8 i can nothing find too

steadicamop 01-15-2009 08:08 AM

I've checked the package and the option code is there, I did test it before I uploaded it by uninstalling it, then reinstalling on my own 3.8 installation and the option did reappear. If this clarifies anything, the option is with all the standard VB options, on the drop down menu, on mine, it's one up from the bottom, but may not be at the bottom. If it still doesn't appear I'll give it a further test on my installation.

samuelss 01-15-2009 12:17 PM

Thanks for the Mod. The options are not showing on my 3.80 also so there must be something somewhere.

Thanks.

alik4277 01-16-2009 03:28 PM

If you can not see option to enable Anti-Leech:

Go to AdminCP -> Plugin & Products -> Plugin Manager -> anti-leech Plugin

Replace all plugin code with
PHP Code:

    $ref str_replace('http://www.','',$_SERVER['SERVER_NAME']);
    if(!
strstr($_SERVER['HTTP_REFERER'],$ref)) {
        
$id $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT postid FROM ".TABLE_PREFIX."attachment WHERE attachmentid = ".mysql_escape_string($_REQUEST['attachmentid'])));
            eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('antileech') . '");');
        exit;
    } 

Save

MẪ$T?Я 01-16-2009 03:34 PM

it`s nice :up:

will try it

ammm
Quote:

Important : This has been tested on 3.6.2 and 3.8, I can presume it will be compatible with 3.7.x because it works on 3.8 - as always BACKUP FIRST
backup for database ?

thanks

YLP1 01-16-2009 04:43 PM

Installed and just doing a test run. Woo Hoo! This is awesome!! Works like a charm... cept I still don't have the acp enable/disable to show --- I used the code snippet from a couple of posts abovea and that didn't allow this mod to show up in the vbacp either.

samuelss 01-16-2009 08:13 PM

Quote:

Originally Posted by alik4277 (Post 1714787)
If you can not see option to enable Anti-Leech:

Go to AdminCP -> Plugin & Products -> Plugin Manager -> anti-leech Plugin

Replace all plugin code with
PHP Code:

    $ref str_replace('http://www.','',$_SERVER['SERVER_NAME']);
    if(!
strstr($_SERVER['HTTP_REFERER'],$ref)) {
        
$id $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT postid FROM ".TABLE_PREFIX."attachment WHERE attachmentid = ".mysql_escape_string($_REQUEST['attachmentid'])));
            eval(
'$navbar = "' fetch_template('navbar') . '";');
        eval(
'print_output("' fetch_template('antileech') . '");');
        exit;
    } 

Save

I still cannot see this in my VBulletin Options on 3.8.0 even after i have changed the code as you mentioned above. I also noticed that "if ($vbulletin->options['al_disable'])" is missing from the code you quoted above.

Thanks

alik4277 01-16-2009 08:36 PM

samuelss,
Replace, Save and test it

samuelss 01-16-2009 09:10 PM

Thanks. I have replaced and saved with and without "if ($vbulletin->options['al_disable'])". I have also tried install and uninstall and nothing is still showing.

Thanks.

alik4277 01-16-2009 09:21 PM

You can nothing find.
Replace plugin code with mine code, save and open link to attach-file on new window

Angel-Wings 01-17-2009 04:53 PM

Hmmm - can't this be done already with htaccess ?

Something like:

Quote:

<FilesMatch "attachment\.php">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</FilesMatch>
And when using the filesystem as storage:

Quote:

<LocationMatch "/uploads">
RewriteCond %{HTTP_REFERRER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.*$ - [F,NC]
</LocationMatch>
Or is there any difference like some additional check ? Reading the addon, if I understand it right you parse HTTP_REFERRER too via PHP, doing it directly via the Server is maybe less portable, but maybe also faster that PHP doesn't need to be called everytime.

pipin 02-02-2009 05:00 AM

Quote:

Originally Posted by samuelss (Post 1715104)
Thanks. I have replaced and saved with and without "if ($vbulletin->options['al_disable'])". I have also tried install and uninstall and nothing is still showing.

Thanks.

Same here with 3.8.1

Does not work and no Option in the vB Settings.

scottct1 02-03-2009 03:13 PM

Same here... No option... Please help.

djxcee 02-07-2009 06:58 AM

Getting the same problem people are getting. I don't see an option in the backend.

steadicamop 02-07-2009 07:58 AM

Hmmm this is odd, I will download the mod again and re-install it on my forum, the option is definitely there on mine, not too sure what's happening here.....

djxcee 02-08-2009 09:59 AM

Quote:

Originally Posted by steadicamop (Post 1736848)
Hmmm this is odd, I will download the mod again and re-install it on my forum, the option is definitely there on mine, not too sure what's happening here.....

This problem is very odd.

Tried reinstalling it and still no go.

jj 02-17-2009 08:09 PM

Actually this is only working for browsers where the referer is passed back to the site. This won't work for anyone using a proxy or a multiple proxy with altering hostnames. Be aware of this.

icemann 02-17-2009 08:49 PM

Works good for me. :cool:

Pebbled 03-15-2009 01:29 PM

Quote:

Originally Posted by Angel-Wings (Post 1715933)
Hmmm - can't this be done already with htaccess ?

Something like:



And when using the filesystem as storage:



Or is there any difference like some additional check ? Reading the addon, if I understand it right you parse HTTP_REFERRER too via PHP, doing it directly via the Server is maybe less portable, but maybe also faster that PHP doesn't need to be called everytime.

Angel-Wings, is it possible to display an alternative image for advertising your site instead of a plain red X - In this way it's free advertising for your site by linking to an alternative hotlink image? :cool:

I've had a go with copying some other code for .htacess from another hotlinking post on here but couldn't get it to work because I assume it only works on the filetype stated rather than the attachments. Code I used as below:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.examplesite.co.uk/forum/.*$ [NC]
RewriteRule .(jpg|jpeg|gif|png|bmp)$ http://www.examplesite.co.uk/forum/images/hotlink.jpg [R,L]

I'm a total novice at this type of stuff so apologies for any errors!

steadicamop would it be possible to add an alternate image to display in the plugin you have created?

dutchbb 04-21-2009 02:00 AM

Just imported the product, nothing has changed, attachments can still ne hotlinked? Also no option, like others have mentioned...

*uninstalled.

Pebbled 04-30-2009 06:33 PM

Same here!!! I've tried importing the product again yet nothing has changed, attachments can still be hotlinked? Also like you say, there is no option in admin CP!

Pebbled 05-02-2009 08:00 PM

*uninstalled* which is a great shame because it had so much potential :(

steadicamop 05-13-2009 09:47 PM

Sorry guys, been out of the loop for quite a while now, will take a look at this and see if anything needs updating, I have tested it on my current install and it works fine.

Jason (Steadicamop)

steadicamop 05-13-2009 09:54 PM

[Update]

Tested on vb 3.8.0 - click to test -- http://www.steadiforum.com/attachmen...2&d=1222457106

Could you confirm which version of vb you are attempting to run this on? I will re-investigate the admincp issue, there should be the option there.

Thanks,

Jason

Snookieboy 05-19-2009 01:43 PM

Works perfectly on my forum - VB 3.8.2 with VBSEO :)

Only problem that still remains is with people with no referer entry (ie they have antivirus programs like Norton which remove the referer tag for no apprant reason). A fix that would also allow people with no referer to download to would be brilliant.

Example attachment: http://digiex.net/attachments/guides...otosendfix.zip

Sp32 06-04-2009 12:34 AM

Installed, much appreciated

ShackMaster 08-10-2009 12:38 AM

Installed on my 3.8.3 board, but does not work and there is no option in vB Options either. I tried replacing the plugin code as an earlier poster suggested, but it still does not work.

pablete 08-10-2009 11:58 AM

thanks. there is a mod like this but to do this with the images displayed in a forum? is that if someone copies the address of an image to put in another forum, this will not show any image and leave another pic in place? thanks

grafbyte 09-18-2009 12:44 AM

hi

im install dir in the 3.8.4 and i cant not see the settings :(
PHP Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="antileech" active="1">
    <title>Anti Leech Attachments</title>
    <description>Prevent hot linking your 

attachments!</description>
    <version>1.1</version>
    <url>https://vborg.vbsupport.ru/showthread.php?t=149666</url>
    

<versioncheckurl><![CDATA[https://vborg.vbsupport.ru/misc.php?do=productcheck&pid=antileech]]></versioncheckurl>
    

<dependencies>
    </dependencies>
    <codes>
    </codes>
    <templates>
        <template name="antileech" 

templatetype="template" date="172182599" username="Jason" version="1.00b"><![CDATA[$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[antileech]</title>
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" 

align="center">
<tr>
    <td class="tcat">$vboptions[bbtitle] - $vbphrase[antileech]</td>
</tr>
                <td class="panelsurround" align="center"><br /><br />
            <div class="panel" style="width:70%">
        <br /><phrase 1="{$id['postid']}">$vbphrase[antileechmessage]</phrase><br /><br />
</div><br /><br /></td>
</tr>
</table>
$footer
</body>
</html>]]></template>
    </templates>
    <plugins>
        <plugin active="1" executionorder="5">
            

<title>anti-leech</title>
            <hookname>attachment_start</hookname>
            <phpcode><![CDATA[if 

($vbulletin->options['al_disable'])
{
    $ref = str_replace('http://www.','',$_SERVER['SERVER_NAME']);
    if(!strstr($_SERVER['HTTP_REFERER'],$ref)) {
        $id = $vbulletin->db->fetch_array($vbulletin->db->query_read("SELECT postid FROM ".TABLE_PREFIX."attachment WHERE 

attachmentid = ".mysql_escape_string($_REQUEST['attachmentid'])));
            eval('$navbar = "' . fetch_template('navbar') . '";');
        eval('print_output("' . fetch_template('antileech') . '");');
        exit;
    }  
}]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="GLOBAL" 

fieldname="global">
            <phrase name="antileech" date="1172182599" username="Jason" 

version="1.0"><![CDATA[Anti Leech Protected]]></phrase>
            <phrase name="antileechmessage" 

date="1172182522" username="Jason" version="1.0"><![CDATA[Sorry, only direct links from threads are allowed to view 

attachments.  As a courtesy, the link to the post containing the attachment is provided below.<br /><br /> <a 

href=showthread.php?p={1}>Click here to visit the post with the attachment.</a> <br /><br /> Leeching from the forum is not 

permitted, to save bandwidth abuse only direct clicks from the thread the attachment is with will work. All attachments are 

viewable by guests (you are not required to register).]]></phrase>
        </phrasetype>
        <phrasetype 

name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_al_disable_desc" 

date="1231584976" username="Jason" version="1.00b"><![CDATA[Enable Anti-Leech Attachments?  Allows non-hotlinking of 

attachments, the only way they can be viewed is from clicking the attachment link on the post.]]></phrase>
            

<phrase name="setting_al_disable_title" date="1231584976" username="Jason" version="1.00b"><![CDATA[Enable Anti-Leech 

Attachments]]></phrase>
            <phrase name="settinggroup_leech_settings" date="1231576342" username="Jason" 

version="1.00b"><![CDATA[Anti-Leech Settings]]></phrase>
        </phrasetype>
    </phrases>
    <options>
    

</options>
    <helptopics>
    </helptopics>
    <cronentries>
    </cronentries>
    <faqentries>
    </faqentries>
</product>


TheChaosFactor 09-30-2009 09:43 AM

Quote:

Originally Posted by pablete (Post 1864524)
thanks. there is a mod like this but to do this with the images displayed in a forum? is that if someone copies the address of an image to put in another forum, this will not show any image and leave another pic in place? thanks

I just copied the address and posted that pic in my forum using image tags with no problem, which is what I thought this was supposed to prevent?

Not sure I understand the use of this, at all?

kalisekj 09-30-2009 04:36 PM

Installed but its not working :( I am still able to hot link to my attachments :(

TheChaosFactor 10-04-2009 02:14 PM

Quote:

Originally Posted by kalisekj (Post 1892913)
Installed but its not working :( I am still able to hot link to my attachments :(

I tested it using the demo pic and hotlinked it from there, so I don't think it's just you.


All times are GMT. The time now is 01:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01334 seconds
  • Memory Usage 1,857KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete