Skip to content

Commit 13afbc4

Browse files
committed
Properly check root for remove_lock_root (android post module)
This uses the Msf::Post::Android::Priv mixin.
1 parent d7887b5 commit 13afbc4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/post/android/manage/remove_lock_root.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
##
55

66
require 'msf/core'
7-
require 'rex'
7+
require 'msf/core/post/android'
88

99
class Metasploit4 < Msf::Post
1010

1111
include Msf::Post::Common
12+
include Msf::Post::Android::Priv
1213

1314
def initialize(info={})
1415
super( update_info( info, {
@@ -28,10 +29,9 @@ def initialize(info={})
2829
end
2930

3031
def run
31-
id = cmd_exec('id')
32-
unless id =~ /root/
33-
#print_error("This module requires root permissions")
34-
#return
32+
unless is_root?
33+
print_error("This module requires root permissions.")
34+
return
3535
end
3636

3737
%W{

0 commit comments

Comments
 (0)