zoukankan      html  css  js  c++  java
  • packetbeat

    下载并安装实现libpcap接口的数据sniffing库,例如Npcap。

    如果使用Npcap,请确保以WinPcap API兼容模式安装它。 如果您打算从loopback设备捕获流量(127.0.0.1流量),则还选择支持loopback流量的选项。

    从下载页面下载Packetbeat Windows zip文件
    将zip文件的内容提取到C:Program Files
    将packetbeat- <版本> -windows目录重命名为Packetbeat
    以管理员身份打开PowerShell提示符(右键单击PowerShell图标,然后选择“以管理员身份运行”)。
    在PowerShell提示符下,运行以下命令以将Packetbeat安装为Windows服务:

    PS > cd 'C:Program FilesPacketbeat'
    PS C:Program FilesPacketbeat> .install-service-packetbeat.ps1
     请注意:如果在系统上禁用了脚本执行,则需要为当前会话设置执行策略以允许脚本运行。 例如:

    PowerShell.exe -ExecutionPolicy UnRestricted -File .install-service-packetbeat.ps1
    在使用Packetbeat之前,我们必须配置Packetbeat才可以使它正常工作。在Packetbeat的安装目录下,有一个叫做packetbeat.yml的配置文件(针对Linux的情况,它位于/etc/packetbeat/目录下)。在最简单的情况下,我们必须修改:

    .packetbeat.exe devices   查看网卡信息写入yml

    packetbeat.interfaces.device: 3

    output.elasticsearch:
    hosts: ["myEShost:9200"]
    username: "filebeat_internal"
    password: "YOUR_PASSWORD"
    setup.kibana:
    host: "mykibanahost:5601"
    username: "my_kibana_user"
    password: "YOUR_PASSWORD"
    我们需要把Elasticsearch及Kibana的地址填入到上面的位置。这样我们我们就可以把数据传入到Elasticsearch中,并在Kibana中的Dashboard中进行展示。更多的配置请参阅Elastic的官方文档“Configure Packetbeat”。
    .packetbeat.exe setup --dashboards

    1) 安装packetbeat
    [root@web01 ~]# rpm -ivh packetbeat-7.4.0-x86_64.rpm

    2) 配置packetbeat
    [root@web01 ~]# cat /etc/packetbeat/packetbeat.yml
    #监控所有的网卡流量
    packetbeat.interfaces.device: eth0

    packetbeat.flows:
    timeout: 30s
    period: 10s


    packetbeat.protocols:
    - type: icmp
    enabled: true

    - type: dns
    ports: [53]

    - type: http
    ports: [80, 8080, 8000, 5000, 8002]

    - type: mysql
    ports: [3306,3307]

    - type: redis
    ports: [6379]

    - type: nfs
    ports: [2049]

    - type: tls
    ports:
    - 443 # HTTPS
    - 993 # IMAPS
    - 995 # POP3S
    - 5223 # XMPP over SSL
    - 8443
    - 8883 # Secure MQTT
    - 9243 # Elasticsearch

    setup.kibana:
    host: "10.0.0.161:5601"

    output.elasticsearch:
    hosts: ["10.0.0.161:9200","10.0.0.162:9200","10.0.0.163:9200"]


    3) 重启packetbeat
    [root@web01 ~]# systemctl restart packetbeat

    4) 初始化环境
    [root@web01 ~]# packetbeat -e setup

  • 相关阅读:
    过滤器排序规则
    n维立体空间建模
    将多个Sheet导入到同一个Excel文件中
    Oracle分页查询
    SSH整合逻辑图
    MD5算法原理
    Spring框架整合Struts2
    Pandas入门——Series基本操作
    Python 使用selenium+webdriver爬取动态网页内容
    Python处理json和dict
  • 原文地址:https://www.cnblogs.com/joycezhou/p/13095455.html
Copyright © 2011-2022 走看看