vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Proxy ip to real ip conversion (https://vborg.vbsupport.ru/showthread.php?t=69295)

Paul M 09-09-2004 10:00 PM

Proxy ip to real ip conversion
 
This modification is no longer available or supported.

A simple modification I did for our forum that was originally based on the Proxy Detector Hack (v3.0). Obviously, like all proxy server detection hacks, this will only work if the proxy server passes the appropiate http variables.

This hack makes the forum always use the members real ip when a proxy is detected, meaning that all existing ip functions continue to work, basically ignoring the proxy server (other than recording it's presence).

i.e.

* The real ip/host is displayed in who's online

* The real and proxy server ip's are accesible for each post, the button is red for members using a proxy.

* The real ip is searchable in the admin/mod cp, not the proxy ip.

* The real ip is bannable by admins (no moving to another proxy to avoid a ban).

etc etc.

The installation should take about 10-15 mins (4 file edits, 2 phrase changes, 1 new template, 1 sql query, 1 new image).

???`S?LV?R???` 09-10-2004 10:40 PM

nice

Surtain23 09-10-2004 11:10 PM

Cool, I'm going to install this later after I work on vb ads for a while.

BladeZ 09-11-2004 11:34 AM

Thank you! Very usefull :)
*clicks install*

Bigwrenn 09-11-2004 11:50 AM

Thank you very much! :D

sacredfox 09-11-2004 01:53 PM

wheres the original proxy hack that i need

Beermonster 09-11-2004 02:22 PM

Very good idea

[high]* Beermonster clicks install :)[/high]

lcryan 09-11-2004 02:34 PM

kinda having trouble beleaving it can resolve the users real IP, but we will see :)

Paul M 09-11-2004 03:56 PM

Quote:

Originally Posted by sacredfox
wheres the original proxy hack that i need

In the Zip file, as it says. :)

Quote:

Originally Posted by lcryan
kinda having trouble beleaving it can resolve the users real IP, but we will see :)

As long as the proxy passes the client IP on in the standard http variables it will. Obviously it can't do anything about proxies that don't do this. I can't perform miracles.

Spinball 09-21-2004 11:15 AM

Paul - I've installed your hack as per the instructions, but I'm getting IP addresses being saved by proxy users in the post table such as
192.168.1.7, 82.
172.26.106.249,
unknown, 10.255.
10.20.5.2, 194.2

I'm regarding this is quite a serious error as IP information needs to be correct.

PHP Code:

I've looked at the bit of code which I think gets the real IP in init.php :
// ####################### HN getproxyip START########################
// Establish Proxy Server IP address (if it exists) and Real IP Address
// Make sure forum always uses real client IP address 
// Start of Paul Marsden Proxy Hack Modification
if ($_SERVER['
HTTP_X_FORWARDED_FOR'] != '') 

    $proxyip = $_SERVER['
HTTP_X_FORWARDED_FOR']; 

else if ($_SERVER['
HTTP_CLIENT_IP'] != '') 

    $proxyip = $_SERVER['
HTTP_CLIENT_IP']; 

else if ($_SERVER['
HTTP_FORWARDED'] != '') 

    $proxyip = $_SERVER['
HTTP_FORWARDED']; 

else 

    $proxyip = ''; 

$proxyip = preg_replace('
/javascript/i', 'java script', $proxyip); 
$proxyip = str_replace('"', '"', $proxyip); 
$proxyip = str_replace('
<', '&lt;', $proxyip); 
$proxyip = str_replace('
>', '&gt;', $proxyip); 
if (!preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $proxyip))
{
    $proxyip = ''; 
}
if ($proxyip == '')
{
    define('
PROXYIP', ''); 
    define('
IPADDRESS', $_SERVER['REMOTE_ADDR']);
}
else
{
    define('
PROXYIP', $_SERVER['REMOTE_ADDR']);
    define('
IPADDRESS', $proxyip); 
}
unset($proxyip); 
// End of Paul Marsden Proxy Hack Modification
// ####################### HN getproxyip END ######################## 

Is this code in error?
Please help!


All times are GMT. The time now is 06:57 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.01115 seconds
  • Memory Usage 1,745KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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