idb 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +19 -0
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +65 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +2 -0
  9. data/bin/idb +5 -0
  10. data/idb.gemspec +41 -0
  11. data/lib/LICENSE +20 -0
  12. data/lib/README.md +54 -0
  13. data/lib/config/.dummy +0 -0
  14. data/lib/config/settings.yml +8 -0
  15. data/lib/gui/app_binary_tab_widget.rb +45 -0
  16. data/lib/gui/app_details_group_box.rb +213 -0
  17. data/lib/gui/app_list_dialog.rb +67 -0
  18. data/lib/gui/app_list_widget_item.rb +9 -0
  19. data/lib/gui/binary_strings_widget.rb +33 -0
  20. data/lib/gui/browse_filesystem_widget.rb +4 -0
  21. data/lib/gui/ca_manager_dialog.rb +137 -0
  22. data/lib/gui/cache_db_widget.rb +61 -0
  23. data/lib/gui/certificate_item.rb +5 -0
  24. data/lib/gui/console_widget.rb +163 -0
  25. data/lib/gui/cycript_console_widget.rb +68 -0
  26. data/lib/gui/cycript_thread.rb +81 -0
  27. data/lib/gui/device_info_group_box.rb +55 -0
  28. data/lib/gui/device_status_dialog.rb +351 -0
  29. data/lib/gui/file_system_events_widget.rb +4 -0
  30. data/lib/gui/fs_viewer_tab_widget.rb +245 -0
  31. data/lib/gui/i_device_syslog_thread.rb +47 -0
  32. data/lib/gui/images/check.png +0 -0
  33. data/lib/gui/images/folder.ico +0 -0
  34. data/lib/gui/images/iphone.ico +0 -0
  35. data/lib/gui/images/screenshot.png +0 -0
  36. data/lib/gui/key_chain_widget.rb +86 -0
  37. data/lib/gui/local_storage_tab_widget.rb +37 -0
  38. data/lib/gui/log_plain_text_edit.rb +18 -0
  39. data/lib/gui/log_widget.rb +71 -0
  40. data/lib/gui/main_tab_widget.rb +179 -0
  41. data/lib/gui/pasteboard_monitor_widget.rb +116 -0
  42. data/lib/gui/path_list_widget_item.rb +5 -0
  43. data/lib/gui/pb_watcher_thread.rb +63 -0
  44. data/lib/gui/plist_file_widget.rb +66 -0
  45. data/lib/gui/qt_ruby_variant.rb +16 -0
  46. data/lib/gui/screenshot_wizard.rb +169 -0
  47. data/lib/gui/settings_dialog.rb +69 -0
  48. data/lib/gui/settings_tab_widget.rb +149 -0
  49. data/lib/gui/shared_libraries_widget.rb +47 -0
  50. data/lib/gui/snoop_it_fs_events_widget.rb +150 -0
  51. data/lib/gui/snoop_it_keychain_widget.rb +172 -0
  52. data/lib/gui/snoop_it_sensitive_api_widget.rb +128 -0
  53. data/lib/gui/snoop_it_tab_widget.rb +27 -0
  54. data/lib/gui/snoop_it_update_thread.rb +48 -0
  55. data/lib/gui/sqlite_widget.rb +73 -0
  56. data/lib/gui/ssh_port_forward_tab_widget.rb +209 -0
  57. data/lib/gui/tool_widget.rb +94 -0
  58. data/lib/gui/url_handler_widget.rb +26 -0
  59. data/lib/gui/url_scheme_fuzz_widget.rb +103 -0
  60. data/lib/gui/url_scheme_widget.rb +60 -0
  61. data/lib/gui/weak_class_dump_widget.rb +89 -0
  62. data/lib/helper/ssh_port_forwarder.rb +72 -0
  63. data/lib/idb.rb +295 -0
  64. data/lib/idb/version.rb +3 -0
  65. data/lib/lib/CgBI.rb +153 -0
  66. data/lib/lib/abstract_device.rb +31 -0
  67. data/lib/lib/app.rb +286 -0
  68. data/lib/lib/app_binary.rb +57 -0
  69. data/lib/lib/ca_interface.rb +151 -0
  70. data/lib/lib/configuration.rb +0 -0
  71. data/lib/lib/console_launcher.rb +24 -0
  72. data/lib/lib/device.rb +438 -0
  73. data/lib/lib/device_ca_interface.rb +36 -0
  74. data/lib/lib/host_file_wrapper.rb +27 -0
  75. data/lib/lib/i_device_diagnostics_wrapper.rb +90 -0
  76. data/lib/lib/keychain_plist_parser.rb +15 -0
  77. data/lib/lib/local_operations.rb +67 -0
  78. data/lib/lib/otool_wrapper.rb +116 -0
  79. data/lib/lib/plist_util.rb +72 -0
  80. data/lib/lib/qt_thread_fix.rb +29 -0
  81. data/lib/lib/rsync_git_manager.rb +81 -0
  82. data/lib/lib/screen_shot_util.rb +59 -0
  83. data/lib/lib/settings.rb +67 -0
  84. data/lib/lib/simulator.rb +60 -0
  85. data/lib/lib/simulator_ca_interface.rb +16 -0
  86. data/lib/lib/snoop_it_wrapper.rb +80 -0
  87. data/lib/lib/ssh_operations.rb +136 -0
  88. data/lib/lib/ssh_port_forwarder.rb +43 -0
  89. data/lib/lib/tools.rb +11 -0
  90. data/lib/lib/url_scheme_fuzzer.rb +98 -0
  91. data/lib/lib/usb_muxd_wrapper.rb +32 -0
  92. data/lib/lib/weak_class_dump_wrapper.rb +62 -0
  93. data/lib/utils/dumpdecrypted/README +4 -0
  94. data/lib/utils/dumpdecrypted/dumpdecrypted_armv6.dylib +0 -0
  95. data/lib/utils/dumpdecrypted/dumpdecrypted_armv7.dylib +0 -0
  96. data/lib/utils/ios-ssl-kill-switch/com.isecpartners.nabla.sslkillswitch_v0.5-iOS_6.1.deb +0 -0
  97. data/lib/utils/keychain_dump/README +2 -0
  98. data/lib/utils/keychain_dump/keychain_dump +0 -0
  99. data/lib/utils/pbwatcher/pbwatcher +0 -0
  100. data/lib/utils/pcviewer/protectionclassviewer +0 -0
  101. data/lib/utils/weak_class_dump/README +5 -0
  102. data/lib/utils/weak_class_dump/weak_classdump.cy +726 -0
  103. metadata +412 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 11406269953d2f4d75ddaefc4f9eda22342161ae
4
+ data.tar.gz: 462682be7e29f8756d42ef7223198c13752b77e9
5
+ SHA512:
6
+ metadata.gz: b9059fcaac50e027d4ef0dfefc6c4d8cffaeaf9106ce43d4c2c7acdff18f62b5cf047de345624fea9508238cb22ea69617a7cea5c70be082503d936d1f6aa2e2
7
+ data.tar.gz: b929944e0110ed607679fbe8c7e56f852bf94f034c266ac7f71e43e62d81ee5f3d43528cb5e177ab4b09930e1544b725dbeadd9e93687d0e5f5520799133b0f7
Binary file
@@ -0,0 +1,19 @@
1
+ tmp/
2
+ .idea
3
+ .bundle
4
+ config/settings.yml
5
+ *.swp
6
+ /.bundle/
7
+ /.yardoc
8
+ /gemfile.lock
9
+ /_yardoc/
10
+ /coverage/
11
+ /doc/
12
+ /pkg/
13
+ /spec/reports/
14
+ /tmp/
15
+ *.bundle
16
+ *.so
17
+ *.o
18
+ *.a
19
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in idb.gemspec
4
+ gemspec
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ idb (1.3.1)
5
+ awesome_print
6
+ coderay
7
+ eventmachine
8
+ ffi
9
+ git
10
+ highline
11
+ htmlentities
12
+ launchy
13
+ log4r
14
+ net-sftp
15
+ net-ssh
16
+ nokogiri
17
+ plist4r
18
+ qtbindings
19
+ rbkb
20
+ sqlite3
21
+ trollop
22
+
23
+ GEM
24
+ remote: https://rubygems.org/
25
+ specs:
26
+ addressable (2.3.6)
27
+ awesome_print (1.2.0)
28
+ coderay (1.1.0)
29
+ eventmachine (1.0.3)
30
+ ffi (1.9.5)
31
+ git (1.2.8)
32
+ haml (4.0.5)
33
+ tilt
34
+ highline (1.6.21)
35
+ htmlentities (4.3.2)
36
+ launchy (2.4.2)
37
+ addressable (~> 2.3)
38
+ libxml-ruby (2.7.0)
39
+ libxml4r (0.2.6)
40
+ libxml-ruby (>= 1.1.3)
41
+ log4r (1.1.10)
42
+ mini_portile (0.6.0)
43
+ net-sftp (2.1.2)
44
+ net-ssh (>= 2.6.5)
45
+ net-ssh (2.9.1)
46
+ nokogiri (1.6.3.1)
47
+ mini_portile (= 0.6.0)
48
+ plist4r (1.2.2)
49
+ haml
50
+ libxml-ruby
51
+ libxml4r
52
+ qtbindings (4.8.6.0)
53
+ rake (10.3.2)
54
+ rbkb (0.7.2)
55
+ sqlite3 (1.3.9)
56
+ tilt (2.0.1)
57
+ trollop (2.0)
58
+
59
+ PLATFORMS
60
+ ruby
61
+
62
+ DEPENDENCIES
63
+ bundler (~> 1.6)
64
+ idb!
65
+ rake
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Daniel A. Mayer
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Idb
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'idb'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install idb
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/idb/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/idb ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'idb'
4
+
5
+ idb = Idb::Idb.run
@@ -0,0 +1,41 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'idb/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "idb"
8
+ spec.version = Idb::VERSION
9
+ spec.authors = ["Daniel A. Mayer"]
10
+ spec.email = ["mayer@cysec.org"]
11
+ spec.summary = %q{idb is a tool to simplify some common tasks for iOS pentesting and research.}
12
+ spec.description = %q{Still under test but ready for prime-time soon!}
13
+ spec.homepage = "https://github.com/dmayer/idb"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_runtime_dependency 'highline'
25
+ spec.add_runtime_dependency 'launchy'
26
+ spec.add_runtime_dependency 'plist4r'
27
+ spec.add_runtime_dependency 'trollop'
28
+ spec.add_runtime_dependency 'net-ssh'
29
+ spec.add_runtime_dependency 'net-sftp'
30
+ spec.add_runtime_dependency 'rbkb'
31
+ spec.add_runtime_dependency 'nokogiri'
32
+ spec.add_runtime_dependency 'sqlite3'
33
+ spec.add_runtime_dependency 'coderay'
34
+ spec.add_runtime_dependency 'qtbindings'
35
+ spec.add_runtime_dependency 'awesome_print'
36
+ spec.add_runtime_dependency 'ffi' # not really used atm.
37
+ spec.add_runtime_dependency 'htmlentities'
38
+ spec.add_runtime_dependency 'eventmachine'
39
+ spec.add_runtime_dependency 'log4r'
40
+ spec.add_runtime_dependency 'git'
41
+ end
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Daniel A. Mayer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # gidb
2
+
3
+ gidb is a tool to simplify some common tasks for iOS pentesting and research. It is still a work in progress but already provides a bunch of (hopefully) useful commands. The goal was to provide all (or most) functionality for both, iDevices and the iOS simulator. For this, a lot is abstracted internally to make it work transparently for both environments. Although recently the focus has been more on supporting devices.
4
+
5
+ idb was released as part of a talk at [ShmooCon](http://shmoocon.org) 2014. The [slides of the talk](https://speakerdeck.com/dmayer/introducing-idb-simplified-blackbox-ios-app-pentesting) are up on [Speakerdeck](https://speakerdeck.com/dmayer/introducing-idb-simplified-blackbox-ios-app-pentesting). [Video](https://archive.org/details/ShmooCon2014_Introducing_idb_Simplified_Blackbox_iOS_App_Pentesting) is available on [archive.org](http://www.archive.org) There is also a [blog post](http://cysec.org/blog/2014/01/23/idb-ios-research-slash-pentesting-tool/) on my [personal website](http://cysec.org).
6
+
7
+ ## Getting Started
8
+ Visit the [getting started guide](//github.com/dmayer/idb/wiki/Getting-started) on the wiki to get installation instructions. Next, there is a basic [manual and walk-through](//github.com/dmayer/idb/wiki/Manual-and--Walk-Through) available as well.
9
+
10
+ Bug reports, feature requests, and contributions are more than welcome!
11
+
12
+ ## Command-Line Version
13
+ idb started out as a command line tool which is still accessible through the `cli` branch. Find the [getting started](//github.com/dmayer/idb/wiki/CLI-Version:-Getting-Started) guide and some more documentation in the wiki.
14
+
15
+ ## gidb Features
16
+
17
+ * Simplified pentesting setup
18
+ * Setup port forwarding
19
+ * Certificate management
20
+ * iOS log viewer
21
+ * Screen shot utility
22
+ * Simplifies testing for the creation of backgrounding screenshots
23
+ * App-related functions
24
+ * App binary
25
+ * Download
26
+ * List imported libraries
27
+ * Check for encryption, ASLR, stack canaries
28
+ * Decrypt and download an app binary (requires [dumpdecrypted](//github.com/stefanesser/dumpdecrypted))
29
+ * Launch an app
30
+ * View app details such as name, bundleid, and `Info.plist` file.
31
+ * Inter-Process Communication
32
+ * URL Handlers
33
+ * List URL handlers
34
+ * Invoke and fuzz URL handlers
35
+ * Pasteboard monitor
36
+ * Analyze local file storage
37
+ * Search for, download, and view plist files
38
+ * Search for, download, and view sqlite databases
39
+ * Search for, download, and view local caches (`Cache.db`)
40
+ * File system browser
41
+ * Install utilities on iDevices
42
+ * Install [iOS SSL killswitch](//github.com/iSECPartners/ios-ssl-kill-switch)
43
+ * alpha: Compile and install [dumpdecrypted](//github.com/stefanesser/dumpdecrypted)
44
+ * Alpha:
45
+ * Cycript console
46
+ * Snoop-It integration
47
+
48
+ ## Documentation
49
+ Some documentation can be found on the [wiki](//github.com/dmayer/idb/wiki).
50
+
51
+ ## FAQ
52
+
53
+ ### Q: After staring idb, the menu bar does not appear
54
+ A: This seems to be a bug when using ruby 2.1 on OS X. I have no idea why this is happening, but switching to a different application and the back to idb fixes it. Any pointers on how to fix this are greatly appreciated!
File without changes
@@ -0,0 +1,8 @@
1
+ ---
2
+ ssh_host: localhost
3
+ ssh_port: 22
4
+ ssh_username: root
5
+ ssh_password: alpine
6
+ manual_ssh_port: '2222'
7
+ idb_utility_port: '4711'
8
+ device_connection_mode: usb
@@ -0,0 +1,45 @@
1
+ require_relative 'shared_libraries_widget'
2
+ require_relative 'binary_strings_widget'
3
+ require_relative 'weak_class_dump_widget'
4
+
5
+ module Idb
6
+
7
+ class AppBinaryTabWidget < Qt::TabWidget
8
+
9
+
10
+ def initialize *args
11
+ super *args
12
+
13
+ @tabs = Hash.new
14
+
15
+ @shared_libs = SharedLibrariesWidget.new self
16
+ @tabs[:@shared_libs] = addTab(@shared_libs, "Shared Libraries")
17
+
18
+ @strings = BinaryStringsWidget.new self
19
+ @tabs[:strings] = addTab(@strings, "Strings")
20
+
21
+ @weak_class_dump = WeakClassDumpWidget.new self
22
+ @tabs[:weak_class_dump] = addTab(@weak_class_dump, "Weak Class Dump")
23
+
24
+
25
+ end
26
+
27
+ def clear
28
+ @tabs.each { |tab|
29
+ tab.clear
30
+ }
31
+ end
32
+
33
+ def refresh_current_tab
34
+ puts "Refreshing current tab in App binary tab"
35
+ end
36
+
37
+ def refresh
38
+ end
39
+
40
+ def enableTabs
41
+ @shared_libs.setEnabled(true)
42
+ setTabEnabled(@tabs[:@shared_libs],true)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,213 @@
1
+ require_relative '../lib/app'
2
+
3
+ module Idb
4
+
5
+ class AppDetailsGroupBox < Qt::GroupBox
6
+ attr_accessor :uuid, :bundle_id
7
+ signals "app_changed()"
8
+ signals "show_device_status()"
9
+
10
+ def initialize args
11
+ super *args
12
+
13
+ # details on selected app
14
+ @layout = Qt::GridLayout.new
15
+ setLayout(@layout)
16
+ setTitle "App Details"
17
+
18
+
19
+ @icon_button_layout = Qt::GridLayout.new
20
+
21
+
22
+ # select app
23
+ @select_app_button = Qt::PushButton.new "Select App..."
24
+ @select_app_button.setEnabled(false)
25
+ @select_app_button.connect(SIGNAL(:released)) { |x|
26
+ @app_list = AppListDialog.new
27
+ @app_list.connect(SIGNAL('accepted()')) {
28
+ $selected_app = @app_list.app_list.currentItem().app
29
+ @vals['uuid'].setText($selected_app.uuid)
30
+ @vals['bundle_id'].setText($selected_app.bundle_id)
31
+ @vals['bundle_name'].setText($selected_app.bundle_name)
32
+ @vals['url_handlers'].setText($selected_app.get_url_handlers.join("\n"))
33
+ @vals['platform_version'].setText($selected_app.platform_version)
34
+ @vals['sdk_version'].setText($selected_app.sdk_version)
35
+ @vals['minimum_os_version'].setText($selected_app.minimum_os_version)
36
+ @launch_app.setEnabled(true)
37
+ @open_folder.setEnabled(true)
38
+
39
+ begin
40
+ icon_file = $selected_app.get_icon_file
41
+ pixmap = Qt::Pixmap.new(icon_file)
42
+ @icon.setPixmap pixmap.scaledToWidth(50) unless icon_file.nil?
43
+
44
+ rescue => e
45
+ $log.error "Icon CONVERSION failed. #{e.message}"
46
+ @icon.setPixmap Qt::Pixmap.new
47
+ # lets ignore conversion errors for now..
48
+ end
49
+
50
+ emit app_changed()
51
+ }
52
+
53
+ @app_list.exec
54
+ }
55
+
56
+
57
+ @icon_button_widget = Qt::Widget.new self
58
+ @icon_button_widget.setLayout @icon_button_layout
59
+
60
+ @icon = Qt::Label.new
61
+
62
+ @icon_button_layout.addWidget @icon, 0, 0, 1, 1
63
+ @icon_button_layout.addWidget @select_app_button, 0, 1, 1, 3
64
+ @layout.addWidget @icon_button_widget, 0, 0, 1, 2
65
+
66
+
67
+
68
+
69
+ @labels = Hash.new
70
+ @vals = Hash.new
71
+ @cur_row = 1
72
+
73
+ addDetail 'bundle_id', 'Bundle ID'
74
+ addDetail 'bundle_name', 'Bundle Name'
75
+ addDetail 'uuid', 'UUID'
76
+ addDetail 'url_handlers', 'URL Handlers'
77
+ addDetail 'platform_version', 'Platform Version'
78
+ addDetail 'sdk_version', 'SDK Version'
79
+ addDetail 'minimum_os_version', 'Minimum OS'
80
+
81
+ @launch_app = Qt::PushButton.new "Launch App"
82
+ @launch_app.setEnabled(false)
83
+ @launch_app.connect(SIGNAL(:released)) {
84
+ if $device.open_installed?
85
+ $selected_app.launch
86
+ else
87
+ error = Qt::MessageBox.new self
88
+ error.setInformativeText("'open' not found on the device. Please visit the status dialog and install it.")
89
+ error.setIcon(Qt::MessageBox::Critical)
90
+ error.setMinimumWidth(500)
91
+ error.exec
92
+ emit show_device_status()
93
+ end
94
+ }
95
+
96
+ @layout.addWidget @launch_app, @cur_row, 0, 1, 2
97
+
98
+ @cur_row+=1
99
+
100
+ @open_folder = Qt::PushButton.new "Open Local Temp Folder"
101
+ @open_folder.setEnabled(false)
102
+ @layout.addWidget @open_folder, @cur_row, 0, 1, 2
103
+
104
+ @open_folder.connect(SIGNAL :released) {
105
+ Launchy.open $selected_app.cache_dir
106
+
107
+ }
108
+
109
+ end
110
+
111
+ def clear
112
+ $selected_app = nil
113
+ @vals['uuid'].setText("")
114
+ @vals['bundle_id'].setText("")
115
+ @vals['bundle_name'].setText("")
116
+ @vals['url_handlers'].setText("")
117
+ @vals['platform_version'].setText("")
118
+ @vals['sdk_version'].setText("")
119
+ @vals['minimum_os_version'].setText("")
120
+ @launch_app.setEnabled(false)
121
+ @open_folder.setEnabled(false)
122
+
123
+ end
124
+
125
+
126
+
127
+ def addDetail id, label
128
+ @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
129
+ @vals[id] = Qt::Label.new "", self, 0
130
+ @layout.addWidget @labels[id], @cur_row, 0
131
+ @layout.addWidget @vals[id], @cur_row, 1
132
+ @cur_row += 1
133
+ end
134
+
135
+
136
+ def enable_select_app
137
+ @select_app_button.setEnabled(true)
138
+ end
139
+
140
+ def disable_select_app
141
+ @select_app_button.setEnabled(false)
142
+ end
143
+
144
+ end
145
+
146
+ class AppBinaryGroupBox < Qt::GroupBox
147
+ signals "binary_analyzed()"
148
+
149
+ def initialize args
150
+ super *args
151
+
152
+ # details on selected app
153
+ @layout = Qt::GridLayout.new
154
+ setLayout(@layout)
155
+ setTitle "App Binary"
156
+
157
+
158
+ # analyze binary
159
+ @analyze_binary_button = Qt::PushButton.new "Analyze Binary..."
160
+ @analyze_binary_button.setEnabled(false)
161
+ @analyze_binary_button.connect(SIGNAL(:released)) { |x|
162
+ #TODO progress bar
163
+ $selected_app.analyze
164
+ @vals['encryption_enabled'].setText($selected_app.binary.is_encrypted?.to_s)
165
+ @vals['cryptid'].setText($selected_app.binary.get_cryptid.to_s)
166
+ @vals['pie'].setText($selected_app.binary.is_pie?.to_s)
167
+ @vals['canaries'].setText($selected_app.binary.is_stack_protected?.to_s)
168
+ @vals['arc'].setText($selected_app.binary.uses_arc?.to_s)
169
+ emit binary_analyzed()
170
+ }
171
+ @layout.addWidget @analyze_binary_button, 0, 0, 1, 2
172
+
173
+ @labels = Hash.new
174
+ @vals = Hash.new
175
+ @cur_row = 1
176
+
177
+ addDetail 'encryption_enabled', 'Encryption?'
178
+ addDetail 'cryptid', 'Cryptid'
179
+ addDetail 'pie', 'PIE'
180
+ addDetail 'canaries', 'Stack Canaries'
181
+ addDetail 'arc', 'ARC'
182
+
183
+ end
184
+
185
+
186
+ def addDetail id, label
187
+ @labels[id] = Qt::Label.new "<b>#{label}</b>", self, 0
188
+ @vals[id] = Qt::Label.new "", self, 0
189
+ @layout.addWidget @labels[id], @cur_row, 0
190
+ @layout.addWidget @vals[id], @cur_row, 1
191
+ @cur_row += 1
192
+ end
193
+
194
+ def app_changed
195
+ clear
196
+ @analyze_binary_button.setEnabled(true)
197
+ end
198
+
199
+ def clear
200
+ @vals['encryption_enabled'].setText("")
201
+ @vals['cryptid'].setText("")
202
+ @vals['pie'].setText("")
203
+ @vals['canaries'].setText("")
204
+ @vals['arc'].setText("")
205
+ end
206
+
207
+ def disable_analyze_binary
208
+ @analyze_binary_button.setEnabled(false)
209
+ end
210
+
211
+
212
+ end
213
+ end