{"id":1704,"date":"2016-03-25T04:10:30","date_gmt":"2016-03-25T10:10:30","guid":{"rendered":"http:\/\/www.supportpro.com\/blog\/?p=1704"},"modified":"2026-03-26T04:05:36","modified_gmt":"2026-03-26T10:05:36","slug":"configuring-cphulk-via-whm-command-line","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/configuring-cphulk-via-whm-command-line\/","title":{"rendered":"Configuring cPHulk via WHM &#038; command line"},"content":{"rendered":"\n<p>Now-a-days Brute force attacks to servers\/websites are frequent. Brute force attack is generally a password guessing technique. It is a type of attack in which trying every possible combination of characters or data in order to find the decrypted message. A brute force guarantees finding the key \u2013 it\u2019s trying every possible combination and does not rely on any potentially incomplete dictionaries or lists of possible keys.<\/p>\n\n\n\n<p><b>cPHulk &nbsp;Brute force Protection<\/b> is an inbuilt protection used in WHM for preventing brute force attack. cPHulk Brute force Protection &nbsp;will detect and will block continuous failed login IP address.<\/p>\n\n\n\n<p><strong>cPHulk<\/strong> is a brute force protection system developed by the cPanel team and is exclusive to cPanel \/ WHM control panels. It has been integrated with cPanel version 11. With cPHulk, you can set a threshold for authentication attempts on services like POP3, cPanel, WHM, FTP, etc. After a certain amount of attempts, the attacker will no longer be able to authenticate<\/p>\n\n\n\n<p>We can enable\/disable cPhulk via WHM and command line.<\/p>\n\n\n\n<p><strong>1] Steps to enable cPHulk via WHM<\/strong><\/p>\n\n\n\n<p>Enabling cPHulk is pretty easy. Simply<a href=\"https:\/\/www.supportpro.com\/blog\/access-whm-cpanel-without-root-password\/\"> log into your WHM control panel<\/a> as root. From the main menu on the left, click on <strong>Security Center<\/strong> from the Security section. When youre done, simply click on the <strong>Enable<\/strong> button at the top.<\/p>\n\n\n\n<p>Click on the <strong>cPHulk Brute Force Detection<\/strong> link at the top of the page. Now you may want to configure cPHulk before you enable it. The configuration parameters are pretty much self-explanatory. Basically you set the number of failed attempts before an IP or an account is blocked and you set how long you want it to be blocked.<\/p>\n\n\n\n<p>&gt;&gt; &nbsp;Login to WHM.<\/p>\n\n\n\n<p>&gt;&gt; &nbsp;Navigate to Home -&gt; Security Center -&gt; cPHulk Brute Force Protection.<\/p>\n\n\n\n<p>&gt;&gt; &nbsp;Click the toggle ON\/OFF option to enable or disable the cPHulk.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a1.jpg\" data-rel=\"penci-gallery-image-content\"  rel=\"attachment wp-att-1705\"><img decoding=\"async\" src=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a1.jpg\" alt=\"a1\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Configuration settings<\/strong><\/p>\n\n\n\n<p>We can configure cPHulk settings in WHM as per the image below. We can change limits of failed login attempts and temporary blocks duration using this tab.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a2.jpg\" data-rel=\"penci-gallery-image-content\"  rel=\"attachment wp-att-1706\"><img decoding=\"async\" src=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a2.jpg\" alt=\"a2\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Whitelist Management<\/strong><\/p>\n\n\n\n<p>We can also whitelist an IP address from cPHulk interface. The whitelist specified IP address for which cPHulk always allows login to our server.We can enter the IP address in the New Whitelist Records field and click the Add button. We can add desired comments in the comment text box. These comments will help you for quick reference. When clicking on the whitelist management tab you will get a screen that looks like the picture below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a3.jpg\" data-rel=\"penci-gallery-image-content\"  rel=\"attachment wp-att-1707\"><img decoding=\"async\" src=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a3.jpg\" alt=\"a3\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Blacklist Management<\/strong><\/p>\n\n\n\n<p>Blacklist management is opposite of the whitelist tab. This tab help you to block specific IP address and ranges.If you found repeated failed attempts to login your server from an unauthorized IP address you can add it to your blacklist to prevent any future attempts.<\/p>\n\n\n\n<p>We can remove the blocked IP address by clicking the Delete button to the right of the IP address<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a4.jpg\" data-rel=\"penci-gallery-image-content\"  rel=\"attachment wp-att-1708\"><img decoding=\"async\" src=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a4.jpg\" alt=\"a4\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>History Reports<\/strong><\/p>\n\n\n\n<p>The History Reports tab shows all the failed attempts to access our server. We can clear the log &nbsp;details using this tab and it will release any current lock outs.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a5.jpg\" data-rel=\"penci-gallery-image-content\"  rel=\"attachment wp-att-1709\"><img decoding=\"async\" src=\"http:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2016\/04\/a5.jpg\" alt=\"a5\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong> \u00a0\u00a0 Steps to enable cPHulk via Command line<\/strong><\/li>\n<\/ol>\n\n\n\n<p><strong>cPHulk status<\/strong><\/p>\n\n\n\n<p>To check the cPHulk status , run this command &nbsp;:<\/p>\n\n\n\n<p><i># ps aux | grep \u2013i cphulk<\/i><\/p>\n\n\n\n<p><i>Output : &nbsp;&nbsp;&nbsp;<\/i><\/p>\n\n\n\n<p><i>root &nbsp;<\/i><i>&nbsp;&nbsp;&nbsp; <\/i><i>8196 &nbsp;0.0 &nbsp;0.2 &nbsp;41088 &nbsp;2120 ? &nbsp;&nbsp;&nbsp;<\/i><i>&nbsp;&nbsp;&nbsp; <\/i><i>S<\/i><i>&nbsp;&nbsp;&nbsp; <\/i><i>Feb05 &nbsp;&nbsp;2:38 cPhulkd &#8211; processor<\/i><\/p>\n\n\n\n<p>This output shows that cPHulk is enabled.<\/p>\n\n\n\n<p><strong>Restart cPHulk<\/strong><\/p>\n\n\n\n<p>To restart cPHulk daemon, perform either one of the commands.<\/p>\n\n\n\n<p>Perform a soft restart.<\/p>\n\n\n\n<p><i># \/scripts\/restartsrv_cphulkd<\/i><\/p>\n\n\n\n<p>Perform a hard restart and force the system to flush the daemon\u2019s memory.<\/p>\n\n\n\n<p><i># \/scripts\/restartsrv_cphulkd &#8211;stop; \/scripts\/restartsrv_cphulkd \u2013start<\/i><\/p>\n\n\n\n<p><strong>Disable cPHulk<\/strong><\/p>\n\n\n\n<p>To disable cPHulk<\/p>\n\n\n\n<p><i># \/usr\/local\/cpanel\/etc\/init\/stopcphulkd<\/i><\/p>\n\n\n\n<p><i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/i><i>&nbsp;&nbsp;&nbsp; <\/i><i>Or<\/i><\/p>\n\n\n\n<p><i>&nbsp;&nbsp;&nbsp; <\/i><i># \/usr\/local\/cpanel\/bin\/cphulk_pam_ctl &#8211;disable<\/i><\/p>\n\n\n\n<p>To disable cPHulk to keep it offline, even after a restart of cPanel &amp;WHM, remove the cPHulk touch file with the following command:<\/p>\n\n\n\n<p><i># rm &nbsp;\/var\/cpanel\/hulkd\/enabled<\/i><\/p>\n\n\n\n<p><strong>Enable cPHulk<\/strong><\/p>\n\n\n\n<p>To enable cPHulk<\/p>\n\n\n\n<p><i># \/usr\/local\/cpanel\/etc\/init\/startcphulkd<\/i><\/p>\n\n\n\n<p><i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/i><i>&nbsp;&nbsp;&nbsp; <\/i><i>Or<\/i><\/p>\n\n\n\n<p><i>&nbsp;&nbsp;&nbsp; <\/i><i># \/usr\/local\/cpanel\/bin\/cphulk_pam_ctl \u2013enable<\/i><\/p>\n\n\n\n<p><strong>IP address Management via command line<\/strong><\/p>\n\n\n\n<p>Add IP address to whitelist<\/p>\n\n\n\n<p>To add IP addresses to the whitelist from the command line, run this command \/scripts\/cphulkdwhitelist IP &nbsp;where IP shows the IP address that you wish to whitelist.<\/p>\n\n\n\n<p><i># \/scripts\/cphulkdwhitelist x.x.x.x &nbsp;&nbsp;<\/i>(Note: x.x.x.x denotes your IP address)<\/p>\n\n\n\n<p><strong>Add IP address to Blacklist<\/strong><\/p>\n\n\n\n<p>We can also use the command \/scripts\/cphulkdblacklist IP for blacklisting an IP address in cphulk.<\/p>\n\n\n\n<p><i># \/scripts\/cphulkdblacklist x.x.x.x<\/i><\/p>\n\n\n\n<p><strong>IP address management via MYSQL<\/strong><\/p>\n\n\n\n<p>cPHulk stores all of its information in a database called cphulkd. There are two tables of interest: &nbsp;&nbsp;\u201dlogins\u201d and \u201cbrutes\u201d.The logins table stores login authentication failure.The brutes table stores excessive authentication failures indicative of a brute force attack.<\/p>\n\n\n\n<p><strong>Whitelisting through MySQL prompt<\/strong><\/p>\n\n\n\n<p>&gt;&gt; Login to your server via SSH as the root user and run the following commands.<\/p>\n\n\n\n<p>&gt;&gt; <i>mysql<\/i><\/p>\n\n\n\n<p>To access the cPHulk database<\/p>\n\n\n\n<p>&gt;&gt; <i>use cphulkd <\/i><\/p>\n\n\n\n<p>To show the list of tables under cPHulk\u2019s database.<\/p>\n\n\n\n<p>&gt;&gt; <i>show tables;<\/i><\/p>\n\n\n\n<p>To check if your IP address is in brutes tables.<\/p>\n\n\n\n<p>&gt;&gt; <i>select * from brutes where IP =\u2019X.X.X.X\u2019; <\/i>&nbsp;(Note: X.X.X.X represents your IP address)<\/p>\n\n\n\n<p>If IP address found in brutes table, then remove the IP address using the following command.<\/p>\n\n\n\n<p>&gt;&gt; <i>delete from brutes where IP =\u2019X.X.X.X\u2019;<\/i><\/p>\n\n\n\n<p>Or we can delete the IP address from logins table<\/p>\n\n\n\n<p>&gt;&gt; <i>delete from logins where IP = \u2018X.X.X.X\u2019;<\/i><\/p>\n\n\n\n<p>&gt;&gt;exit<\/p>\n\n\n\n<p><strong>cPHulk Log files<\/strong><\/p>\n\n\n\n<p>The log files are first contributor on all the IT environment when we troubleshooting the problem. The cPHulk log file are located under \/usr\/local\/cpanel\/logs\/ directory and you can use less, cat, more or tail command to check the logs messages.<\/p>\n\n\n\n<p>These are the log files of cPHulk Brute Force Protection :<\/p>\n\n\n\n<p><i>&gt;&gt; \/usr\/local\/cpanel\/logs\/cphulkd.log<\/i><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><i>&gt; \/usr\/local\/cpanel\/logs\/cphulkd_errors.log<\/i><\/p>\n<\/blockquote>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Now-a-days Brute force attacks to servers\/websites are frequent. Brute force attack is generally a password guessing technique. It is a type of attack in which trying every possible combination of&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,6,4],"tags":[],"class_list":["post-1704","post","type-post","status-publish","format-standard","hentry","category-general-topics","category-linux-basics","category-server-security"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1704"}],"version-history":[{"count":16,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1704\/revisions"}],"predecessor-version":[{"id":16641,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1704\/revisions\/16641"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}