Page Index Toggle Pages: [1] 2 
Topic Tools
Very Hot Topic (More than 25 Replies) [Minor] Admin: add IP to registration log (Read 13,282 times)
cepheid
Senior Member
****
Offline



Posts: 516
[Minor] Admin: add IP to registration log
May 20th, 2009 at 5:12am
Post Tools
This feature request is primarily for combating spambots or other abusive users: in the Registration Log (in Admin Center), I would like to see the user's IP.  Actually, I'd like to see 2 IPs: the one used while registering, and the one used while activating, if the two IPs are different.

The reason I'm asking for this is that spammers often use multiple IPs for registration, activation, and for subsequent spam posting.  I can easily see the IP used while posting, since it's shown in the topic summary, so it's easy to ban that IP or subnet... but to find the IP used for registration and/or activation, I have to dig around in my Apache logs, so that's much more difficult.

Since there's a "status" column there already, it'd be great if we could populate it with those IPs.
« Last Edit: Mar 25th, 2010 at 2:20am by »  
Back to top
WWW  
IP Logged
 
Karen England
YaBB Newcomer
*
Offline



Posts: 16
Location: Carlisle United Kingdom
Re: Admin: add IP to registration log
Reply #1 - May 24th, 2009 at 10:10am
Post Tools
I agree.. This would allow us to check the IP address and ban  before the forum spammer can place a posting and help fight the fight.
  
Back to top
 
IP Logged
 
OH Eng
Past Team Members
Documentation Team
Offline



Posts: 4,026
Location: Pensacola, Florida USA
Re: Admin: add IP to registration log
Reply #2 - May 24th, 2009 at 2:12pm
Post Tools
Does that mean you'd ban every AOL user?  Their IP numbers change on the fly.. in mid session, beyond their control.  Anyone on a host that used DHCP will also have the potential to have a different IP than what they registered with.

Not suggesting the feature isn't of use, it certainly would be nice to have the current IP, just that it isn't going to as easy as seeing two different numbers and using that as a decision to ban members or not.

  

 
Back to top
 
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,903
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: Admin: add IP to registration log
Reply #3 - May 24th, 2009 at 4:35pm
Post Tools
A few more thoughts along that line.

Some of us travel a lot and/or have work & home computers, or, like me, are professional geeks who may have multiple IP circuits in the same location, and where I am coming from depends on where I am sitting when I look at Yabb.


It might be a thought to let the Guardian interact with some of the backlisting services like mailservers do.

Also maybe a form of greylisting to dodge openrelay spammers. Requiring validation would seem to get around the latter. 


I AM FOR SURE AN ANTI-SPAMMER

and I actually like a slice of REAL Spam here and there (Good fried with eggs once in awhile)  Wink

Smiley
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #4 - May 24th, 2009 at 9:37pm
Post Tools
OH Eng wrote on May 24th, 2009 at 2:12pm:
Does that mean you'd ban every AOL user?

Absolutely not... this would not be because I want to ban anyone whose IP changes.  This would be so that when I find a spambot to ban, it's easier to discover what IP they used to register, rather than having to manually parse my apache logs.

I would never use such silly criteria to ban a user... this is for making my life easier during the actual banning process.

I am also in no way suggesting that this be automated... this is just providing an info field so I don't have to dig in my apache logs after finding a known spambot.
  
Back to top
WWW  
IP Logged
 
OH Eng
Past Team Members
Documentation Team
Offline



Posts: 4,026
Location: Pensacola, Florida USA
Re: Admin: add IP to registration log
Reply #5 - May 25th, 2009 at 7:15am
Post Tools
Okay, cepheid, I'm just checking to see what the intent is.  Reason I ask is it HAS been suggested before, where a changed IP would signal some kind of alert or even to automate it in a banning process, so I wanted to be sure what you meant. 

I see exactly what you mean about saving the Apache log search.  Good idea!

  

 
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #6 - Jun 26th, 2009 at 10:21am
Post Tools
I've gone ahead and coded this up.  The patch file linked below modifies Admin/RegistrationLog.pl (for viewing) and Sources/Register.pl (for registering/activating).  When a user registers and/or activates an account, his IP is now recorded in the registration log.  The IP is not recorded if activation is performed by an admin.  If present, the IP is displayed in the Status column when viewing the Log.

The patch is at:
http://dev.3phase.com/yabb/regip.patch

The screenshot below shows what the modification looks like.  I also added another minor mod to omit attempting to link to a deleted member, and instead putting a "deleted" message.  This only happens for admin-approved entries, because those are the only ones where the link is ever placed.  This last piece is primarily a cosmetic fix.
  

yabb_regip.png ( 52 KB | 262 Downloads )
yabb_regip.png
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Admin: add IP to registration log
Reply #7 - Jun 26th, 2009 at 5:24pm
Post Tools
Added code to SVN.

I modified your code a bit because you added English language text into the code, but we have a multi-language forum software, so you MUST always search for an existing or add a new language variable!

I also added the ip to the other entrys in the log-file, like errors and also if admin or gmod adds this user.
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #8 - Jun 26th, 2009 at 6:57pm
Post Tools
deti wrote on Jun 26th, 2009 at 5:24pm:
I modified your code a bit because you added English language text into the code

Ah, right... oops!  Sorry about that.

deti wrote on Jun 26th, 2009 at 5:24pm:
I also added the ip to the other entrys in the log-file, like errors and also if admin or gmod adds this user.

I left the IP out for admin/gmod because then it would be the admin/gmod's IP, which I figured wasn't important... I guess it doesn't hurt to have it there.

Thanks. Smiley
  
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #9 - Jun 27th, 2009 at 1:06am
Post Tools
deti, if the IP isn't present, you should omit the "IP: " part from the Status column, IMHO... just for cosmetic purposes, and because having the label there without an IP makes it seem like something is broken.  For older log entries, the IP will not always be there.

Also, I noticed that in your edits you did something like:
Code
Select All
(undef, $regstatus, $reguser, undef) = split(/\|/, $_, 4); 


In fact, you don't need to specify the last undef, and you don't even need to tell split to only take the first 4 elements... all of these fail gracefully.  If your receiving array has fewer elements than what split returns, any excess elements are just discarded.  Similarly, if split returns too few elements, then any excess elements in the receiving array remain undefined.

So, you can probably save a tiny bit of code by removing the undef and the extra argument to split, because it works without those.  (I've tested it.)  Thus, you can actually just do:
Code
Select All
(undef, $regstatus, $reguser) = split(/\|/, $_); 


(Actually, you can even omit the $_, since that is the default loop variable anyway!)

(If instead you want to be really strict, then you must actually insert extra code to check if $actid and $ipadd are defined, rather than relying on the fact that undefined variables equate to the empty string... but since you can rely on that fact, which you do later in the code [you check if $actid=='' without checking if it's been defined], you can also rely on split failing gracefully. Smiley)
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Admin: add IP to registration log
Reply #10 - Jun 27th, 2009 at 2:54pm
Post Tools
cepheid wrote on Jun 27th, 2009 at 1:06am:
For older log entries, the IP will not always be there.

I know, but I thought that the users will delete the old log after a while and then this will not be of importance any more. I think backward compatibility is needed in general but here it will not be of that importance.

cepheid wrote on Jun 27th, 2009 at 1:06am:
In fact, you don't need to specify the last undef

You are right, but I am accustomed to do so ... Smiley

cepheid wrote on Jun 27th, 2009 at 1:06am:
and you don't even need to tell split to only take the first 4 elements

I know, but I am accustomed to do so to stop the split process. I thought I will save some processing, at least on longer strings to split.
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #11 - Jun 27th, 2009 at 2:59pm
Post Tools
deti wrote on Jun 27th, 2009 at 2:54pm:
I know, but I am accustomed to do so to stop the split process. I thought I will save some processing, at least on longer strings to split.

It might, not sure.  If you're going to do that, may as well stop it at 3 then, since the 4th item is assigned to undef anyway! Smiley
  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Admin: add IP to registration log
Reply #12 - Jun 27th, 2009 at 3:01pm
Post Tools
cepheid wrote on Jun 27th, 2009 at 2:59pm:
If you're going to do that, may as well stop it at 3 then, since the 4th item is assigned to undef anyway!

No. If you do this, the 3rd will include everything until the end of the string! Wink
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Admin: add IP to registration log
Reply #13 - Jun 27th, 2009 at 3:05pm
Post Tools
deti wrote on Jun 27th, 2009 at 3:01pm:
No. If you do this, the 3rd will include everything until the end of the string!

Ahhh, true.  Good point, I forgot about that.  OK, well, do it however you want; I recommend the way I suggested earlier (leave out the undefs and don't bother with the number), but it's not a big deal either way - the performance difference is minimal at best, and either way works. Smiley
  
Back to top
WWW  
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: [Minor] Admin: add IP to registration log
Reply #14 - Apr 9th, 2010 at 4:08pm
Post Tools
New
Admin/RegistrationLog.pl
Sources/Register.pl

in CVS.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top