Advertisement
digininja

Home directory enumeration

Jun 21st, 2016
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.49 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. # Ruby version of @adriendb's Python home directory enumeration script
  4.  
  5. require "net/http"
  6. require "uri"
  7.  
  8. File.open(ARGV[0], "r").each do |lastname|
  9.     lastname.chop!
  10.     "a".upto("z") do |initial|
  11.         url = "http://www.sec542.org/~" + initial + lastname +"/"
  12.         uri = URI.parse(url)
  13.         # Full
  14.         http = Net::HTTP.new(uri.host, uri.port)
  15.         response = http.request(Net::HTTP::Get.new(uri.request_uri))
  16.         if response.code == "200"
  17.             puts "Hit on: " + url
  18.         end
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement