Skip to content

Commit

Permalink
Add libimobiledevice / update iproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Beckers committed Dec 26, 2024
1 parent 723c4ee commit f3da3a7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Document/0x06b-iOS-Security-Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ It is also possible to get the UDID via various command line tools on macOS whil
| "USB Serial Number" = "9e8ada44246cee813e2f8c1407520bf2f84849ec"
```

- By using [ideviceinstaller](https://github.com/libimobiledevice/ideviceinstaller) (also available on Linux):
- By using @MASTG-TOOL-0126:

```sh
$ brew install ideviceinstaller
$ idevice_id -l
316f01bd160932d2bf2f95f1f142bc29b1c62dbc
```
Expand Down
9 changes: 3 additions & 6 deletions techniques/ios/MASTG-TECH-0052.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ During a real black box test, a reliable Wi-Fi connection may not be available.
Connect macOS to an iOS device by installing and starting @MASTG-TOOL-0055:

```bash
$ brew install libimobiledevice
$ iproxy 2222 22
waiting for connection
```
Expand All @@ -60,13 +59,11 @@ The above command maps port `22` on the iOS device to port `2222` on localhost.
With the following command in a new terminal window, you can connect to the device:
```bash
$ ssh -p 2222 root@localhost
root@localhost's password:
iPhone:~ root#
$ ssh -p 2222 mobile@localhost
mobile@localhost's password:
iPhone:~ mobile%
```
> Small note on USB of an iDevice: on an iOS device you cannot make data connections anymore after 1 hour of being in a locked state, unless you unlock it again due to the USB Restricted Mode, which was introduced with iOS 11.4.1
## On-device Shell App
While usually using an on-device shell (terminal emulator) might be very tedious compared to a remote shell, it can prove handy for debugging in case of, for example, network issues or check some configuration. For example, you can install [NewTerm 2](https://chariz.com/get/newterm "NewTerm 2") via Cydia for this purpose (it supports iOS 6.0 to 12.1.2 at the time of this writing).
Expand Down
2 changes: 1 addition & 1 deletion techniques/ios/MASTG-TECH-0063.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ waiting for connection
The next step is to make a remote port forwarding of port 8080 on the iOS device to the localhost interface on our computer to port 8080.

```bash
ssh -R 8080:localhost:8080 root@localhost -p 2222
ssh -R 8080:localhost:8080 mobile@localhost -p 2222
```

You should now be able to reach Burp on your iOS device. Open Safari on iOS and go to 127.0.0.1:8080 and you should see the Burp Suite Page. This would also be a good time to [install the CA certificate](https://support.portswigger.net/customer/portal/articles/1841109-installing-burp-s-ca-certificate-in-an-ios-device "Installing Burp\'s CA Certificate in an iOS Device") of Burp on your iOS device.
Expand Down
8 changes: 6 additions & 2 deletions tools/ios/MASTG-TOOL-0055.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
title: iProxy
platform: ios
source: https://github.com/tcurdt/iProxy
source: https://github.com/libimobiledevice/libusbmuxd
---

A tool used to connect via SSH to a jailbroken iPhone via USB - <https://github.com/tcurdt/iProxy>
iProxy allows you to forward a port from a connected iOS device to a port on the host machine. iProxy can be useful for interacting with jailbroken devices, as some jailbreaks do not expose the SSH port on the public interface. With iProxy, the SSH port can be forwarded over USB to the host, allowing you to still connect to it.

!!! warning

While many package repositories (apt, brew, cargo, ...) have versions of libimobiledevice tools, they are often outdated. We recommend compiling the different tools from source for the best results.
42 changes: 42 additions & 0 deletions tools/ios/MASTG-TOOL-0126.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: libimobiledevice suite
platform: ios
host:
- macOS
- windows
- linux
source: https://libimobiledevice.org/
---

The libimobiledevice suite is cross-platform protocol library for interacting with iOS devices. The different libraries can be compiled into binaries for direct interaction with iOS devices from the commandline.

!!! warning

While many package repositories (apt, brew, cargo, ...) have versions of libimobiledevice tools, they are often outdated. We recommend compiling the different tools from source for the best results.

The following tools are part of the libimobiledevice suite:

| Tool | Purpose |
|------------------|---------------------|
| idevice_id | List attached devices or print device name of given device. |
| idevicebackup | Create or restore backup from the current or specified directory (<iOS 4). |
| idevicebackup2 | Create or restore backup from the current or specified directory (>= iOS 4). |
| idevicecrashreport | Move crash reports from device to a local DIRECTORY. |
| idevicedate | Display the current date or set it on a device. |
| idevicedebug | Interact with the debugserver service of a device. |
| idevicedebugserverproxy | Proxy debugserver connection from device to a local socket at PORT. |
| idevicediagnostics | Use diagnostics interface of a device running iOS 4 or later. |
| ideviceenterrecovery | Makes a device with the supplied UDID enter recovery mode immediately. |
| ideviceimagemounter | Mounts the specified disk image on the device. |
| ideviceinfo | Show information about a connected device. |
| ideviceinstaller | Manage apps on iOS devices. |
| idevicename | Display the device name or set it to NAME if specified. |
| idevicenotificationproxy | Post or observe notifications on a device. |
| idevicepair | Manage host pairings with devices and usbmuxd. |
| ideviceprovision | Manage provisioning profiles on a device. |
| idevicescreenshot | Gets a screenshot from a device. |
| idevicesetlocation | Sets the location on a device. |
| idevicesyslog | Relay syslog of a connected device. |
| inetcat | Opens a read/write interface via STDIN/STDOUT to a TCP port on a usbmux device. |
| iproxy | Proxy that binds local TCP ports to be forwarded to the specified ports on a usbmux device. |
| plistutil | Convert a plist FILE between binary, XML, JSON, and OpenStep format. |

0 comments on commit f3da3a7

Please sign in to comment.