Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cphulk 11.50+ : remove IP via ssh connection

Discussion in 'General Discussion' started by Dev@SH, Jul 8, 2015.

  1. Dev@SH

    Dev@SH Member

    Joined:
    Mar 11, 2014
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Due to some questionable design choices in 11.50+ with regards to cphulks blacklist UI, I would like to delete IPs by SSHing into the server and removing the IPs from the blacklist via commandline.

    In the past :
    delete from cphulkd.logins where IP='X.X.X.X'; delete from cphulkd.brutes where IP='X.X.X.X'; would work to remove the IP and allow the customer to login.

    Thank you.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,563
    Likes Received:
    43
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hello,

    You can remove banned IP addresses via command line using the following utility:

    Code:
    /usr/local/cpanel/scripts/hulk-unban-ip
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Dev@SH

    Dev@SH Member

    Joined:
    Mar 11, 2014
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Yes and that would remove a cPhulk ban. How can I remove an IP from the blacklist via commandline?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    The whitelisted and blacklisted IPs are stored in "ip_lists" table of the cphulk database as VARBINARY entries - in order to "read" them via a select statement, you will need to use the INET6_NTOA() mysql function (only available in 5.6.3+). EX to check whitelisted IPs:

    Code:
    mysql cphulkd;
    SELECT INET6_NTOA(`STARTADDRESS`), INET6_NTOA(`ENDADDRESS`), `COMMENT` from `ip_lists` WHERE TYPE = 1;"
    If you are using an earlier version of MySQL, then you could use our API to obtain the blacklisted IP addresses instead. This is documented at:

    WHM API 1 - get_cphulk_brutes

    Here's an existing tutorial on using it:

    Additional API functions are available if you need to remove specific records (e.g. delete_cphulk_record).

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Ruan likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice