Skip to content

Commit d00737c

Browse files
add view event frequency timeline option (#567)
* added option visual-timeline option #566 * updated readme #566 * updated changelog #566 * updated rules * cargo fmt * change --visual-timeline to --visualize-timeline Co-authored-by: Tanaka Zakku <[email protected]>
1 parent 6811aca commit d00737c

File tree

7 files changed

+40
-30
lines changed

7 files changed

+40
-30
lines changed

CHANGELOG-Japanese.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# 変更点
22

3-
## v1.3.0 [2022/06/04]
3+
## v1.3.0 [2022/06/06]
44

55
**新機能:**
66

7-
- 検知されたイベントが5つ以上の時、イベント頻度のタイムラインを作成するようにした。 (#533) (@hitenkoku)
7+
- `--visualize-timeline`オプションで検知されたイベントが5つ以上の時、イベント頻度のタイムラインを作成するようにした。 (#533, #566) (@hitenkoku)
88
- `--all-tags`オプションでルールにある全てのtagsを、outputで指定したcsvのMitreAttackの列に出力するようにした。 (#525) (@hitenkoku)
99
- `-R` / `--display-record-id` オプションの追加。evtx file内のレコードを特定するレコードID`<Event><System><EventRecordID>`が出力できるようになった。 (#548) (@hitenkoku)
1010
- レベルごとの検知数が最も多い日を表示するようにした。 (#550) (@hitenkoku)

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Changes
22

3-
## v1.3.0 [2022/06/04]
3+
## v1.3.0 [2022/06/06]
44

55
**New Features:**
66

7-
- Added Event Frequency Timeline feature to visualize the number of events. (Note: There needs to be more than 5 events.) (#533)(@hitenkoku)
7+
- Added `-V / --visualize-timeline` option: Event Frequency Timeline feature to visualize the number of events. (Note: There needs to be more than 5 events and you need to use a terminal like Windows Terminal, iTerm2, etc... for it to properly render.) (#533, #566) (@hitenkoku)
88
- Display all the `tags` defined in a rule to the `MitreAttack` column when saving to CSV file with the `--all-tags` option. (#525) (@hitenkoku)
99
- Added the `-R / --display-record-id` option: Display the event record ID (`<Event><System><EventRecordID>`). (#548) (@hitenkoku)
1010
- Display dates with most detections. (#550) (@hitenkoku)

README-Japanese.md

+19-18
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Hayabusaは、日本の[Yamato Security](https://yamatosecurity.connpass.com/)
3131
- [スレット(脅威)ハンティング](#スレット脅威ハンティング)
3232
- [フォレンジックタイムラインの高速生成](#フォレンジックタイムラインの高速生成)
3333
- [スクリーンショット](#スクリーンショット)
34-
- [起動画面:](#起動画面)
35-
- [ターミナル出力画面:](#ターミナル出力画面)
36-
- [イベント頻度タイムライン出力画面:](#イベント頻度タイムライン出力画面)
37-
- [結果サマリ画面:](#結果サマリ画面)
38-
- [Excelでの解析:](#excelでの解析)
39-
- [Timeline Explorerでの解析:](#timeline-explorerでの解析)
40-
- [Criticalアラートのフィルタリングとコンピュータごとのグルーピング:](#criticalアラートのフィルタリングとコンピュータごとのグルーピング)
41-
- [Elastic Stackダッシュボードでの解析:](#elastic-stackダッシュボードでの解析)
34+
- [起動画面](#起動画面)
35+
- [ターミナル出力画面](#ターミナル出力画面)
36+
- [イベント頻度タイムライン出力画面 (`-V`オプション)](#イベント頻度タイムライン出力画面--vオプション)
37+
- [結果サマリ画面](#結果サマリ画面)
38+
- [Excelでの解析](#excelでの解析)
39+
- [Timeline Explorerでの解析](#timeline-explorerでの解析)
40+
- [Criticalアラートのフィルタリングとコンピュータごとのグルーピング](#criticalアラートのフィルタリングとコンピュータごとのグルーピング)
41+
- [Elastic Stackダッシュボードでの解析](#elastic-stackダッシュボードでの解析)
4242
- [タイムラインのサンプル結果](#タイムラインのサンプル結果)
4343
- [特徴&機能](#特徴機能)
4444
- [予定されている機能](#予定されている機能)
@@ -100,36 +100,36 @@ Windowsのイベントログは、
100100

101101
# スクリーンショット
102102

103-
## 起動画面:
103+
## 起動画面
104104

105105
![Hayabusa 起動画面](/screenshots/Hayabusa-Startup.png)
106106

107-
## ターミナル出力画面:
107+
## ターミナル出力画面
108108

109109
![Hayabusa ターミナル出力画面](/screenshots/Hayabusa-Results.png)
110110

111-
## イベント頻度タイムライン出力画面:
111+
## イベント頻度タイムライン出力画面 (`-V`オプション)
112112

113113
![Hayabusa イベント頻度タイムライン出力画面](/screenshots/HayabusaEventFrequencyTimeline.png)
114114

115-
## 結果サマリ画面:
115+
## 結果サマリ画面
116116

117117
![Hayabusa 結果サマリ画面](/screenshots/HayabusaResultsSummary.png)
118118

119-
## Excelでの解析:
119+
## Excelでの解析
120120

121121
![Hayabusa Excelでの解析](/screenshots/ExcelScreenshot.png)
122122

123-
## Timeline Explorerでの解析:
123+
## Timeline Explorerでの解析
124124

125125
![Hayabusa Timeline Explorerでの解析](screenshots/TimelineExplorer-ColoredTimeline.png)
126126

127127

128-
## Criticalアラートのフィルタリングとコンピュータごとのグルーピング:
128+
## Criticalアラートのフィルタリングとコンピュータごとのグルーピング
129129

130130
![Timeline ExplorerでCriticalアラートのフィルタリングとコンピュータグルーピング](screenshots/TimelineExplorer-CriticalAlerts-ComputerGrouping.png)
131131

132-
## Elastic Stackダッシュボードでの解析:
132+
## Elastic Stackダッシュボードでの解析
133133

134134
![Elastic Stack Dashboard 1](doc/ElasticStackImport/17-HayabusaDashboard-1.png)
135135

@@ -331,6 +331,7 @@ USAGE:
331331
--all-tags '出力したCSVファイルにルール内のタグ情報を全て出力する。'
332332
-R, --display-record-id 'EventRecordIDを出力する。'
333333
-v, --verbose '詳細な情報を出力する。'
334+
-V, --visualize-timeline 'イベント頻度タイムラインを出力する。'
334335
-D, --enable-deprecated-rules 'Deprecatedルールを有効にする。'
335336
-n, --enable-noisy-rules 'Noisyルールを有効にする。'
336337
-u, --update-rules 'rulesフォルダをhayabusa-rulesのgithubリポジトリの最新版に更新する。'
@@ -575,8 +576,8 @@ Hayabusaの結果は`level`毎に文字色が変わります。
575576

576577
## イベント頻度タイムライン
577578

578-
検知したイベントの数が5以上の時、頻度のタイムライン(スパークライン)を画面に出力します。
579-
マーカーの数は最大10個です。
579+
`--visualize-timeline`オプションを使うことで、検知したイベントの数が5以上の時、頻度のタイムライン(スパークライン)を画面に出力します。
580+
マーカーの数は最大10個です。デフォルトのCommand PromptとPowerShell Promptでは文字化けされるので、Windows TerminalやiTerm2等のターミナルをご利用ください。
580581

581582
## 最多検知日の出力
582583

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Hayabusa is a **Windows event log fast forensics timeline generator** and **thre
3232
- [Screenshots](#screenshots)
3333
- [Startup](#startup)
3434
- [Terminal Output](#terminal-output)
35-
- [Time Fequency Timeline](#time-fequency-timeline)
35+
- [Event Fequency Timeline (`-V` option)](#event-fequency-timeline--v-option)
3636
- [Results Summary](#results-summary)
3737
- [Analysis in Excel](#analysis-in-excel)
3838
- [Analysis in Timeline Explorer](#analysis-in-timeline-explorer)
@@ -104,7 +104,7 @@ Hayabusa is not intended to be a replacement for tools like [Evtx Explorer](http
104104

105105
![Hayabusa terminal output](/screenshots/Hayabusa-Results.png)
106106

107-
## Time Fequency Timeline
107+
## Event Fequency Timeline (`-V` option)
108108

109109
![Hayabusa Event Frequency Timeline](/screenshots/HayabusaEventFrequencyTimeline.png)
110110

@@ -329,6 +329,7 @@ USAGE:
329329
--all-tags 'Output all tags when saving to a CSV file.'
330330
-R, --display-record-id 'Display EventRecordID.'
331331
-v, --verbose 'Output verbose information.'
332+
-V, --visualize-timeline 'Output event frequency timeline.'
332333
-D, --enable-deprecated-rules 'Enable rules marked as deprecated.'
333334
-n, --enable-noisy-rules 'Enable rules marked as noisy.'
334335
-u, --update-rules 'Update to the latest rules in the hayabusa-rules github repository.'
@@ -573,8 +574,8 @@ If you want to disable color output, you can use `--no-color` option.
573574

574575
## Event Fequency Timeline
575576

576-
The Event Frequency Timeline feature displays a sparkline frequency timeline of detected events.
577-
Note: There needs to be more than 5 events.
577+
If you add `-V` or `--visualize-timeline` option, the Event Frequency Timeline feature displays a sparkline frequency timeline of detected events.
578+
Note: There needs to be more than 5 events. Also, the characters will not render correctly on the default Command Prompt or PowerShell Prompt, so please use a terminal like Windows Terminal, iTerm2, etc...
578579

579580
## Dates with most total detections
580581

rules

Submodule rules updated 128 files

src/afterfact.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ fn _print_timeline_hist(timestamps: Vec<i64>, length: usize, side_margin_size: u
128128

129129
let title = "Event Frequency Timeline";
130130
let header_row_space = (length - title.len()) / 2;
131-
println!();
132131
writeln!(wtr, "{}{}", " ".repeat(header_row_space), title).ok();
133132
println!();
134133

@@ -354,9 +353,17 @@ fn emit_csv<W: std::io::Write>(
354353
Some((Width(w), _)) => w as usize,
355354
None => 100,
356355
};
357-
358-
_print_timeline_hist(timestamps, terminal_width, 3);
359356
println!();
357+
358+
if configs::CONFIG
359+
.read()
360+
.unwrap()
361+
.args
362+
.is_present("visualize-timeline")
363+
{
364+
_print_timeline_hist(timestamps, terminal_width, 3);
365+
println!();
366+
}
360367
let reducted_record_cnt: u128 = all_record_cnt - detected_record_idset.len() as u128;
361368
let reducted_percent = if all_record_cnt == 0 {
362369
0 as f64

src/detections/configs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ fn build_app<'a>() -> ArgMatches<'a> {
7878
--all-tags 'Output all tags when saving to a CSV file.'
7979
-R, --display-record-id 'Display EventRecordID.'
8080
-v, --verbose 'Output verbose information.'
81+
-V, --visualize-timeline 'Output event frequency timeline.'
8182
-D, --enable-deprecated-rules 'Enable rules marked as deprecated.'
8283
-n, --enable-noisy-rules 'Enable rules marked as noisy.'
8384
-u, --update-rules 'Update to the latest rules in the hayabusa-rules github repository.'

0 commit comments

Comments
 (0)