Skip to content

Commit

Permalink
Refactor NoirRunner to include passive scan results and add OutputBui…
Browse files Browse the repository at this point in the history
…lderPassiveScan class

Signed-off-by: HAHWUL <[email protected]>
  • Loading branch information
hahwul committed Sep 29, 2024
1 parent 4e7cb42 commit e7e902d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/models/noir.cr
Original file line number Diff line number Diff line change
Expand Up @@ -431,5 +431,11 @@ class NoirRunner
builder = OutputBuilderCommon.new @options
builder.print @endpoints
end

if @passive_results.size > 0
@logger.puts "\nPassive Results:"
builder = OutputBuilderPassiveScan.new @options
builder.print @passive_results
end
end
end
17 changes: 15 additions & 2 deletions src/output_builder/passive_scan.cr
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
require "../models/output_builder"
require "../models/endpoint"
require "../models/passive_scan"

require "json"
require "yaml"

class OutputBuilderPassiveScan < OutputBuilder

def print(passive_results : Array(PassiveScanResult))
passive_results.each do |result|
puts "ID: #{result.id}"
puts "Info: #{result.info}"
puts "Matchers: #{result.matchers}"
puts "Matchers Condition: #{result.matchers_condition}"
puts "Category: #{result.category}"
puts "Techs: #{result.techs.join(", ")}"
puts "File Path: #{result.file_path}"
puts "Line Number: #{result.line_number}"
puts "Extract: #{result.extract}"
puts "-" * 40
end
end
end

0 comments on commit e7e902d

Please sign in to comment.