Пример #1
0
def installed(device: frida.core.Device):
    try:
        pid = device.spawn('/usr/bin/debugserver')
    except frida.ExecutableNotFoundError:
        return False

    device.kill(pid)
    return True
Пример #2
0
def setup(device: frida.core.Device):
    if device_type(device) != 'iOS':
        raise ValueError('This command is for iOS only')

    if installed(device):
        return True

    with (Path(__file__).parent / 'ent.xml').open('r') as fp:
        content = fp.read()

    pid = device.spawn('/bin/sh')
    session = device.attach(pid)
    script = session.create_script(read_agent())
    script.load()
    script.exports.sign_debugserver(content)
    session.detach()
    device.kill(pid)

    return True
Пример #3
0
def install(device: frida.core.Device):
    if device_type(device) != 'iOS':
        raise ValueError('This command is for iOS only')

    pubkey = Path.home() / '.ssh' / 'id_rsa.pub'
    if not (pubkey.exists() and pubkey.is_file()):
        raise RuntimeError('id_rsa.pub does not exists')

    with pubkey.open('r') as fp:
        content = fp.read().strip()

    pid = device.spawn('/bin/sh')
    session = device.attach(pid)
    script = session.create_script(read_agent())
    script.load()
    script.exports.copyid(content)
    session.detach()
    device.kill(pid)

    return True