diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 12b53740..ef68e5b7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -23,7 +23,7 @@ If applicable, add screenshots to help explain your problem. **Versions** - OS: [e.g. macos, linux] - - Version [e.g. v0.18.0] + - Version [e.g. v0.18.1] **Additional context** Add any other context about the problem here. diff --git a/shard.yml b/shard.yml index ae13032e..02a9853a 100644 --- a/shard.yml +++ b/shard.yml @@ -1,6 +1,6 @@ # Project Metadata name: noir -version: 0.18.0 +version: 0.18.1 authors: - hahwul - ksg97031 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 419ed1cf..509ef861 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: noir base: core20 -version: 0.18.0 +version: 0.18.1 summary: Attack surface detector that identifies endpoints by static analysis. description: | Noir is an open-source project specializing in identifying attack surfaces for enhanced whitebox security testing and security pipeline. diff --git a/src/config_initializer.cr b/src/config_initializer.cr index fbebd191..797382d6 100644 --- a/src/config_initializer.cr +++ b/src/config_initializer.cr @@ -25,9 +25,7 @@ class ConfigInitializer # Create the config file if it doesn't exist File.write(@config_file, generate_config_file) unless File.exists?(@config_file) - rescue e : Exception - puts "Failed to create config directory or file: #{e.message}" - puts "Using default config." + rescue end def read_config @@ -71,9 +69,6 @@ class ConfigInitializer final_options = default_options.merge(symbolized_hash) { |_, _, new_val| new_val } final_options rescue e : Exception - puts "Failed to read config file: #{e.message}" - puts "Using default config." - default_options end end diff --git a/src/noir.cr b/src/noir.cr index cdbd7f46..d4e1e712 100644 --- a/src/noir.cr +++ b/src/noir.cr @@ -6,12 +6,9 @@ require "./options.cr" require "./techs/techs.cr" module Noir - VERSION = "0.18.0" + VERSION = "0.18.1" end -# Print banner -banner() - # Run options parser noir_options = run_options_parser() @@ -57,6 +54,7 @@ if noir_options["exclude_codes"] != "" end # Run Noir +banner() app = NoirRunner.new noir_options start_time = Time.monotonic diff --git a/src/options.cr b/src/options.cr index 25c08a57..a5852121 100644 --- a/src/options.cr +++ b/src/options.cr @@ -133,13 +133,10 @@ def run_options_parser case var when "zsh" puts generate_zsh_completion_script - STDERR.puts "\n> Instructions: Copy the content above and save it in the zsh-completion directory as _noir".colorize(:yellow) when "bash" puts generate_bash_completion_script - STDERR.puts "\n> Instructions: Copy the content above and save it in the .bashrc file as noir.".colorize(:yellow) when "fish" puts generate_fish_completion_script - STDERR.puts "\n> Instructions: Copy the content above and save it in the fish-completion directory as noir.fish".colorize(:yellow) else puts "ERROR: Invalid completion type.".colorize(:yellow) puts "e.g., noir --generate-completion zsh" @@ -164,6 +161,7 @@ def run_options_parser end parser.separator "\n OTHERS:".colorize(:blue) parser.on "-h", "--help", "Show help" do + banner() puts parser puts "" puts "EXAMPLES:" diff --git a/src/passive_scan/detect.cr b/src/passive_scan/detect.cr index 0862120f..f2552f0d 100644 --- a/src/passive_scan/detect.cr +++ b/src/passive_scan/detect.cr @@ -51,9 +51,17 @@ module NoirPassiveScan when "regex" case matcher.condition when "and" - matcher.patterns && matcher.patterns.all? { |pattern| content.match(Regex.new(pattern.to_s)) } + begin + matcher.patterns && matcher.patterns.all? { |pattern| content.match(Regex.new(pattern.to_s)) } + rescue + false + end when "or" - matcher.patterns && matcher.patterns.any? { |pattern| content.match(Regex.new(pattern.to_s)) } + begin + matcher.patterns && matcher.patterns.any? { |pattern| content.match(Regex.new(pattern.to_s)) } + rescue + false + end else false end