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!

Paul M 09-21-2004 11:40 AM

Quote:

Originally Posted by Spinball
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.

Please help!

Hi Spinball,

This problem is corrected in v1.1 - which has a better ip extraction and check.

The steps to update are in the new zip file. :)

Spinball 09-21-2004 03:50 PM

Thanks. I'll keep an eye on it. For the bad IP addresses, I'll just edit out anything after the first 4 numbers and in the case of them having 'unknown' in the text I'll leave them blank. Do you agree with this course of action?
FYI I have installed this hack and the IP Info hack so my moderators can track down the morons causing trouble with duplicate registrations and proxys.

mikeB 09-21-2004 04:54 PM

I installed Proxy Detector 3.0 to my VB 3.01 - and next to the IP button is _HacNho - it doesnt seem to be working, any idea what might cause this? thanks>!

Paul M 09-21-2004 05:36 PM

Quote:

Originally Posted by Spinball
For the bad IP addresses, I'll just edit out anything after the first 4 numbers and in the case of them having 'unknown' in the text I'll leave them blank. Do you agree with this course of action?

Yes, if you really need to edit old records that are in error then that would work. I'm not sure it is worth the effort, depends on how many you have I suppose.

Quote:

Originally Posted by mikeB
I installed Proxy Detector 3.0 to my VB 3.01 - and next to the IP button is _HacNho - it doesnt seem to be working, any idea what might cause this? thanks>!

Well I didn't write that hack, but by the sound of it you have a small error in the postbit_ip template. Make sure you have copyied that part correctly.

mikeB 09-21-2004 06:59 PM

Quote:

Originally Posted by Paul M

Well I didn't write that hack, but by the sound of it you have a small error in the postbit_ip template. Make sure you have copyied that part correctly.

no Ive checked it 10 times - maybe this wont work w 3.0.1?

Paul M 09-21-2004 11:58 PM

Quote:

Originally Posted by mikeB
no Ive checked it 10 times - maybe this wont work w 3.0.1?

Hmm, Well you are right, the postbit_ip template code in that proxy detector text file is a bit duff. I just took that hack, as was, and added it to my zip file assuming it was ok.

You could replace it with this which should work ok ;
PHP Code:

<if condition="$show['ip']">
    
$vbphrase[ip]: $post[ip
    <if 
condition="($post[proxyip] != '')">
        <
br>Proxy Detected Real IP$post[proxyip])
    </if>
<else />
    <if 
condition="($post[proxyip] != '')">
        <
a href="postings.php?$session[sessionurl]do=getip&amp;p=$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]title="Proxy Server : $post[ip] - Real IP: $post[proxyip]border="0" /></a>
    <else />
        <
a href="postings.php?$session[sessionurl]do=getip&amp;p=$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]title="$post[ip]border="0" /></a>
    </if>
</if> 

But it's a bit academic if you are applying my Hack, as part of mine replaces the postbit_ip template code again anyway.

Paul.

nnjj.net 09-22-2004 04:32 PM

nothing change,
I did the change in postbit_ip
but nothing!

Paul M 09-22-2004 05:51 PM

Quote:

Originally Posted by nnjj.net
nothing change,
I did the change in postbit_ip
but nothing!

Sorry, but you will have to be a little more specific.

What steps have you done, and what is the problem ?

Rich 09-26-2004 06:35 PM

Hello,
I have some members that I know for certain are behind a proxy. however, this hack hasn't changed or added the second "red" comp in their posts.
I do believe that it is showing the correct IP, but now I can't see who else is behind a proxy.
If there is a proxy detected, will it tell me that a proxy was detected? I click the normal comp and it tells me the IP and the host, but not if they were behind a proxy.
On "who's online", nothing has changed either. All I see are the usernames,where they are currently on the site, and their IP address. Should i also see the host?

integra99 09-26-2004 09:25 PM

Quote:

Originally Posted by iguanairs
Hello,
I have some members that I know for certain are behind a proxy. however, this hack hasn't changed or added the second "red" comp in their posts.
I do believe that it is showing the correct IP, but now I can't see who else is behind a proxy.
If there is a proxy detected, will it tell me that a proxy was detected? I click the normal comp and it tells me the IP and the host, but not if they were behind a proxy.
On "who's online", nothing has changed either. All I see are the usernames,where they are currently on the site, and their IP address. Should i also see the host?

Depends on if they are using a completly anonymous proxy, or just a regular proxy

DeMiNe0 09-26-2004 10:59 PM

whatproxy can i use to test this?

Paul M 09-27-2004 03:43 PM

Quote:

Originally Posted by iguanairs
Hello,
I have some members that I know for certain are behind a proxy. however, this hack hasn't changed or added the second "red" comp in their posts.
I do believe that it is showing the correct IP, but now I can't see who else is behind a proxy.
If there is a proxy detected, will it tell me that a proxy was detected? I click the normal comp and it tells me the IP and the host, but not if they were behind a proxy.
On "who's online", nothing has changed either. All I see are the usernames,where they are currently on the site, and their IP address. Should i also see the host?

See https://vborg.vbsupport.ru/showpost....85&postcount=9 for the first bit.

For who's online, it is an option (in Admin CP) to turn on host display, but this still relies on there actually being a reverse dns lookup record for the ip (which is nothing to do with me ;))

MickDoneDee 10-03-2004 09:45 AM

Thanks Paul. Yesterday I installed Proxy Detector v3.1 - for Posts and WOL which also allows you to see the Proxy IP address and Real IP address in Who's Online when User Agent info is displayed.

I think I discovered a bug afterwards in relation to the Revert function which caused my Whosonline template to disappear. I explained what happened in this post.

Today I added your Proxy IP Hack Modification v1.1. Can you explain why you've changed the text in the phrase thread_displayproxyip from

Below is text from original Proxy Detector v3.0 hack which is replaced

The proxy IP Address is: $postinfo[ipaddress]<br>
The proxy host name is: $postinfo[hostaddress]<br>
The real IP Address is: $postinfo[proxyip]
--------------------------------------------------------
to

Real IP Address : $postinfo[ipaddress]<br>
$postinfo[hostaddress]<br>
Proxy Server IP Address : $postinfo[proxyip]<br>
$postinfo[proxyhost]
-----------------------------------------------------------
Why was this necessary?

Also, in your postbit_ip modification one of the lines you add is:

<if condition="($post[proxyip] != '' & $permissions['adminpermissions'])">

I changed it to <if condition="($post[proxyip] != '')">

to allow my supermods to see the red gif identifying the proxy users.

Paul M 10-03-2004 04:27 PM

Quote:

Originally Posted by MickDoneDee
Can you explain why you've changed the text in the phrase thread_displayproxyip ....

Well I would have hoped it was obvious from looking at it. The old template has the ip's reversed (i.e. it displays the proxyip as the real ip, and vice versa) - there is also now a forth line to display the proxy servers host name.

Quote:

Originally Posted by MickDoneDee
<if condition="($post[proxyip] != '' & $permissions['adminpermissions'])">

I changed it to <if condition="($post[proxyip] != '')">

to allow my supermods to see the red gif identifying the proxy users.

Fine, it was just an extra check and should probably be removed anyway as it's a bit redundant. Interestingly, our supermods can see them anyway. If I do another update I'll probably remove it myself.

MickDoneDee 10-03-2004 08:55 PM

Quote:

Originally Posted by Paul M
Well I would have hoped it was obvious from looking at it. The old template has the ip's reversed (i.e. it displays the proxyip as the real ip, and vice versa) - there is also now a forth line to display the proxy servers host name.

It was obvious to me, Paul but I wanted confirmation from a coder. Are you saying that original text display is incorrect? Why then hasn't someone informed mtha?
https://vborg.vbsupport.ru/showthread.php?t=61331

Paul M 10-03-2004 09:28 PM

Quote:

Originally Posted by MickDoneDee
It was obvious to me, Paul but I wanted confirmation from a coder. Are you saying that original text display is incorrect? Why then hasn't someone informed mtha?
https://vborg.vbsupport.ru/showthread.php?t=61331

No, the original text display is correct for the way his hack works.

The main reason I wrote this [for our forum] was because when his hack detects a proxy, it still treats the proxy server ip as the real ip, and just records the real ip in the proxyip field. As detailed in post one of this thread, my hack corrects this 'problem' and makes sure the forum always uses the members real ip, even when a proxy is detected. :)

MickDoneDee 10-03-2004 09:47 PM

Thanks again, Paul. Just wanted further clarification as the fields appear to be swapped between your version and the original but your modification works and adds further benefits to the original without diminishing the original so thankyou for sharing it.

MickDoneDee 10-05-2004 02:00 PM

Quote:

Originally Posted by Paul M

The main reason I wrote this [for our forum] was because when his hack detects a proxy, it still treats the proxy server ip as the real ip, and just records the real ip in the proxyip field. As detailed in post one of this thread, my hack corrects this 'problem' and makes sure the forum always uses the members real ip, even when a proxy is detected. :)

Paul, I need further clarification, please. With your hack installed and a member logs in using a proxy will that proxy address be stored in the database and be available to search in admin or mod cp to see which members use the same proxy server?

Or are proxy IP addresses ignored and not stored? Thereby, making it impossible to search and find proxy IPs shared by members.

Paul M 10-06-2004 12:33 AM

Quote:

Originally Posted by MickDoneDee
With your hack installed and a member logs in using a proxy will that proxy address be stored in the database and be available to search in admin or mod cp to see which members use the same proxy server?

Yes, and No. Both addresses are stored, but the ACP / MCP functions only scan the real ip data field, not the proxy ip field.

Quote:

Originally Posted by MickDoneDee
Or are proxy IP addresses ignored and not stored? Thereby, making it impossible to search and find proxy IPs shared by members.

No, and Yes !. As above, the proxy server addresses are stored, but the current vB ip functions do not access them.

MickDoneDee 10-06-2004 04:38 PM

Paul, since installing your hack I'm getting weird results when searching in admin cp Search IP Addresses.

For example: a member called Scott-Wozniak has 640 posts recorded with 80.3.32.4 When I do a search "Find IP Addresses for user" and type Scott-Wozniak I get 80.3.32.4 However, when I use "Find Users by IP Address" and type 80.3.32.4 I get No Matches Found. What is going on here, Paul. Have others experienced the same problem since installing this hack.

I've checked other members including myself and some IP numbers listed when using Find IP Addresses for user return "No Matches Found" when entered as the search string in Find Users by IP Address to get the members name. But some IP numbers do return the member's name. Any explanation for this?

Paul M 10-07-2004 03:49 PM

Quote:

Originally Posted by MickDoneDee
Paul, since installing your hack I'm getting weird results when searching in admin cp Search IP Addresses.

For example: a member called Scott-Wozniak has 640 posts recorded with 80.3.32.4 When I do a search "Find IP Addresses for user" and type Scott-Wozniak I get 80.3.32.4 However, when I use "Find Users by IP Address" and type 80.3.32.4 I get No Matches Found. What is going on here, Paul. Have others experienced the same problem since installing this hack.

I've checked other members including myself and some IP numbers listed when using Find IP Addresses for user return "No Matches Found" when entered as the search string in Find Users by IP Address to get the members name. But some IP numbers do return the member's name. Any explanation for this?

Sorry, TBH I can't follow exactly what what you are saying, but just to be clear here - this hack makes no changes to the search functions in ACP, or MCP, nor does it make any changes to ip data collected prior to installing it. All it does, if a proxy is detected, is make the correct ip address for that member is available to vB. What vB does with that ip is unchanged.

gotvenm 10-13-2004 02:22 AM

Paul, great work !

I was wondering if there was an easy way to show something in WOL to see whos using a proxy without needing them to post first ?

I have hancho's WOL installed, but it doesnt seem to show this...?

MickDoneDee 10-13-2004 03:26 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=61331" target="_blank">Proxy Detector v3.1 - for Posts and WOL </a> shows proxy IP in WOL but first you must turn the User Agent option on. The setting is at the bottom of the WOL page and is off by default. It also defaults each time you close the page and re-open it. Once user agent is on the real IP is seen above the user agent info and the proxy IP is indicated by a blue question icon (vB3)that appears to th eright of the user agent info. Mouse-over/hover over the icon to reveal the proxy IP.

gotvenm 10-13-2004 04:16 AM

Quote:

Originally Posted by MickDoneDee
Proxy Detector v3.1 - for Posts and WOL shows proxy IP in WOL but first you must turn the User Agent option on. The setting is at the bottom of the WOL page and is off by default. It also defaults each time you close the page and re-open it. Once user agent is on the real IP is seen above the user agent info and the proxy IP is indicated by a blue question icon (vB3)that appears to th eright of the user agent info. Mouse-over/hover over the icon to reveal the proxy IP.

Oh... DOH ! Thanks for explaining that to me. I get it now.
I was turning on the user agent, but somehow I missed the whole mousehover over the ? thing.

mtha 10-13-2004 04:40 AM

Quote:

Originally Posted by gotvenm
Oh... DOH ! Thanks for explaining that to me. I get it now.
I was turning on the user agent, but somehow I missed the whole mousehover over the ? thing.

The pupose of leaving them in "user agent" is I dont want/need to see too many text in the WOL page (my preference).

however, if you want, you can modify the template :)

Neal-UK 10-14-2004 10:21 AM

Quote:

Originally Posted by mtha
The pupose of leaving them in "user agent" is I dont want/need to see too many text in the WOL page (my preference).

however, if you want, you can modify the template :)

This version works fine, great thanks!

JazzleBug 10-21-2004 10:12 PM

I like this, but would like to see it integrated into the ipInfo hack (or vice versa)...

MickDoneDee 10-21-2004 10:23 PM

Quote:

Originally Posted by JazzleBug
I like this, but would like to see it integrated into the ipInfo hack (or vice versa)...

I'm happy that the IpInfo hacks works as an add-on. It just means you have two ip.gif icons in the postbit but that doesn't bother me.

JazzleBug 10-21-2004 10:58 PM

Quote:

Originally Posted by MickDoneDee
I'm happy that the IpInfo hacks works as an add-on. It just means you have two ip.gif icons in the postbit but that doesn't bother me.

Oh, absolutely! Don't get me wrong, I love both of them and will gladly live with two icons, but I'm a freak for streamlined, consolidated functionality. ;)

Seekers 10-28-2004 03:19 PM

Well I am pretty puzzled. I have installed the hack but I don't see anything different in the WOL, or on any posts. It simply displays one IP address and not

Real IP Address : $postinfo[ipaddress]<br>
$postinfo[hostaddress]<br>
Proxy Server IP Address : $postinfo[proxyip]<br>
$postinfo[proxyhost]

as indicated by the explaination of the thread. I must have done something wrong. Anyone got any ideas.

Thanks


All times are GMT. The time now is 06:47 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.02170 seconds
  • Memory Usage 1,878KB
  • 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
  • (2)bbcode_php_printable
  • (23)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