diff --git a/modules/exploits/linux/local/af_packet_chocobo_root_priv_esc.rb b/modules/exploits/linux/local/af_packet_chocobo_root_priv_esc.rb index b5a4dd78fd..acb9b57a20 100644 --- a/modules/exploits/linux/local/af_packet_chocobo_root_priv_esc.rb +++ b/modules/exploits/linux/local/af_packet_chocobo_root_priv_esc.rb @@ -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