diff --git a/art/christmas.txt b/art/christmas.txt new file mode 100644 index 00000000..48a94f93 --- /dev/null +++ b/art/christmas.txt @@ -0,0 +1,13 @@ + /⌒\、__/⌒ ̄} + \__(__)__/ + 〃〓/ ̄ > <  ̄\〓〃 + ミ☆/: (:: ::):: >☆彡 + ★≡〃\/〉:: ::〈\/ ≡〃★ + ●※○ ^^^^^^^^ ○※● +〃≡★ Merry Christmas ★≡〃 + ☆〓 〓☆ + 〃≡★ (;) ★≡〃 + ●※○- ,_】【_, ,-○※● + ★〃≡〓 ○ 〓≡〃★ + ミ☆-★※★-☆彡 + ● \ No newline at end of file diff --git a/art/happynewyear.txt b/art/happynewyear.txt new file mode 100644 index 00000000..14c2bc91 --- /dev/null +++ b/art/happynewyear.txt @@ -0,0 +1,10 @@ + _〆 + (∴) + ( ̄ ̄ ̄) + <( ̄ ̄ ̄ ̄)> + [二◆二二◆二] + |◇ ● ◇| + |◆ ◆| + |____| + + A Happy New Year!! diff --git a/art/logo.txt b/art/logo.txt index 9e74bef3..3e2f102e 100644 --- a/art/logo.txt +++ b/art/logo.txt @@ -1,4 +1,4 @@ -██╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗███████╗ █████╗ +██╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗███████╗ █████╗ ██║ ██║██╔══██╗╚██╗ ██╔╝██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗ ███████║███████║ ╚████╔╝ ███████║██████╔╝██║ ██║███████╗███████║ ██╔══██║██╔══██║ ╚██╔╝ ██╔══██║██╔══██╗██║ ██║╚════██║██╔══██║ diff --git a/art/ninja.txt b/art/ninja.txt new file mode 100644 index 00000000..505ddce6 --- /dev/null +++ b/art/ninja.txt @@ -0,0 +1,37 @@ + + Today is Ninja Day (2/22)! + + .`,I>>+<;"' + .,}u#zcccccz*#W&jI. + `\&zccccccccccccccz&B~ + `u8zcccccccccccccccccc*%v. + "BMcccccccccccccccccccczWBn + . '$Wccccccccccccccccccccc*&1 + 't$@x. !@zccccMccccccccccccccccccM/ + ^|$%M8i. +Wcccc&McccccccccccccMccccc$[ + .1&v&$M^ `cccc*$#WWMMM##***zzc%*ccccB$ + ^c$#8$} ,*ccc8@xn@x]}{11{f$cn#%cccz8< + ;B$B@z' IBccz$%(z$x}[[[]])$#/-$ccccW( + .u%M$$< '$zcW$t .`^",""`'. c*ccz@^ + 'c$$*%c' }Wz%$i ..'`'. 1Mcz%; + -$@B$%, cz%$Mr1|v&&&&88#j[;,tWzB) + ,%Bzz@{ 'W8$#cccccz&WMcccccc88@z..^,l~+?-+!,' + .f$&c#*'.z$zcccccc$:c#ccccc8$%tM&WWMMMMMW%$$#' + l@8W$B,.tWzccccc@,?&ccczWc_{tzBB%%8%B@$$@r]` + 'c$$$${~$@Wzcccc']8czWB8@, .'^+v$$$$$$$%j~` + `?*$$$$$$$MM%8M*c j88%MW$$%uz@$%f!``""^`. + ^f$$$$$8W#z8%zc*W$r *Wz*z*M%zcccz#M&%x` + .ItB$&WM*z$&cccz@$%&W$; vMM#vW@*cccccccccz\:`. + ;@$$B*cccccM$*cccW$$~c$' ~n}?(@*ccccccccccccc#8#{,. + '"_zWM#ccccccccB%ccczB$$$B1+`,$$$#cccccccccccccccczM%B[. + `/8zcccccccccccccM$WccczB$z#Mz@`z$WcccczWcccccccccccccc#@B: + [B#cccccccccccccccc%$*ccc&MnnBz@`%$8cccc8&cccccccccccccccz8$! + .r%zcccccccccccccccccz$%cc8@nnnun%#$$WcccM@zccccccccccccccccc&$i + .u@zcccccccccccccccccccW$W&$Wnnnn8/Wu%Mcc*$Mccccccccccccccccccc8$] + z$WcccccccccccccccccccccB$$BvnnnM")vnu@&z%Wccccccccccccccccccccz%$j. + l$@zcccccccccccccccccccz&$&znnnn#/ tznnu*B@*cccccccccccccccccccccz@$#' + c$Wcccccccccc*Wzccccc#8B#unnnnnc$$cWBunnnn#$BW*ccccccccccccccz*ccc#$$W' + '$@zccccccccccz$BzczW%Wvnnnnnnv%$$$*M$@nnnnnuW$$@&zcccccccccc#@*cccc%$$# + [$#ccccccccccccB$%WMcnnnnnnnnz$$$B&cc#@8nnnnnnu#@$$&*cccccccMB*ccccc#$$$, + @%ccccccccccccz$#cxcnnnnnnnnM$$$@zcccc*$8nnnnnnnnW8$$%MMMM*#&zccccccc@$$| + "$*cccccccccccc#$cnx@WnnnnnnW$$$$Wccccc#@$8unnnn*@Wu&@$$$$$$@#cccccccc&$$W diff --git a/art/takoyaki.txt b/art/takoyaki.txt new file mode 100644 index 00000000..29320d36 --- /dev/null +++ b/art/takoyaki.txt @@ -0,0 +1,43 @@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@#------@@@@@@@@--------@@@@@@@@--------@@@@@@@@--------@@@@@@@@--------@@@@@@@@------#@@ +@@* @@@@@@@% @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@ +@@* @@@@@@@% @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@ +@@#------********--------********--------********--------********--------********=-----#@@ +@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@ +@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@ +@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@ +@@@@@@@@@-------=@@@@@@@%-------=@@@@@@@@-------=@@@@@@@@-------=@@@@@@@@-------=@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=:@@@@@@@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.-+#@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@%#*+-::. ..:-=*#%@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@%##***++++=============++++***##%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@======@@#--%@@#=+@@+=#@#=--=#@#==@@==#@@+-=@@@+=*@@==%==#@@@*====+%@@@#--%@@*=*@%==%==@@ +@@*+ ##@@. .@@* .@= :@- .+*: -# %% +@# -@@- =@: =@ *@@@- -#+ #@@. .@@= .@* % %@ +@@@# @@@: =- -@* .@@ #@@% @# *@% *. *@- =@@ #@@@= =@@= -@- -= -@@+ .#@:.@@ +@@@# @@+ :: ** .@: :@+ -- +@@# #@@: .:: %- =%. =@ *@@@- :+- .%* :: +@@+ @@@=-@@ +@@@%++@@*+%@@#+*%+*@@*+#@@*++*@@@@@**@@@++@@@*+##+#@%++%++%@@@#+++*#@@*+%@@%+*@@%**@@@*+@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@:.......@@@@@@@@:.......@@@@@@@@:.......@@@@@@@@:.......%@@@@@@@:.......@@@@@@@@@ +@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@ +@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@ +@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@ +@@#:::::-########::::::::########::::::::########::::::::########::::::::########::::::#@@ +@@* .@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@ +@@* .@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@ +@@%+++++*@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++%@@ \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index dd4d59df..07b9270f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,8 @@ extern crate serde; extern crate serde_derive; -use chrono::{DateTime, Utc}; +use chrono::Datelike; +use chrono::{DateTime, Local}; use evtx::{EvtxParser, ParserSettings}; use hayabusa::detections::detection; use hayabusa::detections::detection::EvtxRecordInfo; @@ -12,6 +13,7 @@ use hayabusa::{detections::configs, timeline::timeline::Timeline}; use hhmmss::Hhmmss; use pbr::ProgressBar; use serde_json::Value; +use std::collections::HashMap; use std::{ fs::{self, File}, path::PathBuf, @@ -22,9 +24,15 @@ use std::{ const MAX_DETECT_RECORDS: usize = 40000; fn main() { + let analysis_start_time: DateTime = Local::now(); if !configs::CONFIG.read().unwrap().args.is_present("q") { output_logo(); println!(""); + output_eggs(&format!( + "{:02}/{:02}", + &analysis_start_time.month().to_owned(), + &analysis_start_time.day().to_owned() + )); } if configs::CONFIG.read().unwrap().args.args.len() == 0 { println!( @@ -33,7 +41,6 @@ fn main() { ); return; } - let analysis_start_time: DateTime = Utc::now(); if let Some(filepath) = configs::CONFIG.read().unwrap().args.value_of("filepath") { if !filepath.ends_with(".evtx") { AlertMessage::alert( @@ -64,7 +71,7 @@ fn main() { print_contributors(); return; } - let analysis_end_time: DateTime = Utc::now(); + let analysis_end_time: DateTime = Local::now(); let analysis_duration = analysis_end_time.signed_duration_since(analysis_start_time); println!("Elapsed Time: {}", &analysis_duration.hhmmssxxx()); println!(""); @@ -237,12 +244,30 @@ fn _output_with_omikuji(omikuji: Omikuji) { println!("{}", content); } +/// output logo fn output_logo() { let fp = &format!("art/logo.txt"); - let content = fs::read_to_string(fp).unwrap(); + let content = fs::read_to_string(fp).unwrap_or("".to_owned()); println!("{}", content); } +/// output easter egg arts +fn output_eggs(exec_datestr: &str) { + let mut eggs: HashMap<&str, &str> = HashMap::new(); + eggs.insert("01/01", "art/happynewyear.txt"); + eggs.insert("02/22", "art/ninja.txt"); + eggs.insert("08/08", "art/takoyaki.txt"); + eggs.insert("12/25", "art/christmas.txt"); + + match eggs.get(exec_datestr) { + None => {} + Some(path) => { + let content = fs::read_to_string(path).unwrap_or("".to_owned()); + println!("{}", content); + } + } +} + #[cfg(test)] mod tests { use crate::collect_evtxfiles;