dmayer / idb

idb is a tool to simplify some common tasks for iOS pentesting and research
MIT License
942 stars 156 forks source link

IDB crashes once an application is selected #103

Open rortega opened 6 years ago

rortega commented 6 years ago

IDB closes once an application is selected.

1) IDB Connects to device via port 2222 due to g0blin jailbreak (10.3.1) using Sierra 2) "Select App..." displays the current application 3) IDB closes after the application is selected. Below is the stack trace info received

/Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_details_group_box.rb:69:in app_changed': undefined methodsub' for {"identifier"=>nil, "snapshots"=>nil, "$class"=>nil}:Hash (NoMethodError) Did you mean? sum from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_tab_widget.rb:48:in app_changed' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/main_tab_widget.rb:163:inapp_changed' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/idb.rb:122:in block in init_ui' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:ininvoke' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in qt_metacall' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:inapp_changed' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in block (2 levels) in initialize' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:ininvoke' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in qt_metacall' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:inmethod_missing' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in block in initialize' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:ininvoke' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:in qt_metacall' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:inmethod_missing' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:in exec' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:63:inblock in initialize' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:in invoke' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:inqt_metacall' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:in method_missing' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:inexec' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/idb.rb:278:in run' from /Users/rortega/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/bin/idb:4:in<top (required)>' from /Users/rortega/.rvm/gems/ruby-2.4.1/bin/idb:23:in load' from /Users/rortega/.rvm/gems/ruby-2.4.1/bin/idb:23:in

' from /Users/rortega/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in eval' from /Users/rortega/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in
' recv failed: Resource temporarily unavailable rortega-mbp:~ rortega$

buchy13 commented 6 years ago

I have the same issue on iOS 10.2 and macOS High Sierra 10.13.3

Rick11929 commented 6 years ago

I have the same issue on iOS 10.0.2

dzmitry-savitski commented 6 years ago

The same for macOS Sierra v 10.12.1 + iPhone 10.3.3

/Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_details_group_box.rb:69:inapp_changed': undefined method sub' for nil:NilClass (NoMethodError) from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_tab_widget.rb:48:inapp_changed' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/main_tab_widget.rb:163:in app_changed' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/idb.rb:122:inblock in init_ui' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:in invoke' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:inqt_metacall' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in app_changed' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:inblock (2 levels) in initialize' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:in invoke' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:inqt_metacall' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in method_missing' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:inblock in initialize' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:in invoke' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:inqt_metacall' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:in method_missing' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:917:inexec' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:63:in block in initialize' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:2470:ininvoke' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:in qt_metacall' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:inmethod_missing' from /Users/user/.rvm/gems/ruby-2.4.1/gems/qtbindings-4.8.6.4/lib/Qt/qtruby4.rb:479:in exec' from /Users/user/.rvm/gems/ruby-2.4.1/gems/idb-2.10.3/lib/idb.rb:278:inrun' from ./idb:4:in <main>'

raesene commented 6 years ago

I've run into this too. Looking at the code it seems that $selected_app.data_directory is a hash not a string so the call to sub as a method fails (NoMethodError). I've had a quick look with my sample app. but I can't easily see what was meant to be in there, to allow for it to be fixed...

sushi2k commented 6 years ago

Same issue for me. Using an iPhone 6 with iOS 10.3.3 with Double Helix Jailbreak. I can ssh in with idb, I get the listing of the apps, but once I selected it I get a crash.

[ERROR] 2018-08-26 19:18:05 :: idb ::  Icon CONVERSION failed.  undefined method `[]' for nil:NilClass
[INFO] 2018-08-26 19:18:05 :: idb ::  Locating application binary...
[DEBUG] 2018-08-26 19:18:06 :: idb ::  Executing blocking SSH command: /usr/bin/ldid -e '/private/var/containers/Bundle/Application/465C94AD-EE98-436F-8DE9-AC87C856968B//Test.app/Test'
#<Plist4r::Plist:0x00007fcb168925e0>
[DEBUG] 2018-08-26 19:18:06 :: idb ::  Executing blocking SSH command: /usr/bin/ldid -e '/private/var/containers/Bundle/Application/465C94AD-EE98-436F-8DE9-AC87C856968B//Test.app/Test'
#<Plist4r::Plist:0x00007fcb15490038>
[DEBUG] 2018-08-26 19:18:06 :: idb ::  Executing blocking SSH command: /usr/bin/ldid -e '/private/var/containers/Bundle/Application/465C94AD-EE98-436F-8DE9-AC87C856968B//Test.app/Test'
#<Plist4r::Plist:0x00007fcb152ac3c0>
Traceback (most recent call last):
    24: from /usr/local/bin/idb:23:in `<main>'
    23: from /usr/local/bin/idb:23:in `load'
    22: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/bin/idb:4:in `<top (required)>'
    21: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/idb.rb:278:in `run'
    20: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `exec'
    19: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `method_missing'
    18: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `qt_metacall'
    17: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:2470:in `invoke'
    16: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:63:in `block in initialize'
    15: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:917:in `exec'
    14: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:917:in `method_missing'
    13: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:917:in `qt_metacall'
    12: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:2470:in `invoke'
    11: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in `block in initialize'
    10: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in `method_missing'
     9: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/app_list_dialog.rb:24:in `qt_metacall'
     8: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:2470:in `invoke'
     7: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in `block (2 levels) in initialize'
     6: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in `app_changed'
     5: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/global_app_details_group_box.rb:61:in `qt_metacall'
     4: from /usr/local/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:2470:in `invoke'
     3: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/idb.rb:122:in `block in init_ui'
     2: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/main_tab_widget.rb:163:in `app_changed'
     1: from /usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/app_tab_widget.rb:48:in `app_changed'
/usr/local/lib/ruby/gems/2.5.0/gems/idb-2.10.3/lib/gui/app_details_group_box.rb:69:in `app_changed': undefined method `sub' for {"identifier"=>nil, "snapshots"=>nil, "$class"=>nil}:Hash (NoMethodError)
Did you mean?  sum
recv failed: Resource temporarily unavailable
mechanico commented 5 years ago

see #105