The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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,460
    Likes Received:
    22
    Trophy Points:
    38
    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
    
     
  3. Dev@SH

    Dev@SH Member

    Joined:
    Mar 11, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
    Ruan likes this.
Loading...

Share This Page