vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Get an e-mail if someone is trying to access your Admin CP (With IP address) (https://vborg.vbsupport.ru/showthread.php?t=32707)

Lethal 04-25-2002 05:08 PM

works great!!! thanks firefly

Airwaves 04-27-2002 06:13 PM

It only sends me mail when someone tries accessing with an Admin user name

normal users and their passwords arent emailed
made up user names and passwords arent emailed either

can this be added in?

Learner29 04-29-2002 07:01 AM

what a cooooooool hack . thank you so much . lol.

GsxrTony 05-01-2002 12:53 PM

[QUOTE]Originally posted by Mutt
firefly, I've added alittle to your hack

Here's the chunk of code that needs to be added to 2 files

PHP Code:

            // email alert
            
$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
            
$iphostname = @gethostbyaddr($ipaddress);
            if (
$HTTP_COOKIE_VARS['bbuserid']) {
                
$realuserid $HTTP_COOKIE_VARS['bbuserid'];
                
$realusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$realuserid'");
                
$MessageAddon .= "\nThier cookie identifys them as ".addslashes($realusername[username]."\n");
            }
            if (
$sessionids=$DB_site->query("SELECT userid FROM session WHERE host='$ipaddress' AND userid>0 GROUP BY userid")) {
                while (
$sessionid $DB_site->fetch_array($sessionids)) {
                    
$realusername=$DB_site->query_first("SELECT username FROM user WHERE userid='$sessionid[userid]'");
                    
$MessageAddon .= "\nSessions identifys them as ".addslashes($realusername[username]);
                }
            }
            
$message="Someone is trying to login to the $bbtitle control panel!\nThe Script was : $PHP_SELF\n\nUsername they tried to use: $loginusername\nPassword they tried to use: $loginpassword (".md5($loginpassword)." in encryption)\n\nThe IP address is: $ipaddress\nThe host is: $iphostname\n\nSearch for members using this ip\n $bburl/admin/user.php?action=doips&s=&ipaddress=$ipaddress\n$MessageAddon";
            
mail($webmasteremail,"Warning: vBulletin Admin Login Attempted",$message,"From: \"$bbtitle Admin CP\" <$webmasteremail>");
            
// email alert 


the first addition is in sessions.php as instructed by firefly

it goes right after

PHP Code:

 if (md5($loginpassword)!=$bbuserinfo[password]) { 



then second additon is in adim/global.php

and it goes right after

PHP Code:

$getperms=$DB_site->query_first("SELECT cancontrolpanel FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND user.userid='$bbuserinfo[userid]'");
if (
$getperms[cancontrolpanel]!=1) { 

now you'll get an email like this



now the email gets sent for any incorect login instead of just ones with a correct username and wrong password. If they are somehow listed in sessions under multiple userids, (logged on and then logged on again under a second account) you'll get them all.

Firefly, thanks for this. I really like it and plan to keept expanding it. Security is key. I have a bunch of jerkoffs at my Stern site and have been pushing off upgrading it to VB until I had lots of admin tools like this little email notice.

I'll be doing something very similar to this which will be used to track multiple accounts.

Hey people, let me know if you have any problems with this

Learner29 05-01-2002 03:16 PM

> New at vBulletin.org!
> You can now reply to the thread by replying to this message

that is an amaaaaaasing great feature!!!!
vbulletin.org, you are real cool guys.

Chris M 05-01-2002 05:50 PM

And they know it...

Satan

Learner29 05-01-2002 06:11 PM

> And they know it...

LOL. Do you think those cool guys would tell me what hack is used to send
new posts by email???

Chris M 05-01-2002 06:14 PM

I dont think it is released...

If it is, then it is a well kept secret...

I think FireFly wanted it to be a vb.org exclusive, but I may be wrong...

Satan

KarateKid 05-01-2002 09:33 PM

@FireFly:

Do you release a new complete explanation for this hack in the first post in this thread?

Jawelin 05-02-2002 08:51 AM

I followed many of this long thread tips and now I have at least 5 different points where the email is launched... ;)

To optimize code, I created a function mail2wm() within adminfunctions.php so I simply call it from everywhere passing some parameters... :p

So, I can receive many emails each time. A general question is: could I set, within that function, a global variable to tell the function itself it has already done its job ?
Sorry, but I'm not too good at php about globals and sessions... Actual question is: such a global variable will be unique for the entire board - each user - or only for that user set it up ?
First case, could I 'localize' any way that variable for that particular session ?

Thanks a lot, and sorry for the O-T.
Bye

FleaBag 05-21-2002 10:41 AM

Thanks for this hack FireFly! Working on 2.2.5. :D

Kars10 06-04-2002 02:47 PM

Great hack-Great Work!!
Thank U Very Much!!! :D

Grealm 06-05-2002 03:41 AM

cant seem to find this code from sessions.php

[QUOTE]if (md5($loginpassword)!=$bbuserinfo[password]) {

Admin 06-05-2002 06:07 AM

What version of vB are you running, Grealm?

Heckwork 06-16-2002 12:45 AM

Did someone already get this code working on Apache 2.0 ?

I understand it should be something like:
$ipaddress=iif(HTTP_SERVER_VARS("REMOTE_ADDR")!="" ,HTTP_SERVER_VARS("REMOTE_ADDR "),$HTTP_HOST);
$iphostname = @gethostbyaddr($ipaddress);

but I can't get it work.

Peter

Mr H 06-17-2002 12:10 AM

Works great on 2.2.6. And I'm a newbie that isn't too informed about hacks :)

Heckwork 06-17-2002 06:05 PM

[QUOTE]Originally posted by Heckwork
Did someone already get this code working on Apache 2.0 ?

FleaBag 06-19-2002 06:33 PM

Upgraded to 2.2.6 and working great! :)

Admin 06-20-2002 05:09 AM

Dude stop installing my hacks! ;)

FleaBag 06-20-2002 09:19 AM

I'm sorry, I'm sorry! I just wanna be the first to have them all, and it's your own fault for making such good hacks in the first place! :p

Admin 06-20-2002 11:12 AM

:p

Bro_Joey_Gowdy 06-24-2002 04:32 AM

BUUUURRRRRRRRRP !!!!!

Ahhhhh....

That sure was a good hack...

Off to find somemore now...

allen 06-30-2002 08:55 PM

stupid question, but where do I install this hack? where do you find the sessions.php file?

mjames 07-01-2002 02:31 AM

[QUOTE]Originally posted by allen
stupid question, but where do I install this hack? where do you find the sessions.php file?

Christine 07-01-2002 07:16 PM

Great job mutt and firefly!!

:)

HeadStAtE! 07-03-2002 02:42 AM

This code can also be used (with slight modifications) to flag attempted unauthorised use of moderation features in moderator.php.

Find each occurance of:

PHP Code:

show_nopermission(); 

Before this line of code add:

PHP Code:

$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
$iphostname = @gethostbyaddr($ipaddress);
$message="Someone is trying to access the moderator user options.\n\nUsername is using: $loginusername\nPassword he tried to use: $loginpassword (".md5($loginpassword)." in encryption)\n\nThe IP address is: $ipaddress\nThe host is: $iphostname";
    
mail($webmasteremail,"Warning: vBulletin access to the moderator functions tried.",$message,"From: \"$bbtitle \" <$webmasteremail>"); 

I've found a few users trying the mod screen via the admin link that is displayed to all users in the template getinfo.

Users accessing the moderator.php options can also be viewed in the Currently Active Users list with the description "Unknown Location:/moderator.php"

Gary King 07-04-2002 07:22 PM

Good job FireFly :) Just installed it :D

Heineken77 07-17-2002 12:00 AM

great hack, i likes :)

thanks!

spinach 07-21-2002 08:00 AM

I've installed the hack (version 2.2.6) and it works - but I get an email not just every time I log in incorrectly, but CORRECTLY too. Also, I get a mail every time I save something in the cp. So for instance, I just logged in (correctly), changed some colours, and have now received NINE emails!

Anyone had this? Or know how to deal with it?

Thanks in adance,

Spinach

JJR512 07-21-2002 08:06 AM

Yeah, I had that, too. I just uninstalled it. There's some other similar version out there somewhere.

Martin64 07-21-2002 10:48 AM

Working great, thanks Chen. :D

Heineken77 07-21-2002 03:09 PM

LOL! Damn Spinach .... that's funny. I installed it and it works perfectly :) If I were you, I would uninstall it and re-install it. This hack works great :)

veedee 07-21-2002 03:15 PM

If a n00b like me can install this ;)

...then so can you!

Chase 07-21-2002 09:55 PM

Great hack! I just installed it!

Greystang302 08-09-2002 01:52 AM

[QUOTE]Originally posted by Mutt
then second additon is in adim/global.php

and it goes right after

PHP Code:

$getperms=$DB_site->query_first("SELECT cancontrolpanel FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND user.userid='$bbuserinfo[userid]'");
if (
$getperms[cancontrolpanel]!=1) { 

now the email gets sent for any incorect login instead of just ones with a correct username and wrong password. If they are somehow listed in sessions under multiple userids, (logged on and then logged on again under a second account) you'll get them all.

Hey people, let me know if you have any problems with this [/B]

Learner29 08-09-2002 10:19 AM

I installed this long time ago and it works......

StevieBee 08-09-2002 09:47 PM

Doesn't seem to work for me either..

OOPPPPSSS sorry.. it does work but only if I use admin name.. I was under the impression it worked on any name.. Now if only I can work out how to add the hack for that and install it :banana:

Erwin 08-10-2002 12:04 AM

It's been working for me for a loooong time... I use Mutt's version, which works in all cases.

Greystang302 08-10-2002 06:04 PM

Hmn... any ideas on what could have gone wrong? I followed the directions to the letter.

Boofo 08-10-2002 07:42 PM

Where can I get that version? I can't seem to find it here. :surprised:

[QUOTE]Originally posted by Erwin
It's been working for me for a loooong time... I use Mutt's version, which works in all cases.


All times are GMT. The time now is 06:35 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.01510 seconds
  • Memory Usage 1,836KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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