Skip to content

Commit a1a7471

Browse files
committed
Land rapid7#5949, is_root? for remove_lock_root
2 parents 017832b + f2ccca9 commit a1a7471

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/msf/core/post.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Msf::Post < Msf::Module
1616
require 'msf/core/post/solaris'
1717
require 'msf/core/post/unix'
1818
require 'msf/core/post/windows'
19+
require 'msf/core/post/android'
1920

2021
include Msf::PostMixin
2122

modules/post/android/manage/remove_lock_root.rb

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

66
require 'msf/core'
7-
require 'rex'
87

98
class Metasploit4 < Msf::Post
109

1110
include Msf::Post::Common
11+
include Msf::Post::Android::Priv
1212

1313
def initialize(info={})
1414
super( update_info( info, {
@@ -28,10 +28,9 @@ def initialize(info={})
2828
end
2929

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

3736
%W{

0 commit comments

Comments
 (0)