1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Auto-ban IP address after X bad password attempts?

Discussion in 'Security' started by inworx, Feb 26, 2007.

  1. #1
    Is there any way to automatically ban an IP address after they've made some number of bad password attempts, similar to the banning after N invalid commands? I am running WHM/cPanel and there are daily about 1k+ invalid login attempts from a specific ip address.


    I've now had two cases in the last 3 weeks where some script kiddie is trying to get onto my server by testing several thousand password variations for variopus accounts by trying various passes and usernames. The ability to ban an IP address on invalid passwords would have prevented this after the first few bad attempts.

    Is this possible t configure by WHM or by any method possible?

    Please help.

    These attempts slow down my server's cpanel/whm...:(
     
    inworx, Feb 26, 2007 IP
  2. Mxhub

    Mxhub Active Member

    Messages:
    474
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Don't think it is possible to auto-ban..
    you can contact your host with the IP and ask them to ban it.
    If it is from a similar IP range, ban the whole subnet.
     
    Mxhub, Feb 26, 2007 IP
  3. clixxer

    clixxer Peon

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Of course it is possible to autoban!
    Use this Firewall: [sorry, the forum rules do not permit me to tell you]
    and this for the brute force attacks: [sorry, the forum rules do not permit me to tell you]

    google apf bfd

    Works like a charm.
     
    clixxer, Mar 1, 2007 IP
    WebGeek182 likes this.
  4. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #4
    there is also a python script called "DenyHosts" that will check SSH logs, and deny hosts who fail so many times.

    It's completely configurable, it adds the IPs to hosts.deny. It's pretty cool really, easier than setting up a firewall, probably.
     
    nddb, Mar 2, 2007 IP
  5. WebGeek182

    WebGeek182 Active Member

    Messages:
    510
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    95
    #5
    Yes...auto-banning is a great solution. You could use a php script or any of the options listed above. Also, if it is just 1 IP, you can manually ban it for now through cpanel's IP Deny Manager. I'd ban then right away and work on your auto-banning solution. My sites auto-ban potential hackers all the time. I agree with clixxer...install APF asap.
     
    WebGeek182, Mar 4, 2007 IP
  6. ilxeon

    ilxeon Peon

    Messages:
    336
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yes you can do it easily from apf with bfd settings
     
    ilxeon, Mar 5, 2007 IP
  7. WoodiE55

    WoodiE55 Well-Known Member

    Messages:
    193
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    125
    #7
    WoodiE55, Mar 16, 2007 IP
    inworx likes this.
  8. funtoosh

    funtoosh Active Member

    Messages:
    415
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Yeah csf with lsf works great and very easy to manage, give it a try

    Greets
     
    funtoosh, Mar 17, 2007 IP
  9. serjio28

    serjio28 Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    My site has a function that analise which IP adress should be blocked. When someone tries to login to my site by using wrong account for some time it records its IP adress to the special table of a database.

    There is special program for add new firewall rules. It is launched hourly and read the table that is created by the above function. The program walk throught all entries from this table and insert iptables rules for each IP address.

    iptables -A INPUT -p tcp --syn -s xx.xx.xx.xx --dport 80 -j REJECT --reject-with icmp-host-unreachable 
    
    Code (markup):
    Actually this solution is pretty easy but it works fine for me.
     
    serjio28, Mar 26, 2007 IP
  10. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks mate!

    Rep. added
     
    inworx, Mar 28, 2007 IP
  11. Juan Pablo Olivera

    Juan Pablo Olivera Peon

    Messages:
    53
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Install APF and BFD. No additional configuration needed, BFD integrates with APF and will ban every IP after 3 failed login attempts.
     
    Juan Pablo Olivera, May 23, 2007 IP
  12. nukepuppy

    nukepuppy Peon

    Messages:
    93
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #12
    csf with lsf is _THE_ solution for cpanel.. specially with their web based interface..

    its basicly everything APF and BFD did but better..
     
    nukepuppy, Jun 5, 2007 IP
  13. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Its basically apf and bfd but easy to use.

    P.S. This thread is active for so many days...WOW!
     
    inworx, Jun 12, 2007 IP