* changed default level to Low #211 * fixed usage #211 * erased Lang option #195 * changed output credit to contributors #141 * Removed contributor information for uncreated features and features that will not be introduced in v1.0. #141 * removed slack notification feature #202 - removed config option - removed artifact slack notification call * removed description of slack notification #202 * fixed default level to Low #211 * removed description about slack notification #202
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
|
||||
# Hayabusa
|
||||
Hayabusa is a very fast Windows event analyzer used for creating forensic timelines and performing threat hunting based on IoCs written in either hayabusa or SIGMA rules. It can be run live, offline, pushed out as agents to be run on endpoints in an enterprise after an incident or even periodically reporting back alerts on slack.
|
||||
Hayabusa is a very fast Windows event analyzer used for creating forensic timelines and performing threat hunting based on IoCs written in either hayabusa or SIGMA rules. It can be run live, offline, pushed out as agents to be run on endpoints in an enterprise after an incident.
|
||||
|
||||
# About Hayabusa
|
||||
Hayabusa ("falcon" in Japanese) was written by the Yamato Security group in Japan. First inspired by the DeepblueCLI Windows event log analyzer, we started in 2020 porting it over to Rust for the RustyBlue project, then created SIGMA-like flexible signatures based in YAML, and then added a backend to SIGMA to support converting SIGMA rules into hayabusa rules. Supporting multi-threading, (to our knowledge) it is currently the fastest forensics timeline generator and threat hunting tool as well supports the most features in SIGMA. It can analyze multiple Windows event logs and consolidate the results into one timeline for easy analysis. It will output in CSV to be imported into tools like Timeline Explorer and Excel for analysis.
|
||||
@@ -20,7 +20,6 @@ Add screenshots here.
|
||||
* Faster than a hayabusa falcon!
|
||||
* English and Japanese support
|
||||
* Multi-thread support
|
||||
* Enterprise-wide threat hunting via alerts to Slack
|
||||
* Creating event timelines for forensic investigations and incident response
|
||||
* Threat hunting based on IoC signatures written in easy to read/create/edit YAML based hayabusa rules
|
||||
* SIGMA support to convert SIGMA rules to hayabusa rules
|
||||
@@ -39,7 +38,6 @@ FLAGS:
|
||||
--credits Prints a list of contributors
|
||||
-h, --help Prints help information
|
||||
--rfc-2822 Output date and time in RFC 2822 format. Example: Mon, 07 Aug 2006 12:34:56 -0600
|
||||
--slack Sends alerts to Slack
|
||||
-s, --statistics Prints statistics for event logs
|
||||
-u, --utc Output time in UTC format (default: local time)
|
||||
-V, --version Prints version information
|
||||
@@ -84,20 +82,6 @@ If you have rust installed, you can compile from source with the following comma
|
||||
cargo build --release
|
||||
````
|
||||
|
||||
# How to send alerts to a Slack channel
|
||||
|
||||
Slackチャンネルへの通知にはSlackでのWEBHOOKURLの設定と実行マシンの環境変数(WEBHOOKURL、CHANNEL)への追加が必要です。
|
||||
|
||||
1. Add an "Incoming Webhook" to the slack workspace you want to send alerts to.
|
||||
2. 「チャンネルへの投稿」で投稿するチャンネルを選択し 「Incoming Webhookインテグレーションの追加」をクリックします。
|
||||
3. 遷移後のぺージの「Webhook URL」の内容(https:hooks.slack.com/services/xxx...)を環境変数の`WEBHOOK_URL` に代入してください。
|
||||
4. 投入するchannelを#付きで環境変数の`CHANNEL`に代入してください。
|
||||
5. 以下のコマンドで実行をするとCHANNELで指定したチャンネルに検知情報の通知が送付されます。
|
||||
|
||||
````
|
||||
hayabusa.exe --slack
|
||||
````
|
||||
|
||||
# Other Windows event log analyzers and related projects
|
||||
There is no "one tool to rule them all" and we have found that each have their own merits so we recommend checking out these other great tools and projects and see which ones you like.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
|
||||
# Hayabusa
|
||||
Hayabusaは非常に高速なWindowsイベントアナライザで、フォレンジックタイムラインの作成や、HayabusaまたはSIGMAルールで記述されたIoCに基づいた脅威のハンティングを行うために使用されます。ライブでもオフラインでも実行でき、インシデント後に企業内のエンドポイントで実行されるエージェントとしてプッシュアウトしたり、slackで定期的にアラートを報告することもできます。
|
||||
Hayabusaは非常に高速なWindowsイベントアナライザで、フォレンジックタイムラインの作成や、HayabusaまたはSIGMAルールで記述されたIoCに基づいた脅威のハンティングを行うために使用されます。ライブでもオフラインでも実行でき、インシデント後に企業内のエンドポイントで実行されるエージェントとしてプッシュアウトすることもできます。
|
||||
|
||||
# Hayabusaについて
|
||||
Hayabusaは日本のYamato Securityグループによって書かれました。最初にDeepblueCLI Windowsイベントログアナライザに触発され、2020年にRustyBlueプロジェクトのためにRustに移植することから始まり、SIGMAのようなYAMLベースの柔軟なシグネチャを作成し、SIGMAのルールをhayabusaのルールに変換することをサポートするためにSIGMAにバックエンドを追加しました。マルチスレッドをサポートし、(我々の知る限り)現在最速のフォレンジックタイムラインジェネレータと脅威探索ツールであり、SIGMAの最も多くの機能をサポートしています。複数のWindowsイベントログを分析し、分析しやすいように結果を一つのタイムラインに集約することができます。また、CSV形式で出力されるので、Timeline ExplorerやExcelなどのツールに取り込んで分析することができます。
|
||||
@@ -19,7 +19,6 @@ screenshotを入れる
|
||||
* ハヤブサよりも速い!
|
||||
* 英語と日本語に対応
|
||||
* マルチスレッド
|
||||
* エンタプライズ向けのインシデント対応やヘルスチェックのためのSlackへのアラート通知
|
||||
* フォレンジック調査用のイベントタイムライン作成
|
||||
* 作成・編集しやすいYAML形式のhayabusaルールでIoCシグネチャーを作成し、攻撃検知(スレットハンティング)を行う
|
||||
* SIGMAルールをhayabusaルールに自動変換
|
||||
@@ -38,7 +37,6 @@ FLAGS:
|
||||
--credits コントリビューターの一覧表示
|
||||
-h, --help ヘルプ画面の表示
|
||||
--rfc-2822 日付と時間をRFC 2822形式で表示する。例: Mon, 07 Aug 2006 12:34:56 -0600
|
||||
--slack Slackへの通知
|
||||
-s, --statistics イベントログの集計
|
||||
-u, --utc 時間をUTCで出力する(デフォルトはローカル時間)
|
||||
-V, --version バージョン情報を出力する
|
||||
@@ -83,20 +81,6 @@ rulesフォルダには組み込みルールファイルも設置されていま
|
||||
cargo build --release
|
||||
````
|
||||
|
||||
# Slackチャンネルへの通知
|
||||
|
||||
Slackチャンネルへの通知にはSlackでのWEBHOOKURLの設定と実行マシンの環境変数(WEBHOOKURL、CHANNEL)への追加が必要です。
|
||||
|
||||
1. 通知先のSlackのワークスペースに対して「Incoming Webhook」をSlackに追加してください。
|
||||
2. 「チャンネルへの投稿」で投稿するチャンネルを選択し 「Incoming Webhookインテグレーションの追加」をクリックします。
|
||||
3. 遷移後のぺージの「Webhook URL」の内容(https:hooks.slack.com/services/xxx...)を環境変数の`WEBHOOK_URL` に代入してください。
|
||||
4. 投入するchannelを#付きで環境変数の`CHANNEL`に代入してください。
|
||||
5. 以下のコマンドで実行をするとCHANNELで指定したチャンネルに検知情報の通知が送付されます。
|
||||
|
||||
````
|
||||
hayabusa.exe --slack
|
||||
````
|
||||
|
||||
# 関連するWindowsイベントログのスレットハンティングプロジェクト
|
||||
まだ完璧なWindowsイベントログ解析ツールは存在していなくて、それぞれ長所短所があるので、以下のツールとプロジェクトもチェックして、好きなツールを使ってくださいね!
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Hayabusa was possible thanks to the following people (in alphabetical order):
|
||||
|
||||
Akira Nishikawa (@nishikawaakira): Previous lead developer, record ID gap analysis, slack channel notification, core hayabusa rule support, etc...
|
||||
Akira Nishikawa (@nishikawaakira): Previous lead developer, core hayabusa rule support, etc...
|
||||
Dai (@__da13__): Developer
|
||||
DustInDark(@hitenkoku): Core developer, project management, sigma count implementation, rule creation, countless feature additions and fixes, etc…
|
||||
Garigariganzy (@garigariganzy31): Developer, event ID statistics implementation, etc...
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
use crate::detections::configs;
|
||||
use crate::detections::print;
|
||||
use crate::detections::print::AlertMessage;
|
||||
use crate::notify::slack::SlackNotify;
|
||||
use chrono::{DateTime, Local, TimeZone, Utc};
|
||||
use serde::Serialize;
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::io::BufWriter;
|
||||
use std::process;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
@@ -33,47 +31,31 @@ pub fn after_fact() {
|
||||
process::exit(1);
|
||||
};
|
||||
|
||||
// slack通知する場合はemit_csvした後に
|
||||
if configs::CONFIG.read().unwrap().args.is_present("slack") {
|
||||
let mut buf = vec![];
|
||||
let mut writer = BufWriter::new(buf);
|
||||
if let Err(err) = emit_csv(&mut writer) {
|
||||
fn_emit_csv_err(err);
|
||||
} else {
|
||||
buf = writer.into_inner().unwrap();
|
||||
let s = std::str::from_utf8(&buf).unwrap();
|
||||
if SlackNotify::notify(s.to_string()).is_err() {
|
||||
eprintln!("slack notification failed!!");
|
||||
let mut target: Box<dyn io::Write> = if let Some(csv_path) = configs::CONFIG
|
||||
.read()
|
||||
.unwrap()
|
||||
.args
|
||||
.value_of("csv-timeline")
|
||||
{
|
||||
// ファイル出力する場合
|
||||
match File::create(csv_path) {
|
||||
Ok(file) => Box::new(file),
|
||||
Err(err) => {
|
||||
AlertMessage::alert(
|
||||
&mut std::io::stderr().lock(),
|
||||
format!("Failed to open file. {}", err),
|
||||
)
|
||||
.ok();
|
||||
process::exit(1);
|
||||
}
|
||||
println!("{}", s.to_string());
|
||||
}
|
||||
} else {
|
||||
let mut target: Box<dyn io::Write> = if let Some(csv_path) = configs::CONFIG
|
||||
.read()
|
||||
.unwrap()
|
||||
.args
|
||||
.value_of("csv-timeline")
|
||||
{
|
||||
// ファイル出力する場合
|
||||
match File::create(csv_path) {
|
||||
Ok(file) => Box::new(file),
|
||||
Err(err) => {
|
||||
AlertMessage::alert(
|
||||
&mut std::io::stderr().lock(),
|
||||
format!("Failed to open file. {}", err),
|
||||
)
|
||||
.ok();
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 標準出力に出力する場合
|
||||
Box::new(io::stdout())
|
||||
};
|
||||
// 標準出力に出力する場合
|
||||
Box::new(io::stdout())
|
||||
};
|
||||
|
||||
if let Err(err) = emit_csv(&mut target) {
|
||||
fn_emit_csv_err(err);
|
||||
}
|
||||
if let Err(err) = emit_csv(&mut target) {
|
||||
fn_emit_csv_err(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,14 +52,12 @@ fn build_app<'a>() -> ArgMatches<'a> {
|
||||
--rfc-2822 'Output date and time in RFC 2822 format. Example: Mon, 07 Aug 2006 12:34:56 -0600'
|
||||
--rfc-3339 'Output date and time in RFC 3339 format. Example: 2006-08-07T12:34:56.485214 -06:00'
|
||||
--verbose 'Output check information to target event file path and rule file.'
|
||||
-l --lang=[LANG] 'Output language'
|
||||
-L --level=[LEVEL] 'Specified execute rule level(default: INFO)'
|
||||
-L --level=[LEVEL] 'Specified execute rule level(default: LOW)'
|
||||
-u --utc 'Output time in UTC format(default: local time)'
|
||||
-d --directory=[DIRECTORY] 'Event log files directory'
|
||||
-s --statistics 'Prints statistics for event logs'
|
||||
-t --threadnum=[NUM] 'Thread number'
|
||||
--slack 'Slack notification'
|
||||
--credits 'Prints credits'";
|
||||
--contributors 'Prints the list of contributors'";
|
||||
App::new(&program)
|
||||
.about("hayabusa. Aiming to be the world's greatest Windows event log analysis tool!")
|
||||
.version("1.0.0")
|
||||
|
||||
13
src/main.rs
13
src/main.rs
@@ -49,8 +49,13 @@ fn main() {
|
||||
return;
|
||||
}
|
||||
analysis_files(evtx_files);
|
||||
} else if configs::CONFIG.read().unwrap().args.is_present("credits") {
|
||||
print_credits();
|
||||
} else if configs::CONFIG
|
||||
.read()
|
||||
.unwrap()
|
||||
.args
|
||||
.is_present("contributors")
|
||||
{
|
||||
print_contributors();
|
||||
return;
|
||||
}
|
||||
let analysis_end_time: DateTime<Utc> = Utc::now();
|
||||
@@ -92,8 +97,8 @@ fn collect_evtxfiles(dirpath: &str) -> Vec<PathBuf> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
fn print_credits() {
|
||||
match fs::read_to_string("./credits.txt") {
|
||||
fn print_contributors() {
|
||||
match fs::read_to_string("./contributors.txt") {
|
||||
Ok(contents) => println!("{}", contents),
|
||||
Err(err) => {
|
||||
AlertMessage::alert(&mut std::io::stderr().lock(), format!("{}", err)).ok();
|
||||
|
||||
10
src/yaml.rs
10
src/yaml.rs
@@ -102,11 +102,11 @@ impl ParseYaml {
|
||||
// 指定されたレベルより低いルールは無視する
|
||||
let doc_level = &yaml_doc["level"]
|
||||
.as_str()
|
||||
.unwrap_or("INFO")
|
||||
.unwrap_or("LOW")
|
||||
.to_string()
|
||||
.to_uppercase();
|
||||
let doc_level_num = configs::LEVELMAP.get(doc_level).unwrap_or(&1);
|
||||
let args_level_num = configs::LEVELMAP.get(level).unwrap_or(&1);
|
||||
let doc_level_num = configs::LEVELMAP.get(doc_level).unwrap_or(&2);
|
||||
let args_level_num = configs::LEVELMAP.get(level).unwrap_or(&2);
|
||||
if doc_level_num < args_level_num {
|
||||
return Option::None;
|
||||
}
|
||||
@@ -161,12 +161,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// no specifed "level" arguments value is adapted default level(INFO)
|
||||
/// no specifed "level" arguments value is adapted default level(LOW)
|
||||
fn test_default_level_read_yaml() {
|
||||
let mut yaml = yaml::ParseYaml::new();
|
||||
let path = Path::new("test_files/rules/level_yaml");
|
||||
yaml.read_dir(path.to_path_buf(), &"").unwrap();
|
||||
assert_eq!(yaml.files.len(), 5);
|
||||
assert_eq!(yaml.files.len(), 4);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user