Trivia/eastereggs#212 (#266)

* add ninja arts #212

* add takoyakiday eggs #212

* add christmas eggs #212

* add happy newyear eggs #212

* changed encode from UTF-8 BOM to UTF-8

* add output easteregg #212

- changed analysis datetime from Utc to Local
- added output easteregg #213

* changed happynewyear arts #212

* fix ninja day #212

* fix christmas #212
This commit is contained in:
DustInDark
2021-12-07 01:52:27 +09:00
committed by GitHub
parent 50daf1d716
commit 493c5ddec1
6 changed files with 133 additions and 5 deletions

13
art/christmas.txt Normal file
View File

@@ -0,0 +1,13 @@
、__⌒ ̄}
______/
〃〓/ ̄ > <  ̄\〓〃
ミ☆/: :: :: >☆彡
★≡〃\/〉:: ::〈\/ ≡〃★
●※○ ^^^^^^^^ ○※●
〃≡★ Merry Christmas ★≡〃
☆〓 〓☆
〃≡★ ;) ★≡〃
●※○- ,_】【_, ,-○※●
★〃≡〓 ○ 〓≡〃★
ミ☆-★※★-☆彡

10
art/happynewyear.txt Normal file
View File

@@ -0,0 +1,10 @@
_〆
(∴)
( ̄ ̄ ̄)
( ̄ ̄ ̄ ̄)
[二◆二二◆二]
|◇ ● ◇|
|◆ ◆|
|____|
A Happy New Year!!

View File

@@ -1,4 +1,4 @@
██╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗███████╗ █████╗
██╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██╗███████╗ █████╗
██║ ██║██╔══██╗╚██╗ ██╔╝██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗
███████║███████║ ╚████╔╝ ███████║██████╔╝██║ ██║███████╗███████║
██╔══██║██╔══██║ ╚██╔╝ ██╔══██║██╔══██╗██║ ██║╚════██║██╔══██║

37
art/ninja.txt Normal file
View File

@@ -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

43
art/takoyaki.txt Normal file
View File

@@ -0,0 +1,43 @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@#------@@@@@@@@--------@@@@@@@@--------@@@@@@@@--------@@@@@@@@--------@@@@@@@@------#@@
@@* @@@@@@@% @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@
@@* @@@@@@@% @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@
@@#------********--------********--------********--------********--------********=-----#@@
@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@
@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@
@@@@@@@@@ @@@@@@@# @@@@@@@@ @@@@@@@@ @@@@@@@% @@@@@@@@@
@@@@@@@@@-------=@@@@@@@%-------=@@@@@@@@-------=@@@@@@@@-------=@@@@@@@@-------=@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=:@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.+@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= *@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%:-@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*.*@@@@@@@@@@@@
@@@@@@@@@@@%*=-:::-=*@@@@@@@@@%*=-:::-+#@@@@@@@@@#+=-::-=+#@@@@@@@@@#+--::: =%@@@@@@@@@@@@
@@@@@@@@@*: = :#@@@@+. -%@@@@= =@@@@%- .+@@@@@@@@@@
@@@@@@@@: :: #* -@%. - *= =@* -. =#. *@+ :: -#: .#@@@@@@@@
@@@@@@@. : -. . : .= : : = . %@@@@@@@
@@@@@@+ =*. -+=. .++ =+= :*= =+- -*- .++- . -@@@@@@@
@@@@@@= *@@@@=-#@@@@+:+@% .*@@@%==#@@@@=:*@# :#@@@#==%@@@%--#@+ -%@@@*-=@@@@#--%@-:@@@@@@@
@@@@-== #@@@@@@@@@@@@@@@+ %@@@@@@@@@@@@@@@- .@@@@@@@@@@@@@@@@. :@@@@@@@@@@@@@@@@ :=:@@@@@
@@@@#. =*#@@@@@@@@@@@* *-.%@@@@@@@@@@@@@= #::@@@@@@@@@@@@@@:.# -@@@@@@@@@@@%*=. .*@@@@@
@@@@@@#- .:-=+*#%*::%@@*.-#@@@@@@@@@+.-%@@=.=%@@@@@@@@%=.=@@@=.+%#*+=-:. :*@@@@@@@
@@@@@@@@@*- ..::- :====-. .=++++++: .-====-. :::.. :*@@@@@@@@@@
@@@@@@@@@@@@%+-. .-+#@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@%#*+-::. ..:-=*#%@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@%##***++++=============++++***##%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@======@@#--%@@#=+@@+=#@#=--=#@#==@@==#@@+-=@@@+=*@@==%==#@@@*====+%@@@#--%@@*=*@%==%==@@
@@*+ ##@@. .@@* .@= :@- .+*: -# %% +@# -@@- =@: =@ *@@@- -#+ #@@. .@@= .@* % %@
@@@# @@@: =- -@* .@@ #@@% @# *@% *. *@- =@@ #@@@= =@@= -@- -= -@@+ .#@:.@@
@@@# @@+ :: ** .@: :@+ -- +@@# #@@: .:: %- =%. =@ *@@@- :+- .%* :: +@@+ @@@=-@@
@@@%++@@*+%@@#+*%+*@@*+#@@*++*@@@@@**@@@++@@@*+##+#@%++%++%@@@#+++*#@@*+%@@%+*@@%**@@@*+@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@:.......@@@@@@@@:.......@@@@@@@@:.......@@@@@@@@:.......%@@@@@@@:.......@@@@@@@@@
@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@
@@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ %@@@@@@@ @@@@@@@@@
@@#:::::-########::::::::########::::::::########::::::::########::::::::########::::::#@@
@@* .@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@
@@* .@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ *@@
@@%+++++*@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++++@@@@@@@@++++++%@@

View File

@@ -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> = 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> = 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> = Utc::now();
let analysis_end_time: DateTime<Local> = 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;