reg_ip question

Advertise a phpBB hack or request help with an existing one.

Moderator: TerraFrost

reg_ip question

Postby Myrlin » Mon Feb 13, 2006 1:49 am

the reg_ip info is stored in the database in a hash.

One of the uses of this is to enable the board admin to see if users are just creating numerous email accounts to enable them to create numerous accounts on the board.

This is not usually a large problem. Mostly you get the real pests doing it.

Is there a way to limit the number of accounts created from the same ip address by checking for something like the number of entries in that field that match the new registration and denying a new registration because a preset number has been reached?
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

Postby TerraFrost » Tue Feb 14, 2006 5:32 am

There's not a MOD to do that, yet. I'll see if I can whip something up tomorrow, though :)
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Postby Myrlin » Tue Feb 14, 2006 6:05 am

Thank You.

BTW: is there a nice little script to decipher the hash into a readable address? Without having to go to the ACP to look at each one?
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

Postby Myrlin » Tue Feb 21, 2006 8:12 pm

Getting anywhere on this?
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

Postby TerraFrost » Wed Feb 22, 2006 12:02 am

Err... sorry. I completly forgot :(

I'll try to look into it when I get home :)
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Postby TerraFrost » Wed Feb 22, 2006 4:38 am

Try this:

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
#
#-----[ BEFORE, ADD ]-----------------------------------
#
if ( $mode == 'register' && !$userdata['session_logged_in'] )
{
   $sql = 'SELECT COUNT(*) AS regip_count
      FROM ' . USERS_TABLE . "
      WHERE user_regip = '" . $userdata['session_ip'] . "'";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query user_regip information', '', __LINE__, __FILE__, $sql);
   }
   $row = $db->sql_fetchrow($result);

   if ( $row['regip_count'] >= 3)
   {
      message_die(GENERAL_MESSAGE,'Registration attempt blocked.<br />You\'ve already registered to many times');
   }
}

By default, it prevents people from registering 3+ times from the same IP address.
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Postby Myrlin » Sun Mar 19, 2006 4:51 am

Is there a reason that the ip is stored as a hash in the regip field?

It is a pain to do an analysis of the ip addresses without being able to easily read and sort the addresses.

Do you have or know of a script to bring up a list of readable ip addresses sorted in ascending order.

That would give you a quick way to review them.
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

Postby TerraFrost » Mon Mar 20, 2006 1:52 am

I can try to write one within the next few days (I may, like last time, though, need to be reminded, heh).

As for why "hashes" of them are stored... that's the way phpBB does it, already. Eight hexadecimal characters (all encoded IP addresses in phpBB's thing are like that; in reality, it's four bytes, for IPv4) are smaller to store than 12 numbers and three dots (with 255.255.255.255 being the worst-case thing).

It's also, I imagine, easier to sort / search IP addresses when they're encoded as hexadecimal stuff (or raw binary) than it would be to search / sort stuff that is of the form 255.255.255.255.
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am

Postby Myrlin » Tue Mar 21, 2006 6:39 am

Ok Now at least I can understand the "why" of the hashing.....lol

As far as a script goes...anything you can develop that would enable me to pull up a list showing a readable ip address in the "quad" format and showing the username, user_id and email address related to each one would be MOST appreciated. Preferably sorted in ascending order from the regip field.

If you REALLY want to get fancy you could make it a script that sorts by selected field. I know, DONT push my luck eh?....lol
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

ummmm "Reminder"....lol

Postby Myrlin » Mon Mar 27, 2006 4:30 am

[quote="TerraFrost"]I can try to write one within the next few days (I may, like last time, though, need to be reminded, heh).

quote]
User avatar
Myrlin
Traveler
 
Posts: 7
Joined: Wed Feb 08, 2006 10:32 pm

Postby TerraFrost » Mon Mar 27, 2006 8:57 pm

Looking at mods to this mod that other people have written...

maybe this does what you want?:

http://www.phpbb.com/phpBB/viewtopic.ph ... 71#1705271

Alternatively, it might not be a bad idea to install the Admin Userlist MOD:

http://www.phpbb.com/phpBB/viewtopic.php?t=117359

once that's installed, the following will allow you to sort by registration IP addresses:

http://www.phpbb.com/phpBB/viewtopic.ph ... 46#1558346

If none of these do what you want, let me know.
TerraFrost
Legendary Guard
 
Posts: 12357
Joined: Wed Dec 04, 2002 6:37 am


Return to phpBB Hacks and MODs

Who is online

Users browsing this forum: No registered users and 1 guest

cron