Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rexml/document'
- require 'net/http'
- require 'uri'
- require 'getoptlong'
- require 'fileutils'
- require 'optparse'
- require 'csv'
- if ARGV.length != 1
- puts "Missing wordlist (try --help)"
- exit 0
- end
- filename = ARGV.shift
- hosts = ["google.com", "cnn.com", "reddit.com"]
- def get_page (*hosts, page)
- uri = URI.parse("http://#{hosts}/#{page}")
- http = Net::HTTP.new(uri.host, uri.port)
- request = Net::HTTP::Get.new(uri.request_uri)
- res = http.request(request)
- if res.code == "200"
- puts "Valid page: #{page}"
- elsif res.code == "403"
- puts "Forbidden paged: #{page}"
- else
- end
- end
- File.open(filename, "r") do |f|
- f.each_line do |line|
- line.strip!
- if line == ""
- next
- end
- hosts.each do |host|
- host.chomp('[')
- get_page("#{host}", "#{line}")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment