2 SSH Brute-Force-Attack Countermeasures

By Daniel Miessler on December 9th, 2008: Tagged as Information Security
  • nerfed

    I use Denyhosts (http://denyhosts.sourceforge.net/) on several production machines. It’s a small python script that drops IP’s of hosts into /etc/hosts.deny that try to brute force. You can set the threshold.

  • nerfed

    I use Denyhosts (http://denyhosts.sourceforge.net/) on several production machines. It’s a small python script that drops IP’s of hosts into /etc/hosts.deny that try to brute force. You can set the threshold.

  • http://dmiessler.com/ Daniel Miessler

    nerfed,

    Denyhosts is being bypassed by this; that’s the whole point of the story. They don’t care if you deny one IP or 100; they have thousands to try from. See?

  • http://dmiessler.com Daniel Miessler

    nerfed,

    Denyhosts is being bypassed by this; that’s the whole point of the story. They don’t care if you deny one IP or 100; they have thousands to try from. See?

  • Brett Dreher

    Don’t you feel you should mention that if you have multiple machines if you allow only key based authentication without a password that say once your key gets cracked, like this past year with the Debian issue, that someone will now have full access to your entire network without even using a single password?

    Passwords are not poor security practice if you use secure ones and rotate them sufficiently.

    Couldn’t agree more on changing the ssh port, a decent option is that you set two ports for ssh on your machine, the default and an open one (say 22 and 24). Simply have your firewall only forward port 24 to the machine and it will save you from having to append the port number when you would like to access the machine from other local ones.

  • Brett Dreher

    Don’t you feel you should mention that if you have multiple machines if you allow only key based authentication without a password that say once your key gets cracked, like this past year with the Debian issue, that someone will now have full access to your entire network without even using a single password?

    Passwords are not poor security practice if you use secure ones and rotate them sufficiently.

    Couldn’t agree more on changing the ssh port, a decent option is that you set two ports for ssh on your machine, the default and an open one (say 22 and 24). Simply have your firewall only forward port 24 to the machine and it will save you from having to append the port number when you would like to access the machine from other local ones.

  • bob schäfer

    great observation. the real trifecta is obscure port + keys only + only from restricted addresses, but honestly, i’ve had boxes in hostile networks for almost a decade and they all run with ssh on some ephemeral port and there’s simply never failed attempts in my logs.

    hopefully, people will harken to your advice.

  • bob schäfer

    great observation. the real trifecta is obscure port + keys only + only from restricted addresses, but honestly, i’ve had boxes in hostile networks for almost a decade and they all run with ssh on some ephemeral port and there’s simply never failed attempts in my logs.

    hopefully, people will harken to your advice.

  • http://na.com/ double oh

    since this is tagged security by obscurity, i’ll let it pass.

  • http://na.com double oh

    since this is tagged security by obscurity, i’ll let it pass.

  • http://steamcommunity.com/id/m-p-3 m-p{3}

    I already use a different port (443) and it works very well so far, no failed logins (except mine..) in the logs. I should consider using keys, but I’d like to use it simultaneously with a password, to make it more like a two-factors authentication. We learn something new everyday :)

  • http://steamcommunity.com/id/m-p-3 m-p{3}

    I already use a different port (443) and it works very well so far, no failed logins (except mine..) in the logs. I should consider using keys, but I’d like to use it simultaneously with a password, to make it more like a two-factors authentication. We learn something new everyday :)

  • Pingback: Email Content Security


Top

Popular

Information Security / Technology

Politics

Philosophy & Religion

Technology & Science

Culture & Society

Miscellaneous

Arguments

Projects

Collections

Twitter

What I'm Reading

Favorite Books and Essays

Top Blog Categories

Inputs