ChiChou / bagbak

Yet another frida based iOS dumpdecrypted. Also decrypts app extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal Error, agent.js does not exist. Frida 16.0.14 nodeJS 19.5.0

gelosecurity opened this issue · comments

Describe the bug
Fatal Error, agent.js does not exist.

To Reproduce
Steps to reproduce the behavior:

  1. Install Frida 16.0.14 on iOS and MacOS.
  2. Install bagbak using npm
  3. bagbak -l is working
  4. when attempting bagbak '[app]', get the following error:
FATAL ERROR
[Error: ENOENT: no such file or directory, open '/opt/homebrew/lib/node_modules/bagbak/agent/dist/agent.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/opt/homebrew/lib/node_modules/bagbak/agent/dist/agent.js'
}

Expected behavior
Should dump the app

Desktop (please complete the following information):

  • OS: MacOS
  • nodejs: v19.5.0
  • frida: 16.0.14
  • frida on device version: 16.0.14
  • iOS and jailbreak version: palera1n 15.7.3

There is a known issue(#93, #94) that v2.5.1 and v2.5.2 are incompletely published. Please make sure you are on the latest version: npm install -g bagbak@2.5.3

commented

Still seems to have an issue

node_modules$ 
node_modules$ npm list -g         
/Users/ben/.nvm/versions/node/v19.5.0/lib
├── bagbak@2.5.3
└── frida@16.0.17

tools$ bagbak -u xxxxxxxxxxx com.app.internal -o /Users/ben/Documents/ios -z -f
FATAL ERROR
[Error: ENOENT: no such file or directory, open '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent/dist/agent.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent/dist/agent.js'
}

I deleted all 2.5.x releases. However the v2.5.3 failed to pull from npm because of too many downloads

commented

Still getting this issue on 2.6.0

FATAL ERROR
[Error: ENOENT: no such file or directory, open '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent/dist/agent.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent/dist/agent.js'
}

npm list -g          
/Users/ben/.nvm/versions/node/v19.5.0/lib
├── bagbak@2.6.0
├── frida@16.0.17
├── grapefruit@0.2.0
└── retire@4.1.1

...pushed a new version again @bensh

commented
ios$ npm -g list
/Users/ben/.nvm/versions/node/v19.5.0/lib
├── bagbak@2.6.1
├── frida@16.0.17
├── grapefruit@0.2.0
└── retire@4.1.1

ios$ 
ios$ 
ios$ bagbak com.thomsonreuters.eikonhd -z
FATAL ERROR
[Error: ENOENT: no such file or directory, open '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent.dist.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/ben/.nvm/versions/node/v19.5.0/lib/node_modules/bagbak/agent.dist.js'
}

Is there anything I can help you with debugging wise? Or anything I can try my end in case its my setup?

@bensh npm is cursed. I tried 0607d6b bug it only works locally.

I am giving up on this, maybe I shoud ignore #90 and revert evrything to two weeks ago

The problem is that agent.dist.js got excluded from the package because it respects rules from .gitignore. Meanwhile I need this rule to exclude the compiled code of course to avoid accidently commit it.

commented

Appreciate all the time you are putting into this for the community.

EDIT:
3 mins after I wrote this I install 2.6.3, and it downloaded and it dumped fine. Had an issue with the original app I tried above

dump extensions
unable to dump plugins Error: Timeout was reached

But a different app worked fine

patch PluginKit validation
dump extensions
download ...A8C-ACE3-E2F407D83FF1/Rescue.app/PlugIns/RescueDeviceView.appex/RescueDeviceView
fetching decrypted data
████████████████████████████████████████ | 100% | 0.02Mib/0.02Mib
Congrats!
open dump/com.logmein.rescue/Payload

7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs LE)

Scanning the drive:
150 folders, 441 files, 15325393 bytes (15 MiB)

Creating archive: ../com.logmein.rescue.zip

Items to compress: 591

                                                             
Files read from disk: 441
Archive size: 7509752 bytes (7334 KiB)
Everything is Ok
archive: dump/com.logmein.rescue.ipa
contents: dump/com.logmein.rescue

Should be working now