網絡分析利器wireshark命令版:Apache Spot中tshark模塊(3)

tshark是網絡分析工具wireshark下的一個工具,主要用於命令行環境進行抓包、分析,尤其對協議深層解析時,tcpdump難以勝任的場景中。本系列文章將整理介紹tshark相關內容。本文將介紹與tshark相關的開源系統。

Apache Spot

Spot簡介

Apache Spot是一個開源軟件,提供流量和數據包分析的洞察力。通過透明的服務交付,可以幫助識別企業與服務提供商或在雲規模運營的資源之間發生的攻擊、潛在安全威脅,深入瞭解其網絡環境及安全風險。雖然威脅情報工具有助於識別未知威脅和攻擊,但發現未知威脅仍然是一項挑戰。 Apache Spot通過大數據和科學計算學科中強大的技術,專注於檢測諸如橫向移動,旁道數據逃逸,內幕問題或隱身行爲等事件的“深層安全問題”,使用流量和數據包分析技術暴露可疑連接和以前看不見的攻擊的能力,爲公司構建一個旨在支持這一戰略的解決方案。

整體架構

Spot產品架構圖

主要功能及特點

感知Telemetry

  • Flows.
  • 域名解析DNS (pcaps).
  • 代理Proxy.

** 並行採集框架Parallel Ingest Framework

  • 開源解碼器Open source decoders.
  • 讀取hadoop數據Load data in Hadoop.
  • 數據轉換Data transformation.

機器學習Machine Learning

  • 快速過濾10億級事件Filter billion of events to a few thousands.
  • 無監督學習Unsupervised learning.

操作分析Operational Analytics

  • 可視化Visualization.
  • 啓發式分析Attack heuristics.
  • 噪音過濾Noise filter.

Spot採集架構

Spot數據處理架構
由上圖可知,Apache Spot在處理DNS流量時採用tshark方案,用於協議解析數據ETL等工作。

tshark相關源碼

根據架構圖,發現主要在ingest模塊,查看相關源碼,可以發現Spot是如何應用tshark的。具體代碼如下:

查看源碼 spot-ingest/pipelines/dns/worker.py

        # build process cmd.
        process_cmd = "tshark -r {0}{1} {2} > {0}{1}.csv".format(self._local_staging, file_name, self._process_opt)

再查看相關配置 spot-ingest/ingest_conf.json

        "dns":{
            "type":"dns",
            "collector_path":"/collector_path/dns",
            "local_staging":"/collector_path/dns/tmp",
            "supported_files":[".pcap"],
            "pkt_num":"650000",
            "pcap_split_staging":"/collector_path/dns/dns_staging",    
            "process_opt":"-E separator=, -E header=y -E occurrence=f -T fields -e frame.time 
            -e frame.time_epoch -e frame.len -e ip.src -e ip.dst -e dns.resp.name 
            -e dns.resp.type -e dns.resp.class -e dns.flags.rcode -e dns.a 'dns.flags.response == 1'"
        },

上面Dshark命令就不詳細介紹,可參考上篇文章: tshark使用示例(2)

嘗試Demo

  1. 部署docker環境
  2. 抽取docker鏡像: docker pull apachespot/spot-demo
  3. 啓動鏡像: docker run -it -p 8889:8889 apachespot/spot-demo
  4. 在瀏覽器中打開 http://localhost:8889/files/ui/flow/suspicious.html#date=2016-07-08

參考

系列文章:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章