Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active December 30, 2015 02:19
Show Gist options
  • Save acoomans/7762036 to your computer and use it in GitHub Desktop.
Save acoomans/7762036 to your computer and use it in GitHub Desktop.
CapitalOne 360 cafe login script
# 360 script
# This script (re)login automatically on the wifi of CapitalOne 360 cafe in San Francisco
# created by: unknown
# adapted by: acoomans
require 'net/http'
require 'uri'
puts "<" * 80
user = ARGV[0] || ENV['PASS']
puts "Using password \"#{user}\""
form_url = "http://10.0.4.13/ING_Cafe_1.php"
while true do
print "Signing in"
thread = Thread.new {
while true
print "."
sleep 0.5
end
}
form_post_response = Net::HTTP.post_form(URI.parse(form_url), :user => user, :password => "")
puts
begin
body = form_post_response.body
form_action_rx = /<form name="weblogin_form".*?action="(.*?)".*?>/
form_action = body.match(form_action_rx)[1]
password_rx = /<input type="hidden" name="password" value="(.*?)">/
password = body.match(password_rx)[1]
form_post_response = Net::HTTP.post_form(URI.parse(form_action), :user => user, :password => password, :cmd => "authenticate", "Login" => '"Log In"')
body = form_post_response.body
rescue
end
thread.raise
puts "Signed in."
puts ">" * 80
sleep 1800
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment