PDA

View Full Version : Administrative and Maintenance Tools - AdminCP Firewall ~ Protect your AdminCP!


liamwli
03-20-2013, 11:00 PM
This is a mod I made to increase the security of your forum!

It has the following features:
Email alert when an Admin logs into the CP
IP Checking for Admins
E-Mail if the IP isn't whitelisted
Block user access to the AdminCP if the IP isn't whitelisted
E-Mail if someone fails an AdminCP loginThose features will allow you to secure your AdminCP - and the only upload required is the product file!

So, what are you waiting for? Install now ;)

Update History
Version 1.3.3:
PHP error should be fixed

Version 1.3.2:
Fixed - PHP error message when logging into AdminCP :)
Branding Removed

Version 1.3.1:
Fixed - text would be displayed on login failure page if failure email turned off or not from admincp

Version 1.3:
Added - Ability to have an email sent when someone fails an admincp login.
Added - Branding. Sorry! Any donation of ?2.50 or more will allow you to remove it :)

Version 1.2:
Added - Ability to specify IP's as CIDR ranges
Added - Ability to set both IP email and IP deny
Added - IP email will now tell you if any forum members registered using the unauthorized IP
Changed - Updated Admin Help Pages

Version 1.1:
Added - Ability to specify multiple email addresses
Added - Help entries for the admin options
Changed - IP's are separated with a line break now, not a comma.

Mark as Installed if Installed and Nominate for MOTM if you think this mod deserves it!

-----------

Donating

I kindly accept donations for my work. Donating will allow you to remove the branding. You can donate via paypal using the link on the right, or using bitcoin. Please PM me if you wish to donate using bitcoin.

This modification is free to modify and distribute with attribution. I no longer own a vBulletin license.

liamwli
03-21-2013, 08:34 PM
FAQ

Q. What if my IP changes? How can I get into the AdminCP!

A. Just add this line to your config.php file:

define('CPFIREWALLDISABLEIPDENY', true);

Q. You say the mod will deny a user access to the AdminCP. How does it do this - what is shown to the user?

A. The user will see the standard AdminCP no permission message, called by print_cp_no_permission().

Q. Can I reuse this mods code?

A. Please PM me.

synseal
03-22-2013, 12:04 AM
This works very well!.

Installed and set up, tested, received email when I logged in as I had it set to send on every log in.

Tried behind a proxy received the unauthorized email with username and IP address, also got the not authorized message.

Working fine 4.2 with vbseo.

Thank you!

liamwli
03-22-2013, 11:32 AM
This works very well!.

Installed and set up, tested, received email when I logged in as I had it set to send on every log in.

Tried behind a proxy received the unauthorized email with username and IP address, also got the not authorized message.

Working fine 4.2 with vbseo.



Thank you!

No worries, glad it works well for you :up: :)

Srdar
03-22-2013, 02:00 PM
Can multiple email addresses be notified on logins?

liamwli
03-22-2013, 03:28 PM
Can multiple email addresses be notified on logins?

I'll add this by the end of the day GMT :)

liamwli
03-22-2013, 05:40 PM
Can multiple email addresses be notified on logins?

This has been added to the latest version :)

Liam

Srdar
03-22-2013, 06:05 PM
Installed and working great

TheSupportForum
03-23-2013, 12:36 AM
would it be possible if it checks the IP address of registered members

for example if user gets denied message, the email will include the IP address and a registered member if it matches

dizzynation
03-23-2013, 02:07 AM
Seems like a great MOD, I will have to go to all the locations I go to now and get the IP's before I install though :)

Thanks!

ForceHSS
03-23-2013, 03:02 AM
And what if your ip chances each time you restart your pc

TheSupportForum
03-23-2013, 09:26 AM
And what if your ip chances each time you restart your pc

yes that can happen only if you dont have static IP and the fact that your ISP doesnt control your IP

the only way to fool the system would be to clear all cookies and the forum will keep the cookie so even an IP change won't matter its picked up by the cookie

liamwli
03-23-2013, 10:45 AM
And what if your ip chances each time you restart your pc

Then I suggest you use the email on login system and remain vigilant to those logins ;)

I will also try and make it so you can enter IP's as a CIDR mask - so as to whitelist multiple IP's at the same time

would it be possible if it checks the IP address of registered members

for example if user gets denied message, the email will include the IP address and a registered member if it matches

Hmm, clever! I'll see what I can do ;)

Liam

BadgerDog
03-23-2013, 01:42 PM
Installed for testing with thanks on 4.1.3 ...

Regards,
Doug

FTG LIQUID CL
03-23-2013, 02:42 PM
Sounds nice ,I will give it a try!

avitor
03-23-2013, 03:19 PM
thanks for so nice mod

whats upend if i don't have access to that ip anymore ? and i want to change it to my new ip
can i log in to admin cp from other ip? how to do that ?
cheers

liamwli
03-23-2013, 03:21 PM
thanks for so nice mod

whats upend if i don't have access to that ip anymore ? and i want to change it to my new ip
can i log in to admin cp from other ip? how to do that ?
cheers

That's FAQ 1 ;)

See the second post :)

SuperTaz
03-24-2013, 01:21 AM
Nice mod. Installed. :)

liamwli
03-24-2013, 01:03 PM
would it be possible if it checks the IP address of registered members

for example if user gets denied message, the email will include the IP address and a registered member if it matches

That is in the newest version :)

And what if your ip chances each time you restart your pc

I have now added the ability to set IP CIDR ranges :)

franzes80
03-24-2013, 02:09 PM
very well!!Works on vb 4.20 Pl3 thank you

liamwli
03-24-2013, 02:10 PM
very well!!Works on vb 4.20 Pl3 thank you

Please don't forget to mark as installed :)

Liam

elfenny
03-24-2013, 07:24 PM
FAQ

Q. What if my IP changes? How can I get into the AdminCP!

A. Just add this line to your config.php file:

define('CPFIREWALLDISABLEIPDENY', true);



this is going to end config.php?

I use multiple ip

liamwli
03-24-2013, 07:31 PM
this is going to end config.php?

I use multiple ip

It would go anywhere in the config.php file, but on it's own line.

You can also disable the IP deny system in the options, which is recommended if your admins don't have static IP's.

TheSupportForum
03-24-2013, 07:33 PM
Hi liamwli

in your next version can you do login attempts too, so it logs if someone also tries to login

liamwli
03-24-2013, 07:51 PM
Hi liamwli

in your next version can you do login attempts too, so it logs if someone also tries to login

Hmm, I'll certainly try....

TheSupportForum
03-24-2013, 10:01 PM
with new version i get

Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4
but testing it, the email does work on sending the correct info

https://vborg.vbsupport.ru/external/2013/04/56.png

liamwli
03-24-2013, 10:13 PM
with new version i get

Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4
but testing it, the email does work on sending the correct info

https://vborg.vbsupport.ru/external/2013/04/56.png

Hmmm. Strange. What PHP version are you using, and when does this occur?

TheSupportForum
03-24-2013, 10:29 PM
post edited.................


found Solution

main admin account did not have IP inserted and error now goes

and nominated for MOTM

this is a script that i need to find many time, thanks for your development of this

liamwli
03-24-2013, 10:59 PM
post edited.................


found Solution

main admin account did not have IP inserted and error now goes

and nominated for MOTM

this is a script that i need to find many time, thanks for your development of this


Ah, something I wouldn't have tested ;-) Glad you got it fixed and thanks for the nomination!

Liam

dean3862
03-25-2013, 03:24 AM
i cant get this to work i added 5 ip s an i get this

Sorry, you don't have permission to access the administrative controls on this page.

If you need to access this page, ask your lead administrator to enable your permissions for this page using the Administrator Permissions section of the control panel.

what do i put between the ips ? to separate ips......

TheSupportForum
03-25-2013, 03:29 AM
i cant get this to work i added 5 ip s an i get this


Sorry, you don't have permission to access the administrative controls on this page.

If you need to access this page, ask your lead administrator to enable your permissions for this page using the Administrator Permissions section of the control panel.



what do i put between the ips ? to separate ips......
IP address per line

liamwli
03-25-2013, 08:17 AM
IP address per line

Correct :)

See FAQ 1 if you can't access the admincp.

BadgerDog
03-26-2013, 10:48 AM
Anyone else seeing this error with v1.2 when logging into the AdminCP?

Warning: Invalid argument supplied for foreach() in [path]/includes/functions_login.php(377) : eval()'d code on line 78

I only noticed it this morning when logging in from my IPad?

Thanks... :)

Regards
Doug

liamwli
03-26-2013, 11:14 AM
Anyone else seeing this error with v1.2 when logging into the AdminCP?

Warning: Invalid argument supplied for foreach() in [path]/includes/functions_login.php(377) : eval()'d code on line 78

I only noticed it this morning when logging in from my IPad?

Thanks... :)

Regards
Doug

Make sure all user accounts have an IP specified. Check the main admin account mainly.

BadgerDog
03-26-2013, 11:57 AM
Make sure all user accounts have an IP specified. Check the main admin account mainly.

Ok, but what's the point when I as an Admin, could possibly be logging in from various remote random IP addresses? I don't know in advance what they may be?

Are you saying that this mod will always generate HTML errors unless the IP address of the person logging in is always in the mod's data field?

Regards
Doug

liamwli
03-26-2013, 02:01 PM
Ok, but what's the point when I as an Admin, could possibly be logging in from various remote random IP addresses? I don't know in advance what they may be?

Are you saying that this mod will always generate HTML errors unless the IP address of the person logging in is always in the mod's data field?

Regards
Doug

I'm not referring to the mod settings, I'm referring to the user manager. Edit the main admin user and see if there is a value in the IP field.

BadgerDog
03-26-2013, 04:05 PM
I'm not referring to the mod settings, I'm referring to the user manager. Edit the main admin user and see if there is a value in the IP field.

:confused:

Are you referring to UserId #1 in the users file?

If so, then the registration IP address field for that user is blank...

Regards,
Doug

liamwli
03-26-2013, 04:20 PM
:confused:

Are you referring to UserId #1 in the users file?

If so, then the registration IP address field for that user is blank...

Regards,
Doug

Yes, I am. Enter a valid value for the registration IP address and the error should vanish :P

127.0.0.1 will do ;)

BadgerDog
03-26-2013, 04:47 PM
Yes, I am. Enter a valid value for the registration IP address and the error should vanish :P

127.0.0.1 will do ;)

Thanks .. :)

It won't let me put anything in that user ID as it says it's a protected user and it wants me to modify the config.php file ... :p

Regards,
Doug

liamwli
03-26-2013, 09:47 PM
Thanks .. :)

It won't let me put anything in that user ID as it says it's a protected user and it wants me to modify the config.php file ... :p

Regards,
Doug

Security conscious site owners, nice ;)

TheSupportForum
03-27-2013, 06:37 PM
Thanks .. :)

It won't let me put anything in that user ID as it says it's a protected user and it wants me to modify the config.php file ... :p

Regards,
Doug

in config .php you have set

$config['SpecialUsers']['undeletableusers'] = '1';

if you remove your UserID and save the file then add your IP address to the correct profile field it will go away

when you have the above option set in config.php you can not change anything

Gripi
04-04-2013, 05:16 PM
with new version i get

Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4
but testing it, the email does work on sending the correct info

https://vborg.vbsupport.ru/external/2013/04/56.png

Hello..

I got the same error message, using vb 4.2.0, and latest php stable version, and litespeed webserver.

liamwli
04-05-2013, 10:59 AM
Hello..

I got the same error message, using vb 4.2.0, and latest php stable version, and litespeed webserver.

I'll look into this further :)

liamwli
04-05-2013, 05:01 PM
Hey all, I fixed the php error bug :)

cjwinternet
04-05-2013, 05:17 PM
Mod disabled - I don't want yet another link at the bottom of the page, especially one that tells people that there might possibly be another way in to the forum.

liamwli
04-05-2013, 05:21 PM
Mod disabled - I don't want yet another link at the bottom of the page, especially one that tells people that there might possibly be another way in to the forum.

Right, in that case you need to think about the people that make these mods. I think a bit of advertisement is fine do you not?

Also, how does it state there is another way into the forum?

Gripi
04-05-2013, 05:22 PM
Hey all, I fixed the php error bug :)

Hello..

I already upgrade to 1.3.2, still got same error message.

Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4

liamwli
04-05-2013, 05:23 PM
Mod disabled - I don't want yet another link at the bottom of the page, especially one that tells people that there might possibly be another way in to the forum.

Also, branding is disabled in the latest version (1.3.2)

liamwli
04-05-2013, 05:24 PM
Hello..

I already upgrade to 1.3.2, still got same error message.

Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4

That's officially strange. I no longer do...

Will investigate further :)

BadgerDog
04-05-2013, 08:39 PM
Updated to 1.3.3 with thanks .. :)

Regards,
Doug

liamwli
04-05-2013, 08:41 PM
Updated to 1.3.3 with thanks .. :)

Regards,
Doug

:) Glad!

(Why is the rating decreasing :()

Gripi
04-06-2013, 03:04 PM
That's officially strange. I no longer do...

Will investigate further :)

Hello..

Yup still got the same error after upgrade to 1.3.3

TheSupportForum
04-07-2013, 09:09 AM
Hello..

Yup still got the same error after upgrade to 1.3.3

ensure each user including yourself has an IP allocated to the profiles without it, this error will still apear

Gripi
04-08-2013, 04:38 PM
ensure each user including yourself has an IP allocated to the profiles without it, this error will still apear

Hello..

Sorry.. i'm not quite understand "IP allocated to the profiles", can you explain more detail?

Thanks alot..

liamwli
04-08-2013, 04:54 PM
Hello..

Sorry.. i'm not quite understand "IP allocated to the profiles", can you explain more detail?

Thanks alot..

In the user editor, there is a field called IP. Make sure it contains a valid IP (127.0.0.1 will do).

Gripi
04-10-2013, 03:55 PM
In the user editor, there is a field called IP. Make sure it contains a valid IP (127.0.0.1 will do).

i'm not quite understand about this.

let say nick "david" try to login to admincp with the wrong password, the nick david have ip add in the user profile editor, but still showing error msg.

liamwli
04-10-2013, 04:00 PM
i'm not quite understand about this.

let say nick "david" try to login to admincp with the wrong password, the nick david have ip add in the user profile editor, but still showing error msg.

Everyone should have an IP in the profile editor.

However, I am working on a permanent fix for this issue and shall PM you soon.

djbaxter
04-19-2013, 06:06 AM
Using email notification only at the moment:



requires me to enter an IP address even though I've not enabled Ip monitoring or filtering
works as expected if the admincp folder is not renamed
does not trigger an email on one forum where the admincp forum IS renamed to something else (e.g., new_admin)

liamwli
04-19-2013, 06:17 AM
Using email notification only at the moment:



requires me to enter an IP address even though I've not enabled Ip monitoring or filtering
works as expected if the admincp folder is not renamed
does not trigger an email on one forum where the admincp forum IS renamed to something else (e.g., new_admin)


Did you change the field marked admincp directory, found in the options?

djbaxter
04-19-2013, 06:27 AM
Did you change the field marked admincp directory, found in the options?

Yes, of course. It has the correct folder name there, no leading or trailing slashes, just like with the other forums. And the new folder is in the root of the forum directory, just as the admincp folders are.

djbaxter
04-19-2013, 10:56 AM
Using email notification only at the moment:


requires me to enter an IP address even though I've not enabled Ip monitoring or filtering
works as expected if the admincp folder is not renamed
does not trigger an email on one forum where the admincp forum IS renamed to something else (e.g., new_admin)


Did you change the field marked admincp directory, found in the options?

Yes, of course. It has the correct folder name there, no leading or trailing slashes, just like with the other forums. And the new folder is in the root of the forum directory, just as the admincp folders are.

I checked the setting in the vBulletin Email Options and found an incorrect setting in the one that wasn't working (the one with the renamed admincp). Specifically the "Enable '-f' Parameter" was set to YES on that one forum. I turned it off and the email notifications of admincp logins are now working correctly.

MahdyE23
04-19-2013, 11:31 AM
This is actually a very amazing mod, thank you for this!

djbaxter
04-19-2013, 12:48 PM
This is actually a very amazing mod, thank you for this!

It's certainly timely. See

http://www.vbseo.com/f255/summary-fix-filestore-urlxxx-redirect-issue-55099/

http://www.vbseo.com/f255/filestore-redirect-hack-how-fix-your-forum-55368/

http://club.myce.com/f20/vbulletin-myfilestore-hack-find-traces-remove-them-332219/

http://www.vbseo.com/f255/url123-redirect-tried-everything-i-am-wits-end-54125/

The best guess at the moment is that malware is being used to harvest admincp passwords giving the malware network access to your admincp, which is then used to alter certain plugins to redirect your traffic (or do whatever else they want to do to your site for that matter).

There are several things noted in the first two threads that forum owners should be doing to secure their forums and their servers. This add-on provides an extra layer of protection or at least notification if someone does gain access.

djbaxter
04-23-2013, 03:50 PM
Suggestion regarding awkward wording in notifications:

Change line 502 to read:

{1} logged into the AdminCP from IP address {2}.

elitecarders
04-28-2013, 08:28 PM
Sorry, you don't have permission to access the administrative controls on this page.

If you need to access this page, ask your lead administrator to enable your permissions for this page using the Administrator Permissions section of the control panel.


i got this error after installing my ip nothing changed everything was fine

djbaxter
07-15-2013, 12:57 AM
Email this evening from this mod:

Hi,

northernangel logged into the AdminCP from IP address 209.105.205.53.

AdminCP Firewall


northernangel is a valid membername from a member who had not logged in for a long time. The member was not ad admin or moderator. The records show that member did log in to her account about the time the email was generated but it was from a different IP address and a different country than the one on record. There is no indication in the logs of any entry into the admincp from that member or indeed any member other than the two admins.

How is this possible? Is this a false positive?

I have changed the password for that member, banned the member at the forum level, and banned the IP at the server level to be safe. But should there not be a log entry if there indeed was a breach?

By the way, in order to gain access to the AdminCP, two passwords are required.

DemOnstar
07-15-2013, 10:23 AM
Installed on Localhost so can't test just yet but security may well be a concern so thank you for your work...

djbaxter
07-16-2013, 01:45 PM
Email this evening from this mod:



northernangel is a valid membername from a member who had not logged in for a long time. The member was not ad admin or moderator. The records show that member did log in to her account about the time the email was generated but it was from a different IP address and a different country than the one on record. There is no indication in the logs of any entry into the admincp from that member or indeed any member other than the two admins.

How is this possible? Is this a false positive?

I have changed the password for that member, banned the member at the forum level, and banned the IP at the server level to be safe. But should there not be a log entry if there indeed was a breach?

By the way, in order to gain access to the AdminCP, two passwords are required.

I figured part of this out because it happened with another forum member today while I was actually online. That member in who's online was shown as viewing a "no permissions" error message, meaning they didn't actually get access to the admincp and that's why there was no log entry.

However, you might want to look more closely at what tirggers the email notification of a breach.

MahdyE23
07-29-2013, 09:21 PM
My IP changed and now I cannot access my ACP. I tried adding that code at the end of the config.php, but it did nothing. Please help me?

Disco_Stu
07-30-2013, 02:22 AM
I would be careful installing a mod that could potentially lock you out of your own ACP. I would think your htaccess security should be sufficient in keeping someone from accessing your ACP.

I experimented with another mod (not this mod) that did not install completely. The result was that I could not access my ACP and I had to completely restore my entire site.

I see that the author no longer has a vBulletin license.

Disco_Stu
07-30-2013, 02:23 AM
My IP changed and now I cannot access my ACP. I tried adding that code at the end of the config.php, but it did nothing. Please help me?

Does it work if you add the code to the top of your config file after <?php

eyestrain
08-08-2013, 08:51 PM
A very nice mod.
Also nominated as the mod of the month.

thank you

synseal
08-08-2013, 09:30 PM
My IP changed and now I cannot access my ACP. I tried adding that code at the end of the config.php, but it did nothing. Please help me?

Open your /includes/config.php and add

PHP Code:

define('DISABLE_HOOKS', true);

Directly below

PHP Code:
<?php

Bubble #5
08-13-2013, 10:38 PM
Love the idea of this hack but what can I do if my router ever has problems, or I have to reset it and I lose the exact IP? How would I log in then?:confused:

RichieBoy67
09-03-2013, 03:22 AM
You could simply go into your config file and disallow plug ins. Then log into the admincp and disable.. Bam..


addenum - Disable your plug ins by adding

define('DISABLE_HOOKS', true);

To your config php file

Bubble #5
09-03-2013, 03:33 AM
Then log into the admincp and disable.. Bam..

Disable what? :confused:

ForceHSS
09-03-2013, 03:44 AM
Disable what? :confused:
Note: To temporarily disable the plugin system, edit includes/config.php and add this line right under <?php

define('DISABLE_HOOKS', true);

DemOnstar
09-03-2013, 05:05 AM
Disable what? :confused:

Open your /includes/config.php and add

define('DISABLE_HOOKS', true);

under

<?php

I am guessing it looks like this when you are done.

<?php
define('DISABLE_HOOKS', true);

Then log in...Next go to your plugin manager and disable the mod from there..
After that you will either need to remove what you added to the config.php, comment it out or replace the word 'true' with 'false'. But that again is a guess...

Hope that helps...

RichieBoy67
09-03-2013, 05:14 AM
Yeah, I should have been a little more descriptive but just seemed obvious to me. Thanks for the correction guys.

zushiba
09-13-2013, 07:34 PM
Ah, this is exactly what I was looking for. I was hit with that script kiddy hack going around defacing sites and decided some better security on the AdminCP would be nice.

RichieBoy67
09-13-2013, 08:11 PM
Would also suggest renaming your admincp and modcp.

Bubble #5
09-18-2013, 12:40 AM
Then log in...Next go to your plugin manager and disable the mod from there..
After that you will either need to remove what you added to the config.php, comment it out or replace the word 'true' with 'false'. But that again is a guess...

Hope that helps...

It has banned me from my own forum. It won't let me log in....

(plugins are disabled).

ozzy47
09-18-2013, 12:48 AM
This may work.

Open your config.php and below<?php add this line:

define('CPFIREWALLDISABLEIPDENY', true);So it looks like this:
<?php
define('CPFIREWALLDISABLEIPDENY', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.1.4

Bubble #5
09-18-2013, 12:58 AM
THANKS Ozzy :up:

I was able to get in using the "return;" function :)

ozzy47
09-18-2013, 01:01 AM
What return function?

Bubble #5
09-18-2013, 01:11 AM
I'll send you a PM ;)

DemOnstar
09-18-2013, 02:54 AM
It has banned me from my own forum. It won't let me log in....


This is the reason I don't use it. My IP changes all of the time.. I guess if your IP is fixed, then it is a suitable app.

I see now you have access, curious to know what the return function is too..

Bubble #5
09-18-2013, 03:31 AM
This is the reason I don't use it. My IP changes all of the time.. I guess if your IP is fixed, then it is a suitable app.
Would be nice if there was a password of some kind that would allow the main admin to bypass being banned and log in.

I see now you have access, curious to know what the return function is too..
You've got mail :)

DemOnstar
09-18-2013, 10:24 AM
Would be nice if there was a password of some kind that would allow the main admin to bypass being banned and log in.


Agreed.. Splendid idea!:up:

ozzy47
09-18-2013, 10:28 AM
What I posted in post #83 above will allow you to disable the product and get into the ACP should you get locked out by this product. :)

Paul M
09-18-2013, 10:44 AM
Just adding the genereric disable hooks define to your config.php would also allow you back in.

// Disable Hooks
define('DISABLE_HOOKS',true);

DemOnstar
09-18-2013, 01:07 PM
Installed.

DemOnstar
09-18-2013, 01:20 PM
Just adding the genereric disable hooks define to your config.php would also allow you back in.

// Disable Hooks
define('DISABLE_HOOKS',true);


I did just that...

There is however a slim, coincidental hole with this idea as it will disable all the spam stuff, the protection stuff and everything else for the brief period where one has to do the changes in config.php and then gain access again to add another IP..

There is a vulnerability here... I like the password idea.

ozzy47
09-18-2013, 08:29 PM
Just adding the genereric disable hooks define to your config.php would also allow you back in.

// Disable Hooks
define('DISABLE_HOOKS',true);


Paul, If I understand this mod correctly, it does not use hooks, it can not be disabled that way.

So the way to disable it is the way I said in post #83 and as theOP described in post #2

DemOnstar
09-19-2013, 04:04 AM
Just adding the generic disable hooks define to your config.php would also allow you back in.

// Disable Hooks
define('DISABLE_HOOKS',true);


Paul, If I understand this mod correctly, it does not use hooks, it can not be disabled that way.

So the way to disable it is the way I said in post #83 and as theOP described in post #2

I just added both to my config.php and left them commented out..
In that case, when the inevitable day comes where I have to use them, I know they are there...:)

I guess next I have to protect the includes folder..

Bubble #5
09-19-2013, 05:28 AM
There is a vulnerability here... I like the password idea.
At a minimum it should have a password, but after thinking about it I'd prefer if the admin could fill out their own security question in the ACP, and then answer it. There are scripts that can guess passwords, but who's going to know the answer to your own security question but you?

DemOnstar
09-19-2013, 10:33 AM
At a minimum it should have a password, but after thinking about it I'd prefer if the admin could fill out their own security question in the ACP, and then answer it. There are scripts that can guess passwords, but who's going to know the answer to your own security question but you?

This is a better idea..... Agreed. +1

DemOnstar
09-19-2013, 10:35 AM
I had an email..

A user has logged into the AdminCP using an unauthorized IP address.

Ok, I had to check but it doesn't seem to be the case..
Perhaps re-wording the mail to

A user has attempted to log into the AdminCP using an unauthorized IP address.

I will try to do this myself...

EDIT: It was easy, it is all in languages and phrases...Shall see if it shows up the next time...:up:

bigs15
09-20-2013, 06:54 PM
Mine is dynamic Ip so how does this mod help me?

obglobal.net
09-21-2013, 04:15 AM
Could someone please help me with instructions on how to install this? I'd really like to add this mod as I've been hacked twice in the last 2 weeks.

Thanks very much.

DemOnstar
09-21-2013, 05:13 AM
Could someone please help me with instructions on how to install this? I'd really like to add this mod as I've been hacked twice in the last 2 weeks.

Thanks very much.

Download

Go to your admincP/Plugin and Products/Manage Products/Add/Import Product.
:confused:

obglobal.net
09-21-2013, 07:41 AM
Download

Go to your admincP/Plugin and Products/Manage Products/Add/Import Product.
:confused:

Good gracious! Is that it? Thanks for the heads up, bro! I thought it was gonna be a far more detailed process.

Awesome!

obglobal.net
09-21-2013, 07:57 AM
I just tried to set it up with my own IP and everything and it's blocked me from the ACP!


Sorry, you don't have permission to access the administrative controls on this page.

If you need to access this page, ask your lead administrator to enable your permissions for this page using the Administrator Permissions section of the control panel.

ozzy47
09-21-2013, 08:12 AM
This may work.

Open your config.php and below<?php add this line:

define('CPFIREWALLDISABLEIPDENY', true);So it looks like this:
<?php
define('CPFIREWALLDISABLEIPDENY', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.1.4

obglobal.net
09-21-2013, 08:21 AM
This may work.

Open your config.php and below<?php add this line:

define('CPFIREWALLDISABLEIPDENY', true);So it looks like this:
<?php
define('CPFIREWALLDISABLEIPDENY', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.1.4

Thanks very much, Ozzy47. I read post #83 and have been looking for where I find config.php.

I searched the vb.org forums and apparently it's in forum/includes, but I don't know where to find that, either. I couldn't find it in cPanel.

I use FileZilla - it should be in there, right? :up:

ozzy47
09-21-2013, 08:32 AM
Correct, it will be in what ever folder your forums resides in, so something like this, /public_html/forums/includes

obglobal.net
09-21-2013, 08:46 AM
Correct, it will be in what ever folder your forums resides in, so something like this, /public_html/forums/includes

I'll check that out, bro. You're a good dude. TYVM.

obglobal.net
09-21-2013, 10:39 AM
Correct, it will be in what ever folder your forums resides in, so something like this, /public_html/forums/includes

Man. It was hidden away in there. I found it, though. So does this code work? You've tried it, have you?

obglobal.net
09-21-2013, 10:58 AM
This may work.

Open your config.php and below<?php add this line:

define('CPFIREWALLDISABLEIPDENY', true);So it looks like this:
<?php
define('CPFIREWALLDISABLEIPDENY', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.1.4

Hey, bro. It didn't work, unfortunately. I edited the config.php as you said, then put the original config.php back in the includes folder afterward as I got an error message saying that without a config.php file I couldn't access the ACP.

Any more tips? I could certainly use them. :D

Thanks, man.

I tried the "disbale hooks" code that was in here as well, and that didn't work either.

Ahhhhhh! haha

DemOnstar
09-21-2013, 11:32 AM
I edited the config.php as you said, then put the original config.php back in the includes folder afterward as I got an error message saying that without a config.php file I couldn't access the ACP.


Rather confusing.. You say you edited the config.php and then put back the original..
If you put back the original then the edited config.php should be the one to replace the original.:confused:

ozzy47
09-21-2013, 11:39 AM
Yeah there was no need to load the original config file, just remove the line you added.

obglobal.net
09-21-2013, 11:44 AM
Oh, man. I don't know what I've done.

Sorry to bother you, fellas, and thanks for hitting me back.

Whatever happened the first time, it didn't work.

Should I just try and repeat the process, do you think?

DemOnstar
09-21-2013, 11:48 AM
Repeat the process if it is less confusing.. Save the edited version with the
define('CPFIREWALLDISABLEIPDENY', true);

Upload and let us know what happened.

One more thing, in options/settings/AdminCP firewall

Allowed IP's
Enter the IP's that are allowed to access the AdminCP. These can be single IP's or CIDR ranges. One IP or range per line.

Have you included your IP?

obglobal.net
09-21-2013, 11:50 AM
Repeat the process if it is less confusing.. Save the edited version with the
define('CPFIREWALLDISABLEIPDENY', true);

Upload and let us know what happened.

One more thing, in options/settings/AdminCP firewall

Allowed IP's
Enter the IP's that are allowed to access the AdminCP. These can be single IP's or CIDR ranges. One IP or range per line.

Have you included your IP?

Yeah, I put my IP in.

I just added the original "disable hooks" code and got this: Parse error: syntax error, unexpected '<' in /home/obglobal/public_html/includes/config.php on line 206.

Which is what I got the first time.

Thanks a lot for getting back to me, I appreciate it very much.

obglobal.net
09-21-2013, 11:54 AM
I got it! Oh, thank Christ!

I actually had to delete the <? at the end of the config.php.

Any opinions on that?

Thanks so much, dudes, I was sh*tting bricks for a while there.

DemOnstar
09-21-2013, 11:58 AM
Currently mine looks like this at the very top

<?php
// This to disable AdminCP Firewall.
//define('CPFIREWALLDISABLEIPDENY', true);
// This to Disable Hooks
//define('DISABLE_HOOKS',true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.2.1
|| # ---------------------------------------------------------------- # ||
|| # All PHP code in this file is ?2000-2013 vBulletin Solutions Inc. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/

I haven't yet tried it as you can see, it is still commented out using // at the beginning of the order..

I have a fixed IP for the moment, perhaps now I should go and try from another IP to see if I get the same errors as you...?

Got's me thinking brother...

DemOnstar
09-21-2013, 11:59 AM
I got it! Oh, thank Christ!

I actually had to delete the <? at the end of the config.php.

Any opinions on that?

Thanks so much, dudes, I was sh*tting bricks for a while there.

What made you think of deleting the <?

obglobal.net
09-21-2013, 12:00 PM
Currently mine looks like this at the very top

<?php
// This to disable AdminCP Firewall.
//define('CPFIREWALLDISABLEIPDENY', true);
// This to Disable Hooks
//define('DISABLE_HOOKS',true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.2.1
|| # ---------------------------------------------------------------- # ||
|| # All PHP code in this file is ?2000-2013 vBulletin Solutions Inc. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/

I haven't yet tried it as you can see, it is still commented out using // at the beginning of the order..

I have a fixed IP for the moment, perhaps now I should go and try from another IP to see if I get the same errors as you...?

Got's me thinking brother...

You're a good dude, DS. Same goes for Ozzy47. Thanks for everything, for real.

Man, I think I just lost half a dozen years off my life.

Anyway, this mod is awesome, but I need a fixed IP for it to work as intended, is that right?

obglobal.net
09-21-2013, 12:02 PM
What made you think of deleting the <?

It said there was a parse error on line 207, an unexpected <

So I just deleted that and the question mark next to it and put the code under the <? at the top of the page instead. Pot luck, undeniably.

I went back in and deleted the code and all's swell.

:up:

DemOnstar
09-21-2013, 12:03 PM
Fixed IP or any IP that is recorded in the

Allowed IP's
Enter the IP's that are allowed to access the AdminCP. These can be single IP's or CIDR ranges. One IP or range per line.

I am guessing here....

DemOnstar
09-21-2013, 12:05 PM
and put the code under the <? at the top of the page instead.


Ha ha, that is the original instruction dude....

Line 207 is 3 from the arse end of config.php...:D

obglobal.net
09-21-2013, 12:16 PM
Fixed IP or any IP that is recorded in the

Allowed IP's
Enter the IP's that are allowed to access the AdminCP. These can be single IP's or CIDR ranges. One IP or range per line.

I am guessing here....

Yeah, I saw that. My IP was in there, though. Beats me.

Ha ha, that is the original instruction dude....

Line 207 is 3 from the arse end of config.php...:D

Christ on a bicycle. Mate, when it comes to vBulletin, I am at the arse end of the food chain.

I don't even know how to install DBTech mods so I started a thread and got an answer as stupid as the question.

That's right, I suck.

DemOnstar
09-21-2013, 12:23 PM
Christ on a bicycle. Mate, when it comes to vBulletin, I am at the arse end of the food chain.
That's right, I suck.

Me too owd lad, and a few others...

We suck! Although suck is not a term I would use in these matters...That term is generally applicable with my girlfriend....

Anyway, do test and let us know if this is a good un....

obglobal.net
09-21-2013, 12:29 PM
Me too owd lad, and a few others...

We suck! Although suck is not a term I would use in these matters...That term is generally applicable with my girlfriend....

Anyway, do test and let us know if this is a good un....

Test what, good sir? I already said I got it to work.

DemOnstar
09-21-2013, 12:32 PM
Yeah but have you tried from another IP?

obglobal.net
09-21-2013, 12:35 PM
Oh, right. Sorry homes.

No, I haven't. You? I don't have the VB awesomeness to branch out any further, I don't think. Was yours one of the many forums to get hacked? Is that why you're in here? I got done twice and had to pay for a clean up.

DemOnstar
09-21-2013, 12:48 PM
Oh, right. Sorry homes.

No, I haven't. You? I don't have the VB awesomeness to branch out any further, I don't think. Was yours one of the many forums to get hacked?

Not hacked yet, here to try and prevent that...

I did go out with my android device and attempted to log in form a different IP. It was stopped in it's tracks and I was also given an email of the details..Good!

I haven't tried to access from another IP that has been input as safe...and allowed access to adminCP.

This is what I will do next...

I expect the steps are as follows.

Go to the bar, get a pint of Guinness, find a table...
Log in to try and access adminCP. Get failure details passed on to my email..

Alternatively, finish the Guinness, get another one and then find my current IP. Go to FTP, add the new IP to the config.php (at the top) and then attempt another log in..

My plan..+ a few more Guinness incentives...:up:

obglobal.net
09-21-2013, 02:28 PM
Not hacked yet, here to try and prevent that...

I did go out with my android device and attempted to log in form a different IP. It was stopped in it's tracks and I was also given an email of the details..Good!

I haven't tried to access from another IP that has been input as safe...and allowed access to adminCP.

This is what I will do next...

I expect the steps are as follows.

Go to the bar, get a pint of Guinness, find a table...
Log in to try and access adminCP. Get failure details passed on to my email..

Alternatively, finish the Guinness, get another one and then find my current IP. Go to FTP, add the new IP to the config.php (at the top) and then attempt another log in..

My plan..+ a few more Guinness incentives...:up:

haha! Nice! I've gotten a tad thirsty suddenly.

obglobal.net
09-22-2013, 10:21 AM
Not hacked yet, here to try and prevent that...

I did go out with my android device and attempted to log in form a different IP. It was stopped in it's tracks and I was also given an email of the details..Good!

I haven't tried to access from another IP that has been input as safe...and allowed access to adminCP.

This is what I will do next...

I expect the steps are as follows.

Go to the bar, get a pint of Guinness, find a table...
Log in to try and access adminCP. Get failure details passed on to my email..

Alternatively, finish the Guinness, get another one and then find my current IP. Go to FTP, add the new IP to the config.php (at the top) and then attempt another log in..

My plan..+ a few more Guinness incentives...:up:

How'd you go, monsieur?

DemOnstar
09-22-2013, 01:13 PM
How'd you go, monsieur?

Not so good sire, big typhoon outside and not really worth going out there. Typhoon Usagi just made landfall in the north east and is blowing a little too much for outdoor activities..

obglobal.net
09-22-2013, 02:15 PM
Not so good sire, big typhoon outside and not really worth going out there. Typhoon Usagi just made landfall in the north east and is blowing a little too much for outdoor activities..

You live in Japan? The Rabbit Typhoon?

DemOnstar
09-22-2013, 02:31 PM
Currently homeless in Hong Kong..Live in China normally but there is a visa situation that is not working in my favour...

team74
09-22-2013, 11:07 PM
Thank you so much! I got hacked yesterday, and IP blocking is the only thing I can think of to do since it seems to be a VB vulnerability.

Big donation sent you way!

liamwli
09-23-2013, 05:43 AM
Thank you so much! I got hacked yesterday, and IP blocking is the only thing I can think of to do since it seems to be a VB vulnerability.

Big donation sent you way!

Thanks! I was wondering what it was when I got the email ;)

obglobal.net
09-24-2013, 12:25 AM
Currently homeless in Hong Kong..Live in China normally but there is a visa situation that is not working in my favour...

Visa issues blow. I live in Japan but am married to a Japanese chick. No dramas there. Take the plunge and make half-cast babies! Worked for me! :cool:

I gotta get this mod to work!

DemOnstar
09-24-2013, 01:39 AM
Not been to Japan yet, was gonna go during November before the winter hits..
Got a girlfriend in China but as regards babies, naaghh!:eek:

pityocamptes
10-01-2013, 01:38 AM
Same error with me. I added:

// This to disable AdminCP Firewall.
define('CPFIREWALLDISABLEIPDENY', true);
// This to Disable Hooks
define('DISABLE_HOOKS',true);

in the config file. and when I go to the mod to enter my new ip I get this:

Fatal error: Class 'EmailAddressValidator' not found in XXXXXX/html/includes/adminfunctions_options.php(925) : runtime-created function on line 6

and I have NO SAVE BUTTON at the bottom of the screen!!!!!!! Help....

pityocamptes
10-01-2013, 01:42 AM
Ok, took the HOOKS definition out and it works.... for anyone having the same issues. Just used the first definition (CPFIREWALL)...

DemOnstar
10-26-2013, 05:49 PM
Just one gripe..

emails still come to the admin regardless of the ip's permitted access..

By that I mean an ip that is recorded as being ok, there is still a notification sent and it is the same notification as the 'attempted' access...


A user has attempted to log into your AdminCP using an unauthorized IP address. Their username is XXYYMoiety and their IP is xx.3.xx.73.

This IP matched the following forum user(s):

And this bit This IP matched the following forum user(s): never changes...

It is always, 'This IP matched the following forum user(s)'.

Aren't the brackets () meant to change something?

Works well otherwise...

ozzy47
10-26-2013, 05:53 PM
No the brackets are meant to define singular or plural. user being singular, user(s) being plural.

Terrablade
10-26-2013, 06:42 PM
VB 3.8.7 friendly?

DemOnstar
10-26-2013, 07:42 PM
No the brackets are meant to define singular or plural. user being singular, user(s) being plural.

Marvelous! Trust your judgement....:up:

Terrablade
10-30-2013, 10:04 AM
Ill ask the question again.. Is it VB 3.8.7 PL3 friendly?

ozzy47
10-30-2013, 11:49 PM
I don't see anything in the XML that stands out as it would not work, best thing to do would be to do a backup, then try the mod out. :)

Khoori7
11-25-2013, 02:34 AM
Added this but having an issue with IP-Range what's the format it for it?
I added it this way 86.99.*.* Doesn't seem to work.

Buzzle
11-20-2014, 04:57 PM
I've added the IP but it gives me a restricted message any idea why?

ozzy47
11-20-2014, 08:27 PM
It should work, what is the message you are getting?
What version of vB and PHP are you running?

pityocamptes
02-05-2015, 03:07 AM
Warning: Invalid argument supplied for foreach() in [path]/login.php(119) : eval()'d code on line 4

I am getting this warning even after putting an IP in the admin user field. I notice it does this after I click on the admincp and have to put my pw in again to verify. If I type in the wrong pw this error comes up. Why? Thanks.

pityocamptes
02-14-2015, 06:07 PM
BUMP!!

pityocamptes
03-04-2015, 11:54 PM
Anyone????

ForceHSS
03-05-2015, 01:34 AM
But going by the small info you have given it looks like a conflict with a hook from a custom plugin and this one using the same
look over all plugins using login_failure hook
If you still are having problems use this plugin (https://vborg.vbsupport.ru/showthread.php?t=276228) it does the same but many more things

apleschu
03-05-2015, 10:58 PM
Is this mod IPv6 aware and safe?

Mertx
06-14-2021, 12:09 PM
Nice.