在centos上安裝moloch
使用moloch-1.6.1-1.x86_64.rpm進行安裝,環境centos7,Elasticsearch6.4.
在centos7上安裝時:
第一步:yum install -y perl-JSON perl-libwww-perl libyaml-devel
第二步:rpm -ivh moloch-1.6.1-1.x86_64.rpm
第三步:/data/moloch/bin/Configure
按照提示進行配置:
Found interfaces: enxxx1;enxxx2;enxxx3;enxxx4;enxxx0;enxxx1;lo
Semicolon ';' seperated list of interfaces to monitor [eth1] enxxx2(按照上面所列出的網路卡介面,選擇捕獲資料包的網路卡)
Install Elasticsearch server locally for demo, must have at least 3G of memory, NOT recommended for production use (yes or no) [no] no(選擇no)
Elasticsearch server URL [http://localhost:9200] http://xxx.xxx.xxx.xxx:9200(輸入ES資料庫地址)
Password to encrypt S2S and other things [no-default] (輸入相關的密碼)
Moloch - Creating configuration files
Installing systemd start files, use systemctl
Moloch - Installing /etc/logrotate.d/moloch to rotate files after 7 days
Moloch - Installing /etc/security/limits.d/99-moloch.conf to make core and memlock unlimited
Download GEO files? (yes or no) [yes] yes(選擇yes,下載相關地理位置檔案)
Moloch - Downloading GEO files
2018-12-04 09:14:46 URL:https://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.csv [23031] -> "ipv4-address-space.csv" [1]
WARNING: timestamping does nothing in combination with -O. See the manual
for details.
2018-12-04 09:14:52 URL:https://updates.maxmind.com/app/update_secure?edition_id=GeoLite2-Country [1792881/1792881] -> "GeoLite2-Country.mmdb.gz" [1]
WARNING: timestamping does nothing in combination with -O. See the manual
for details.
2018-12-04 09:15:17 URL:https://updates.maxmind.com/app/update_secure?edition_id=GeoLite2-ASN [3483756/3483756] -> "GeoLite2-ASN.mmdb.gz" [1]
2018-12-04 09:15:29 URL:https://raw.githubusercontent.com/wireshark/wireshark/master/manuf [1523729/1523729] -> "oui.txt" [1]
Moloch - Configured - Now continue with step 4 in /data/moloch/README.txt
/sbin/start elasticsearch # for upstart/Centos 6/Ubuntu 14.04
systemctl start elasticsearch.service # for systemd/Centos 7/Ubuntu 16.04
5) Initialize/Upgrade Elasticsearch Moloch configuration
a) If this is the first install, or want to delete all data
/data/moloch/db/db.pl http://ESHOST:9200 init
b) If this is an update to moloch package
/data/moloch/db/db.pl http://ESHOST:9200 upgrade
6) Add an admin user if a new install or after an init
/data/moloch/bin/moloch_add_user.sh admin "Admin User" THEPASSWORD --admin
7) Start everything
a) If using upstart (Centos 6 or sometimes Ubuntu 14.04):
/sbin/start molochcapture
/sbin/start molochviewer
b) If using systemd (Centos 7 or Ubuntu 16.04 or sometimes Ubuntu 14.04)
systemctl start molochcapture.service
systemctl start molochviewer.service
8) Look at log files for errors
/data/moloch/logs/viewer.log
/data/moloch/logs/capture.log
9) Visit http://MOLOCHHOST:8005 with your favorite browser.
user: admin
password: THEPASSWORD from step #6
第四步:/data/moloch/db/db.pl http://xx.xx.xx.xx:9200 init
第五步:/data/moloch/bin/moloch_add_user.sh admin "Admin User" 這裡輸入admin的密碼 --admin
第六步:調整ES資料庫的刪除週期
cd /data/moloch/db
vi daily.sh
#!/bin/sh
# This script is only needed for Moloch deployments that monitor live traffic.
# It drops the old index and optimizes yesterdays index.
# It should be run once a day during non peak time.
# CONFIG
ESHOSTPORT=xxx.xxx.xxx.xxx:9200(修改)
RETAINNUMDAYS=7(修改)
/data/moloch/db/db.pl $ESHOSTPORT expire daily $RETAINNUMDAYS
然後:使用命令crontab -e
編輯寫入以下內容:00 01 * * * /data/moloch/db/daily.sh >> /data/moloch/logs/daily.log 2>&1
使用crontab -l檢視是否成功
第七步:調整pcap刪除週期
cd /data/moloch/etc
vi config.ini
freeSpaceG = 20%(根據自己需要,修改臨界值用於刪除pcap)
最後:
啟動服務:
systemctl start molochcapture.service
systemctl start molochviewer.service
在瀏覽器中輸入http://xx.xx.xx.xx:8005
http://hackforlab.com/moloch-usage/
https://qbox.io/blog/introduction-using-moloch-elasticsearch
http://blog.alejandronolla.com/2013/04/06/moloch-capturing-and-indexing-network-traffic-in-realtime/
相關文章
- 在CentOS上安裝dockerCentOSDocker
- 在CentOS上安裝GitCentOSGit
- 在CentOS 8.1上安裝 DockerCentOSDocker
- 在Centos7上安裝DockerCentOSDocker
- 在CentOS 7.5上安裝和配置ProFTPDCentOSFTP
- 在Red Hat和Centos上安裝MongoDBCentOSMongoDB
- 截圖利器:shutter在centos上的安裝CentOS
- 在 Centos/RHEL 6.X 上安裝 WettyCentOS
- 在Centos8上安裝和使用curlCentOS
- 在centos7上安裝mysql5.7CentOSMySql
- 在Centos7上安裝Redis6CentOSRedis
- CentOS 上安裝 NginxCentOSNginx
- centos上安裝grafanaCentOSGrafana
- 在linux centos伺服器上安裝telnet命令LinuxCentOS伺服器
- 在rhel和CentOS上安裝SQL Server的方法CentOSSQLServer
- PostgreSQL tar.gz在centos7上安裝SQLCentOS
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- centos 線上安裝 dockerCentOSDocker
- 在 CentOS 中安裝 nodejsCentOSNodeJS
- 在 CentOS7 上安裝 zookeeper-3.4.9 服務CentOS
- 在Centos7上安裝圖形化桌面工具CentOS
- openGauss資料庫在CentOS上的安裝實踐資料庫CentOS
- 記一次在CentOS上安裝GitLab的流程CentOSGitlab
- Docker架構及在Centos7上安裝dockerDocker架構CentOS
- 在VMware已安裝的CentOS7.9上編譯安裝mysql5.6CentOS編譯MySql
- Centos7上安裝dockerCentOSDocker
- Linux Centos上安裝 MySQL 8.0.16LinuxCentOSMySql
- Centos上安裝Node環境CentOS
- 在VMware上安裝CentOS版本的Linux虛擬機器CentOSLinux虛擬機
- 在CentOS 8上安裝與配置Apache虛擬主機CentOSApache
- 在CentOS7上安裝MySQL5.7-YUM源方式CentOSMySql
- 在linux(Centos 7以上版本親測)上安裝mysql5.6LinuxCentOSMySql
- VIM在CentOS7上的無root許可權安裝CentOS
- 在Centos 上安裝oracle-database-preinstall-19c軟體包CentOSOracleDatabase
- 教你如何在 CentOS 上安裝RedisCentOSRedis
- vmware 線上安裝 CentOS7CentOS
- centos6.5上安裝mysql 5.7.20CentOSMySql
- 如何在 CentOS 7 上安裝 NginxCentOSNginx