Last-modified: 2020-02-09 (日) 21:08:59
Moloch/チートシート

はじめに

サンプルのローカルIP範囲は、192.168.12.0/24 で統一しています。

クエリ

基本

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
-
|
|
!
-
|
|
!
-
|
!
-
|
|
!
-
# 論理積(&&)
# 論理和(||, <field>==[val1, val2, val3])
# 否定(!)
 
# ワイルドカード("*.example.com")
# 正規表現(/.*\.example\.com/)
#  ワイルドカード, 正規表現をリスト(e.g. [val1, val2, val3])内に書くとただの文字列扱い
 
# IP(192.168.1.10, 192.168.1.0/24)
#   port同時指定も可能(192.168.1.10:443)
 
# 存在確認(EXIST!)
#   存在する(cert.issuer.cn==EXISTS!)
#   存在しない(cert.issuer.cn!=EXISTS!)
 
# フィールド名は、検索ボックスのインテリセンスか、検索画面左上のフクロウをクリックして[Fields]

ブロック/不通

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
-
!
 
-
!
# 外部→内部
packets.dst==0 && ip.dst==192.168.12.0/24 && protocols!=icmp
 
# 内部→外部
packets.src==0 && ip.src==192.168.12.0/24 && protocols!=icmp

API

https://molo.ch/api

フォーマット

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 
 
-
|
|
|
|
|
|
|
|
|
|
!
curl --digest -u <user>:<password> "http://<moloch server>/<API path>"
 
# 検索(sessions.json, sessions.csv)
# よく使うオプション
# URLエンコード必須(CyberChefをローカルに配置して使うのが楽)
#   expression: クエリ, e.g. expression=country!=JP%20&&%20port.dst!=443 (country!=JP && port.dst!=443)
#   length: 結果数(最大200万件), e.g. length=1000
#   startTime/stopTime: 検索日時(UTC)
#     e.g. JST1日(00:00 - 23:59:59) : startTime=2020/02/09%2015:00:00&stopTime=2020/02/10%2014:59:59
#          JST日中(08:00 - 19:59:59): startTime=2020/02/09%2023:00:00&stopTime=2020/02/10%2010:59:59
#          JST夜間(20:00 - 07:59:59): startTime=2020/02/10%2011:00:00&stopTime=2020/02/10%2022:59:59
#   fields: 結果フィールド, e.g. 
#   order: 結果ソート, e.g. 
curl --digest -u <user>:<password> "http://<moloch server>/sessions.json?expression=<URLエンコードしたクエリ>"

a

Everything is expanded.Everything is shortened.
  1
 
a