|
|

楼主 |
发表于 2006-3-20 14:39:03
|
显示全部楼层
10. What To Do During and After a Breakin 入侵发生了
So you have followed some of the advice here (or elsewhere) and have detected a break-in? The first thing to do is to remain calm. Hasty actions can cause more harm than the attacker would have.
您监测到入侵了吗? 您按照这些忠告来做了吗? 首先是保持冷静. 草率的行动可能是使事情变的更糟.
10.1 Security Compromise Underway. 安全入侵起步.
Spotting a security compromise under way can be a tense undertaking. How you react can have large consequences.
察觉安全入侵可能是一个进行态. 如何应对则与后果密切相关.
If the compromise you are seeing is a physical one, odds are you have spotted someone who has broken into your home, office or lab. You should notify your local authorities. In a lab, you might have spotted someone trying to open a case or reboot a machine. Depending on your authority and procedures, you might ask them to stop, or contact your local security people.
如果您发觉的入侵是物理的, 很幸运, 您可以明确的找到是谁进入您的家, 办公室或实验室. 您应当注意一下您的本地授权. 在实验室中, 您可以明确的查出是谁使用或重启了计算机. 根据您的职责和需求, 您可以要求他们立即停止, 或同本地安全人员联系.
If you have detected a local user trying to compromise your security, the first thing to do is confirm they are in fact who you think they are. Check the site they are logging in from. Is it the site they normally log in from? No? Then use a non-electronic means of getting in touch. For instance, call them on the phone or walk over to their office/house and talk to them. If they agree that they are on, you can ask them to explain what they were doing or tell them to cease doing it. If they are not on, and have no idea what you are talking about, odds are this incident requires further investigation. Look into such incidents , and have lots of information before making any accusations.
如果您发觉一个本地用户试图入侵您的系统, 首先要确定他就是您认为的那个人. 检查记录, 看他从何处登录. 是他通常登录的地点吗? 不是? 使用非电子的方式联络一下.例如, 用电话, 或直接到他的办公室/家, 了解一下. 如果他们承认是他们干的, 您可以要求他们做出解释, 或告诉他们不要这么干了. 如果否认, 或者根本不给你交谈的机会, 那么这件事则要进一步调查. 调查这类事情, 在做出结论之前, 需要获取很多信息.
If you have detected a network compromise, the first thing to do (if you are able) is to disconnect your network. If they are connected via modem, unplug the modem cable; if they are connected via Ethernet, unplug the Ethernet cable. This will prevent them from doing any further damage, and they will probably see it as a network problem rather than detection.
如果您发现了网络入侵, 首先要(如果可以)断开网络连接. 如果是通过调制解调器上网, 则要断开电缆; 如果是以太网, 拔掉网线. 这样可以阻止做更多的破坏, 他们可能认为是网络出现了问题, 而不是被察觉了.
If you are unable to disconnect the network (if you have a busy site, or you do not have physical control of your machines), the next best step is to use something like tcp_wrappers or ipfwadm to deny access from the intruder's site.
如果不能断开网络(比如是一个高访问量站点, 或无法物理接触您的计算机) 则最好是使用类似tcp_wrappers 或 ipfwadm 的工具来禁止入侵者的地址访问.
If you can't deny all people from the same site as the intruder, locking the user's account will have to do. Note that locking an account is not an easy thing. You have to keep in mind .rhosts files, FTP access, and a host of possible backdoors.
如果不能禁止所有与入侵者来自同一地址的访问者. 则需要锁定用户账号. 注意锁定一个账号并不是容易的事情. 需要注意 .rhosts 文件, FTP 访问, 和可能的后门.
After you have done one of the above (disconnected the network, denied access from their site, and/or disabled their account), you need to kill all their user processes and log them off.
做完这些以后(断开网络连接, 禁止访问地址, 和/或 禁用了账号), 您需要杀死所有相关进程,并将它们注销掉.
You should monitor your site well for the next few minutes, as the attacker will try to get back in. Perhaps using a different account, and/or from a different network address.
应当对您的网站监视一段时间, 因为入侵者可能会再回来. 也可能使用别的账号, 和/或 从别的网络地址登录.
10.2 Security Compromise has already happened 安全入侵发生了
So you have either detected a compromise that has already happened or you have detected it and locked (hopefully) the offending attacker out of your system. Now what?
那么你要么已经监测到了已经发生的入侵, 要么已经监测到了并且把入侵者驱逐出了您的系统之外? 现在该做什么了呢?
Closing the Hole 封锁漏洞
If you are able to determine what means the attacker used to get into your system, you should try to close that hole. For instance, perhaps you see several FTP entries just before the user logged in. Disable the FTP service and check and see if there is an updated version, or if any of the lists know of a fix.
如果您可以找到攻击者入侵您的系统的方法, 您应当尝试进行处理. 例如, 也许您在用户登录前发现了 FTP 连接. 停掉 FTP 服务, 并检查, 看是否有更新版本提供, 或者有如何修复的信息.
Check all your log files, and make a visit to your security lists and pages and see if there are any new common exploits you can fix. You can find Caldera security fixes at http://www.caldera.com/tech-ref/security/. Red Hat has not yet separated their security fixes from bug fixes, but their distribution errata is available at http://www.redhat.com/errata
检查所有的日志文件, 访问您的安全列表, 和网页, 看是否有需要修复的安全漏洞. 在 http://www.caldera.com/tech-ref/security/ 处您可以找到 Caldera 提供的安全修复文件. Red Hat 还没有从它的错误修复中将安全修复分离出来, 但是可以在 http://www.redhat.com/errata 获取它的发行版勘误表.
Debian now has a security mailing list and web page. See: http://www.debian.org/security/ for more information.
Debian 现在提供了安全邮件列表和网页. 更多信息参阅 http://www.debian.org/security/
It is very likely that if one vendor has released a security update, that most other Linux vendors will as well.
如果一个提供商发布一个安全更新, 那么其它的提供商也应该有.
There is now a Linux security auditing project. They are methodically going through all the user-space utilities and looking for possible security exploits and overflows. From their announcement:
现在有一个 Linux 安全审计项目. 他们正系统的检查所有的用户空间工具, 并查找可能的安全漏洞和溢出. 他们宣称:
"We are attempting a systematic audit of Linux sources with a view to being as secure as OpenBSD. We have already uncovered (and fixed) some problems, but more help is welcome. The list is unmoderated and also a useful resource for general security discussions. The list address is: security-audit@ferret.lmh.ox.ac.uk To subscribe, send a mail to: security-audit-subscribe@ferret.lmh.ox.ac.uk"
"我们试图对 Linux 的源代码进行系统的审计, 使其变的和 OpenBSD 一样安全. 我们已经解决(修复)了一些问题, 并需要更多的帮助. 邮件列表是 unmoderated 的(任何发送到该列表的邮件被立即分发到列表中的 用户邮箱中), 同时也是进行安全讨论的有用资源. 邮件列表地址是: security-audit@ferret.lmh.ox.ac.uk 发送邮件到 security-audit-subscribe@ferret.lmh.ox.ac.uk 进行订阅."
If you don't lock the attacker out, they will likely be back. Not just back on your machine, but back somewhere on your network. If they were running a packet sniffer, odds are good they have access to other local machines.
如果您不能将攻击者拒之门外, 他们很可能会再次回来. 不仅您的计算机, 甚至您的整个网络. 如果他们运行了数据包嗅探器, 就有可能能入侵其它的本地机器.
Assessing the Damage 损失评估
The first thing is to assess the damage. What has been compromised? If you are running an integrity checker like Tripwire, you can use it to perform an integrity check; it should help to tell you what has been compromised. If not, you will have to look around at all your important data.
首先要评估一下损失. 什么被入侵了? 如果您运行了完整检查攻击, 如 Tripwire, 则可以用它来完成完成性检查; 它将帮助您找出哪些被入侵了. 如果没有, 您将需要检查所有的重要数据.
Since Linux systems are getting easier and easier to install, you might consider saving your config files, wiping your disk(s), reinstalling, then restoring your user files and your config files from backups. This will ensure that you have a new, clean system. If you have to restore files from the compromised system, be especially cautious of any binaries that you restore, as they may be Trojan horses placed there by the intruder.
因为 Linux 系统变的越来越容易安装, 您可能会考虑保存配置文件, 整理磁盘, 重新安装, 然后从备份中恢复您的用户文件和配置文件. 这可以确保您拥有一个新的, 干净的系统. 如果您需要从入侵的系统中恢复二进制数据, 则要特别的注意, 因为可能被入侵者放置了木马程序.
Re-installation should be considered mandatory upon an intruder obtaining root access. Additionally, you'd like to keep any evidence there is, so having a spare disk in the safe may make sense.
如果入侵者获取了 root 权限, 应当考虑重新安装系统. 另外, 可以考虑使用备用磁盘保存证据.
Then you have to worry about how long ago the compromise happened, and whether the backups hold any damaged work. More on backups later.
然后, 如果您担心入侵发生多久了, 以及是否备份中包含了破坏了的数据. 那就恢复较旧的数据.
Backups, Backups, Backups! 备份,备份,备份!
Having regular backups is a godsend for security matters. If your system is compromised, you can restore the data you need from backups. Of course, some data is valuable to the attacker too, and they will not only destroy it, they will steal it and have their own copies; but at least you will still have the data.
正规的备份, 对于安全事件来说是意想不到的惊喜. 如果您的系统被入侵了, 您可以从备份中恢复所需数据. 当然, 有些数据对于攻击者也很有价值, 他们可能不会破坏它, 而只是窃取它, 获取一个拷贝; 但至少你还拥有数据.
You should check several backups back into the past before restoring a file that has been tampered with. The intruder could have compromised your files long ago, and you could have made many successful backups of the compromised file!
在恢复前, 您应当检查备份文件, 看是否是被篡改的. 入侵者可能入侵了您的系统很久了, 也许您已经对入侵文件做了多次备份.
Of course, there are also a raft of security concerns with backups. Make sure you are storing them in a secure place. Know who has access to them. (If an attacker can get your backups, they can have access to all your data without you ever knowing it.)
当然, 备份还包括很多安全方面的内容. 确保您将它们存储在了安全的地方. 知道谁可以接触它们.(如果攻击者可以获取您的备份, 那么他们可以在您不知晓的情况下, 接触所有数据.)
Tracking Down the Intruder. 追踪入侵者
Ok, you have locked the intruder out, and recovered your system, but you're not quite done yet. While it is unlikely that most intruders will ever be caught, you should report the attack.
Ok, 您现在可以将入侵者拒之门外, 并对系统进行恢复, 但是这是不够的. 抓住大多数的入侵者是不可能的, 您需要报告入侵事件.
You should report the attack to the admin contact at the site from which the attacker attacked your system. You can look up this contact with whois or the Internic database. You might send them an email with all applicable log entries and dates and times. If you spotted anything else distinctive about your intruder, you might mention that too. After sending the email, you should (if you are so inclined) follow up with a phone call. If that admin in turn spots your attacker, they might be able to talk to the admin of the site where they are coming from and so on.
您应当向攻击者利用的攻击您的站点的管理员报告攻击事件. 可以使用 whois 或 Internic 数据库查找站点的管理员. 您可以将所有的相关日志, 日期和时间通过电子邮件发送给他们. 如果您获取了攻击者的某些详细信息, 也可以发送给他们. 发送邮件以后, 您应当(如果有必要)通过电话联系一下. 如果管理员可以找到攻击源, 那么他们可以同攻击的上游站点的管理员联系.
Good crackers often use many intermediate systems, some (or many) of which may not even know they have been compromised. Trying to track a cracker back to their home system can be difficult. Being polite to the admins you talk to can go a long way to getting help from them.
老练的攻击者通常会使用多级系统跳板, 通常跳板并不知道被入侵了. 试图追踪攻击者是很困难的. 有礼貌的同管理员交流, 可以使获得很大的帮助.
You should also notify any security organizations you are a part of ( CERT or similar), as well as your Linux system vendor.
您还应当通知您所属的安全组织( CERT 或类似的), 以及您的 Linux 系统提供商. |
|