fix gcc for shell_reverse_tcp payloads on ubuntu

GSoC/Meterpreter_Web_Console
Tim W 2018-05-21 16:46:42 +08:00
parent 2331a610d6
commit cd0161ada2
1 changed files with 6 additions and 1 deletions

View File

@ -93,7 +93,12 @@ class MetasploitModule < Msf::Exploit::Local
def upload_and_compile(path, data)
upload "#{path}.c", data
output = cmd_exec "gcc -o #{path} #{path}.c -lpthread"
gcc_cmd = "gcc -o #{path} #{path}.c -lpthread"
if session.type.eql? 'shell'
gcc_cmd = "PATH=$PATH:/usr/bin/ #{gcc_cmd}"
end
output = cmd_exec gcc_cmd
unless output.blank?
print_error output