vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Email notification if someone attempts to access your Admin CP (https://vborg.vbsupport.ru/showthread.php?t=64519)

EvilLS1 04-28-2004 10:00 PM

Email notification if someone attempts to access your Admin CP
 
This is my version of the hack that Firefly released for VB2.

VB3's standard log of failed admincp login attempts is a nice feature.. but since you get no instant notification, by the time you check the log it could be too late. Also, the log doesn't show which passwords the potential intruder is trying... If someone is close to guessing my password I wanna know about it!

What does it do? With this hack, when someone tries to login to your admincp or modcp you'll get an email that contains the username they tried, the password they tried, their ip address, hostname, # of strikes, referer, script, and the date & time of the attempt.

It will look something like this:

Quote:

--------------------------------------------------
WARNING: Failed admin logon in vBulletin 3.0.1
--------------------------------------------------
Someone is trying to login to your Admin CP!

Username tried: JimbobJoe
Password tried: aCcEsS
IP Address: 67.13.27.156
Host: asd691917124.whatever.com
Strikes: 1/5
Referer: http://www.yoursite.com/forums/admincp/
Script: http://www.yoursite.com/forums/login.php
Date: Wednesday 28th of April 2004 07:50:02 AM
--------------------------------------------------
If the person who is attempting to access your CP happens to be registered & logged in, this line will also be included in the email:
Quote:

vBulletin has identified this user as: (intruder's real username here)
(Thanks to AlexanderT for the idea for this addon.)


Update (1-4-05): A couple of users have expressed concern about this mod sending a plaintext password over http for all logins. This update (v1.1) addresses that concern by only sending the password for cplogins. To update just re-do the first step in the instructions for your vbulletin version (the first edit to adminfunctions.php). Or if you'd prefer that the attempted password not be sent at all simply skip the edits to adminfunctions.php.

If you don't recieve an email when testing, make sure you have the webmaster email set in the admincp (vBulletin Options + Site Name / URL / Contact Details). Also, sometimes it takes a while for the email to arrive. So give it plenty of time before screaming "it doesn't work".. ;)

Still not working? Read this!

Credits: Thanks to the original creator of this hack (Chen) for the idea, and thanks to Boofo for helping me test it. :)

Boofo 04-29-2004 07:04 AM

Installed and working like a champ! Good one, buddy! ;)

Phalynx 04-29-2004 07:09 AM

*Clicked Install*

insanctus 04-29-2004 07:16 AM

I will have to use this one , /me kicks install

AlexanderT 04-29-2004 07:27 AM

Nice hack. It could be extended by adding the username of the user (in case he was already logged in to the forum before) who tries to login.

KevinUK 04-29-2004 08:06 AM

**Clicks Install**

Excellent hack, EvilLS1

Kevin

SnowBot 04-29-2004 08:11 AM

Quote:

Originally Posted by AlexanderT
Nice hack. It could be extended by adding the username of the user (in case he was already logged in to the forum before) who tries to login.

yes thats a great idea :) i will be installing this :)

???`S?LV?R???` 04-29-2004 09:01 AM

great idea, i'll use this (clicks install)

Beermonster 04-29-2004 09:13 AM

cool hack will be installing this one :)

[high]* Beermonster clicks install[/high]

Zelda-King 04-29-2004 03:27 PM

Working fine on 3.0.1. Thanks!

Incendium 04-29-2004 03:33 PM

Nice job. *clicks Install*

mmw 04-29-2004 05:09 PM

Nice hack cheers :)

trekwarfare 04-29-2004 05:15 PM

Nice! Thanks, will be installing this one shortly!

DenzoForums 04-29-2004 06:21 PM

ok.. of course i have to be the idiot that can't get this to work :ermm:

I made the changes exactly as said in the text file. I then attempted to login 2 times with wrong password..

I have waited 10- 15 minutes for the e-mail to showup.. Is this long enough.. or should i wait longer?

With the changes in place.. I am not getting any error messages or anything..

Thanks
Dave

EvilLS1 04-29-2004 08:17 PM

Quote:

Originally Posted by AlexanderT
Nice hack. It could be extended by adding the username of the user (in case he was already logged in to the forum before) who tries to login.

Thats a great idea!

For those who have already installed and want to add this feature..

In login.php find:
Code:

        $iphostname = @gethostbyaddr(IPADDRESS);
Below it add:
Code:

        if ($bbuserinfo[userid]>0)
        {
          $realname = "vBulletin has identified this user as: $bbuserinfo[username] \r\n";
        }

Then find this code (2 places):
Code:

$message="Someone is trying to login to your admincp!\n\n $fusername $fpassword $fipaddress Host: $iphostname\r\n $fstrk $freferer $fscriptpath $fdate";
Replace both instances of the code above with this:
Code:

$message="Someone is trying to login to your admincp!\n\n $fusername $fpassword $fipaddress Host: $iphostname\r\n $fstrk $freferer $fscriptpath $fdate $realname";
I updated the instructions to include this. Thanks to AlexanderT for the idea. :)

aloha 04-29-2004 08:20 PM

Thank you... works like a charm :)

EvilLS1 04-29-2004 08:24 PM

Quote:

Originally Posted by DenzoForums
ok.. of course i have to be the idiot that can't get this to work :ermm:

I made the changes exactly as said in the text file. I then attempted to login 2 times with wrong password..

I have waited 10- 15 minutes for the e-mail to showup.. Is this long enough.. or should i wait longer?

With the changes in place.. I am not getting any error messages or anything..

Thanks
Dave

Hmm.. What version of vb are you using? Heres a few things to try:

Make sure you have the webmasters email set in your admincp (under options).

Make sure you added the last bit of code in the instructions under both places.

Try re-applying all of the code changes in login.php.

Make sure your vbulletin mail system is working (run the test in the admin cp).

Keep in mind, you only get an email when someone tries to login to your admincp or modcp... This has no effect on any of the regular login forms.

SexyGal 04-29-2004 08:54 PM

How do you install hacks?

alkatraz 04-29-2004 08:56 PM

Fantastic idea!! thx

DenzoForums 04-29-2004 09:00 PM

[quoye]Hmm.. What version of vb are you using? Heres a few things to try:

Make sure you have the webmasters email set in your admincp (under options).

Make sure you added the last bit of code in the instructions under both places.

Try re-applying all of the code changes in login.php.

Make sure your vbulletin mail system is working (run the test in the admin cp).

Keep in mind, you only get an email when someone tries to login to your admincp or modcp... This has no effect on any of the regular login forms.[/quote]

see i told you i was an idiot.. i never set the webmasters e-mail address in the control panel. I thought it was referring to the config.php one..

AWESOME!! Love .. thanks!

Dave

EvilLS1 04-29-2004 09:26 PM

Quote:

Originally Posted by SexyGal
How do you install hacks?

How to Install vBulletin Hacks - Guide for Newbies ;)

Zelda-King 04-29-2004 09:37 PM

I'm glad the username thing has been added. It was on the vB2 version.

SnowBot 04-30-2004 01:01 AM

Great, now it shows the registered & logged in part it realy makes it complete :)

Fantastic hack and one that should be a standard vb feature, it adds abit of security to things :) Always a good idea though is to keep changing your password.

SnowBot 04-30-2004 04:12 AM

[high]* SnowBot clicks install. I love the way its done, so easy also.
[/high]

Code:



Someone is trying to login to your admincp!

 

Username tried: biggerboo

Password tried: testing123

IP Address: *.*.*.36

Host: ***-*****.*****.***.net

Strikes: 1/5

Referer: http://www.synergyforums.com/forum/admincp/index.php?

Script: http://www.synergyforums.com/forum/login.php

Date: Friday 30th of April 2004 12:33:11 AM

IP + Host removed.

Ocean 05-04-2004 05:02 PM

I'm having a curious problem trying to get this to work in vB 3.01.


I first tried this on my Test Board - and everything worked fine. I tweaked the email message for spacing - but ultimately, it worked as I wanted it to.

Then I applied the hack to my primary vB site. Everything should be exactly the same. However, I'm having two oddities:


1. The Attempted Password is not shown. The field name shows - but no password is listed.

2. It's not Identifying vB Users at all. This field just doesn't even show up - exactly as if it couldn't tell that anyone was logged in. And yes, I made sure that I was logged in at the time - so it should have listed me.


Any ideas?

Ocean 05-04-2004 05:36 PM

Update - after completely shutting down my browser and going back in - everything works now.

Strange, yes? Perhaps it had something to do with the cookies from the two vB boards (although they did have different prefixes).


As a seperate question, though - since this hack does something extra with the entered password before submitting it through the MD5 Hash - is there any additional security risk? Do normal or AdminCP logins end up with a cleartext copy of the password floating around anywhere?

AlexanderT 05-04-2004 06:31 PM

*install* ;)

EvilLS1 05-04-2004 08:53 PM

Quote:

Originally Posted by Ocean
Update - after completely shutting down my browser and going back in - everything works now.

Strange, yes? Perhaps it had something to do with the cookies from the two vB boards (although they did have different prefixes).


As a seperate question, though - since this hack does something extra with the entered password before submitting it through the MD5 Hash - is there any additional security risk? Do normal or AdminCP logins end up with a cleartext copy of the password floating around anywhere?

Glad you got it working. To answer your question: No, the only place the attempted password gets passed to is the webmaster's email, and even then only if its incorrect. This has no effect on regular logins. :)

Xtreame 05-05-2004 05:46 AM

great hack. *click Install*

Bulent Tekcan 05-05-2004 07:22 AM

My board is 3.0.1 but not working....Everything is OK,webmaster mail is OK but not working...

Anybody send me 2 modified files ?

Thanks

EvilLS1 05-05-2004 08:08 AM

Quote:

Originally Posted by turkeyforum
My board is 3.0.1 but not working....Everything is OK,webmaster mail is OK but not working...

Anybody send me 2 modified files ?

Thanks

In your admin cp under Import & Maintenance click "Diagnostics". Do the email test to verify that your vbmail() function is working. Test it with your webmaster email address.

If it works, make sure you added the last bit of code in the instructions in two places.

If you still don't recieve the failed login email try re-applying all changes to login.php.

Leah 05-06-2004 12:05 AM

Quote:

Originally Posted by EvilLS1
Hmm.. What version of vb are you using? Heres a few things to try:

Make sure you have the webmasters email set in your admincp (under options).

Make sure you added the last bit of code in the instructions under both places.

Try re-applying all of the code changes in login.php.

Make sure your vbulletin mail system is working (run the test in the admin cp).

Keep in mind, you only get an email when someone tries to login to your admincp or modcp... This has no effect on any of the regular login forms.

I've tried this and I don't get any mail either.
Could this be conflicting with another hack or something?

EvilLS1 05-06-2004 12:48 AM

Quote:

Originally Posted by Leah
I've tried this and I don't get any mail either.
Could this be conflicting with another hack or something?

Did you recieve an email when you ran the email test under diagnostics? If so, and you added the code in both places in login.php I can't think of any reason why it wouldn't work for you.

Leah 05-06-2004 12:58 AM

Quote:

Originally Posted by EvilLS1
Did you recieve an email when you ran the email test under diagnostics? If so, and you added the code in both places in login.php I can't think of any reason why it wouldn't work for you.

I got an email when I ran the email test under diagnostics and I've checked the login.php and found the code added properly.

EvilLS1 05-06-2004 01:05 AM

Quote:

Originally Posted by Leah
I got an email when I ran the email test under diagnostics and I've checked the login.php and found the code added properly.

I'm stumped then. This hack uses the same vbmail() function used in all the other features, so it should work. I know this is a long shot, but try closing and re-opening your browser, then go back to your admincp login page and hit your refresh button.. Then try logging in again with an incorrect username or password. If it still doesn't work then I have no idea.

AlexanderT 05-06-2004 07:42 AM

I don't get any email either. EvilLS, are you 100% positive that you are using the proper parameters for vbmail()?

EvilLS1 05-06-2004 09:04 AM

Quote:

Originally Posted by AlexanderT
I don't get any email either. EvilLS, are you 100% positive that you are using the proper parameters for vbmail()?

Yep, because its working fine for me and about 40 other people who have already installed it. I just re-applied the hack again to a fresh login.php from vbulletin 3.0.1 and it worked perfectly. Very strange that its not working for only a few people. Has to be either a vb setting or something blocking it in the email software itself.

Are you by chance using any kind of spam guard for your emails? If so, maybe a combination of words in the warning email is triggering it? Thats all I can think of.

EvilLS1 05-06-2004 09:41 AM

The official "Its not working" check-list.;)

If for some reason you don't get a warning email when testing this hack please carefully read through the checklist below..

1) Log into your Admin CP and click "vbulletin options". From the list click on "Site Name / URL / Contact Details".
Scroll down to where it says "Webmaster's Email" (not Contact Us Link). Make sure that you have entered a valid email address there.

2) In your Admin CP under "Import & Maintenance" click Diagnostics.
In the email testing area enter the same email address that you have as your webmaster's email. Run the email test to verify that your vbulletin email is working properly. If it is, you should recieve an email after running the test.

3) If you're using vB 3.0.1 or earlier make sure that you added the last bit of code from the instructions in two seperate places. Open your edited login.php file and search for this:
Code:

vbmail($vboptions['webmasteremail'], $subject, $message);
Once you've found the first instance of that code, search for the same code again. You should find it twice.

4) This hack has been tested on vBulletin 3.0.1 - 3.0.5. If you're using a different version, open your register.php file and search for "vbmail" (without the quotes).. This is to make sure that the vbmail() function has the same name in your version.

5) Re-apply the file edits to login.php making sure that you follow the instructions carefully.

6) If you're using any kind of spam guard for your emails that blocks junk mail, turn it off (temporarily).

7) Now lets test it again. Close your browser and re-open it again. Go to your forum and click "logout". While still logged out go to yoursite.com/forums/admincp/ and then hit the "refresh" button on your browser. Type in an incorrect password and hit submit.
Now lets test it again while you are logged into the forum but not the admincp. Close your browser & reopen it again. Go to your forums and login with the correct info. Then go back to /forums/admincp/ and your username should already be listed. Type in an incorrect password and hit submit.

Wait 15-25 minutes before checking your email this time (sometimes it takes a while for the mail to be delivered).

Keep in mind, you only get an email when someone tries to login to your admincp or modcp... This has no effect on any of the regular login forms.

If you've carefully checked everything in the list above and it still doesn't work for you then it could be conflicting with another hack that you've installed. Other than that, I have no idea.

Ocean 05-06-2004 01:01 PM

Quote:

Originally Posted by EvilLS1
Wait 15-25 minutes before checking your email this time (sometimes it takes a while for the mail to be delivered).


Actually, what causes it to not be delivered immediately is that when the vbmail function is called - it adds the email to the Queue, rather than sending it out immediately. The queue is triggered by activity on the board (clicking links/buttons/etc...).

So, if you do the test-incorrect-login, and then immediately stop and wait - if there's no one on your board, you're not going to get any email until someone does something on your board. All you have to do is just click on something - anything - and the queue will be processed.


Of course, this assumes that the rest of the checklist items are set correctly - but I thought I might shed some insight as to why it sometimes seems to take forever for someone to get the email. :)

EvilLS1 05-07-2004 04:59 PM

Quote:

Originally Posted by Ocean
Actually, what causes it to not be delivered immediately is that when the vbmail function is called - it adds the email to the Queue, rather than sending it out immediately. The queue is triggered by activity on the board (clicking links/buttons/etc...).

So, if you do the test-incorrect-login, and then immediately stop and wait - if there's no one on your board, you're not going to get any email until someone does something on your board. All you have to do is just click on something - anything - and the queue will be processed.


Of course, this assumes that the rest of the checklist items are set correctly - but I thought I might shed some insight as to why it sometimes seems to take forever for someone to get the email. :)

Hmm.. I wasn't sure if the mail queue effected emails to the webmaster (doesn't seem to on my board). Maybe I should add that one to the checklist. :)


All times are GMT. The time now is 05:47 AM.

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.01633 seconds
  • Memory Usage 1,852KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete