View Full Version : need proxy help
crspyjohn 05-13-2006, 10:31 PM hey,
i been looking for a way to disable hotlinking in phproxy. I think some sites are using my site as a hotlinking source. Is there anyway to block this?
Amdac 05-13-2006, 11:25 PM I figured it's time I shared some logic with the proxy community. :D
I just wrote a short article regarding the prevention of hotlinking files via phproxy.
The article can be found here: http://www.webmastertalk.net/showthread.php?t=29
messa 05-14-2006, 12:00 AM Looks nice Amdac.
Can this be optimised to include other preffered referrer sites such as proxy.org etc?
Another point is that you are loosing alot of ad traffic that would have came through your site on proxified pages.
CPM on proxified pages can be worth the extra bandwidth that's used up.
comment more later...
Amdac 05-14-2006, 12:10 AM Looks nice Amdac.
Can this be optimised to include other preffered referrer sites such as proxy.org etc?
Another point is that you are loosing alot of ad traffic that would have came through your site on proxified pages.
CPM on proxified pages can be worth the extra bandwidth that's used up.
comment more later...
In regards to the loss of ads, the only direct links to proxied pages would be posts on other sites. There's no way for a search engine to crawl anything beyond the index page. If you'd like to accomodate for ads on direct links, you could simply add the ads to the error page as well. As long as you provide a link back to the index page in your error message, there's a good chance you'll retain most of the traffic.
You've made a good point about allowing proxy.org, considering my site is listed there as well. I'll do some quick modifications and add it to the article in a few minutes. Thanks! :D
crspyjohn 05-14-2006, 12:14 AM On my site 24proxy.com i did a refresh that will refresh the page instantly so i won't lose the traffic.
Amdac 05-14-2006, 12:18 AM I'll do some quick modifications and add it to the article in a few minutes. Thanks! :D
I took the easy route, the orginal idea was much more complex. It should now allow proxy.org.
crspyjohn 05-14-2006, 12:32 AM Bug fix. The original script doesn't display the url include forum if the body tag of a site is empty
do you have a fix for that? :P
Amdac 05-14-2006, 12:53 AM I'll let you know in a sec.
Amdac 05-14-2006, 01:03 AM Are you saying you want url_form.inc included on the intercepted pages? Just want to make sure I'm understanding it correctly.
crspyjohn 05-14-2006, 01:05 AM When you access pages like yahoo.com then view there news the url_form disappears.
aim: crspyjohn
msn: crspyjohn@hotmail.com
skype: crspyjohn
Amdac 05-14-2006, 01:11 AM When you access pages like yahoo.com then view there news the url_form disappears.
aim: crspyjohn
msn: crspyjohn@hotmail.com
skype: crspyjohn
Ah, that's a completely different issue with phproxy.
The solution to that can be found here (check the post by murdock):
http://whitefyre.com/boards/genmessage.php?topic=102
That enables it on many sites that it normally doesn't show up on.
crspyjohn 05-14-2006, 01:15 AM thanks you
Amdac 05-14-2006, 01:20 AM Glad I could help. :D
Vdevelopers 05-14-2006, 01:35 AM Nice resource, Amdac. I personally just added something similar to what I've got running. I've been having similar problems with hotlinking, so what I added was...
if ( $_GET["q"] && !(strpos( $_SERVER["HTTP_REFERER"], "http://www.proxyboys." ) === 0 || strpos( $_SERVER["HTTP_REFERER"], "http://proxyboys." ) === 0 || $_SERVER["HTTP_REFERER"] == "" )) {
Header( "Referer: http://www.proxyboys.com/" );
Header( "Location: http://www.proxyboys.com/index.php" );
}
Now, I'm not 100% sure that this will even work, and I tried to test it but then I realized that the HTTP_REFERER environment variable isn't even being set on my server, or at least not when I was trying to access it, but it should work in theory.
Difference is is that I added the part in where it allows the user to bypass the hotlink filter if they enter in the URL directly (or have it bookmarked). I also took in to account that some people access websites without using the "www" prefix.
Anywho, if someone uses this, let me know - just throw it at the top of your page before any includes etc. Curious to know if it works. I think my server is just a little borked (I'm terrible at managing my own VPS, so for all I know I left off some important Apache2 module when upgrading.)
Amdac 05-14-2006, 01:41 AM || $_SERVER["HTTP_REFERER"] == ""
I don't know why I didn't think of that, definately a nice touch. ;)
slippyfist 05-14-2006, 03:03 AM proxyhelper.com
TonyB 05-14-2006, 05:55 PM Interesting way to prevent hotlinking I went a totally different way and started switching the query string based on ip and day and creating an md5 of that and trimming it down to a reasonable length.
So rather than say
http://www.arandomproxy.com/index.php?q=d3d3LmRldm90ZWRob3N0Lm5ldA--&hl=11111010011111101001
I get
http://www.arandomproxy.com/index.php?b47c3=d3d3LmRldm90ZWRob3N0Lm5ldA--&hl=11111010011111101001
VolkNet 05-15-2006, 01:28 AM For some reason this script didnt work for me. I tried linking from my blog, and it still works.
Odd.
I'm going to try reinstalling php proxy with a fresh copy and then try it.
crspyjohn 05-15-2006, 02:18 AM Only the first one works.`
Amdac 05-15-2006, 02:29 AM I know mine works since I use it myself, the link in the post is proof. ;)
messa 05-15-2006, 11:41 AM Works for me too.
How would I add multiple sites to the referrer list?
Amdac 05-15-2006, 03:05 PM Works for me too.
How would I add multiple sites to the referrer list?
I've edited it a bit since the initial post and added that option. :D
VolkNet 05-16-2006, 12:56 AM Might want to mention, register_globals needs to be set to ON in the PHP.ini file for this script to function correctly.
wormy 07-13-2006, 06:08 PM Interesting way to prevent hotlinking I went a totally different way and started switching the query string based on ip and day and creating an md5 of that and trimming it down to a reasonable length.
So rather than say
http://www.arandomproxy.com/index.php?q=d3d3LmRldm90ZWRob3N0Lm5ldA--&hl=11111010011111101001
I get
http://www.arandomproxy.com/index.php?b47c3=d3d3LmRldm90ZWRob3N0Lm5ldA--&hl=11111010011111101001
Thats an interesting approach but how would you accomodate "legit hotlinkers" such as proxy.org? Proxy.org expects a certain url to work. I think Baron has an auto script that checks proxies periodically. Whenever I change anything in my proxifed path I find that my proxy gets mistakenly labelled as disabled on proxy.org.
UpsideOut 08-26-2006, 12:35 PM The Post in whitefyre's site appears to be down (actually the entire forums are). I need to test my anti-hotlinking code but I am confused on just how to 'test' it. I also would like the code to get my mini-bar up on more pages. Anyone want to lend a hand? =)
messa 08-26-2006, 02:12 PM Wow, this post is more than a month old but sure I'll lend a hand.
You can test if it's working by using your proxy to do a search. Then copy the whole url from the address bar and paste it into google and try to browse to it.
If you get your gateway page then everything is working fine.
Regards,
UpsideOut 08-26-2006, 02:35 PM My main site is 2012.ws.
I tried just visiting yahoo.com, copying the url, and googling it. It appears as if it doesnt work?
http://2012.ws/index.php?q=uggc%3A%2F%2Fjjj.lnubb.pbz&hl=1111110001
UpsideOut 08-26-2006, 03:39 PM <?php
$spliturl = explode(".ws", $HTTP_REFERER);
if (isset($q) && $spliturl[0] != "http://www.2012" && $spliturl[0] != "http://2012" && $HTTP_REFERER != "http://www.proxy.org/" && $HTTP_REFERER != "http://proxy.org/" && $HTTP_REFERER != "http://www.goodwaiter.com/" && $HTTP_REFERER != "http://goodwaiter.com/") {
echo 'Hotlinking Not Allowed on the Proxy. Return to www.IntranetProxy.com' (http://www.IntranetProxy.com');
}
else {
?>
<?php
require 'PHProxy.class.php'; (rest of code)
Here is how my code looks, I can't figure out what could be wrong?
UpsideOut 08-27-2006, 11:28 AM Ahhh...I had to turn on globals apparently...working OK now. Do you know how to customize the landing page?
BillyConnite 08-29-2006, 12:43 AM Hey all,
I coded up a little something a while ago, and posted it here just recently, works just fine with PHProxy.
Here: http://webhostingtalk.com/showthread.php?t=541450
All the best, Rhett.
|