-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathiFix.py
296 lines (203 loc) · 7.78 KB
/
iFix.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# import system functions
import signal
import requests
import urllib.request
import os
import time
import re
import tkinter as tk
from tkinter import *
from tkinter import messagebox
from tkinter.simpledialog import askstring
from tkinter.messagebox import showinfo
from subprocess import run
import subprocess
# load images in Tkinter python
from PIL import ImageTk, Image
# web
import webbrowser
# sounds
# from pygame import mixer
# Designed and developed by @hackt1vator
# cd the folder
script_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(script_path)
# frame settings
root = tk.Tk()
frame = tk.Frame(root, width="500", height="250")
frame.pack(fill=BOTH,expand=True)
#tk.Entry(root).pack(fill='x')
# uses current directory to load the image file for the icon
root.iconphoto(False, tk.PhotoImage(file='icon.png'))
def show_popup():
popup = tk.Toplevel()
popup.geometry("300x200") # set the width and height of the window
popup.title("palera1n")
# center the window on the screen
window_width = popup.winfo_reqwidth()
window_height = popup.winfo_reqheight()
position_right = int(popup.winfo_screenwidth() / 2 - window_width / 2)
position_down = int(popup.winfo_screenheight() / 2 - window_height / 2)
popup.geometry("+{}+{}".format(position_right, position_down))
# create larger buttons
button1 = tk.Button(popup, text="build fake fs", command=build_fakefs, width=20, height=5)
button1.pack(pady=10)
button2 = tk.Button(popup, text="boot fake fs", command=boot_fakefs, width=20, height=5)
button1.pack(pady=10)
button2.pack()
def build_fakefs():
messagebox.showinfo("", "Please put the device into dfu")
# Display a message box with a yes/no option
response = messagebox.askyesno("iphone?", "Do you have a A9 device?")
# Check the user's response and execute the appropriate command
if response == 1: # Yes
# Run the command in a subprocess
process = subprocess.Popen(["./palera1n-macos-universal", "-cf"], preexec_fn=os.setsid)
# Wait for 8 seconds or until the process completes
for i in range(20):
if process.poll() is not None:
break
time.sleep(1)
# If the process is still running, terminate it
if process.poll() is None:
os.killpg(os.getpgid(process.pid), signal.SIGTERM)
os.system("./palera1n-macos-universal -cf")
if response == 0: # No
os.system("./palera1n-macos-universal -cf")
messagebox.showinfo("", "After the device boots you can boot the fake fs")
def boot_fakefs():
messagebox.showinfo("", "Please put the device into dfu")
# Display a message box with a yes/no option
response = messagebox.askyesno("iphone?", "Do you have a A9 device?")
# Check the user's response and execute the appropriate command
if response == 1: # Yes
# Run the command in a subprocess
process = subprocess.Popen(["./palera1n-macos-universal", "-f"], preexec_fn=os.setsid)
# Wait for 8 seconds or until the process completes
for i in range(20):
if process.poll() is not None:
break
time.sleep(1)
# If the process is still running, terminate it
if process.poll() is None:
os.killpg(os.getpgid(process.pid), signal.SIGTERM)
os.system("./palera1n-macos-universal -f")
if response == 0: # No
os.system("./palera1n-macos-universal -f")
messagebox.showinfo("", "Now start the bypass")
def startcheckra1n():
os.system("open ./checkra1n.app")
def showDFUMessage():
messagebox.showinfo("Step 1","Put your iDevice into DFU mode.\n\nClick Ok once its ready in DFU mode to proceed.")
def enterRecMode():
os.system("./device/ideviceinfo > ./device/lastdevice.txt")
time.sleep(2)
f = open("./device/lastdevice.txt", "r")
fileData = f.read()
f.close()
# Find the UDID
start = 'UniqueDeviceID: '
end = 'UseRaptorCerts:'
s = str(fileData)
foundData = s[s.find(start) + len(start):s.rfind(end)]
UDID = str(foundData)
LAST_CONNECTED_UDID = str(UDID)
print("Kicking device into recovery mode...")
os.system(f"./device/ideviceenterrecovery {LAST_CONNECTED_UDID}")
def exitRecMode():
print("Kicking device out recovery mode...")
os.system("./device/irecovery -n")
def quitProgram():
print("Exiting...")
os.system("exit")
def opentwitter():
webbrowser.open('https://www.twitter.com/hackt1vator', new=2)
def mdmbypass():
global LAST_CONNECTED_UDID, LAST_CONNECTED_IOS_VER
# Step 1: Detect connected device
print("Searching for connected device...")
os.system("idevicepair unpair")
os.system("idevicepair pair")
os.system("./device/ideviceinfo > ./device/lastdevice.txt")
time.sleep(2)
f = open("./device/lastdevice.txt", "r")
fileData = f.read()
f.close()
if "ERROR:" in fileData:
# No device was detected, so retry user!
print("ERROR: No device found!")
messagebox.showinfo("No device detected! 0x404","Try disconnecting and reconnecting your device.")
return # stop function execution here
else:
# We definitely have something connected...
# Find the UDID
start = 'UniqueDeviceID: '
end = 'UseRaptorCerts:'
s = str(fileData)
foundData = s[s.find(start) + len(start):s.rfind(end)]
UDID = str(foundData)
LAST_CONNECTED_UDID = str(UDID)
if len(UDID) > 38:
# Stop automatic detection
timerStatus = 0
else:
print("Couldn't find your device")
messagebox.showinfo("","No device connected")
return # stop function execution here
showinfo("", "We will now bypass your device. Be sure to jailbreak your device first with palera1n or checkra1n")
print("Starting bypass...")
os.system("bash ./mdm.sh")
print("Device is bypassed\n")
showinfo('bypass Success!', 'Device is now bypassed!')
root.title('Twitter: @hackt1vator')
frame.pack()
#BIG title on program
mainText = Label(root, text="iFix",font=('Helveticabold', 24))
mainText.place(x=340, y=170)
img2 = Image.open("iFix.jpg")
NewIMGSize2 = img2.resize((1000,1000), Image.ANTIALIAS)
new_image2 = ImageTk.PhotoImage(NewIMGSize2)
label = Label(frame, image = new_image2)
label.place(x=0, y=0)
#label
my_label2 = Label(frame,
text = "mdm Bypass")
my_label2.place(x=300, y=230)
#label
my_label3 = Label(frame,
text = "ver 1.0")
my_label3.place(x=10, y=420)
cButton1 = tk.Button(frame,
text="bypass ios 12-16.5",
command=mdmbypass,
state="normal")
cButton1.place(x=270, y=360)
cButton5 = tk.Button(frame,
text="enter recovery",
command=enterRecMode,
state="normal")
cButton5.place(x=10, y=10)
cButton6 = tk.Button(frame,
text="exit recovery",
command=exitRecMode,
state="normal")
cButton6.place(x=580, y=10)
cButton7 = tk.Button(frame,
text="start checkra1n",
command=startcheckra1n,
state="normal")
cButton7.place(x=530, y=200)
cButton9 = tk.Button(frame,
text="start palera1n",
command=show_popup,
state="normal")
cButton9.place(x=50, y=200)
cbeginExploit2 = tk.Button(frame,
text="Twitter!",
command=opentwitter,
state="normal")
cbeginExploit2.place(x=580, y=410)
root.geometry("700x450")
root.resizable(False, False)
root.eval('tk::PlaceWindow . center')
root.mainloop()