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 01-13-2005 11:22 AM

Quote:

Originally Posted by Eagle Creek
I had but not anymore, I guess I did something wrong with the install..

So have you installed this ? If so then might I ask you to click on the relevant install link to indicate you have done so. :)

ToastBusters 01-13-2005 04:19 PM

Hey guys,

I just *barely* installed my copy of vb last night, so I have a few complete newbie questions for you guys.

First, the modification has this:

PHP Code:

Add the following phrase "thread_displayproxyip" 

How do I go about doing that? Second:

PHP Code:

Replace the template "postbit_ip"

Do I do that by editing a file or making changes in the admin cp?

Finally, is it permissible to create a second "test" board that only I have access to so I can test mods before making them live? It's not your competence in creating the mods that concerns me, only my own ability to impliment them. ;)

Thanks!

yoyoyoyo 01-13-2005 04:30 PM

Quote:

Originally Posted by ToastBusters
Hey guys,

I just *barely* installed my copy of vb last night, so I have a few complete newbie questions for you guys.

You may want to read up a bit before adding any hacks, etc., and start off with some simple ones (look in the minor mods section)
Quote:

First, the modification has this:

PHP Code:

Add the following phrase "thread_displayproxyip" 

How do I go about doing that?
In the admin CP -> languages & phrases -> Phrase Manager -> Add New Phrase

Quote:

PHP Code:

Replace the template "postbit_ip"

Do I do that by editing a file or making changes in the admin cp?
all template changes are done via the style manager in the admin CP
Quote:

Finally, is it permissible to create a second "test" board that only I have access to so I can test mods before making them live? It's not your competence in creating the mods that concerns me, only my own ability to impliment them. ;)
yes, you can have one, but it must be not available to the public (ie: closed) and it must be named "vbtest," and located on the same server, etc..

ToastBusters 01-14-2005 12:15 AM

[quote]yes, you can have one, but it must be not available to the public (ie: closed) and it must be named "vbtest," and located on the same server, etc..[/quote

I can't imagine doing it any other way. :)

Thanks man, just what I wanted to know! I've done extensive hacks on a phpbb before this, but on that software it's just follow the instructions and replace code. I don't think I've ever had to do anything in the control panel.

charlesk 01-16-2005 03:23 PM

Well, I just tested this hack using two different proxies. The first time, it detected the proxy but got the real IP address wrong, and the second time it didn't detect it at all. Any suggestions?

It does seem to be working for some proxies. Install clicked; thanks.

Charles

Delphiprogrammi 01-16-2005 05:08 PM

charlesk ,

that's completely normal anonymous do not pass the variables this hack uses ... that's why it is called "anonymous" for example an anonymous proxy won't pass "HTTP_X_FORWARDED_FOR" <<-- you'll see the anonymous proxy ip here instead.

anyway i'm having a problem with this hack it's operation works fine but if i click the image to get the ipadress vbulletin tells me "couldn't find the phrase "thread_displayproxyip" althrough the phrase is there and i'm sure i didn't make any typos while editing postings.php (phrasetype GLOBAL)

PHP Code:

$postinfo['proxyhost'] = @gethostbyaddr($postinfo['proxyip']);
    if(
$postinfo['proxyip'] !='')
    {
        eval(
print_standard_error('thread_displayproxyip'10));
    } 

attached two images one shows that the hack is working correctly the second image is a little proof the phrase is there now the question is what do i do about it ?

charlesk 01-16-2005 07:42 PM

Delphi: you need to make the phrase a Front End Error phrase rather than a global. That happened to me as well, I hope Paul will fix the instructions.

As for the anon proxy issue... it doesn't seem to even work for AOL proxies, which is unfortunate.

c

Paul M 01-16-2005 07:45 PM

Quote:

Originally Posted by charlesk
Delphi: you need to make the phrase a Front End Error phrase rather than a global. That happened to me as well, I hope Paul will fix the instructions.

Oops, I completely forgot to update them. I'll do it now.

Paul M 01-16-2005 07:50 PM

Quote:

Originally Posted by charlesk
As for the anon proxy issue... it doesn't seem to even work for AOL proxies, which is unfortunate.

Yes, it will only work with proxy servers that actually pass the correct http variables. There is nothing anyone can do about that.

Delphiprogrammi 01-16-2005 08:34 PM

hmmm strange now i'm getting the global variables names as result

IPADDRESS and PROXYIP looks like it passed or something i can't find anything wrong with it :rolleyes:

Paul M 01-16-2005 09:49 PM

Are you sure you have correctly done the edit to init.php and uploaded it ? - this is where those constants are defined.

Delphiprogrammi 01-17-2005 06:11 AM

Quote:

Originally Posted by Paul M
Are you sure you have correctly done the edit to init.php and uploaded it ? - this is where those constants are defined.

i did edited that file but there was a typo :tired: now it works fine i tested it with a normal proxy and with an anonymous one (the hack doesn't detect this type of proxys) but that's normal nothing you or anybody else cando about it

rgds

cyt0plas 02-09-2005 03:50 PM

So what if a regular user sends the X-Forwarded for header, specifying someone else's IP? Can the user avoid bans/etc?

Delphiprogrammi 02-09-2005 03:54 PM

Quote:

Originally Posted by cyt0plas
So what if a regular user sends the X-Forwarded for header, specifying someone else's IP? Can the user avoid bans/etc?

that's impossible unless you "spoof" an ip adress which isn't so easy ...

xheliox 02-12-2005 05:30 PM

Is there any way to ignore reserved private IP ranges? I have several users who show up has having 192.168.x.x or 10.0.x.x as their "real IP".

Great mod, btw.. :)

Paul M 02-12-2005 06:00 PM

Quote:

Originally Posted by xheliox
Is there any way to ignore reserved private IP ranges? I have several users who show up has having 192.168.x.x or 10.0.x.x as their "real IP".

Great mod, btw.. :)

What exactly do you mean by "ignore them" ?

xheliox 02-12-2005 07:05 PM

Quote:

Originally Posted by Paul M
What exactly do you mean by "ignore them" ?

Show the "real IP" as the proxy IP.

Paul M 02-12-2005 07:28 PM

Well I haven't tested it, but this should work ;

Find;
PHP Code:

    $proxyip $iplist[0]; 

Add below it ;
PHP Code:

    if (preg_match("#^(127|10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168|169\.254)\.#"$proxyip)) 

    {
        
$proxyip ''
    } 

Obviously this won't change any existing data.

Edit: Updated for full 172 range and 127 range as per posts below.

xheliox 02-12-2005 07:36 PM

That seemed to do the trick. Thank you kindly.

Any chance you'll be adding that to your next release?

xheliox 02-12-2005 07:40 PM

PS - the range is 172.16.0.0 through 172.31.255.255.. I'm a regex moron, how would I add that range?

preg_match("#^(10|172\.[16-31]|192\.168)\.#", $proxyip))

?

Paul M 02-12-2005 08:35 PM

Quote:

Originally Posted by xheliox
PS - the range is 172.16.0.0 through 172.31.255.255.. I'm a regex moron, how would I add that range?

preg_match("#^(10|172\.[16-31]|192\.168)\.#", $proxyip))

?

I'm not sure that would work - regex gives me headaches - I'll look into it for you.

xheliox 02-12-2005 08:37 PM

Quote:

Originally Posted by Paul M
I'm not sure that would work - regex gives me headaches - I'll look into it for you.

Yeah, my way didn't work at all. It just broke the whole thing. :(

I appreciate it. :)

Paul M 02-12-2005 08:53 PM

Try this;
PHP Code:

if (preg_match("#^(10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\.#"$proxyip)) 

:)

xheliox 02-13-2005 11:44 AM

That seems to work.. I'll keep an eye on it and let you know. Thanks again!

David Bott 02-15-2005 09:17 PM

I was just coming here to post about this same issue. I just had an issue with 127.0.0.1 and also some 10.X.X.X numbers. I do not think the above handles 127's. Somtimes hacks just work too good.

Paul M 02-15-2005 09:58 PM

Quote:

Originally Posted by David Bott
Somtimes hacks just work too good.

No, they work as designed. :)

I have no reason to exclude those addresses, so my hack doesn't. If you don't want them then use the extra code posted above, you can add 127.x.x.x to it easily enough as well.

David Bott 02-16-2005 08:42 AM

Hi Paul...Thanks for the reply. I am sorry to say I am not advanced enough to understand how to add in the 127 range. Can you please be so kind to advise.

Thank you in advance. (Currently dealing with a problem user.)

Paul M 02-16-2005 09:07 AM

Quote:

Originally Posted by David Bott
Hi Paul...Thanks for the reply. I am sorry to say I am not advanced enough to understand how to add in the 127 range. Can you please be so kind to advise.

Sure - I have updated the code in Post 98 for all the changes. :)

David Bott 02-16-2005 09:36 AM

Paul...Here is something for you to REALLY help in this case...

http://www.tcpipguide.com/free/t_IPR...ddresses-3.htm

It lists all the private IP's that could be used. (Not many)

Thank you for the updates!!!!

BTW...I am gussing that if the code finds any of these private IPs, it will just use the reported proxy IP like it did not find anything. (Thus we can choose to block the proxy if need be.)

BTW...Now running on TiVo Community (http://www.tivocommunity.com) and will be at AVS Forum after I convert that. (http://www.avsforum.com)

Paul M 02-16-2005 10:20 AM

Thanks - the only one really relevant in that list that was missing was the DHCP auto range of 169.254.x.x - I have added that.

BTW - you just reminded me to check my old Tivo userid out - I joined in 2002 !

David Bott 02-16-2005 10:24 AM

Great. I updated the code.

Am I right in what I mentioned above? "I am gussing that if the code finds any of these private IPs, it will just use the reported proxy IP like it did not find anything. (Thus we can choose to block the proxy if need be.)"

Paul M 02-16-2005 10:38 AM

Quote:

Originally Posted by David Bott
Am I right in what I mentioned above? "I am gussing that if the code finds any of these private IPs, it will just use the reported proxy IP like it did not find anything. (Thus we can choose to block the proxy if need be.)"

Correct - it will simply treat it as no proxy found - so the "real" IP will be the proxy ip, and be bannable.

The hack code has been updated to include this [optional] change.

David Bott 02-16-2005 11:05 AM

Thanks for the help in this. It should help.

VBUsers 02-26-2005 05:57 AM

i got this when i tried to run the SQL query

PHP Code:

SQL-query

ALTER TABLE post ADD proxyip VARCHAR50 NOT NULL AFTER ipaddress 
MySQL said
:  

#1146 - Table 'smoralo_forum.post' doesn't exist 


why??? can you help?

MickDoneDee 02-26-2005 07:52 AM

ALTER TABLE post ADD proxyip VARCHAR(50) not null AFTER ipaddress;

You forgot to add the semi-colon to the end of the query statement which closes the statement and tells MySQL to execute the statement.

VBUsers 02-26-2005 08:04 AM

Quote:

Originally Posted by MickDoneDee
ALTER TABLE post ADD proxyip VARCHAR(50) not null AFTER ipaddress;

You forgot to add the semi-colon to the end of the query statement which closes the statement and tells MySQL to execute the statement.


i did add it : just like this

Step 1.

Run the following SQL code;

ALTER TABLE post ADD proxyip VARCHAR(50) not null AFTER ipaddress;

Delphiprogrammi 02-26-2005 08:14 AM

Quote:

Originally Posted by lowandloudinc
i did add it : just like this

Step 1.

Run the following SQL code;

ALTER TABLE post ADD proxyip VARCHAR(50) not null AFTER ipaddress;


people,

you are both wrong see the error MySQL is telling you

#1146 - Table 'smoralo_forum.post' doesn't exist

the korrect query becomes

Code:

ALTER TABLE smoralo_forum_post ADD proxyip VARCHAR(50) NOT NULL AFTER ipaddress;

MickDoneDee 02-26-2005 08:18 AM

Do you have a table called post? Are you running the query within vBulletin or phpMyAdmin? You can manually add the proxyip field manually within the post table using phpMyAdmin.

VBUsers 02-26-2005 08:18 AM

Quote:

Originally Posted by Delphiprogrammi
people,

you are both wrong see the error MySQL is telling you

#1146 - Table 'smoralo_forum.post' doesn't exist

the korrect query becomes

Code:

ALTER TABLE smoralo_forum_post ADD proxyip VARCHAR(50) NOT NULL AFTER ipaddress;

it didnt work either

SQL-query:

ALTER TABLE smoralo_forum_post ADD proxyip VARCHAR( 50 ) NOT NULL AFTER ipaddress
MySQL said:

#1146 - Table 'smoralo_forum.smoralo_forum_post' doesn't exist

VBUsers 02-26-2005 08:24 AM

Quote:

Originally Posted by MickDoneDee
Do you have a table called post? Are you running the query within vBulletin or phpMyAdmin? You can manually add the proxip field manually within the post table using phpMyAdmin.

im using phpmyadmin and im using the run SQL query where it asks you to drop in the text to create a table. ive done this before but i dont see the smoralo_forum_post.



theres a smora_post and smora_forum. wich one do i need to do it in?

all my tables are smora_something.


All times are GMT. The time now is 09:54 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.01366 seconds
  • Memory Usage 1,852KB
  • 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_code_printable
  • (9)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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