Browse files

Added Progress Bar to bnat-scan-fast

progress bar wrapped to show progress by subnet loaded from file
  • Loading branch information...
1 parent e65d429 commit cb708ad89391008c50f98b2e4cba3ec3b7e6c6b4 @claudijd claudijd committed Nov 6, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 bnat-scan-fast.rb
View
9 bnat-scan-fast.rb
@@ -19,6 +19,7 @@
require 'rubygems'
require 'packetfu'
require 'netaddr'
+require 'progressbar'
#Set specific port we are going scan for
port = 80
@@ -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"

0 comments on commit cb708ad

Please sign in to comment.