Skip to content

Instantly share code, notes, and snippets.

@emctoo
Created June 20, 2012 13:41
Show Gist options
  • Save emctoo/2959939 to your computer and use it in GitHub Desktop.
Save emctoo/2959939 to your computer and use it in GitHub Desktop.
try password(to be continued)
require "open-uri"
require "net/http"
Net::HTTP.version_1_2
uri = URI.parse("http://192.168.1.1")
http = Net::HTTP.new(uri.host, uri.port)
while true
request = Net::HTTP::Get.new(uri.request_uri)
request.basic_auth("admin", "***")
response = http.request(request)
if response.code == "200"
puts "done"
break
end
end
# todo: generate password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment