vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   ban proxy servers (https://vborg.vbsupport.ru/showthread.php?t=46958)

BlackDeath 12-24-2002 06:08 AM

ban proxy servers
 
i have several users who like to cause a lot of trouble. they boast that they can't be banned because they use proxy servers. well you can ban their true IP but once u do that, they use proxy's. there is a hack that will allow u to detect the proxy server and will even tell u their true IP. could someone modify this hack to make it an option in the admin cp that you can disallow anyone using a proxy? i would be most appreciative and so would several other people i know who have the same problem. thanks!

Logician 12-24-2002 11:29 AM

This is NOT tested:

edit functions.php, find:
PHP Code:

$ipaddress=$HTTP_SERVER_VARS['REMOTE_ADDR']; 

After that add:
PHP Code:

 if (getenv("HTTP_FORWARDED")!="") {
        
$proxyip=getenv("HTTP_FORWARDED");
      } elseif (
getenv("HTTP_X_FORWARDED_FOR")!="") {
        
$proxyip=getenv("HTTP_X_FORWARDED_FOR");
      } elseif (
getenv("HTTP_CLIENT_IP")!="") {
        
$proxyip=getenv("HTTP_CLIENT_IP");
      } else {
        
$proxyip="";
      } 


find
PHP Code:

if (strstr(" ".$ipaddress," ".trim($val))!="") {
        eval(
"standarderror(\"".gettemplate("error_banip")."\");");
      } 

After that add:
PHP Code:

if ($proxyip AND strstr(" ".$proxyip," ".trim($val))!="") {
        eval(
"standarderror(\"".gettemplate("error_banip")."\");");
      } 

What it does is this: It checks if user has a proxy user and if yes it not only matchs his proxy IP but also real IP for banned IPs and if either one matches, he is banned.

However please notice that not every proxy server sends the real IP to your site so your users might have a point while saying you can not get their real IP anyway if they are using such a proxy server.

Again I didn't test the hack myself..

BlackDeath 12-24-2002 09:15 PM

this will help a lot but i would prefer if i could make it that the board banned all proxys from registered users but allowed proxys by admins (i use a proxy at work). is that possible? thanks.

Logician 12-24-2002 09:50 PM

edit global.php, find:

PHP Code:

checkipban(); 

Before that add:

PHP Code:

if (getenv("HTTP_FORWARDED")!="") {
        
$proxyip=getenv("HTTP_FORWARDED");
      } elseif (
getenv("HTTP_X_FORWARDED_FOR")!="") {
        
$proxyip=getenv("HTTP_X_FORWARDED_FOR");
      } elseif (
getenv("HTTP_CLIENT_IP")!="") {
        
$proxyip=getenv("HTTP_CLIENT_IP");
      } else {
        
$proxyip="";
      }
if (
$proxyip AND $bbuserinfo[usergroupid]!=6) { eval("standarderror(\"".gettemplate("error_banip")."\");");exit;} 


BlackDeath 12-26-2002 04:28 AM

i think it works. both codes work. i had someone w/ a proxy test it and it seems to show that the server is busy?? i'll post a SS of the error soon. if i want to allow mod level people or possibly create a user group that i allow proxys, how would that look? i think if someone could make this nice and clean to go along w/ the existing proxy hack, and make it an option in the admin cp, a lot of people who get trouble makers on their forums will be very happy!! thanks.

BlackDeath 12-26-2002 04:43 AM

here is the error.

Logician 12-26-2002 08:19 AM

nope it's suppose to display "error_banip" template, this error does not seem related

Scott MacVicar 12-26-2002 11:23 AM

It would affect alot of users including NTL and freeserve which are quite big in the UK who use transparent proxies and then add HTTP_CLIENT_IP to pass the real IP.

BlackDeath 12-27-2002 03:17 PM

Quote:

Originally posted by PPN
It would affect alot of users including NTL and freeserve which are quite big in the UK who use transparent proxies and then add HTTP_CLIENT_IP to pass the real IP.
its been working for most, no one has gotten that error however there have been a few people who have been banned who say they aren't on proxys, why would that be?

Chris M 12-27-2002 07:12 PM

@BlackDeath - I know you may have trouble with Proxies, but people like myself, are forced to use a Proxy to access the internet...

Our home network will only issue an Internet connection if you have the Proxy settings setup...

You should consider all sides before totally banning;)

Satan


All times are GMT. The time now is 06:58 PM.

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.01547 seconds
  • Memory Usage 1,752KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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