centos7 运行 jar_CentOS7下部署开源网络流量回溯分析系统Moloch

b6aad58a2e247a55fef272b00708a124.png

CentOS7下部署开源网络流量回溯分析系统Moloch

Moloch 是一个由AOL开源的,能够大规模的捕获IPv4数据包(PCAP)、索引和数据库系统,由以下三个部分组成:

1)capture :绑定interface运行的单线程C语言应用

2)viewer :运行在capture主机上的node.js web应用

3)elasticsearch : moloch的数据检索驱动

1、下载Moloch CentOS7版本的RPM包

https://molo.ch/downloads

40bd991cf80123697e131aedbd2457ff.png

https://s3.amazonaws.com/files.molo.ch/builds/centos-7/moloch-2.4.0-1.x86_64.rpm

另外下载elasticsearch Linux系统的RPM包 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-x86_64.rpm

08477c88e9f05338868e0e0352f6aa4f.png

2、上传jdk,配置jdk环境变量

tar -zxvf jdk-8u261-linux-x64.tar.gz -C /usr/local/cd /usr/local/mv jdk1.8.0_261 jdkecho "export JAVA_HOME=/usr/local/jdk" >>  /etc/profile.d/java8.shecho "export PATH=$PATH:$JAVA_HOME/bin" >>  /etc/profile.d/java8.shecho "export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar" >>  /etc/profile.d/java8.shsource /etc/profile.d/java8.sh

3、安装并配置elasticsearch

1)调整JVM内存大小

cd /opt/rpm -ivh elasticsearch-7.9.1-x86_64.rpmcd  /etc/elasticsearch/vi jvm.options
60a478efdf00fc3721d549c9fa7b3384.png
2fcadad882a343f2e9d4f35e643da125.png
c2744ff0aa3cfe149b524828b9768581.png

2)修改elasticsearch配置文件

cd /datamkdir /data/elasticsearchmkdir -p /data/log/elasticsearchchown -R elasticsearch:elasticsearch elasticsearchchown -R elasticsearch:elasticsearch log
vi /etc/elasticsearch/elasticsearch.yml#修改如下几个地方path.data: /data/elasticsearchpath.logs: /data/log/elasticsearchnetwork.host:10.20.90.46http.port:9200discovery.seed_hosts: ["10.20.90.46"]
f7de4e4f5a5b48fa977e1c34ab9ade84.png
7275318442ae3d8fb7a574fd686114d8.png

3)启动elasticsearch

systemctl daemon-reloadsystemctl enable elasticsearch.servicesystemctl start elasticsearch.service

最后可以curl http://IP:9200测试服务是否正常运行

4、安装Moloch

yum localinstall moloch-2.4.0-1.x86_64.rpm
e727f7eba8d2bdedb81ccd19a9c63ac9.png

5、Moloch初始化配置

cd /data/moloch/bin./Configure

选择需要监控的网卡 也就是你的镜像流量对应的网卡

25a3525f5d01d998382ddd89cbb50206.png
0496571929a611c04389e8856f44ab1e.png
/data/moloch/db/db.pl http://10.20.90.46:9200 init
fcecc404b51b713265d038338b2658f1.png

出现如下报错时 Couldn't GET http://10.20.90.46:9200/_cluster/health the http status code is 503 are you sure elasticsearch is running/reachable? at /data/moloch/db/db.pl line 277.

解决办法如下

vi /etc/elasticsearch/elasticsearch.yml修改配置文件如下行,配置node.name及cluster.initial_master_nodes,然后重启elasticsearchnode.name: es-nodecluster.initial_master_nodes: ["es-node"]systemctl restart elasticsearch.service 

继续初始化配置

/data/moloch/bin/moloch_add_user.sh admin "Admin User" admin --adminsystemctl start molochcapture.servicesystemctl start molochviewer.servicenetstat -anp | grep 8005
447067a6bdd171b2efbf4ab42c2bc50c.png

6、web登录并体验Moloch

http://IP:8005,密码为之前的初始化时设置的密码

5c954a1b35fb7931f4304317e072e073.png
af20dc93026a33d82ffc20623bb8e3b2.png
942fd23e764075a829dafac6693ead80.png
487a1f190eafcf09604aa6ea55513658.png

具体使用帮助可以点击猫头鹰头像

7fa845cbdd55652fbdb1c717b6f72c1f.png

7、开启镜像网卡的混杂模式

ifconfig ens33 promisc
ad5af89b66e46cb035297203b55ee5e3.png
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值