Skip to content

Commit

Permalink
Added Progress Bar to bnat-scan-fast
Browse files Browse the repository at this point in the history
progress bar wrapped to show progress by subnet loaded from file
  • Loading branch information
Jonathan Claudius committed Nov 6, 2011
1 parent 0547098 commit a1206ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bnat-scan-fast.rb
Expand Up @@ -19,6 +19,7 @@
require 'rubygems'
require 'packetfu'
require 'netaddr'
require 'progressbar'

#Set specific port we are going scan for
port = 80
Expand Down Expand Up @@ -97,9 +98,11 @@ def scanrange(range)
puts "Scan start time: #{start_time}"

#Scan Each Range
ranges.each do |range|
scanrange(range)
end
pbar = ProgressBar.new("Scan Progress:", ranges.size)
ranges.each_with_index {|range,i|
pbar.set(i+1)
scanrange(range)
}

#Mark Scan Completion and Run Time in Seconds
puts "\nBNAT Scanned #{$ips} IPs in #{Time.now - start_time}s"
Expand Down

0 comments on commit a1206ff

Please sign in to comment.