lib/scanner/plugins/http/directory_search.rb in yawast-0.5.0.beta1 vs lib/scanner/plugins/http/directory_search.rb in yawast-0.5.0.beta2

- old
+ new

@@ -14,11 +14,11 @@ end if search_list == nil @search_list = [] - File.open(File.dirname(__FILE__) + '/../../../resources/common.txt', 'r') do |f| + File.open(File.dirname(__FILE__) + '/../../../resources/common_dir.txt', 'r') do |f| f.each_line do |line| @search_list.push line.strip end end else @@ -70,26 +70,31 @@ end def self.load_queue(uri) @search_list.each do |line| check = uri.copy - check.path = check.path + "#{line}/" - #add the job to the queue - @jobs.push check + begin + check.path = check.path + "#{line}/" + + #add the job to the queue + @jobs.push check + rescue + #who cares + end end end def self.process(uri) begin res = Yawast::Shared::Http.head uri if res.code == '200' - @results.push "\tFound: '#{uri.to_s}'" + @results.push "\tFound: '#{uri}'" load_queue uri if @recursive elsif res.code == '301' && @list_redirects - @results.push "\tFound Redirect: '#{uri.to_s} -> '#{res['Location']}'" + @results.push "\tFound Redirect: '#{uri} -> '#{res['Location']}'" end rescue => e Yawast::Utilities.puts_error "Error searching for directories (#{e.message})" end end