From 6e257d5f57fc9c34a78d3bad16572bf2ddc9f59e Mon Sep 17 00:00:00 2001 From: Royce Davis Date: Fri, 9 Nov 2012 08:50:09 -0600 Subject: [PATCH] Simplify main method --- modules/auxiliary/admin/smb/command.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/auxiliary/admin/smb/command.rb b/modules/auxiliary/admin/smb/command.rb index b3569adede..4c85269504 100644 --- a/modules/auxiliary/admin/smb/command.rb +++ b/modules/auxiliary/admin/smb/command.rb @@ -74,9 +74,6 @@ class Metasploit3 < Msf::Auxiliary if execute_command(smbshare, ip, cmd, text, bat) get_output(smbshare, ip, text) - else - cleanup_after(smbshare, ip, cmd, text, bat) - return end cleanup_after(smbshare, ip, cmd, text, bat) end @@ -91,10 +88,10 @@ class Metasploit3 < Msf::Auxiliary simple.connect(smbshare) print_status("Executing your command on host: #{ip}") psexec(smbshare, execute) - return True + return true rescue StandardError => execerror print_error("#{ip} - Unable to execute specified command: #{execerror}") - return False + return false end end