Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Login log - Log successful login attempts Details »
Login log - Log successful login attempts
Mod Version: 4.1, by Dave (Moderator) Dave is offline
Developer Last Online: Oct 2020 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (5 votes - 4.80 average) Installs: 37
Released: 28 May 2014 Last Update: 16 Jan 2016 Downloads: 244
Supported DB Changes Uses Plugins Re-usable Code External Content  

Hi,

This plugin will allow you to log all successful login attempts of all users.
This can be useful to see if users share their account or if the account of someone got hijacked. Usernames and IP addresses can be clicked.

It will log the following
- Userid
- Username
- IP
- ISP (Internet Service Provider)
- Country
- HTTP user agent

Settings:
- Enable/disable the product.
- Exclude usergroups from being logged.
- Purge the logs.

Picture


Installation
1. Download the .zip file specified.
2. Upload the contents of the upload folder to the root of your forum.
3. Import the product with the .xml file in the import folder.

Note
The script will log using the current time on the server, in case there's a difference between the server time and your local computer time, you can change the offset in the loginlog.php script on line 12.

Also keep in mind that the country and/or ISP resolving might not be 100% accurate and that it might show no value in the logs.

Credits
Telize.com its API is being used to get the ISP and country off the IP address.

Let me know if it works well.


Changelog
11 June 2014 V4: Added the table_prefix global to the login hook.
5 June 2014 V3: Fixed searching only showing the last 25 entries. Pagination will now work as intended.
30 May 2014 V2: Changed hook location, added enable/disable setting and a setting to exclude usergroups.
28 May 2014 V1: Fixed a little mistake with the filter.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	Untitled.jpg
Views:	1218
Size:	87.5 KB
ID:	149210  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 11 Jun 2014, 15:02
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
With the v4 update can now login without error and view the log
but when purging the log it shows error

also when viewing log and filter on "userid" but leave the search term blank
it shows error
Reply With Quote
  #17  
Old 12 Jun 2014, 09:15
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Originally Posted by Bluemax712 View Post
With the v4 update can now login without error and view the log
but when purging the log it shows error

also when viewing log and filter on "userid" but leave the search term blank
it shows error
Could you give me the errors? It's kind of a guess game now? :P
Reply With Quote
  #18  
Old 12 Jun 2014, 13:20
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
When purging the log it doesn't show much even with debugging enabled
=========================================

Database error in vBulletin 4.2.0:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Script : http://.../admincp/loginlog.php?do=purgenow
Referrer : http://.../admincp/loginlog.php?do=purge

Classname : vB_Database
MySQL Version :

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/admincp/loginlog.php on line 41

=========================================
=========================================

Though when filtering on the blank userid it does give this for an error:

Database error in vBulletin 4.2.0:

Invalid SQL:
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.userid = ORDER BY a.id DESC LIMIT 0,25;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY a.id DESC LIMIT 0,25' at line 1
Error Number : 1064

Script : http://.../admincp/loginlog.php?do=&value=&type=1
Referrer : http://.../admincp/loginlog.php?do=&value=192&type=1

Classname : vB_Database
MySQL Version : 5.0.95-log

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/includes/class_core.php on line 459
#2 vB_Database->query_read() called in [path]/admincp/loginlog.php on line 83

============================================

EDIT:
noticed all the other blank queries work but they use "LIKE" instead of "=":

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE b.username LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.ip LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.loginstamp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.isp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.country LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.browser LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

=====================
EDIT2:
When filling in the userid filter with a number it does work though :
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.userid = 1 ORDER BY a.id DESC LIMIT 0,25

Last edited by Bluemax712; 12 Jun 2014 at 14:20. Reason: more info
Reply With Quote
  #19  
Old 12 Jun 2014, 15:29
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Hello, Cloudflare... Is a problem. If i use cloudflare it will display cloudflare IP's. Can you fix this?
Reply With Quote
  #20  
Old 12 Jun 2014, 16:30
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Originally Posted by Bluemax712 View Post
When purging the log it doesn't show much even with debugging enabled
=========================================

Database error in vBulletin 4.2.0:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Script : http://.../admincp/loginlog.php?do=purgenow
Referrer : http://.../admincp/loginlog.php?do=purge

Classname : vB_Database
MySQL Version :

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/admincp/loginlog.php on line 41

=========================================
=========================================

Though when filtering on the blank userid it does give this for an error:

Database error in vBulletin 4.2.0:

Invalid SQL:
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.userid = ORDER BY a.id DESC LIMIT 0,25;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY a.id DESC LIMIT 0,25' at line 1
Error Number : 1064

Script : http://.../admincp/loginlog.php?do=&value=&type=1
Referrer : http://.../admincp/loginlog.php?do=&value=192&type=1

Classname : vB_Database
MySQL Version : 5.0.95-log

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/includes/class_core.php on line 459
#2 vB_Database->query_read() called in [path]/admincp/loginlog.php on line 83

============================================

EDIT:
noticed all the other blank queries work but they use "LIKE" instead of "=":

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE b.username LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.ip LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.loginstamp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.isp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.country LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.browser LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

=====================
EDIT2:
When filling in the userid filter with a number it does work though :
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.userid = 1 ORDER BY a.id DESC LIMIT 0,25
Does your MySQL user have access to the TRUNCATE function?
The query itself is correct to truncate the table.

I will fix the other error if you search for nothing, although it doesn't have any priority.

Originally Posted by EvoDarrenshan View Post
Hello, Cloudflare... Is a problem. If i use cloudflare it will display cloudflare IP's. Can you fix this?
Please refer to https://support.cloudflare.com/hc/en...ith-vBulletin-
Reply With Quote
  #21  
Old 12 Jun 2014, 17:44
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
Originally Posted by Dave View Post
Does your MySQL user have access to the TRUNCATE function?
The query itself is correct to truncate the table.

I will fix the other error if you search for nothing, although it doesn't have any priority.
hmm ... not sure exactly how to check access to the truncate function
but running 'show grants' from the mysql command line for the user says:
GRANT ALL PRIVILEGES ON ...WITH GRANT OPTION

===============================
EDIT
running this manually from command line worked :
TRUNCATE vb_loginlog;

but using the loginlog control panel purge function just gives the first error above - like it's not getting any input

Last edited by Bluemax712; 12 Jun 2014 at 18:04.
Reply With Quote
  #22  
Old 12 Jun 2014, 19:32
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
I changed loginlog.php to use "query_write" vs. "execute_query" and it seems to work now
not sure if this is proper way to use it though ...i'm only a former sysadmin and not much of a programmer

$db->query_write("TRUNCATE TABLE " . TABLE_PREFIX . "loginlog");
Reply With Quote
  #23  
Old 14 Jun 2014, 20:30
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Originally Posted by Bluemax712 View Post
hmm ... not sure exactly how to check access to the truncate function
but running 'show grants' from the mysql command line for the user says:
GRANT ALL PRIVILEGES ON ...WITH GRANT OPTION

===============================
EDIT
running this manually from command line worked :
TRUNCATE vb_loginlog;

but using the loginlog control panel purge function just gives the first error above - like it's not getting any input
Already did that sir, Still shows cloudflare IP's.
Reply With Quote
  #24  
Old 17 Aug 2014, 14:47
Skyrider Skyrider is offline
 
Join Date: Feb 2006
I've altered the loginlog plugin so it logs in mostly all places on the forums (forumhome/forumdisplay), but after a while the loginlog.php is taking ages to load. Is there a way that this system logs on all pages, and "only" logs new information of a user when either the browser OR ip of that user has changed?
Reply With Quote
  #25  
Old 17 Aug 2014, 14:49
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Originally Posted by Skyrider View Post
I've altered the loginlog plugin so it logs in mostly all places on the forums (forumhome/forumdisplay), but after a while the loginlog.php is taking ages to load. Is there a way that this system logs on all pages, and "only" logs new information of a user when either the browser OR ip of that user has changed?
Yea that is possible. A matter of selecting the latest record of the user and compare the IP/browser with the current one, then if there's a mismatch you just log the entry.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.

Last edited by Dave; 17 Aug 2014 at 16:06.
Reply With Quote
  #26  
Old 17 Aug 2014, 15:49
madness85 madness85 is offline
 
Join Date: Jun 2012
Very nice I will be installing

Got some ideas
It would be great if it could detect ip & create a thread.
Auto prune ips would be nice with option how many days it prunes.
Reply With Quote
  #27  
Old 20 Feb 2015, 20:18
X-or X-or is offline
 
Join Date: Nov 2005
I do not trust any external content, can you make a version without it please? Thank you.
Reply With Quote
  #28  
Old 21 Feb 2015, 11:11
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Originally Posted by X-or View Post
I do not trust any external content, can you make a version without it please? Thank you.
It makes a call to a third party API to get certain information about the IP address such as the ISP/country, etc. I'm not going to make it dependent of nginx/Apache modules so sorry, it will remain as it is. But really, it's no big deal.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #29  
Old 24 Feb 2015, 00:25
X-or X-or is offline
 
Join Date: Nov 2005
Most of the time, it may not be big deal indeed, but it's a different story on privacy aware websites. That would violate our current privacy policy.
Reply With Quote
  #30  
Old 24 Feb 2015, 09:20
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Originally Posted by X-or View Post
Most of the time, it may not be big deal indeed, but it's a different story on privacy aware websites. That would violate our current privacy policy.
The API I use is open-source so you could simply integrate it on your own server and change the API URL I call in the script to your own local URL. https://github.com/fcambus/telize
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:28.

Layout Options | Width: Wide Color: