Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm) v2.6.x
Author Message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Tue Aug 06, 2013 2:44 am Reply with quote

My ISP has switched for some days my internet connection from ipv4 to the new ipv6. Since then, on some pages I have the problem that my IP is no longer recognized.

Code:
You have attempted to access this site with an invalid IP.

Be SURE to include the following information in any email!
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Remote Address: none
Client IP: none
Forwarded For: none


I have found here in the forums some old threads about this issue with ipv6:
[ Only registered users can see links on this board! Get registered or login! ]

Is it true that a server that was converted to ipv6 recognizes only this format and no longer the ipv4? My own server runs with ipv4 (ipv6 is disabled) and there i get for sure a ipv4 result with $_SERVER['REMOTE_ADDR']. But on a other server is ipv6 enabled there i get only my ipv6 ip but the sentinel blocks there my connection with a "invalid IP" warning.

So now is my question, is it really an issue of the Sentinel and if yes, how i can fix it?

_________________
Github: RavenNuke 
View user's profile Send private message
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Wed Aug 07, 2013 2:46 pm Reply with quote

I admit i never investigated, but if sentinel makes a problem of the ipv6 address , then sentinel checks the ipv4 address in a particular string, what at the end makes sense it gives a failure with the ipv6 address.
It is also true when a server is fully configured to ipv6, it will give trouble to the client.

Read: [ Only registered users can see links on this board! Get registered or login! ]

But from what i have seen and hear, i understood that most servers and clients support both.
I'm sure you came across the line: ipv6 ready , sometimes.
It isn't an answer to your question.
But i support the idea of let it investigate.
 
View user's profile Send private message Send e-mail
neralex







PostPosted: Wed Aug 07, 2013 4:44 pm Reply with quote

My own experience: If you have a client connection based on IPV6 and the server is configured to IPV6, then the server returns everytime the IPV6 format if you set an echo on $_SERVER['REMOTE_ADDR'].
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Aug 17, 2013 9:45 am Reply with quote

neralex, you could try replace these line in nukesentinel.php (lines 53-61)
Code:


if(!preg_match(REGEX_IPV4, $nsnst_const['server_ip'])) { $nsnst_const['server_ip'] = 'none'; }
$nsnst_const['client_ip'] = get_client_ip();
if(!preg_match(REGEX_IPV4, $nsnst_const['client_ip'])) { $nsnst_const['client_ip'] = 'none'; }
$nsnst_const['forward_ip'] = get_x_forwarded();
if(!preg_match(REGEX_IPV4, $nsnst_const['forward_ip'])) { $nsnst_const['forward_ip'] = 'none'; }
$nsnst_const['remote_addr'] = get_remote_addr();
if(!preg_match(REGEX_IPV4, $nsnst_const['remote_addr'])) { $nsnst_const['remote_addr'] = 'none'; }
$nsnst_const['remote_ip'] = get_ip();
if(!preg_match(REGEX_IPV4, $nsnst_const['remote_ip'])) { $nsnst_const['remote_ip'] = "none"; }

With this:
Code:


if (!filter_var($nsnst_const['server_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['server_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['server_ip'] = 'none'; }
$nsnst_const['client_ip'] = get_client_ip();
if (!filter_var($nsnst_const['client_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['client_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['client_ip'] = 'none'; }
$nsnst_const['forward_ip'] = get_x_forwarded();
if (!filter_var($nsnst_const['forward_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['forward_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['forward_ip'] = 'none'; }
$nsnst_const['remote_addr'] = get_remote_addr();
if (!filter_var($nsnst_const['remote_addr'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['remote_addr'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['remote_addr'] = 'none'; }
$nsnst_const['remote_ip'] = get_ip();
if (!filter_var($nsnst_const['remote_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['remote_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['remote_ip'] = "none"; }


I did not test this as I do not have the proper environment.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
neralex







PostPosted: Mon Aug 26, 2013 3:22 pm Reply with quote

Thanks. I will check it in the next days with a fresh install of RN251.


Last edited by neralex on Wed Aug 28, 2013 7:20 am; edited 1 time in total 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Tue Aug 27, 2013 5:39 am Reply with quote

Sorry but this trick do not work Palbin. I got this message

Code:
Be SURE to include the following information in any email!

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
Remote Address: none
Client IP: none
Forwarded For: none
PLEASE: bear in mind that even if you have done nothing wrong, you may be getting this page due to someone's misuse of the site in your ip range
 
View user's profile Send private message
neralex







PostPosted: Wed Aug 28, 2013 7:20 am Reply with quote

hicuxunicorniobestbuildpc, do you have a ipv6 ip from your ISP and runs your server with ipv6?
 
hicuxunicorniobestbuildpc







PostPosted: Thu Aug 29, 2013 7:59 am Reply with quote

I guess not otherwise I won't be able to get that message right?
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm) v2.6.x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©