Merge pull request #736 from Yamato-Security/727-null-channel-output-with-hayabusa-170-mac-intel-d-hayabusa-sample-evtx-m
Excluded null channel in record from detection and metric.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- より正確な結果を出力するために、チャンネルとEIDの情報を`rules/config/channel_eid_info.txt`に基づいてチェックするようにした。 (#463) (@garigariganzy)
|
||||
- 検知ルールを利用しないオプション(`-M`と`-L`オプション)の時のメッセージの出力内容を修正した。 (#730) (@hitenkoku)
|
||||
- 検出したルールの作者名を標準出力に追加した。 (#724) (@hitenkoku)
|
||||
- チャンネル情報が`null`となっているレコード(ETWイベント)を検知およびmetricの対象から除外した。 (#727) (@hitenkoku)
|
||||
|
||||
**バグ修正:**
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
- Hayabusa now checks Channel and EID information based on `rules/config/channel_eid_info.txt` to provide more accurate results. (#463) (@garigariganzy)
|
||||
- Do not display a message about loading detection rules when using the `-M` or `-L` options. (#730) (@hitenkoku)
|
||||
- Added a table of rule authors to standard output. (#724) (@hitenkoku)
|
||||
- Ignore event records when the channel name is `null` (ETW events) when scanning and performing metrics. (#727) (@hitenkoku)
|
||||
|
||||
**Bug Fixes:**
|
||||
|
||||
|
||||
20
src/main.rs
20
src/main.rs
@@ -738,9 +738,9 @@ impl App {
|
||||
continue;
|
||||
}
|
||||
|
||||
// target_eventids.txtでイベントIDベースでフィルタする。
|
||||
let data = record_result.as_ref().unwrap().data.clone();
|
||||
if !self._is_target_event_id(&data)
|
||||
// channelがnullである場合もしくは、target_eventids.txtでイベントIDベースでフィルタする。
|
||||
if !self._is_valid_channel(&data) | !self._is_target_event_id(&data)
|
||||
&& !configs::CONFIG.read().unwrap().args.deep_scan
|
||||
{
|
||||
continue;
|
||||
@@ -823,12 +823,24 @@ impl App {
|
||||
}
|
||||
|
||||
match eventid.unwrap() {
|
||||
Value::String(s) => utils::is_target_event_id(s),
|
||||
Value::Number(n) => utils::is_target_event_id(&n.to_string()),
|
||||
Value::String(s) => utils::is_target_event_id(&s.replace('\"', "")),
|
||||
Value::Number(n) => utils::is_target_event_id(&n.to_string().replace('\"', "")),
|
||||
_ => true, // レコードからEventIdが取得できない場合は、特にフィルタしない
|
||||
}
|
||||
}
|
||||
|
||||
/// レコードのチャンネルの値が正しい(Stringの形でありnullでないもの)ことを判定する関数
|
||||
fn _is_valid_channel(&self, data: &Value) -> bool {
|
||||
let channel = utils::get_event_value("Event.System.Channel", data);
|
||||
if channel.is_none() {
|
||||
return false;
|
||||
}
|
||||
match channel.unwrap() {
|
||||
Value::String(s) => s != "null",
|
||||
_ => false, // channelの値は文字列を想定しているため、それ以外のデータが来た場合はfalseを返す
|
||||
}
|
||||
}
|
||||
|
||||
fn evtx_to_jsons(&self, evtx_filepath: PathBuf) -> Option<EvtxParser<File>> {
|
||||
match EvtxParser::from_path(evtx_filepath) {
|
||||
Ok(evtx_parser) => {
|
||||
|
||||
Reference in New Issue
Block a user