Jump to content
MakeWebGames

Recommended Posts

Posted

Securing game

I Haave just started to learn how to secure before about 2 Houers from now. And i was just wondering was all this right.

Its what im think will this secure it? But i need help from masters so tell me any problems. =D

 

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

in login register header authenticate.php

And replace with

$IP = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);

 

Cmarket.php

Normal:

<?php
include "globals.php";

 

Secured i think?

<?php
$_GET['ID'] = abs(@intval($_GET['ID']));
include "globals.php";

 

Tell me if anythink is wrong.

Thanks Rasheed Saeed. :D

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

The IP address is normally inserted into the database - users table, lastip* column.

It's a string that can be changed by the user who knows what they're doing.

Escaping the incoming data would be a good practice ;)

* = lastip, lastip_login, lastip_signup

Posted

Rasheed, it's a good start and be positive about this :). Though you still got a lot to learn, remember copy pasting bits of code into pages will not secure your game to a preferable extent. I'm no master but i do know you got to secure data which is inputted and outputted, becuase if not then your leaving your game open to lots of vulnerabilites by which the bad users can take control of the game and perform actions which will have a negative impact on your project.

Posted

No, most important part is securing the INPUT and OUTPUT on every page

Making sure info into the database is safe, then checking it on output to the page making sure it's safe.

:P

Posted
No, most important part is securing the INPUT and OUTPUT on every page

Making sure info into the database is safe, then checking it on output to the page making sure it's safe.

:P

Every page? LOL

Didn't know i had to secure every file :P

Posted

neither did you till someone told you, Who cares it's a filter FFS do it manually it's much easier and at least you know what your doing, what exactly does %u do? Google time kiddies :)

if your going to do something like

$var = '231'; // doesn't have to be a set var i just thought i'd set one
$var = ( isset($var) AND ctype_digit($var) ) ? $var : '' ; // check it
if ( empty($var) ) {
echo 'error'; // error
} else {
echo '$var'; // could be anything here from echo's to mysql queries
}

 

So are you going to use your "new found" way or stick to the longer but most understanding way, Bet most people never even knew SprintF was a filter (notice the F in sprintF, printF, vsprintF).

Posted
er file page you know what i meant.

 

I dont wanna hear it from you, you didnt know that %u / %s %d do not NEED sprintf to operate ^_^

LMFAOOOO!

Here from me? Why are you on theses forums then? I've been on this forum for alot longer than most people on here.

 

you didnt know that %u / %s %d do not NEED sprintf to operate ^_^

LMFAO!

Wow, i think you need to go back to the manual, because mysql_query() only takes two [2] parameter's. N00B!

And even if you did try it, it will error.. something like "Wrong parameter count for mysql_query()..."

So, get your fact's right before you think your clever enough.

I'll even be kind even linking you to the manual: http://php.net/mysql_query

:D

Posted
Yes, you've been hacking and manipulating people the longest out of anyone, congratulations!

If it didnt work, then why is it working on my queries?

post a example query ill take a look, i never tried MySQL but im sure it's not possible.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...