ios

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package ios configures iOS simulators and devices for HTTPS interception. Simulator CA install is automated via xcrun simctl; physical devices use a generated .mobileconfig (proxy + CA) the operator installs in Safari.

Package ios — SSH helpers for jailbroken iOS devices (OpenSSH as root). Credentials are supplied per request and are never persisted by Interceptor.

Index

Constants

View Source
const (
	KindSimulator = "simulator"
	KindPhysical  = "physical"
)

DeviceKind distinguishes simulators from USB-connected iPhones.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether any automated iOS backend exists on this machine.

func BuildMobileConfig

func BuildMobileConfig(certPEM []byte, opts ProfileOpts) ([]byte, error)

BuildMobileConfig returns a .mobileconfig plist installing the CA and manual HTTP proxy.

func BuildProfileURL added in v0.22.0

func BuildProfileURL(baseURL, proxyHost string, proxyPort int) string

BuildProfileURL returns the control-plane mobileconfig download URL.

func IDeviceAvailable

func IDeviceAvailable() bool

IDeviceAvailable reports whether libimobiledevice is on PATH.

func InstallCASimulator

func InstallCASimulator(d Device, certPEM []byte) error

InstallCASimulator adds the Interceptor CA to a simulator trust store.

func LANHost

func LANHost() (string, error)

LANHost returns a likely private LAN IPv4 (shared helper for Wi‑Fi proxy).

func OpenURL

func OpenURL(d Device, rawURL string) error

OpenURL opens a URL in the simulator (e.g. profile install page).

func SSHAvailable added in v0.22.0

func SSHAvailable() bool

SSHAvailable reports whether the embedded SSH client can be used (always true).

func SimctlAvailable

func SimctlAvailable() bool

SimctlAvailable reports whether Xcode simctl is usable (macOS only).

func TCPReachable added in v0.22.0

func TCPReachable(host string, port int) bool

TCPReachable checks whether host:port accepts a TCP connection (no SSH auth).

Types

type Device

type Device struct {
	Kind            string `json:"kind"`
	UDID            string `json:"udid"`
	Name            string `json:"name"`
	State           string `json:"state,omitempty"`
	Runtime         string `json:"runtime,omitempty"`
	Booted          bool   `json:"booted,omitempty"`
	SuggestedTarget string `json:"suggestedTarget,omitempty"` // simulator | physical
}

Device is a simulator or USB-connected iOS device.

func AllDevices

func AllDevices() ([]Device, error)

AllDevices returns simulators then physical devices.

func PhysicalDevices

func PhysicalDevices() ([]Device, error)

PhysicalDevices lists USB-connected iOS devices via idevice_id.

func ResolveDevice

func ResolveDevice(udid string, devices []Device) (Device, error)

ResolveDevice picks explicit udid or the sole booted simulator / connected phone.

func Simulators

func Simulators() ([]Device, error)

Simulators lists iOS simulators (booted ones first).

type ProfileOpts

type ProfileOpts struct {
	DisplayName  string
	ProxyHost    string
	ProxyPort    int
	Organization string
}

ProfileOpts configures an unsigned configuration profile (CA + global HTTP proxy).

type SSHOpts added in v0.22.0

type SSHOpts struct {
	Host     string
	Port     int
	User     string
	Password string
	KeyPath  string
	KeyPEM   []byte // in-memory key material (preferred over KeyPath when set)
}

SSHOpts configures SSH access to a jailbroken iOS device.

type SSHResult added in v0.22.0

type SSHResult struct {
	Host            string   `json:"host"`
	User            string   `json:"user"`
	Port            int      `json:"port,omitempty"`
	Reachable       bool     `json:"reachable"`
	Authenticated   bool     `json:"authenticated,omitempty"`
	Steps           []string `json:"steps,omitempty"`
	ProfileURL      string   `json:"profileUrl,omitempty"`
	Proxy           string   `json:"proxy,omitempty"`
	NeedsUserAction bool     `json:"needsUserAction,omitempty"`
	Message         string   `json:"message"`
	Warning         string   `json:"warning,omitempty"`
	Method          string   `json:"method,omitempty"`
}

SSHResult is returned from SSH automation steps.

func SSHInstallCA added in v0.22.0

func SSHInstallCA(opts SSHOpts, profileURL string) (*SSHResult, error)

SSHInstallCA opens the Interceptor mobileconfig on the device for manual install.

func SSHSetup added in v0.22.0

func SSHSetup(opts SSHSetupOpts) (*SSHResult, error)

SSHSetup installs the configuration profile (CA + global HTTP proxy) via SSH.

func SSHStatus added in v0.22.0

func SSHStatus(opts SSHOpts) (*SSHResult, error)

SSHStatus verifies SSH connectivity and authentication.

type SSHSetupOpts added in v0.22.0

type SSHSetupOpts struct {
	SSHOpts
	ProxyHost  string
	ProxyPort  int
	ProfileURL string // control plane base URL (scheme + host[:port])
}

SSHSetupOpts configures one-click jailbroken iOS intercept setup.

type SetupOpts

type SetupOpts struct {
	Target     string // simulator | physical | auto
	ProxyMode  string // localhost (simulator) | wifi (physical, default)
	WiFiHost   string
	Port       int
	ProfileURL string // control plane URL prefix for profile download
}

SetupOpts configures one-click iOS intercept setup.

type SetupResult

type SetupResult struct {
	UDID            string   `json:"udid"`
	Kind            string   `json:"kind"`
	Proxy           string   `json:"proxy,omitempty"`
	ProfileURL      string   `json:"profileUrl,omitempty"`
	Steps           []string `json:"steps"`
	NeedsUserAction bool     `json:"needsUserAction,omitempty"`
	Message         string   `json:"message"`
}

SetupResult is returned from Setup.

func Setup

func Setup(d Device, certPEM []byte, opts SetupOpts) (*SetupResult, error)

Setup automates what iOS allows: simulator CA via simctl; all targets get a profile URL.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL