idb 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +30 -0
- data/Gemfile.lock +5 -0
- data/idb.gemspec +1 -0
- data/lib/gui/app_binary_tab_widget.rb +7 -14
- data/lib/gui/app_details_group_box.rb +63 -88
- data/lib/gui/app_list_dialog.rb +29 -35
- data/lib/gui/app_list_widget_item.rb +1 -5
- data/lib/gui/app_tab_widget.rb +17 -22
- data/lib/gui/binary_strings_widget.rb +7 -15
- data/lib/gui/ca_manager_dialog.rb +32 -54
- data/lib/gui/cache_db_widget.rb +21 -26
- data/lib/gui/certificate_item.rb +2 -2
- data/lib/gui/default_protection_class_group_widget.rb +7 -12
- data/lib/gui/device_info_group_box.rb +26 -23
- data/lib/gui/main_tab_widget.rb +2 -21
- data/lib/gui/shared_libraries_widget.rb +1 -1
- data/lib/gui/sqlite_widget.rb +1 -3
- data/lib/gui/weak_class_dump_widget.rb +1 -1
- data/lib/idb.rb +3 -3
- data/lib/idb/version.rb +1 -1
- data/lib/lib/abstract_device.rb +7 -11
- data/lib/lib/app.rb +49 -59
- data/lib/lib/app_binary.rb +18 -29
- data/lib/lib/ca_interface.rb +46 -59
- data/lib/lib/device.rb +68 -155
- data/lib/lib/device_ca_interface.rb +7 -13
- data/lib/lib/host_file_wrapper.rb +6 -8
- data/lib/lib/ios8_last_launch_services_map_wrapper.rb +11 -18
- data/lib/lib/local_operations.rb +24 -32
- data/lib/lib/otool_wrapper.rb +30 -33
- data/lib/lib/rsync_git_manager.rb +26 -22
- data/lib/lib/screen_shot_util.rb +20 -28
- data/lib/lib/settings.rb +14 -17
- data/lib/lib/simulator.rb +11 -16
- data/lib/lib/simulator_ca_interface.rb +1 -3
- data/lib/lib/ssh_operations.rb +49 -65
- data/lib/lib/ssh_port_forwarder.rb +9 -13
- data/lib/lib/tools.rb +3 -3
- data/lib/lib/url_scheme_fuzzer.rb +41 -49
- data/lib/lib/usb_muxd_wrapper.rb +6 -8
- data/lib/lib/weak_class_dump_wrapper.rb +15 -16
- metadata +19 -9
- data/lib/gui/console_widget.rb +0 -163
- data/lib/gui/cycript_console_widget.rb +0 -68
- data/lib/gui/cycript_thread.rb +0 -81
- data/lib/lib/console_launcher.rb +0 -24
- data/lib/lib/i_device_diagnostics_wrapper.rb +0 -90
- data/lib/lib/snoop_it_wrapper.rb +0 -80
@@ -1,68 +0,0 @@
|
|
1
|
-
require_relative 'console_widget'
|
2
|
-
require_relative 'cycript_thread'
|
3
|
-
require 'open3'
|
4
|
-
|
5
|
-
module Idb
|
6
|
-
class CycriptConsoleWidget < Qt::Widget
|
7
|
-
|
8
|
-
def initialize *args
|
9
|
-
super *args
|
10
|
-
@to_send = nil
|
11
|
-
@console = ConsoleWidget.new
|
12
|
-
@console.connect(SIGNAL('command(QString)')) {|cmd|
|
13
|
-
puts cmd.inspect
|
14
|
-
@cycript_thread.send_data cmd + "\n"
|
15
|
-
# @cycript_thread.send_data "testtest\n"
|
16
|
-
}
|
17
|
-
|
18
|
-
@start = Qt::PushButton.new "Start"
|
19
|
-
@start.connect(SIGNAL :released) {
|
20
|
-
# @start.setEnabled(false)
|
21
|
-
# @stop.setEnabled(true)
|
22
|
-
start
|
23
|
-
|
24
|
-
#@console.result data
|
25
|
-
|
26
|
-
}
|
27
|
-
|
28
|
-
@stop = Qt::PushButton.new "Stop"
|
29
|
-
@stop.connect(SIGNAL :released) {
|
30
|
-
Thread.list.each {|t| p t}
|
31
|
-
@cycript_thread.send_data "testtest\n"
|
32
|
-
Thread.pass
|
33
|
-
|
34
|
-
}
|
35
|
-
|
36
|
-
layout = Qt::VBoxLayout.new do |v|
|
37
|
-
v.add_widget(@console)
|
38
|
-
v.add_widget(@start)
|
39
|
-
v.add_widget(@stop)
|
40
|
-
end
|
41
|
-
setLayout(layout)
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
def pure_string s
|
46
|
-
x = loop{ s[/\033\[\d+m/] = "" }
|
47
|
-
rescue IndexError
|
48
|
-
return s
|
49
|
-
x
|
50
|
-
end
|
51
|
-
|
52
|
-
def start
|
53
|
-
@cycript_thread = CycriptThread.new
|
54
|
-
@cycript_thread.connect(SIGNAL('new_entry(QString)')) {|line|
|
55
|
-
@console.result line
|
56
|
-
}
|
57
|
-
@cycript_thread.launch_process
|
58
|
-
end
|
59
|
-
|
60
|
-
def stop
|
61
|
-
@cycript_thread.stop
|
62
|
-
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
data/lib/gui/cycript_thread.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
require 'net/ssh'
|
2
|
-
|
3
|
-
module Idb
|
4
|
-
class CycriptThread < Qt::Object
|
5
|
-
signals "new_entry(QString)"
|
6
|
-
|
7
|
-
attr_accessor :channel
|
8
|
-
|
9
|
-
def initialize *args
|
10
|
-
super *args
|
11
|
-
$terminate_cycript_thread = false
|
12
|
-
@queue = Queue.new
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def send_data data
|
19
|
-
puts "sending data"
|
20
|
-
# @queue << data
|
21
|
-
@channel.send_data data
|
22
|
-
# @channel.send_data "testtest\n"
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
def stop
|
27
|
-
$terminate_cycript_thread = true
|
28
|
-
end
|
29
|
-
|
30
|
-
def launch_process
|
31
|
-
|
32
|
-
@channel = $device.ssh.open_channel do |ch|
|
33
|
-
channel.request_pty do |ch, success|
|
34
|
-
raise "Error requesting pty" unless success
|
35
|
-
ch.exec("export TERM=vt220; stty -echo -icanon; cycript -p SpringBoard") do |ch, success|
|
36
|
-
raise "Error opening shell" unless success
|
37
|
-
|
38
|
-
ch.on_extended_data do |ch, type, data|
|
39
|
-
STDOUT.print "Error: #{data}\n"
|
40
|
-
end
|
41
|
-
|
42
|
-
ch.on_data do |ch, data|
|
43
|
-
puts "emitting"
|
44
|
-
emit new_entry(data)
|
45
|
-
puts "done"
|
46
|
-
end
|
47
|
-
|
48
|
-
ch.on_close { |ch|
|
49
|
-
$log.info "cycript terminated"
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
puts "thred"
|
59
|
-
@abc = Thread.new do
|
60
|
-
loop do
|
61
|
-
#TODO mutex to protect device?
|
62
|
-
#even better: make one central thread that calls process.
|
63
|
-
# and all functions using it call it to ensure its running. or auto start it.
|
64
|
-
sleep 0.5
|
65
|
-
puts "loop"
|
66
|
-
$device.ssh.loop 0.1
|
67
|
-
puts "done"
|
68
|
-
if $terminate_cycript_thread
|
69
|
-
$log.info "Terminating cycript"
|
70
|
-
channel.close
|
71
|
-
break
|
72
|
-
end
|
73
|
-
end
|
74
|
-
$log.info "Terminating thread"
|
75
|
-
end
|
76
|
-
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
end
|
data/lib/lib/console_launcher.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Idb
|
2
|
-
class ConsoleLauncher
|
3
|
-
|
4
|
-
def initialize
|
5
|
-
# if os x
|
6
|
-
#'/Applications/iTerm.app'
|
7
|
-
# '/Applications/Utilities/Terminal.app/ '
|
8
|
-
#if linux
|
9
|
-
# terminator, gnome-terminal, Konsole(?), xterm
|
10
|
-
@term = "terminator"
|
11
|
-
end
|
12
|
-
|
13
|
-
|
14
|
-
def run cmd
|
15
|
-
command = "#{@term} -x sh -c '#{cmd}'"
|
16
|
-
puts command
|
17
|
-
Process.spawn command
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
require 'ffi'
|
2
|
-
|
3
|
-
module IMobileDevice
|
4
|
-
extend FFI::Library
|
5
|
-
|
6
|
-
ffi_lib 'libimobiledevice'
|
7
|
-
IDeviceEventType = enum(
|
8
|
-
:idevice_device_added, 1,
|
9
|
-
:idevice_device_remove
|
10
|
-
)
|
11
|
-
|
12
|
-
class IDeviceEventT < FFI::Struct
|
13
|
-
layout :event, IDeviceEventType,
|
14
|
-
:udid, :string,
|
15
|
-
:conn_type, :int
|
16
|
-
end
|
17
|
-
|
18
|
-
ConnectionType = enum(
|
19
|
-
:connection_usbmuxd, 1
|
20
|
-
)
|
21
|
-
|
22
|
-
class IDevicePrivate < FFI::Struct
|
23
|
-
layout :udid, :string,
|
24
|
-
:conn_type, ConnectionType,
|
25
|
-
:conn_data, :pointer
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
attach_function :idevice_get_device_list, [:pointer, :pointer], :int
|
31
|
-
attach_function :idevice_event_subscribe, [:pointer, :pointer], :int
|
32
|
-
attach_function :idevice_new, [:pointer, :string], :int
|
33
|
-
# attach_function :syslog_relay_client_start_service, [IDevicePrivate, :pointer, :string], :int
|
34
|
-
# attach_function :syslog_relay_start_capture, [:pointer, :pointer, :pointer], :int
|
35
|
-
# attach_function :syslog_relay_client_free, [:pointer], :int
|
36
|
-
|
37
|
-
def self.startLogging
|
38
|
-
ret = idevice_new(IDevicePrivate, @udid)
|
39
|
-
if ret != 0
|
40
|
-
puts "ERROR"
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
def self.stopLogging
|
48
|
-
puts "stopstopstop"
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
# DeviceEvn :device, [:pointer, :long, :uint8], :void
|
53
|
-
|
54
|
-
DeviceEventCB = FFI::Function.new(:void, [:pointer, :pointer]) do |event, userdata|
|
55
|
-
# cast event to struct
|
56
|
-
event_t = IDeviceEventT.new event
|
57
|
-
if event_t[:event] == :idevice_device_added
|
58
|
-
if @syslog.nil? or @syslog == false
|
59
|
-
if @udid.nil? or @udid == false
|
60
|
-
@udid = event_t[:udid]
|
61
|
-
end
|
62
|
-
|
63
|
-
if @udid == event_t[:udid]
|
64
|
-
#TODO error checking
|
65
|
-
puts "[*] Start Logging"
|
66
|
-
IMobileDevice.startLogging
|
67
|
-
end
|
68
|
-
end
|
69
|
-
elsif avent_t[:event] == :idevice_device_remove
|
70
|
-
if not @syslog.nil? and @udid == event_t[:udid]
|
71
|
-
puts "[*] Disconnected"
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
devices = FFI::MemoryPointer.new :pointer
|
78
|
-
num = FFI::MemoryPointer.new :int
|
79
|
-
x = IMobileDevice.idevice_get_device_list(devices, num)
|
80
|
-
device = devices.read_pointer.get_array_of_string(0,num.read_int).first
|
81
|
-
puts "Device #{device}"
|
82
|
-
IMobileDevice.idevice_event_subscribe(IMobileDevice::DeviceEventCB, nil)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
while true
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
|
data/lib/lib/snoop_it_wrapper.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'awesome_print'
|
2
|
-
require 'xmlrpc/client'
|
3
|
-
|
4
|
-
module Idb
|
5
|
-
class SnoopItWrapper
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
connection = Hash.new
|
9
|
-
connection[:host] = "127.0.0.1"
|
10
|
-
connection[:port] = "12345"
|
11
|
-
connection[:path] = "/xmlrpc"
|
12
|
-
# connection[:user] = "snoop-it"
|
13
|
-
# connection[:password] = "snoop-it"
|
14
|
-
|
15
|
-
|
16
|
-
@rpc = XMLRPC::Client.new3(connection)
|
17
|
-
end
|
18
|
-
|
19
|
-
def fsevents_after start = Time.now
|
20
|
-
start_timestamp = start.to_time.to_i
|
21
|
-
# result = @rpc.call("filesystemGetAccessListUpdate", {'lastId' => 0})
|
22
|
-
@rpc.call("filesystemGetAccessList", {'from' => start_timestamp})
|
23
|
-
end
|
24
|
-
|
25
|
-
def fsevents_delete
|
26
|
-
exec_rpc do
|
27
|
-
@rpc.call("filesystemDeleteAll")
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
|
32
|
-
def fsevents_after_id id
|
33
|
-
exec_rpc do
|
34
|
-
@rpc.call("filesystemGetAccessListUpdate", {'lastId' => id})
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def keychain_after_id id
|
39
|
-
exec_rpc do
|
40
|
-
@rpc.call("keychainGetListUpdate", {'lastId' => id})
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def keychain_details id
|
45
|
-
exec_rpc do
|
46
|
-
@rpc.call("keychainGetId", {'id' => id})
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def sensitiveapi_after_id id
|
51
|
-
exec_rpc do
|
52
|
-
@rpc.call("sensitiveAPIGetListUpdate", {'lastId' => id})
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def sensitiveapi_delete
|
57
|
-
exec_rpc do
|
58
|
-
@rpc.call("sensitiveAPIDeleteAll")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def exec_rpc
|
63
|
-
begin
|
64
|
-
yield
|
65
|
-
rescue
|
66
|
-
raise "Connection lost. Make sure the app under assessment is running on the device."
|
67
|
-
end
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
def is_alive?
|
74
|
-
result = @rpc.call("ping")
|
75
|
-
ap result
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
end
|