cPHulkd management

Here you can find tutorials and notes for server-side maintenance/configuration

cPHulkd management

Postby lik » Sat May 23, 2009 12:42 am

WHM locked out - cPHulkd

Today we were locked out on one of our server by cPHulkd. When trying to access the server from WHM we were getting the following message. Thus not allowing us to login into WHM also we were not able to access shell.
—————————————————————————————
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.
—————————————————————————————


This is done by ‘cPHulkd’ - Cpanel Brute Force Protection service: this service monitors failed authentication attempts and locks out accounts after the threshold is met.

To re-enable your account, login via ssh and disable cPHulkd using the command below.
Code: Select all
# /usr/local/cpanel/bin/cphulk_pam_ctl --disable


This should allow you to login to WHM and double check your cPHulk settings.

You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.

Flush DB will remove all blocked IPs:
WHM -> Security Center -> cPHulk Brute Force Protection -> Click on Flush DB

Well the other way to this is given below.

SSH to the server login as root and type the following at the prompt
Code: Select all
mysql
mysql> use cphulkd;
mysql>BACKUP TABLE  brutes TO ‘/path/to/backup/directory’;
mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;
mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;
mysql>quit

or simply
Code: Select all
mysql -e "delete from cphulkd.brutes where 'IP' ='xxx.xxx.xxx.xxx';"

Hopefully this helps you as well.
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

cPHulkd missed MySql database

Postby lik » Mon Sep 21, 2009 2:09 am

Following error message appeared at "/usr/local/cpanel/logs/error_log":
Whostmgr::Mysql::new('Whostmgr::Mysql', 'HASH(0x112a6f8)') called at /usr/local/cpanel/whostmgr/docroot/cgi/tweakcphulk.cgi line 46
main::do_main() called at /usr/local/cpanel/whostmgr/docroot/cgi/tweakcphulk.cgi line 42
DBI connect('cphulkd:localhost','cphulkd',...) failed: Access denied for user 'cphulkd'@'localhost' (using password: YES) at /usr/local/cpanel/Whostmgr/Mysql.pm line 44
at /usr/local/cpanel/Whostmgr/Mysql.pm line 48

The main reason was connected with the non-existent MySql database 'cphulkd'. To re-create it run:
Code: Select all
/usr/local/cpanel/bin/hulkdsetup

MySql password for MySql user 'cphulkd' can be found in:
Code: Select all
cat /var/cpanel/hulkdpass

Having this done, we can enable cPhulkd:
Code: Select all
/usr/local/cpanel/bin/cphulk_pam_ctl --enable
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am


Return to Server Side Actions

 


  • Related topics
    Replies
    Views
    Last post
cron