diff --git a/src/mobile-pentesting/ios-pentesting/ios-protocol-handlers.md b/src/mobile-pentesting/ios-pentesting/ios-protocol-handlers.md index 3e6f504ebdf..734e219fa45 100644 --- a/src/mobile-pentesting/ios-pentesting/ios-protocol-handlers.md +++ b/src/mobile-pentesting/ios-pentesting/ios-protocol-handlers.md @@ -2,7 +2,166 @@ {{#include ../../banners/hacktricks-training.md}} +## Basic Information +In this page, **protocol handlers** are the URL schemes or URL-like handoffs that make iOS leave the current web context or resolve content through a non-standard path. During a pentest, treat every transition from **web content** to **`UIApplication.open`**, **`canOpenURL`**, or a **`WKURLSchemeHandler`** as a trust boundary. +This page focuses on **WebView / browser-driven scheme abuse**. For app registration, deeplink hijacking, and callback stealing, see [iOS Custom URI Handlers / Deeplinks / Custom Schemes](ios-custom-uri-handlers-deeplinks-custom-schemes.md). For the file-origin / `loadFileURL:allowingReadAccessTo:` angle, see [iOS WebViews](ios-webviews.md). For claimed `https` handlers, see [iOS Universal Links](ios-universal-links.md). +Common protocol-handler surfaces: +- System schemes such as `tel:`, `sms:`, `mailto:`, and `facetime:`. +- App schemes such as `myapp://`, browser-internal schemes, and `x-callback-url` style callbacks. +- Custom resource schemes served from native code via `WKURLSchemeHandler` (for example `app://` or `resources://` inside `WKWebView`). + +The key question is always: **can attacker-controlled content make the app open, resolve, or bounce to a URL whose scheme/host/path was not supposed to be reachable?** + +## High-value bug patterns + +### 1. Web content controls the next navigation + +If a `WKWebView` renders attacker-controlled HTML or attacker-controlled data is injected into the DOM, you may get a **scheme pivot** without touching native code directly. Modern payloads do not need `