补了安全漏洞

原文参见Howlym:DreamHost漏洞简易解决方法

请DH新用户在host新的domain的时候,千万不要使用默认的web Directory设置,而是自己手动更改一下,这样别人才不至于从你的logs里,知晓你相应域名所在的directory。

具体方式:
1. Manage Domains,Web Hosting / Edit
2. 更改Web Directory里面的默认设置yourdomain.com为你自己定义的ownname。
3. 使用FTP“移动”功能即可。注意把.htaccess这种文件也移过去(有些FTP设置里默认不显示“.filename”文件,在shell下可以用命令”ls -al”来查看)。
4. 使用Shell,在yourdomain.com路径下,使用mv令即可。

mv * ../ownname

你的yourdomain.com文件夹如果清空了,则会在稍后被系统自动清除。

注意,如果你的Movable Type或其他程序设置里有绝对路径的(例如Movable Type的archives路径),一定要到相应的位置进行更改,否则重建系统会报错。
/home/username/yourdomain.com/…更改为
/home/username/ownname/…
注意,crontab里如果涉及绝对路径,则也应做相应更改!

接下来,把所有含有类似绝对路径的文件(mt-config.cgi, wp-config.php, lilina.edit, and so on)全部将chmod设为600!

chmod 600 mt-config.cgi

注意,Movable Type用户的mt-config.cgi里面,可以使用相对路径或者http路径的,不必一定把整个绝对的路径都写进去。

注意,这只是一个不完全的补漏洞方式,由于/logs是public可读的,因此,入侵者或group用户可以通过error.log,轻易地知道你domain.com对应的根目录文件夹!唯一可行的,是把所有密码文件权限改为600。

[2006-04-07,更新信息]
Dreamhost客服对此漏洞答复如下:

Do not make files that have sensitive information in them world-readabale
(or writable/executable) - you should always employ that as a security
measure regardless of the kind of system you are on.

It’s actually been like this for almost a decade without causing any
problems (we’ve looked into it and there’s not a fix that we can
implement without causing many more serious issues).

大致意思是说:含有敏感信息的文档不要把属性设置成组成员和公共可读,不管自己位于什么样的系统上,这都是作为衡量系统安全性的考量。这种Dreamhost的安全设置已经运行近十年,还没出过严重问题。

那么多人因为CPU时间及安全性而放弃了Dreamhost,他们认为这并不重要!

Leave a Reply