|
1 | 1 | --- |
2 | | -date: 2025-09-25 00:41:15 |
| 2 | +date: 2025-09-25 00:43:15 |
3 | 3 | layout: post |
4 | 4 | title: iOS All The Things - Part II |
5 | 5 |
|
@@ -81,3 +81,106 @@ d. **Semi-Untethered:** if reboot the device , the ios is return to normal statu |
81 | 81 | Using that [website](https://canijailbreak.com/) to know what’s that tool compatible with version of ios device to make jailbreak. |
82 | 82 |
|
83 | 83 |
|
| 84 | +## Pull & Push IPA Packages |
| 85 | + |
| 86 | +Once your iOS device is successfully jailbroken, the next step is to install a package manager like Sileo, Cydia, or Zebra. Think of this as an "alternative App Store" specifically for jailbroken devices, where you can find powerful tools and tweaks that Apple doesn't allow. |
| 87 | + |
| 88 | +One of the most important tools you can install is Filza File Manager. This is a powerful file explorer that gives you full access to the entire iOS filesystem. something that is normally restricted on a non-jailbroken device. |
| 89 | + |
| 90 | +**Filza Uses:** |
| 91 | +* Browse System Files: View and edit files across the entire operating system. |
| 92 | +* Access App Containers: Open the sandboxed directories of installed applications. |
| 93 | +* Extract IPA Files: This is a critical function for penetration testers. |
| 94 | + |
| 95 | +#### How to Extract an IPA using Filza |
| 96 | + |
| 97 | +Another meaning pull any installed app from your device for analysis: |
| 98 | + |
| 99 | +a. Open Filza and navigate to the applications directory: '/var/containers/Bundle/Application/' |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +b. Find the App: You'll see folders with random names. Open each one to find the '.app' bundle for your target application (e.g., Facetime.app). |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +c. Go to any directory, such as /var/mobile/Downloads. Create a new folder named Payload. Paste the copied '.app' bundle into this Payload folder. |
| 108 | + |
| 109 | +d. Compress the Payload folder into a ZIP file. Long-press on the Payload folder and select the "Compress" option. This will create a Payload.zip file. |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +e. Rename the Payload.zip file to YourAppName.ipa. An IPA file is essentially a standard ZIP archive with a specific structure and a different file extension. |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +f. The '.ipa' file is now ready for analysis. You can transfer it to your own machine (e.g., Kali Linux system) using a secure transfer tool like scp (Secure Copy). |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +To move the extracted IPA file from your iOS device to your computer, you need a connection between the two devices. This is typically done using SSH (Secure Shell). |
| 122 | + |
| 123 | + |
| 124 | +* **Method 1:** Using SSH from Your Computer |
| 125 | + |
| 126 | + Ensure SSH is enabled on your jailbroken iOS device and that both devices are on the same network. |
| 127 | + |
| 128 | + ```bash |
| 129 | + scp mobile@[device_ip]:/var/mobile/Downloads/YourAppName.ipa /path/on/your/kali/ |
| 130 | + ``` |
| 131 | + |
| 132 | +* **Method 2:** Using NewTerm on Your iOS Device |
| 133 | + |
| 134 | + Alternatively, you can use NewTerm (available in Sileo/Zebra) a terminal emulator for iOS. to push the file to your computer: |
| 135 | + |
| 136 | + a. Install NewTerm from your package manager. |
| 137 | + |
| 138 | + b. Open NewTerm and use scp in reverse: |
| 139 | + |
| 140 | + ```bash |
| 141 | + scp /var/mobile/Downloads/YourAppName.ipa kali@[KALI_IP]:/home/kali/Downloads/ |
| 142 | + |
| 143 | + # The same scp command can also be used to transfer an IPA package from your computer to your jailbroken device (Push) |
| 144 | + scp /home/kali/Downloads/YourAppName.ipa mobile@[device_ip]:/var/mobile/Downloads/ |
| 145 | + ``` |
| 146 | + |
| 147 | +This ability to extract IPAs directly from a jailbroken device is a game-changer for security testing. It allows you to: |
| 148 | + |
| 149 | +* Perform static analysis on real applications using tools like Ghidra or Hopper. |
| 150 | +* Study the app’s compiled code, configuration files, and resources. |
| 151 | +* Identify potential vulnerabilities without needing the original source code. |
| 152 | + |
| 153 | +#### Analyzing Decrypted Executables with Hopper or Ghidra |
| 154 | + |
| 155 | +After transferring an IPA package to your computer, the next step is to analyze the application's main executable file. You can extract this file by unzipping the IPA package and navigating to the 'Payload/YourApp.app' folder. |
| 156 | + |
| 157 | +When you try to analyze an App Store application using reverse engineering tools like Hopper or Ghidra, you'll encounter a significant obstacle: the main executable file is encrypted. Apple encrypts applications from the App Store to protect intellectual property, which means static analysis tools will show garbled or meaningless code. |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +When an iOS application runs, the system must decrypt it in memory to execute the code. |
| 162 | + |
| 163 | +To overcome this encryption barrier, we use 'frida-ios-dump' a powerful tool that captures a running application directly from the device's memory. Here's how it works: |
| 164 | + |
| 165 | +a. Install frida-server from sileo. |
| 166 | + |
| 167 | +b. Run the target application on your jailbroken device. |
| 168 | + |
| 169 | +c. Execute [frida-ios-dump](https://github.com/AloneMonkey/frida-ios-dump/) from your computer while the app is active. |
| 170 | + |
| 171 | +```bash |
| 172 | +# to forward ssh connection |
| 173 | +iproxy 2222 22 |
| 174 | +# run frida-ios-dump |
| 175 | +./dump.py -H device-ip -u user -P password -p 2222 (bundle/name) |
| 176 | +``` |
| 177 | + |
| 178 | +d. The tool dumps the decrypted version of the application from memory. |
| 179 | + |
| 180 | +e. You now have a decrypted IPA that can be properly analyzed. |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | +## Setup BurpSuite |
| 185 | + |
| 186 | + |
0 commit comments