Created
April 11, 2015 18:43
-
-
Save ch1ago/13f1df617f9f5573ba51 to your computer and use it in GitHub Desktop.
That time you are sure your modem's password is a 6 digits number
This file contains hidden or 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 'net/http' | |
require 'colorize' | |
ip = '10.1.1.1' | |
uri = URI("http://#{ip}/") | |
('00'..'31').each do |d| | |
('00'..'12').each do |m| | |
('00'..'99').each do |y| | |
password = "#{d}#{m}#{y}" | |
req = Net::HTTP::Get.new(uri) | |
req.basic_auth 'admin', password | |
res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) } | |
if res.message == "Unauthorized" | |
puts password.red | |
else | |
puts password.green | |
raise "yes" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment