红联Linux门户
Linux帮助

Ubuntu 10.10下Bothunter安装的一些事情

发布时间:2015-01-13 09:46:03来源:linux网站作者:jo_say

1 环境:Ubuntu10.10 + virtualbox4 + bridge + snort 2.8.5(这个不需要,后来才知道它的jar包中带有snort 2.9,而且被重新编译了)

[dpkg -s snort 查看版本】

2 Bouhunter本来是Gu搞的,现在属于:SRI International /  www.bothunter.net

3 我参考的用户版本是1.6的 应该是最新的了

4 类型定义为:A Network-based Infection Diagnosis System,看来已不仅仅是botnet检测了

5  team小组成员:Phillip Porras (Lead), Martin Fong, Keith Skinner, Steven Cheung,

Steven Dawson, Leigh Moulder (居然没有gu了,gu到德州当副教授了)

6 manual主要包括:系统需求,安装(unix,win),配置,在unix命令台的操作,验证正确的操作in unix, 读一个bot profile, 特殊特征,从前一版本的改变。

7 作者在welcome中提到:安装应该需要30分钟

8 对象:网络管理员,需要有配置网络设备的经验和起码的网络安全知识

9 bouhunter 是什么:BotHunter is NOT an intrusion detection system, firewall, spam blocker, or antivirus tool.

These tools generally don't work in help-ing you rid your network of malware infections. BotHunter takes a different approach:

BotHunter is a new network defensive system designed to help everyone from network administra-

tors to individual Internet-connected PC users detect whether their systems are running coordina-

tion-centric malware (such as botnets, spambots, spyware, Trojan exfiltrators, worms, adware). It is

based on an algorithm called network dialog correlation, developed under the Cyber-TA research

program, in the Computer Science Laboratory at SRI International.

10 更详细的说明其采用方法:

BotHunter monitors the two-way communication flows between hosts within your internal network

and the Internet. It aggressively classifies data exchanges that cross your network boundary as po-

tential dialog steps in the life cycle of an ongoing malware infection. BotHunter employs Snort as a

dialog event generator, and Snort is heavily modified and customized to conduct this dialog classifi-

cation process. Dialog events are then fed directly into a separate dialog correlation engine, where

BotHunter maps each host's dialog production patterns against an abstract malware infection life

cycle model. When enough evidence is acquired to declare a host infected, BotHunter produces an

infection profile to summarize all evidence it has gathered regarding the infection.

11 关于自动升级从SRI的web服务:

To utilize the BotHunter automated remote updating service, you must enable outbound connec-

tions from your BotHunter host to TCP ports 5242 and 6282. You may disable these outbound con-

nections and your BotHunter will function, but it will not be able to receive new threat intelligence

from our remote updating service.

12  安装到哪里?

Installation requires Internet connectivity for downloading the necessary libraries, packages, and

BotHunter ruleset updates.

For site-wide network monitoring, your target platform should have promiscuous-mode (混杂模式)access to

broadcast LAN traffic via port mirroring (e.g., Cisco Switched Port Analyzer (SPAN), 3COM Roving

Analysis Port (RAP)). Ideally, your machine should be attached to a monitoring position on an inter-

nal network egress point to observe successful connection flows.

We strongly recommend that you place BotHunter behind your firewall. It does not need to monitor

incoming packets that are blocked from entry to your net.

13 安装需求:

Root privilege is required to install BotHunter: While installation requires root privilege, Bot-

Hunter will not require root privilege to run. A nonprivileged account will be created to run

BotHunter.

·

Basic network configuration data is required:

o The IP netmask of the network you wish to protect

o IP addresses of your SMTP (email) and DNS servers

· Installing on hosts with prior BotHunter installation: BotHunter's root-phase installation

process will detect a prior installation to the selected nonprivileged user account and of-

fer to rename the prior installation directory (which can later be safely removed). If you

decline the rename, the installation will terminate. The network information from the

prior installation (home net, SMTP & DNS servers, and network interface) will become the

defaults for the current installation process, but any other uniquely set (nondefault) con-

figuration information will need to be reapplied.

· Sun's Java Runtime Environment (JRE) Release 1.5 or later (available here) is required.

Install the Java JRE or JDK before you proceed with the software installation.

14 安装JRE:

snort我之前已经安装ok,但是没有安装jre环境,上网查询后,发现ubuntu已经取消了直接在新立得中下载sun-jre,而是采用open-sdk替代,我就去Oracle官网下了新的jdk(包含jre),81M(自动安装的x86平台版)。

备注:下载以后安装时,先要给bin文件权限: chmod +x ...bin ,(表示给所有用户添加了执行权限)然后 ./..bin就可安装

15 根据manual的说明,中间可以选择安装tor代理,我没有,到后面,突然又提示我是否安装,我yes了,但是Ubuntu的软件库中居然把tor代理去掉了,直接就中止退出了,唉。。。

16 重新安装,ok。根据说明,bothunter需要一个新用话cta-bh, 当然也可以是老用户,但是需要cst(1),我也不太清楚,google下是一个类似c的shell。算了,懒得麻烦了,新建个用户吧 cta-bh.注意,在这个过程后,bothunter要开始编译snort,要花一段时间,不要以为是死机了,linux没那么容易死的

17  linux真的死了

18 这个过程很痛苦:我重启ubuntu后,按照安装说明书的第二阶段User configuration Procedure中的13步骤继续进行时,由于我之前指定了系统开机启动bothunter,因此它的进程已经启动,因此上述过程发生error后退出了。(但是我想看到后面的一些配置的细节内容,所以还是希望按照说明书的走一遍,尽管可能已经安装完毕了,另外补充,开机后,bothunter消耗的资源太不可思议了,我的整个ubuntu都缓慢不堪,只好使用chkconfig --level 2345 cte-BotHunter(忘了是否精确) off 将其开机启动关闭,然后重新重启。)重新启动后,又来到13步,这次ok了!看到了它的一些现实的配置信息,之后,系统提示是否继续安装

我选择了done,上述几项的内容解释可以参考manual的Configuring BotHunter部分。

当Bothunter第一次被调用时,它会创建一些列文件。包括keys,证书,日志和配置设置等。

19 可以在Console和GUI下操作(我之前在开机启动后,进入了那个cta-bh用户,奇慢无比。但是打开就有Bothunter GUI的图标,并且打开了,由于太慢,只好关闭)

20 看看如何在Unix Console Mode下操作:

Bothunter可以处理Snort产生的事件日志(下面四类输入处理模式皆可)

21 我们看bothunter如何在live pipe模式工作:

这是使用Bothunter监控某个网络时推荐的模式,这个状态snort日志按标准格式输出,然后进入Bothunter的correlation处理进程。当你配置bothunter在这个模式,系统将会提示你输入bothunter进程运行的命令。

22 在Live file mode:

如果不是live模式,那么下一步的命令就是让你选择一个输入源for snort alerts, 你可以选择输入源 [ OPTION 2] 来让bothunter从live snort log处理警告。这个方法允许你运行snort在bothunter的外部,但是你也必须assume the burden of restarting snort when it fails and managing disk storage space.

在这个模式,Bothunter处理完指定的input文件后不会终止,而是等待更多的数据添加到这个文件。同时,它也会持续监视这个文件路径,来看其是否变化(文件大小,突然无法访问,读到EOFs但是文件仍在增大)。具体的看manual14页。

23.Batch mode:批模式

24. Inline mode: 选择snort文件来处理,处理完后bothunter就会终止。

25 还可以多实例运行:

26 你可以修改运行时配置:

27. 关闭Bothunter

28 检查状态:

刚开始使用 Bothunter status,就出现了manual中说的问题

后来再调用这个命令就ok了,期间在执行java..时又提示已经运行,我就只好使用了bothunter shutdown.将其关闭后,调用,ok(但是我之后再使用Bothunter重新启动时,它又提示已经运行,管他呢)

29 使用案例警告文件来验证BotHunter

先说两点:

要想在batch模式下试验,先建立一个文件夹,放在bothunter文件夹的下面,之后使用类似

Java –jar ../bothunterinstall.jar configure这样的命令来进行配置

系统会列出你要修改配置的地方,这里要修改输入,当然选1,然后1中让你选择对应的数字

上面的那个命令中可以看到botHunterinstall.jar这个jar包被拷贝了一份到bothunter目录下,因此到处都是../

我找了一个event,里面有6项,复制到一个sample.log文件中,然后复制到这个目录下

可以看到虽然正常运行了,但是没有出了profile,为了确保就是这个事件,我又复制了一些事件到sample2.log中

个数为10,是正确的。但是还是没有profiles出来。这个可能是因为我自己的配置和事件的场景不匹配,因为作者在manual中说了,需要可信网络是:

192.168.0.0/16,那么我调整下试试:

如何调整呢:

还是之前的配置方法:

BotHunter shutdown
java –jar ../botHunterinstaller.jar configure
选择2,然后开始修改IP等。

还是不行,算了,暂时找不到原因,改日再曰。

【先留个位置】

30 读取一个Bot Profile,直接看就可以(GUI也支持,刚才下了个WUI,通过web看的,还没有安装)。

31 特殊配置:选择custom配置,以下均在custom模式下完成:

32 安装Bothunter到防火墙之前的配置,需要进入custom模式

33 Infection log Roll-over: 24页

34 email通知:enter the mail "to" destination (default "");

35 产生ArcSight cEF alerts警告

36 保存Snort log

37 安全频道令牌文件产生 p27

总结一下:

1 安装需要两步骤,它会自动下载很多东西,其实安装还是蛮简单的

2 第一步中间编译snort会花较长时间,不要着急,等待就可以。

3 执行要操作要进入对应的普通用户,默认是新建的cta-bh

4 操作:配置操作命令上文多次使用,很单一的方式,但是很强大智能。会给你7个大选项,然后向细处发展。

如果要实时操作,就要让其进入实时操作模式,默认的模式。

5 我的samples例子还没有实验成功。

先这样吧(qy)。