Skip to content

Commit

Permalink
update color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
YamatoSecurity committed Nov 8, 2024
1 parent bf754af commit cb133d3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-Japanese.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `yaml-rust`クレートを`yaml-rust2`に更新した。(#461) (@yamatosecurity)
- `windash`文字が、`rules/config/windash_characters.txt`から動的に読み込まれるようになった。(#1440) (@fukusuket)
- `logon-summary`コマンドがRDPイベントからのログオン情報を表示するようになった。注意: ファイルに保存する場合、Hayabusaはより詳細な情報を出力する。(#1468) (@fukusuket)
- 見やすくなるように色を更新した。 (#1480) (@yamatosecurity)

**バグ修正:**

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Updated the `yaml-rust` crate to `yaml-rust2`. (#461) (@yamatosecurity)
- `windash` characters are now being dynamically read from `rules/config/windash_characters.txt`. (#1440) (@fukusuket)
- `logon-summary` command now displays logon information from RDP events. Note: Hayabusa will output more detailed information when saving to a file. (#1468) (@fukusuket)
- The colors were updated to make it easier to read. (#1480) (@yamatosecurity)

**Bug Fixes:**

Expand Down
37 changes: 29 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ include = ["src/**/*", "LICENSE.txt", "README.md", "CHANGELOG.md"]

[dependencies]
aho-corasick = "*"
ansi_term = "0.*"
base64 = "*"
bytesize = "1.*"
chrono = "0.4.*"
cidr-utils = "0.6.*"
clap = { version = "4.*", features = ["derive", "cargo", "color"]}
colored = "2"
comfy-table = "7.*"
compact_str = "0.8.*"
console = "0.15.*"
Expand Down
2 changes: 1 addition & 1 deletion rules
20 changes: 14 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use std::{
use bytesize::ByteSize;
use chrono::{DateTime, Datelike, Local, NaiveDateTime, Utc};
use clap::Command;
use colored::Colorize;
use compact_str::CompactString;
use console::{style, Style};
use dialoguer::Confirm;
Expand Down Expand Up @@ -779,7 +780,7 @@ impl App {
for profile in profile_list.iter() {
write_color_buffer(
&BufferWriter::stdout(ColorChoice::Always),
Some(Color::Green),
Some(Color::Rgb(0, 255, 0)),
&format!("- {:<25}", &format!("{}:", profile[0])),
false,
)
Expand Down Expand Up @@ -1539,20 +1540,27 @@ impl App {
}

let template = if stored_static.common_options.no_color {
"[{elapsed_precise}] {human_pos} / {human_len} {spinner} [{bar:40}] {percent}%\r\n\r\n{msg}"
"[{elapsed_precise}] {human_pos} / {human_len} {spinner} [{bar:40}] {percent}%\r\n\r\n{msg}".to_string()
} else {
"[{elapsed_precise}] {human_pos} / {human_len} {spinner:.green} [{bar:40.green}] {percent}%\r\n\r\n{msg}"
let spinner = "{spinner}".truecolor(0, 255, 0).to_string();
let bar = "{bar:40}".truecolor(0, 255, 0).to_string();
format!(
"[{{elapsed_precise}}] {{human_pos}} / {{human_len}} {} [{}] {{percent}}%\r\n\r\n{{msg}}",
spinner, bar
)
};
let progress_style = ProgressStyle::with_template(template)

let progress_style = ProgressStyle::with_template(&template) // Pass `&template` here
.unwrap()
.progress_chars("=> ");

let pb = ProgressBar::with_draw_target(
Some(evtx_files.len() as u64),
ProgressDrawTarget::stdout_with_hz(10),
)
.with_tab_width(55);
pb.set_style(progress_style);
// I tried progress bar with low memory option(output log on detection) but it seemts that progress bar didn't go well with low memory option.
// I tried progress bar with low memory option(output log on detection) but it seems that progress bar didn't go well with low memory option.
// I disabled progress bar if low memory option is specified.
let is_show_progress = !stored_static.is_low_memory || stored_static.output_path.is_some();
if is_show_progress {
Expand Down Expand Up @@ -2321,7 +2329,7 @@ impl App {
let output_color = if stored_static.common_options.no_color {
None
} else {
Some(Color::Green)
Some(Color::Rgb(0,255,0))
};
write_color_buffer(
&BufferWriter::stdout(ColorChoice::Always),
Expand Down

0 comments on commit cb133d3

Please sign in to comment.