Last active
December 17, 2019 18:23
-
-
Save starwels/59085ccc0600c0f976bf1798ec8575a9 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 'open-uri' | |
require 'net/http' | |
URL = 'bucket_url' | |
DIGITS_AND_LETTERS = (0..9).to_a.concat(('a'..'z').to_a) | |
count = 0 | |
DIGITS_AND_LETTERS.repeated_permutation(32) do |num| | |
begin | |
%w(extensions_array).each do |file_extension| | |
response = Net::HTTP.get_response(URI("#{URL}#{num.join}#{file_extension}")) | |
puts URI("#{URL}#{num.join}#{file_extension}") | |
if response.code == '200' | |
download = open("#{URL}#{FILE}#{file_extension}") | |
IO.copy_stream(download, "./files/#{num.join}#{file_extension}") | |
count += 1 | |
puts "#{count} hits!!!!!!" | |
end | |
end | |
rescue => e | |
puts e | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment