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)

Admin 11-25-2001 10:00 PM

Here's my version:

In sessions.php find this code:
Code:

    if (md5($loginpassword)!=$bbuserinfo[password]) {
right below it, add this code:
Code:

                        $ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
                        $iphostname = @gethostbyaddr($ipaddress);
                        $message="Someone is trying to login using your admin account!\n\nUsername he tried to use: $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 Admin Login Tried",$message,"From: \"$bbtitle Admin CP\" <$webmasteremail>");

You will get a message:
Quote:

Someone is trying to login using your admin account!

Username he tried to use: xxx
Password he tried to use: xxx (xxxxxxxxxxxxxxxxxxxx in encryption)

The IP address is: xx.xx.xx.xx
every time someone is trying to login to the admin cp with no success.

Have fun. :)

Lesane 11-26-2001 02:12 PM

Thanks flyfire :)

xcal 11-26-2001 02:51 PM

just installed and tested fine :)
be interesting to see how many people are sneaking around, the admin cp :)

Admin 11-26-2001 02:59 PM

Lesane, it's FireFly, not FlyFire. ;) :p
Thanks.

Just a note, if you test this and don't get an e-mail after 3 seconds, don't panic and scream it's not working.
It probably takes a while for the e-mail to arrive. :)

pipi 11-26-2001 03:19 PM

IS that possible use this code for admin centre? how? thanks
Code:

$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
        $DB_site->query("INSERT INTO loginlog (id, ip, username, password, atime) VALUES ('','$ipaddress', '$username', '$password', '".time()."')");


Lesane 11-26-2001 04:13 PM

[QUOTE]Originally posted by FireFly
Lesane, it's FireFly, not FlyFire. ;) :p
Thanks.

mem 11-26-2001 04:18 PM

It's great and working now.
Thank you, FireFly. :D :D

tweak 11-26-2001 06:06 PM

THANX!! Great HACK!

FWC 11-26-2001 06:20 PM

Another good one, Firefly! :)

|DarkManX| 11-26-2001 07:26 PM

Excellent hack!!!

thanks firefly!

squawell 11-26-2001 07:35 PM

oh~~thankz FireFly:D

this hack is my looking for~~

Goldfinger 11-26-2001 07:45 PM

Nice hack firefly :).

-=dm=- 11-26-2001 09:31 PM

hmm it dont works for me.

btw what to do if u get the email with that message. :D

Mincer 11-26-2001 09:35 PM

Many thanks Chen, yet again a great bit of work. :)

[QUOTE]Originally posted by -=dm=-
btw what to do if u get the email with that message. :D

-=dm=- 11-26-2001 09:50 PM

very funny :D :D :D

man Im seriouse what to do? (actually there is nothing u can do)

JJR512 11-26-2001 10:16 PM

Hopefully with the IP, you can trace it to one of your members and ask them what's up. If the IP doesn't belong to a current member, and it happens more than once, you should consider banning that IP from the board. I would personally take it one step further and block that IP out of the entire site by doing a deny from statement in the .htaccess file. :)

JJR512 11-26-2001 11:10 PM

I've made a slight modification to this hack, so that the email also includes not only the IP name, but the host name as well.

This is the code to add:
Code:

                        $ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
                        $iphostname = @gethostbyaddr($ipaddress);
                        $message="Someone is trying to login using your admin account!\n\nThe IP address is: $ipaddress\nThe host is: $iphostname";
                        mail($webmasteremail,"Warning: vBulletin Admin Login Tried",$message,"From: \"$bbtitle Admin CP\" <$webmasteremail>");

FireFly, if you like you can put that into your "official" version, or if you have any suggestions to improve what I did, please let me know. :)

Syphin 11-26-2001 11:29 PM

Great hack.. ^^

But i just have my whole admin folder password protected... So i dont think this would help me... >_<

-Syphin

almightyone 11-27-2001 12:29 AM

if ya got htaccess installed this wouldnt do much good would it? or does this send the info upon them entering username and a pw or if they try to access it period i use htaccess to protect my directory

MarkB 11-27-2001 05:49 AM

Works great! Thanks FlyingFlea! :D

Baratator 11-27-2001 07:47 AM

goooooooooood idea :) but here is my problem :) : the mailing function is not supported by my host so I had to desactivate it...

Can it send adminitrators PMs instead of emails?

thx :)

Kumaro 11-27-2001 09:53 AM

Excellent hack for my board. People always trying to get get into my admin panel.

Admin 11-27-2001 11:54 AM

[QUOTE]Originally posted by Mincer
Run around your office screaming, grab your nearest workmate, shake them by the shoulders and shout "They're after us, we're DOOOOOOOMED!!!!"

:eek: :eek:

xug 11-27-2001 12:00 PM

Great hack FireFly, just what I needed !

Mincer 11-27-2001 12:31 PM

I seem be experienceing what you may call a 'minor problem' with this hack in the updated form. (I have reverted back to the original release now)

If someone tries to login as another user with any password, it rejects it, but I get no email.

If I try to log in as the admin WITH ANY PASSWORD, IT LETS ME IN!!! :eek: (I do get the email saying failed lonin though. :confused: )

Just thought it's let you know before I start hacking all ya boards. :eek: ;) (j/k)

JJR512 11-27-2001 01:16 PM

I tried to duplicate Mincer's problems.

I tried to login to the admin cp using my name and an incorrect password. I was not successful; I got the wrong password message, and received the email from this hack. So I could not duplicate that aspect of Mincer's problem.

I tried to login as a regular member with that member's correct password, and was simply rejected (the login form reappeared). I received no email from that attempt. So I was able to duplicate this aspect of Mincer's complaint; however, I do not believe this is a problem. I don't believe this hack was designed to send you the email in this situation, although an argument could be made that perhaps it should.

Prezident 11-27-2001 01:57 PM

I also tried some bogus usernames that did not exist. I got no email. Tried using my username with a bad password, and was notified promptly.

I think it would be better suited for this hack to send ANY information regarding failed logon attempts to the admin CP.

Is it possible to make that happen?

Kathy 11-27-2001 09:44 PM

So I'm assuming it looks like this?
Code:

    if (md5($loginpassword)!=$bbuserinfo[password]) {
            $ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
                        $iphostname = @gethostbyaddr($ipaddress);
                        $message="Someone is trying to login using your admin account!\n\nUsername he tried to use: $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 Admin Login Tried",$message,"From: \"$bbtitle Admin CP\" <$webmasteremail>");

                        eval("standarderror(\"".gettemplate("error_wrongpassword")."\");");

In other words...leaving all the original code...and just adding those lines in the right place?

MarkB 11-27-2001 09:46 PM

Admin login with incorrect password let me in as well, although I also got the warning email...

Reverted (for now).

MarkB 11-27-2001 09:50 PM

I'd forgotten to include

eval("standarderror(\"".gettemplate("error_wrongpa ssword")."\");");

at the end, re-added it and now I am not logged in with a wrong password...

Hamma 11-27-2001 10:04 PM

Nice hack, quick and easy too :D

Kathy 11-27-2001 10:06 PM

It works GREAT! Thanks!

Prezident 11-27-2001 10:23 PM

Kathy, can you explain what effects of the code that you added please.

Thanks.

Hooper 11-28-2001 04:07 AM

This hack should be incorporated into the next version of vBulletin Chen. Please pass the request along to John. This is real nice.

Thank You.

Baratator 11-28-2001 06:09 AM

Erf erf can i ask again ?

Could it send PM to administrator instead of emails as the mail function doesn't work on my server?

Hooper 11-28-2001 06:45 AM

[QUOTE]Originally posted by Baratator
Erf erf can i ask again ?

Could it send PM to administrator instead of emails as the mail function doesn't work on my server?

Prezident 11-28-2001 12:28 PM

I have to say that I like the email function, because it also gets passed along to my pager, and I know about it almost instantly.

I would still like to point out that I would like to see it send me a notification on ANY bad attempt to gain access to my Admin CP.

Is it possible to make that happen???

butty 11-28-2001 08:50 PM

cheers ears great hack

Una Persson 11-28-2001 11:01 PM

[QUOTE]Originally posted by Baratator
Erf erf can i ask again ?

Could it send PM to administrator instead of emails as the mail function doesn't work on my server?

scopeman 11-29-2001 01:48 AM

i had a problem, when i use the right password, he sends the email too! what do i wrong?


All times are GMT. The time now is 10:33 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.01253 seconds
  • Memory Usage 1,808KB
  • 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
  • (5)bbcode_code_printable
  • (1)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