Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
EPC Log-in Detector Details »»
EPC Log-in Detector
Version: 1.00, by blogtorank blogtorank is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.8 Rating:
Released: 09-05-2007 Last Update: 09-05-2007 Installs: 28
Code Changes  
No support by the author.

EPC Log-in Detector

Description:


ALL Admins will be notified of who tried to attempt successfully and not successfully to login to your forums and admincp. As this will notify ALL the admins of the offending or not offending person's username used and their IP.

Simple modification and thought we would share this file edit with the rest if they wanted to use this. Here is an example e-mail with the following:
Quote:
from Testing
to
date Sep 5, 2007 9:43 PM
subject Bad login
mailed-by
'theirip' was found trying to login to the account admin. Please investigate this as soon as you can
Edits to be made:

***Warning: Before you make edits, do a back of the following files before commencing:

PHP Code:
/includes/functions_login.php
/login.php 
PHP Code:
go to /includes/functions_login.php:

Find:

        if ((
$strikes_user['strikes'] % == 0) AND $user $vbulletin->db->query_first("SELECT userid, username, email, languageid FROM " TABLE_PREFIX "user WHERE username = '" $vbulletin->db->escape_string($username) . "' AND usergroupid <> 3"))
        { 
// they've got it wrong 5 times for this user lets email them
            
$ip IPADDRESS;
            eval(
fetch_email_phrases('accountlocked'$user['languageid']));
            
vbmail($user['email'], $subject$messagetrue);

Add Under:

///code added by EPC Login Detector
$ip IPADDRESS;
$subject="Bad login -  5 tries";
$message="'$ip' was found trying to login to the account  ".$vbulletin->GPC['vb_login_username']." and was blocked. Please investigate  this as soon as you can.";
$admin =  $vbulletin->db->query_read_slave("SELECT * FROM `user` WHERE `usertitle` =  'Administrator' limit 0,3000");
while (
$item =  $vbulletin->db->fetch_array($admin)) {
vbmail($item['email'], $subject,  $messagetrue);
}
//code end by EPC Login Detector 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

go to /login.php

Find
:

    if (!
verify_authentication($vbulletin->GPC['vb_login_username'], $vbulletin->GPC['vb_login_password'], $vbulletin->GPC['vb_login_md5password'], $vbulletin->GPC['vb_login_md5password_utf'], $vbulletin->GPC['cookieuser'], true))
    {

 
Add under:

        
///code added by EPC Login Detector
        
$ip IPADDRESS;
           
$subject="Bad login";
        
$message="'$ip' was found trying to login to the account ".$vbulletin->GPC['vb_login_username'].". Please investigate this as soon as you can.";
        
$admin $vbulletin->db->query_read_slave("SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000");
        while (
$item $db->fetch_array($admin)) {
          
vbmail($item['email'], $subject$messagetrue);
        }
        
//code end by EPC Login Detector    

 
Find:

            
// log this error if attempting to access the control panel
            
require_once(DIR '/includes/functions_log_error.php');
            
log_vbulletin_error($vbulletin->GPC['vb_login_username'], 'security');

 
Add under:

        
///code added by EPC Login Detector
        
$ip IPADDRESS;
           
$subject="ADMIN AREA: Bad login";
        
$message="'$ip' was found trying to login to the account ".$vbulletin->GPC['vb_login_username'].". Please investigate this as soon as you can.";
        
$admin $vbulletin->db->query_read_slave("SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000");
        while (
$item $db->fetch_array($admin)) {
          
vbmail($item['email'], $subject$messagetrue);
        }
        
//code end EPC Login Detector

 
Find:

        
$vbulletin->userinfo $original_userinfo;

        if (
$vbulletin->options['usestrikesystem'])
        {
            eval(
standard_error(fetch_error('badlogin_strikes'$vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes)));
        }
        else
        {
            eval(
standard_error(fetch_error('badlogin'$vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'])));
        }

    }

 
Add under:

    
///code added by EPC Login Detector
        
$ip IPADDRESS;
           
$subject="Successeful login";
        
$message="'$ip' logged into the account ".$vbulletin->GPC['vb_login_username'].". Please investigate this as soon as you can.";
        
$admin $vbulletin->db->query_read_slave("SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000");
        while (
$item $db->fetch_array($admin)) {
          
vbmail($item['email'], $subject$messagetrue);
        }
   
//code end EPC Login Detector 
That's it!

Summary:

This is only for the ones that want to be notified when there is a unsuccessful login to their forums and to notify the admins. Just a thing we "feel" that vBulletin should implement within their core due to security reasons for forums. It would benefit on seeing who and what is happening for a forums when there is an attempted breach of security of the forums. So whomever had more ideas on how to expand this feel free to update here with ideas or share code of making this better!

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-06-2007, 09:31 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cybertims View Post
One thing you should mention though, it seems this will only send an email if your user tite is Administrator, coud you not have it send the email to all in the admin usergroup?

What if the admin has changed his usertitle?

Cheers
In this case I use the Admin usergroupid

Find:
Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000");
Replace with:
Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usergroupid` = '6' limit 0,3000");

But wait.. wanna limit only to your Admin account and not to some other admins..
Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usergroupid` = '6' AND `username` = 'yourADMINusername' limit 0,3000");
Have fun...
Reply With Quote
  #13  
Old 09-06-2007, 08:48 PM
WarLion's Avatar
WarLion WarLion is offline
 
Join Date: Jun 2006
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by valdet View Post
In this case I use the Admin usergroupid

Find:


Replace with:



But wait.. wanna limit only to your Admin account and not to some other admins..


Have fun...
ooooooooo meaby this is my problem cuz i have custom user title i will try one more time thaanks for this

edit:
that was my problem now i recive all the types of message i guess you need to change your code with usergroupid insted administratos and will work for all kind thank you so much
Reply With Quote
  #14  
Old 09-07-2007, 12:40 PM
Dr.NoTime Dr.NoTime is offline
 
Join Date: Nov 2006
Location: Johnson City,TN
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Nice mod, thanks.

Question. Can I modify it to only notify if someone logs in unsuccessfully?
Reply With Quote
  #15  
Old 09-07-2007, 02:52 PM
apiasto's Avatar
apiasto apiasto is offline
 
Join Date: Oct 2006
Posts: 348
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice idea, will it work on 3.6.7
Reply With Quote
  #16  
Old 09-07-2007, 04:06 PM
Fraxter Fraxter is offline
 
Join Date: Jul 2007
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I become an error if i want log in in my acp:

Quote:
Datenbankfehler in vBulletin 3.6.8:

Invalid SQL:
SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000;

MySQL-Fehler : Table 'dax0801.user' doesn't exist
Fehler-Nr. : 1146
Datum : Friday, September 7th 2007 @ 05:05:57 PM
Skript : http://xxx/login.php
Referrer : http://xxx/admincp/index.php
IP-Adresse : xxx
Benutzername : xxx
Klassenname : vB_Database
Can anyone help me with my problem?
Reply With Quote
  #17  
Old 09-07-2007, 06:37 PM
C_P's Avatar
C_P C_P is offline
 
Join Date: Sep 2004
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I selected Installed only after adding valdet's code suggestion that works great! SMF has a similar mod built in to their admin CP which is a great feature.
This is nice as well.

Find:

Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usertitle` = 'Administrator' limit 0,3000");
Replace with:

Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usergroupid` = '6' limit 0,3000");

Also, SERIOUSLY consider this addition unless your other admins do not care to get all of these emails.
But wait.. wanna limit only to your Admin account and not to some other admins..
Quote:
>query_read_slave("SELECT * FROM `user` WHERE `usergroupid` = '6' AND `username` = 'yourADMINusername' limit 0,3000");
Reply With Quote
  #18  
Old 09-08-2007, 11:10 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pander23 View Post
I become an error if i want log in in my acp:



Can anyone help me with my problem?
That is because your usergroup title for Administrator is probably different. Check the workaround couple of posts above and that should work..

All credits go out to blogtorank for this great idea, and you are free to add my suggestion to your original hack.

Thanks, Val.
Reply With Quote
  #19  
Old 10-05-2007, 07:37 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Typo: Successeful login
should be: Successful login

Also, is there anyway to stop it from sending e-mail to me when I login from a certain IP address? I hate getting e-mails each time I login, and would only like to recieve them if someone rather than myself logs in
Reply With Quote
  #20  
Old 10-12-2007, 12:17 PM
Iskib Iskib is offline
 
Join Date: May 2006
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

--------------------------------------------------------------------------------

I purchased the full version of another one of this guys products. It has been 5 days and still not able to download it. They have asked for information which I have sent and still the file is not there to download.

I have sent 3 support tickets with no response.

************WARNING**************

STAY AWAY
Reply With Quote
  #21  
Old 10-17-2007, 08:42 AM
SuperTaz's Avatar
SuperTaz SuperTaz is offline
 
Join Date: Apr 2007
Location: Pennsylvania
Posts: 744
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you make it so that regular users can not log into the ModCP as well as the AdminCP? If someone does, that does not have the permissions for either one, a pm or thread will be created to notify all admins and moderators.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04712 seconds
  • Memory Usage 2,364KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete