Skip to content

Commit

Permalink
Merge pull request #443 from owasp-noir/dev
Browse files Browse the repository at this point in the history
Release v0.18.1
  • Loading branch information
hahwul authored Nov 1, 2024
2 parents 5615f8b + 196e3eb commit ab1db56
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project Metadata
name: noir
version: 0.18.0
version: 0.18.1
authors:
- hahwul <hahwul@gmail.com>
- ksg97031 <ksg97031@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 1 addition & 6 deletions src/config_initializer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/noir.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -57,6 +54,7 @@ if noir_options["exclude_codes"] != ""
end

# Run Noir
banner()
app = NoirRunner.new noir_options
start_time = Time.monotonic

Expand Down
4 changes: 1 addition & 3 deletions src/options.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:"
Expand Down
12 changes: 10 additions & 2 deletions src/passive_scan/detect.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab1db56

Please sign in to comment.