Game Source Zone Forum
September 03, 2010, 05:25:14 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: TBAB Top Games Forum Reopened - 03/21/2009
 
   Home   Help Arcade Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Replacement  (Read 139 times)
M5K
Administrator
New Member
*****

Karma: +1/-0
Posts: 18



View Profile
« on: December 25, 2009, 05:22:15 PM »

In mc code any place that has this code<br>
Code:
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])

    ?  $_SERVER['HTTP_X_FORWARDED_FOR']

    :  $_SERVER['REMOTE_ADDR'];

should be replaced with this
Code:
$ip=$_SERVER['REMOTE_ADDR'];
The original code (posted first) can cause errors in ip logging which makes you less able to maintain your games security.
Logged
Wickidnezz
New Member
*

Karma: +1/-0
Posts: 2


View Profile
« Reply #1 on: January 24, 2010, 10:02:37 PM »

In mc code any place that has this code<br>
Code:
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])

    ?  $_SERVER['HTTP_X_FORWARDED_FOR']

    :  $_SERVER['REMOTE_ADDR'];

should be replaced with this
Code:
$ip=$_SERVER['REMOTE_ADDR'];
The original code (posted first) can cause errors in ip logging which makes you less able to maintain your games security.

thats helpful but sadly i wouldnt use that method hehe

but eh lets go threw it all

as standard mccodes it would look like this

Code:
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
    ?  $_SERVER['HTTP_X_FORWARDED_FOR']
    :  $_SERVER['REMOTE_ADDR'];

and needs changed in the following files i have listed below

header.php
login.php
register.php
forums.php
global_func
authenticate.php

also here is another way other then using

Code:
$ip=$_SERVER['REMOTE_ADDR'];

or you can use

Code:
$IP = $_SERVER['REMOTE_ADDR'];
$IP=addslashes($IP);
$IP=mysql_real_escape_string($IP);
$IP=strip_tags($IP);

which of both are going to prevent users from performing a hack known as the "IP Hack"

also reason why

Code:
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
    ?  $_SERVER['HTTP_X_FORWARDED_FOR']
    :  $_SERVER['REMOTE_ADDR'];

allows people to perform the IP Hack is because of the firefox addon called X-Forwarded-For Spoofer 1.0.2  is basically being called upon when you insert something like
Code:
hi', user_level='2
which on most mccode games the admin level is 2  so when they insert this into the addon it makes them admin



« Last Edit: January 24, 2010, 10:07:06 PM by Wickidnezz » Logged
M5K
Administrator
New Member
*****

Karma: +1/-0
Posts: 18



View Profile
« Reply #2 on: February 25, 2010, 11:59:49 PM »

A good and valid point Wickidnezz. always good to see someone add to something perhaps it will get a good discussion going.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!