Grapefruit: Runtime Application Instruments for iOS

Overview

Grapefruit

Grapefruit: Runtime Application Instruments for iOS

John Discord npm version Commits contributers License

Screenshot

Get Started

Dependencies

Grapefruit requires Node.js to be installed. If you can't install the frida-node dependency, please check out the troubleshooting section to choose another version of Node.js.

Setup frida on your iOS device: https://www.frida.re/docs/ios/

Start Cydia and add Frida’s repository by going to Manage -> Sources -> Edit -> Add and enter https://build.frida.re. You should now be able to find and install the Frida package which lets Frida inject JavaScript into apps running on your iOS device. This happens over USB, so you will need to have your USB cable handy, though there’s no need to plug it in just yet.

Setup

Grapefruit is now on npm as igf! Interprets as iGrapefruit or maybe iOS Graphical Frida

npm install -g igf

Now you have the grapefruit cli as igf:

port of the server side (default: 31337) --help display help for command">
~ igf --help

Usage: igf [options]

Options:
  -h, --host   hostname (default: "127.0.0.1")
  -p, --port   port of the server side (default: 31337)
  --help               display help for command

Default URL for the web UI is http://localhost:31337

Security Warning

At this moment, grapefruit has no authentication. It's possible to use it to inject arbitrary code to your iPhone for anyone that has the access to the web UI. Please limit it to localhost as much as possible. Contribution welcomed.

Discord Group

If you have experienced anything wrong or want to suggest new features, please join my Discord channel! https://discord.gg/pwutZNx

Comments
  • Problem after frida update

    Problem after frida update

    After updating frida to 14.0.1 Grapefruit doesn't seem to work. Server runs, but when trying to access the sandbox, it doesn't return anything and keeps loading. Am I doing anything wrong here? Is there a work around?

    opened by aadarshaddy 17
  • Error during the npm installation process

    Error during the npm installation process

    Hello, I'm getting the next error message when I try to install IGF on Mac Big Sur. Could you please help to resolve this issue?

    > sudo npm install -g igf
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
    npm ERR! code 1
    npm ERR! path /usr/local/lib/node_modules/igf/node_modules/frida
    npm ERR! command failed
    npm ERR! command sh -c prebuild-install || node-gyp rebuild
    npm ERR! prebuild-install WARN install No prebuilt binaries found (target=16.2.0 runtime=node arch=x64 libc= platform=darwin)
    npm ERR! gyp info it worked if it ends with ok
    npm ERR! gyp info using [email protected]
    npm ERR! gyp info using [email protected] | darwin | x64
    npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/local/opt/[email protected]/bin/python3.9"
    npm ERR! (node:42102) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
    npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
    npm ERR! gyp info spawn /usr/local/opt/[email protected]/bin/python3.9
    npm ERR! gyp info spawn args [
    npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
    npm ERR! gyp info spawn args   'binding.gyp',
    npm ERR! gyp info spawn args   '-f',
    npm ERR! gyp info spawn args   'make',
    npm ERR! gyp info spawn args   '-I',
    npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/igf/node_modules/frida/build/config.gypi',
    npm ERR! gyp info spawn args   '-I',
    npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
    npm ERR! gyp info spawn args   '-I',
    npm ERR! gyp info spawn args   '/Users/dd/Library/Caches/node-gyp/16.2.0/include/node/common.gypi',
    npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
    npm ERR! gyp info spawn args   '-Dvisibility=default',
    npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/dd/Library/Caches/node-gyp/16.2.0',
    npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
    npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/dd/Library/Caches/node-gyp/16.2.0/<(target_arch)/node.lib',
    npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/local/lib/node_modules/igf/node_modules/frida',
    npm ERR! gyp info spawn args   '-Dnode_engine=v8',
    npm ERR! gyp info spawn args   '--depth=.',
    npm ERR! gyp info spawn args   '--no-parallel',
    npm ERR! gyp info spawn args   '--generator-output',
    npm ERR! gyp info spawn args   'build',
    npm ERR! gyp info spawn args   '-Goutput_dir=.'
    npm ERR! gyp info spawn args ]
    npm ERR! gyp: binding.gyp not found (cwd: /usr/local/lib/node_modules/igf/node_modules/frida) while trying to load binding.gyp
    npm ERR! gyp ERR! configure error 
    npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
    npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
    npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
    npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
    npm ERR! gyp ERR! System Darwin 20.4.0
    npm ERR! gyp ERR! command "/usr/local/Cellar/node/16.2.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/igf/node_modules/frida
    npm ERR! gyp ERR! node -v v16.2.0
    npm ERR! gyp ERR! node-gyp -v v7.1.2
    npm ERR! gyp ERR! not ok
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/dd/.npm/_logs/2021-05-24T12_09_02_390Z-debug.log
    
    opened by dior4ik 7
  • iOS 14.2 Problem?

    iOS 14.2 Problem?

    Updated my iDevice to 14.2 and now GF is not operating as expected. Just received this;

    Uncaught RPC error TypeError: cannot read property 'enumerateImports' of null
        at imps (src/modules/symbol.ts:57)
        at apply (native)
        at invoke (src/rpc.ts:19)
        at apply (native)
        at <anonymous> (frida/runtime/message-dispatcher.js:13)
        at c (frida/runtime/message-dispatcher.js:23)
    method: symbol/imps args: [ 'CryptoKitPrivate' ]
    Uncaught RPC error Error: 0x104e83158 is not executable
        at disasm (src/modules/disasm.ts:55)
        at apply (native)
        at invoke (src/rpc.ts:19)
        at apply (native)
        at <anonymous> (frida/runtime/message-dispatcher.js:13)
        at c (frida/runtime/message-dispatcher.js:23)
    method: disasm args: [ '0x104e83158' ]
    Uncaught RPC error Error: 0x104e836ec is not executable
        at disasm (src/modules/disasm.ts:55)
        at apply (native)
        at invoke (src/rpc.ts:19)
        at apply (native)
        at <anonymous> (frida/runtime/message-dispatcher.js:13)
        at c (frida/runtime/message-dispatcher.js:23)
    method: disasm args: [ '0x104e836ec' ]
    

    May be an issue with frida itself, but figured I would report here just in case.

    Also saw this in the GF log;

    Welcome to Grapefruit!
    [11/19/2020, 4:28:28 PM] unexpected error: Error: TypeError: cannot read property 'enumerateImports' of null
    [11/19/2020, 4:28:29 PM] unexpected error: Error: Error: 0x104e83158 is not executable
    [11/19/2020, 4:28:29 PM] unexpected error: Error: Error: 0x104e836ec is not executable
    
    opened by idb- 6
  • Proxy error: Could not proxy request (HPE_INVALID_CONSTANT).

    Proxy error: Could not proxy request (HPE_INVALID_CONSTANT).

    Hi Team,

    I am getting the below shown error while trying to connect my device.

    Proxy error: Could not proxy request /api/devices from localhost:8080 to http://localhost:31337/ (HPE_INVALID_CONSTANT).

    Note: Jailbroken iphone connected via USB. The grapefruit is installed and is up and running on the below IPs;

    App running at:

    • Local: http://localhost:8080/
    • Network: http://192.168.0.132:8080/

    Can you help me with some hints on how to proxy my localhost:8080 (my mac machine) to http://localhost:31337/ (jailbroken iphone)?

    opened by hehacks 6
  • IGF stuck at device fetch information page

    IGF stuck at device fetch information page

    Hi,

    I am using Iphone SE 13.3 jailbroken and installed with frida 15.0.2 (installed from cydia repo). I tried to install igf using npm install -g igf and it was installed without errors. now it stuck at the page described above (ss attached)

    any help? 10x

    image

    opened by B4RD4k 4
  • Syntaxe error on the resolver

    Syntaxe error on the resolver

    https://github.com/ChiChou/grapefruit/blob/0a4c77db47068a8f399c03b5b042be03433086fc/agent/src/modules/symbol.ts#L66

    There's a syntaxe error when trying to enumerate modules and classes.

    Uncaught RPC error Error: invalid query; format is: exports:!open, exports:libc.so!* or imports:notepad.exe!* at O (frida/runtime/core.js:567) at value (frida/runtime/core.js:549) at resolve (src/modules/symbol.ts:66) at invoke (src/rpc.ts:17) at apply (native) at (frida/runtime/message-dispatcher.js:13) at c (frida/runtime/message-dispatcher.js:23)

    According to Frida's documentation the ApiResolver.enumerateModule method cannot take a simple string as an argument.

    Maybe a switch case on the type of resolver could resolve the issue.

    export function resolve(type: 'objc' | 'module', query: string) {
      var matches;
      switch(type) {
      	case 'objc': 
      		matches = new ApiResolver(type).enumerateMatches("*[*" + query.toString() + "* *]")
      		break;
      	case 'module': 
      		matches = new ApiResolver(type).enumerateMatches("imports:*" + query.toString() + "!*") 
      		break;
      	default:
      		matches = new ApiResolver(type).enumerateMatches("*[*" + query.toString() + "* *]")
      		break;
      }
      return type === 'module' ? matches.map(item => {
        const [module, symbol] = item.name.split('!', 2)
        return Object.assign({}, item, { module, symbol })
      }) : matches
    }
    
    opened by Eliotsehr 3
  • Installation error

    Installation error

    I cannot install grapefruit, always getting an error in npm. Any idea what might be wrong?

    ❯ npm install                                                                                                                                                                                                                              ─╯
    
    > [email protected] postinstall /Users/sven/PentestTools/iOS/Grapefruit
    > node scripts/install.js
    
    audited 1490 packages in 7.568s
    
    59 packages are looking for funding
      run `npm fund` for details
    
    found 1 high severity vulnerability
      run `npm audit fix` to fix them, or `npm audit` for details
    
    > [email protected] install /Users/sven/PentestTools/iOS/Grapefruit/server/node_modules/frida
    > prebuild-install || node-gyp rebuild
    
    prebuild-install WARN install No prebuilt binaries found (target=13.7.0 runtime=node arch=x64 libc= platform=darwin)
    gyp: binding.gyp not found (cwd: /Users/sven/PentestTools/iOS/Grapefruit/server/node_modules/frida) while trying to load binding.gyp
    gyp ERR! configure error
    gyp ERR! stack Error: `gyp` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
    gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    gyp ERR! System Darwin 19.5.0
    gyp ERR! command "/usr/local/Cellar/node/13.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/sven/PentestTools/iOS/Grapefruit/server/node_modules/frida
    gyp ERR! node -v v13.7.0
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok
    npm WARN [email protected] No repository field.
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/sven/.npm/_logs/2020-08-23T05_57_28_685Z-debug.log
    child_process.js:650
        throw err;
        ^
    
    Error: Command failed: npm i
        at checkExecSyncError (child_process.js:611:11)
        at Object.execSync (child_process.js:647:15)
        at Object.<anonymous> (/Users/sven/PentestTools/iOS/Grapefruit/scripts/install.js:7:6)
        at Module._compile (internal/modules/cjs/loader.js:1151:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
        at Module.load (internal/modules/cjs/loader.js:1000:32)
        at Function.Module._load (internal/modules/cjs/loader.js:899:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
        at internal/main/run_main_module.js:17:47 {
      status: 1,
      signal: null,
      output: [ null, null, null ],
      pid: 73706,
      stdout: null,
      stderr: null
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] postinstall: `node scripts/install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/sven/.npm/_logs/2020-08-23T05_57_28_771Z-debug.log
    

    image

    opened by sushi2k 3
  • Warning - local regulation restrictions

    Warning - local regulation restrictions

    Hello, I am currently having this issue: When spawning on my Unc0ver jailbroken iPhone 6 the app 抖音 (douyin, the Chinese TikTok), here's what happens:

    Capture d’écran 2022-12-03 à 23 16 03

    Is it coming from the app, which is known for its crazy security measures, or from igf ? Thanks

    question 
    opened by novitae 2
  • Startup Script

    Startup Script

    Hello, and thanks for this great project, the interface is really snappy and with lots of functionality!

    So, I am currently dealing with an app that has jailbreak detection, and I'd like to load a script as soon as the app starts. Is there a way to do so in Grapefruit? If so, I'm sorry for not finding it!

    opened by madt1m 2
  • "Connecting" forever

    UPDATE: Aftrer reboot Mac and reconnect iPhone, the issue is gone, please close, thanks.

    I have lastest frida 15.1.18 on iphone SE (iOS version 13.7) and Mac OS.

    After install grape fruit with npm, I'm able to find iPhone from 127.0.0.1:31337 and connect.

    But when I try to connect to my app, it won't connect, just saying Connecting. Thanks.

    opened by yindeming 2
  • Hi ChiChou,

    Hi ChiChou,

    Hi ChiChou,

    The issue got resolved, it was some nodejs error. It works fine. Thank you :)

    One query: Is it always better to run the production build for testing? or is the development build have any restrictions in place at present?

    Originally posted by @hehacks in https://github.com/ChiChou/grapefruit/issues/5#issuecomment-656302412

    opened by ahmedx90T 2
  • Internal Server Error

    Internal Server Error

    When I connected my iPhone, opened IGF on the website, clicked my iPhone, and showed up "Internal Server Error."

    Arch: arm64 Version: 12.5.2 Platform: darwin Access: jailed image

    opened by pharazone 0
  • Frida script crash

    Frida script crash

    Describe the bug

    Clicking on Classdump icon > App throws this error:

    Uncaught RPC error TypeError: not a function
        at normalize (src/modules/classdump.ts:23)
        at ownClasses (src/modules/classdump.ts:27)
        at list (src/modules/classdump.ts:42)
        at search (src/modules/classdump.ts:49)
        at invoke (src/rpc.ts:17)
        at apply (native)
        at <anonymous> (frida/runtime/message-dispatcher.js:13)
        at c (frida/runtime/message-dispatcher.js:23)
    method: classdump/search args: [ '__app__', '' ]
    

    Desktop (please complete the following information):

    • OS: macOS 12.4 (M1)
    • Browser: Chrome

    Phone (please complete the following information):

    • Device: iPhone 7
    • OS: iOS 14.4.2
    • Browser: safari
    • Jailbreak Name: Chekra1n
    • Frida Version: 16.0.1

    Additional context

    opened by Surendrajat 0
Releases(v0.12.0)
Owner
codecolorist
Metaverse brick transportation expert
codecolorist
A modern runtime (soon: modification) library

Bridge A Modern Runtime (soon: Modification) Library Setup swift package generate-xcodeproj Whenever you need to create/modify a target, please regen

Cero 18 Oct 31, 2022
📱Objection - runtime mobile exploration

objection is a runtime mobile exploration toolkit, powered by Frida, built to help you assess the security posture of your mobile applications, without needing a jailbreak.

SensePost 5.6k Jan 7, 2023
Kushal Shingote 1 Feb 2, 2022
Home Assistant Native iOS Application built with SwiftUI for iOS 15+

Home Assistant - Native iOS SwiftUI Application Screenshots Disclaimer - Please read This application is mostly a not-working mockup written in SwiftU

Alessio Santoru 34 Dec 13, 2022
🛠 A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern.

Model-View-Presenter template A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern. This

Tamerlan Satualdypov 22 Nov 9, 2022
iOS application to extract accession numbers from wall labels using Vision and VisionKit frameworks.

iOS application to extract accession numbers from wall labels using Vision and VisionKit frameworks. Important This is experimenta

San Francisco International Airport Museum 6 Feb 2, 2022
Tip Calculator is a tip calculator application for iOS.

Pre-work - Tip Calculator Tip Calculator is a tip calculator application for iOS. Submitted by: MohammadAmin Montazeri Time spent: 1 hours spent in to

Amin M 0 Nov 23, 2021
IOS Swift Application using VIPER Architecture

IOS Swift Application using VIPER Architecture. This is a simple design application for E-Commerce using VIPER architecture and CoreData, I prefer using Delegate Protocols rather than Third Party Library such as Rx but at this project I make it as an example on how to using VIPER.The application also support localization.

Mahmoud Salah 0 Dec 1, 2021
How to develop an iOS 14 application with SwiftUI 2.0 framework. How to create an Onboarding Screen with Page Tab View

Ama-Fruits USER INTERFACE AND USER EXPERIENCE APP DESIGN How to develop an iOS 14 application with SwiftUI 2.0 framework. How to create an Onboarding

Noye Samuel 1 Dec 11, 2021
iOS application to rate songs in Spotify playlists

Description Reviewery is an iOS application to rate songs in Spotify playlists. It's a hobby project built in React Native. Read more in my Medium art

Vadym Markov 15 May 11, 2022
Joplin - an open source note taking and to-do application with synchronization capabilities for Windows, macOS, Linux, Android and iOS. Forum: https://discourse.joplinapp.org/

Joplin® is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are sea

Laurent 33.7k Dec 30, 2022
The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms.

Bitwarden Mobile Application The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin iOS, and Xamarin Forms. Build/Run Require

Bitwarden 4.2k Dec 29, 2022
PagecallSDK - Integrate Pagecall for your iOS Application

Integrate Pagecall for your iOS Application [!] Bitcode is not supported, becaus

PPLINK 0 Feb 4, 2022
3DProject: MR based IOS application

3DProject Driving Question This is MR based IOS application. MR is to place a me

null 1 Feb 16, 2022
XCSnippetsApp - macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently to Xcode

XCSnippetsApp macOS application to explore code snippets from the Swift and iOS community, view and edit the snippets before adding them conveniently

Marco Eidinger 119 Dec 27, 2022
A macOS application for accessing the output of the SimpleAnalytics package on the desktop.

The SimpleAnalytics package allows you to collect data user interaction analytic data in iOS and macOS applications. This SimpleAnalytics Reader app project allows you to more easily make sense of that collected data by displaying it on your Mac.

Dennis Birch 10 Dec 22, 2022
SandboxKit - Framework that makes it easy to launch a single Scene of your application

SandboxKit This framework makes debugging more efficient in your application. Sandbox is the name of a structure that improves the efficiency of debug

Aoi Okawa 10 Apr 24, 2022
A simple self-development challenge application that aimed to learn

Movie List Challenge A simple self-development challenge application that aimed to learn "The Composable Architecture" basics and build a reactive str

Nicat Muzaffarli 1 Oct 30, 2021
Test application that gets its data from the themoviedb api

SWorld app Aplicacion de prueba que obtiene sus datos de la api themoviedb, se permite listar, buscar por titulos y acceder al detalle Prerquisitos pa

null 0 Nov 17, 2021