fork download
  1. <?php
  2. $serverlist = file("servers.txt", FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
  3.  
  4. $requestlist = '';
  5. foreach (glob("requests/*.xml") as $filename)
  6. {
  7. $requestlist = $requestlist.'<a href="fake-request.php?file='.basename($filename).'" >'.basename($filename, '.xml').'</a><br/>';
  8. }
  9.  
  10. $requestfilename = 'requests/'.(isset($_GET['file']) ? $_GET['file'] : 'fake.php');
  11.  
  12. if (isset($_GET['file']) && file_exists($requestfilename))
  13. {
  14. $activationinfo = file_get_contents($requestfilename);
  15.  
  16. // load and decode activation info
  17. $encodedrequest = new DOMDocument;
  18. $encodedrequest->loadXML($activationinfo);
  19. $activationDecoded= base64_decode($encodedrequest->getElementsByTagName('data')->item(0)->nodeValue);
  20.  
  21. $decodedrequest = new DOMDocument;
  22. $decodedrequest->loadXML($activationDecoded);
  23. $nodes = $decodedrequest->getElementsByTagName('dict')->item(0)->getElementsByTagName('*');
  24.  
  25. for ($i = 0; $i < $nodes->length - 1; $i=$i+2)
  26. {
  27. switch ($nodes->item($i)->nodeValue)
  28. {
  29. case "UniqueChipID": $ECID = $nodes->item($i + 1)->nodeValue; break;
  30. case "IntegratedCircuitCardIdentity": $ICCID = $nodes->item($i + 1)->nodeValue; break;
  31. case "SerialNumber": $AppleSerialNumber = $nodes->item($i + 1)->nodeValue; break;
  32. case "InternationalMobileEquipmentIdentity": $IMEI = $nodes->item($i + 1)->nodeValue; break;
  33. case "InternationalMobileSubscriberIdentity": $IMSI = $nodes->item($i + 1)->nodeValue; break;
  34. }
  35. }
  36. }
  37. $initialserver = isset($serverlist[0]) ? $serverlist[0] : 'http://localhost/';
  38. foreach($serverlist as $item) { $servers = $servers.'<option value='.$item.'>'.$item.'</option>'; }
  39.  
  40. echo '
  41. <html>
  42. <title>IDevice activation</title>
  43. <script type="text/javascript">function changeServer(aForm,aValue) { aForm.setAttribute("action",aValue); } </script>
  44. <body>
  45. <form id="request-form" action="'.$initialserver.'" method="POST">
  46. <p><b>iDevice activation form</b></p>
  47. <p><input type="submit" value="Activate"></p>
  48. <p>
  49. <table>
  50. <tr>
  51. <td>
  52. <table>
  53. <tr><td>SERVER:</td><td><select name="SRVNAME" size=1 required autofocus onChange="changeServer(this.form,this.value);" style="width: 635px">'.$servers.'</select></td></tr>
  54. <tr><td>ECID:</td><td><input type="text" size=100 name="ECID" value="'.$ECID.'"></td></tr>
  55. <tr><td>MachineName:</td><td><input type="text" size=100 name="machineName" value="ICLOUD"></td></tr>
  56. <tr><td>InStoreActivation:</td><td><input type="text" size=100 name="InStoreActivation" value="false"></td></tr>
  57. <tr><td>ICCID:</td><td><input type="text" size=100 name="ICCID" value="'.$ICCID.'"></td></tr>
  58. <tr><td>GUID:</td><td><input type="text" size=100 name="guid" value="0DFAE16C.6F57B068.B803AFB4.CC724E15.96ED2D9C.BFAF971B.95634B69"></td></tr>
  59. <tr><td>Apple serial number:</td><td><input type="text" size=100 name="AppleSerialNumber" value="'.$AppleSerialNumber.'"></td></tr>
  60. <tr><td>IMEI:</td><td><input type="text" size=100 name="IMEI" value="'.$IMEI.'"></td></tr>
  61. <tr><td>IMSI:</td><td><input type="text" size=100 name="IMSI" value="'.$IMSI.'"></td></tr>
  62. <tr><td>Activation info:</td><td><textarea name="activation-info" cols="80" rows="15" >'.$activationinfo.'</textarea></td></tr>
  63. <tr><td></td><td><input type="hidden" name="activation-info-base64" value="'.base64_encode($activationinfo).'"></td></tr>
  64. </table>
  65. </td>
  66. <td><div style="overflow:auto;height:500px;width:400px;">'.$requestlist.'</div></td>
  67. </tr>
  68. </table>
  69. </p>
  70. </form>
  71. </body>
  72. </html>';
  73. ?>
Success #stdin #stdout #stderr 0.04s 25624KB
stdin
Standard input is empty
stdout
<html>
<title>IDevice activation</title>
<script type="text/javascript">function changeServer(aForm,aValue) { aForm.setAttribute("action",aValue); } </script>
<body>
<form id="request-form" action="http://localhost/" method="POST">
  <p><b>iDevice activation form</b></p>
  <p><input type="submit" value="Activate"></p>
  <p>
		<table>
			<tr>
				<td>
					<table>
						<tr><td>SERVER:</td><td><select name="SRVNAME" size=1 required autofocus onChange="changeServer(this.form,this.value);" style="width: 635px"></select></td></tr>
						<tr><td>ECID:</td><td><input type="text" size=100 name="ECID" value=""></td></tr>
						<tr><td>MachineName:</td><td><input type="text" size=100 name="machineName" value="ICLOUD"></td></tr>
						<tr><td>InStoreActivation:</td><td><input type="text" size=100 name="InStoreActivation" value="false"></td></tr>
						<tr><td>ICCID:</td><td><input type="text" size=100 name="ICCID" value=""></td></tr>
						<tr><td>GUID:</td><td><input type="text" size=100 name="guid" value="0DFAE16C.6F57B068.B803AFB4.CC724E15.96ED2D9C.BFAF971B.95634B69"></td></tr>
						<tr><td>Apple serial number:</td><td><input type="text" size=100 name="AppleSerialNumber" value=""></td></tr>
						<tr><td>IMEI:</td><td><input type="text" size=100 name="IMEI" value=""></td></tr>
						<tr><td>IMSI:</td><td><input type="text" size=100 name="IMSI" value=""></td></tr>
						<tr><td>Activation info:</td><td><textarea name="activation-info" cols="80" rows="15" ></textarea></td></tr>
						<tr><td></td><td><input type="hidden" name="activation-info-base64" value=""></td></tr>
					</table>
				</td>
				<td><div style="overflow:auto;height:500px;width:400px;"></div></td>
			</tr>
		</table>
  </p>  
 </form> 
</body>
</html>
stderr
PHP Warning:  file(servers.txt): failed to open stream: No such file or directory in /home/rIH5VI/prog.php on line 2
PHP Warning:  Invalid argument supplied for foreach() in /home/rIH5VI/prog.php on line 38
PHP Notice:  Undefined variable: servers in /home/rIH5VI/prog.php on line 53
PHP Notice:  Undefined variable: ECID in /home/rIH5VI/prog.php on line 54
PHP Notice:  Undefined variable: ICCID in /home/rIH5VI/prog.php on line 57
PHP Notice:  Undefined variable: AppleSerialNumber in /home/rIH5VI/prog.php on line 59
PHP Notice:  Undefined variable: IMEI in /home/rIH5VI/prog.php on line 60
PHP Notice:  Undefined variable: IMSI in /home/rIH5VI/prog.php on line 61
PHP Notice:  Undefined variable: activationinfo in /home/rIH5VI/prog.php on line 62
PHP Notice:  Undefined variable: activationinfo in /home/rIH5VI/prog.php on line 63