Skip to content

Commit

Permalink
Left justified and padded printed output columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcampbell committed Sep 17, 2023
1 parent 7bc5123 commit 0add55e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nessusploitable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@
puts opts
end
nessus = RubyNessus::Parse.new("#{options[:file_path]}")
puts "IP | Hostname | Port | Exploit"
puts "IP Address".ljust(15) + "\t" + "Hostname".ljust(30) + "\t" + "Port".ljust(25) + "\t" + "Exploit"
nessus.scan.each_host do |host|
host.each_event do |event|
if event.exploit_framework_metasploit || event.exploitability_ease == "No exploit is required"
puts "#{host.ip}\t#{host.hostname}\t##{event.port}\t#{event.name}"
if host.hostname.nil?
hostname = ""
else
hostname = host.hostname
end
puts "#{host.ip.ljust(15)}\t#{hostname.ljust(30)}\t##{event.port.to_s.ljust(25)}\t#{event.name}"
end
end
end
Expand Down

0 comments on commit 0add55e

Please sign in to comment.