Skip to content

Commit cd0161a

Browse files
committed
fix gcc for shell_reverse_tcp payloads on ubuntu
1 parent 2331a61 commit cd0161a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/exploits/linux/local/af_packet_chocobo_root_priv_esc.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def upload_and_chmodx(path, data)
9393

9494
def upload_and_compile(path, data)
9595
upload "#{path}.c", data
96-
output = cmd_exec "gcc -o #{path} #{path}.c -lpthread"
96+
97+
gcc_cmd = "gcc -o #{path} #{path}.c -lpthread"
98+
if session.type.eql? 'shell'
99+
gcc_cmd = "PATH=$PATH:/usr/bin/ #{gcc_cmd}"
100+
end
101+
output = cmd_exec gcc_cmd
97102

98103
unless output.blank?
99104
print_error output

0 commit comments

Comments
 (0)