IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> Arkime3(moloch)安装与配置 -> 正文阅读

[系统运维]Arkime3(moloch)安装与配置

00x0 前言

安装服务器环境是CentOS 7,安装当前最新的版本arkime-3.1.1

00x1 安装

1. 下载rpm包

# wget https://s3.amazonaws.com/files.molo.ch/builds/centos-7/arkime-3.1.1-1.x86_64.rpm

2. 安装依赖

# yum -y install perl-libwww-perl perl-JSON libyaml-devel perl-LWP-Protocol-https

3. 安装rpm包

# rpm -ivh arkime-3.1.1-1.x86_64.rpm

4. 安装回显

在这里插入图片描述

注意:提示需要按照README的来运行配置文件

00x2 配置

[root@localhost arkime]# cat README.txt 
Instructions for using the prebuilt Arkime packages.
Please report any bugs or feature requests by opening an issue at https://github.com/arkime/arkime/issues

Basic Arkime Installation steps:
 1) Download an Arkime build for 64bit Ubuntu 14.04, Ubuntu 16.04, Centos 6, or Centos 7 from http://arkime.com/index.html#downloads
 2) Install package
 3) Configure basic arkime items by running the Configure script (this needs to be done only once)
     /opt/arkime/bin/Configure
 4) The Configure script can install elasticsearch for you or you can install yourself
      systemctl start elasticsearch.service
 5) Initialize/Upgrade Elasticsearch Arkime configuration
    a) If this is the first install, or want to delete all data
      /opt/arkime/db/db.pl http://ESHOST:9200 init
    b) If this is an update to a moloch/arkime package
      /opt/arkime/db/db.pl http://ESHOST:9200 upgrade
 6) Add an admin user if a new install or after an init
      /opt/arkime/bin/arkime_add_user.sh admin "Admin User" THEPASSWORD --admin
 7) Start everything
      systemctl start arkimecapture.service
      systemctl start arkimeviewer.service
 8) Look at log files for errors
      /opt/arkime/logs/viewer.log
      /opt/arkime/logs/capture.log
 9) Visit http://arkimeHOST:8005 with your favorite browser.
      user: admin
      password: THEPASSWORD from step #6

If you want IP -> Geo/ASN to work, you need to setup a maxmind account and the geoipupdate program.
See https://arkime.com/faq#maxmind

Any configuration changes can be made to /opt/arkime/etc/config.ini
See https://arkime.com/faq#moloch-is-not-working for issues

Additional information can be found at:
  * https://arkime.com/faq
  * https://arkime.com/settings

1. 运行配置向导脚本

1.1 安装jdk环境

# yum install java-11-openjdk -y //yum安装arkime依赖jDK环境

# java -version
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7-LTS, mixed mode, sharing)

1.2 运行配置脚本

主要做几件事:

  1. 确定抓包接口
  2. 下载并安装默认的es版本,用于快速演示部署(本文采用),生产需要指向生产es
  3. 检查jdk环境,如果没有会提示,安装后再次运行脚本
  4. 下载MaxMind的GEO地理位置数据,这个需要去注册一个账号,这样数据显示可以带上地址位置(本文没有选择)
# cd /opt/arkime/bin/

#./Configure 
Found interfaces: eth0;lo
Semicolon ';' seperated list of interfaces to monitor [eth1] eth0 //选择抓包接口
Install Elasticsearch server locally for demo, must have at least 3G of memory, NOT recommended for production use (yes or no) [no] yes //是否要本地安装es,至少要3G内存,这边主要是演示环境,不推荐生产
/usr/bin/java //这边提示有java环境,如果不是则需要安装jdk环境,再运行配置脚步
Password to encrypt S2S and other things [no-default] S3cur!2019
Arkime - Creating configuration files
Not overwriting /opt/arkime/etc/config.ini, delete and run again if update required (usually not), or edit by hand
Installing systemd start files, use systemctl
Arkime - Downloading and installing demo OSS version of Elasticsearch
Loaded plugins: fastestmirror
elasticsearch-oss-7.10.2-x86_64.rpm                                                                                                         | 220 MB  00:00:33     
Examining /var/tmp/yum-root-Wzs9zH/elasticsearch-oss-7.10.2-x86_64.rpm: elasticsearch-oss-7.10.2-1.x86_64
/var/tmp/yum-root-Wzs9zH/elasticsearch-oss-7.10.2-x86_64.rpm: does not update installed package.
Error: Nothing to do
Download GEO files? You'll need a MaxMind account https://arkime.com/faq#maxmind (yes or no) [yes] no
Arkime - NOT downloading GEO files

Arkime - Configured - Now continue with step 4 in /opt/arkime/README.txt

 4) The Configure script can install elasticsearch for you or you can install yourself
      systemctl start elasticsearch.service
 5) Initialize/Upgrade Elasticsearch Arkime configuration
  a) If this is the first install, or want to delete all data
      /opt/arkime/db/db.pl http://ESHOST:9200 init
  b) If this is an update to a moloch/arkime package
      /opt/arkime/db/db.pl http://ESHOST:9200 upgrade
 6) Add an admin user if a new install or after an init
      /opt/arkime/bin/arkime_add_user.sh admin "Admin User" THEPASSWORD --admin
 7) Start everything
      systemctl start arkimecapture.service
      systemctl start arkimeviewer.service
 8) Look at log files for errors
      /opt/arkime/logs/viewer.log
      /opt/arkime/logs/capture.log
 9) Visit http://arkimeHOST:8005 with your favorite browser.
      user: admin
      password: THEPASSWORD from step #6

If you want IP -> Geo/ASN to work, you need to setup a maxmind account and the geoipupdate program.
See https://arkime.com/faq#maxmind

Any configuration changes can be made to /opt/arkime/etc/config.ini
See https://arkime.com/faq#moloch-is-not-working for issues

Additional information can be found at:
  * https://arkime.com/faq
  * https://arkime.com/settings

2. 开启服务

2.1 开启本地安装的elasticsearch

# systemctl start elasticsearch.service

3. 创建Web访问账号

1qaz2wsx替换为你的密码

# /opt/arkime/bin/arkime_add_user.sh admin "Admin User" 1qaz2wsx --admin
Added

4. 初始化elasticsearch

需要使用arkime提供的db.pl对es进行初始化

# /opt/arkime/db/db.pl http://localhost:9200 init

It is STRONGLY recommended that you stop ALL Arkime captures and viewers before proceeding.  Use 'db.pl http://localhost:9200 backup' to backup db first.

There is 1 elastic search data node, if you expect more please fix first before proceeding.

This is a fresh Arkime install
Erasing
Creating
Finished

5. 启动web服务

5.1 启动arkimeviewer(web服务)

# systemctl start arkimeviewer.service
# systemctl status arkimeviewer.service //查看arkimeviewer服务是否运行正常

5.2 启动arkimecapture(抓包服务)

由于arkimecapture依赖GEO位置数据,运行配置脚本的时候我并没有选择安装GEO,所以也就无法启动了,下面提供了一个办法,通过分析arkime_update_geo.sh脚本内容来达到支持GEO位置信息包更新的目的。

注意:由于国内网络环境有的时候无法正常下载GEO数据,所以我上面就没有选择安装,而是直接手动运行脚本安装,但发现运行脚本也不行,于是我们打开这个shell脚本,看看到底需要下载什么数据

# cd /opt/arkime/bin
# vim arkime_update_geo.sh 

从脚本上主要就是要把2个文件拷贝复制到/opt/arkime/conf目录下,并且用chmod修改权限

#!/bin/bash

# Variables

DEST_DIR="${MOLOCH_DIR:-/opt/arkime}/etc"
TIMEOUT=${WGET_TIMEOUT:-30}

# Check we have a number for timeout

if ! [[ $TIMEOUT =~ ^[0-9]+$ ]] ; then
    echo "WGET_TIMEOUT isn't a number '$TIMEOUT'"
    exit 1;
fi

# Try and download ipv4-address-space.csv, only copy if it works

FILENAME=$(mktemp)
wget -nv --timeout=${TIMEOUT} --no-check-certificate -O "$FILENAME" https://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.csv
if (( $? == 0 )) ; then
  chmod a+r "$FILENAME"
  mv "$FILENAME" "${DEST_DIR}/ipv4-address-space.csv"
fi

# Try and download manuf, only copy if it works

FILENAME=$(mktemp)
wget -nv --timeout=${TIMEOUT} -O "$FILENAME" https://raw.githubusercontent.com/wireshark/wireshark/master/manuf
if (( $? == 0 )) ; then
  chmod a+r "$FILENAME"
  mv "$FILENAME" "${DEST_DIR}/oui.txt"
fi

# Call the maxind geoipupdate program if available. See

# https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/

# https://dev.maxmind.com/geoip/geoipupdate/#For_Free_GeoLite2_Databases

if [ -x "/usr/bin/geoipupdate" ]; then
    /usr/bin/geoipupdate
    chmod a+r /usr/share/GeoIP/*.mmdb
fi


文件我下载放到CSDN上了,点击下载,文件解压到/opt/arkime/conf,并修改下权限

# chmod a+r oui.txt 
# chmod a+r ipv4-address-space.csv

这个时候就可以启动服务了

# systemctl start arkimecapture.service
# systemctl status arkimecapture.service //观察arkimecapture服务是否启动成功

6. 访问界面

ipaddress替换为你安装的服务器IP

http://ipaddress:8005
  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2021-10-22 11:20:10  更:2021-10-22 11:22:23 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 20:48:11-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码