Skip to content

Instantly share code, notes, and snippets.

@ch1ago
Created April 11, 2015 18:43
Show Gist options
  • Save ch1ago/13f1df617f9f5573ba51 to your computer and use it in GitHub Desktop.
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
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