-
-
Save anonymous/614986280ca3d8c548398da812867dd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment