From c04e6b2b142d2ea8f22bf39f50440e71330faf41 Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Wed, 28 Aug 2013 17:13:21 -0500 Subject: [PATCH] Reduce code complexity on check_ipv6 --- modules/post/windows/manage/portproxy.rb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/post/windows/manage/portproxy.rb b/modules/post/windows/manage/portproxy.rb index 18da68d02c..dbecd2506b 100644 --- a/modules/post/windows/manage/portproxy.rb +++ b/modules/post/windows/manage/portproxy.rb @@ -95,20 +95,18 @@ class Metasploit3 < Msf::Post if ipv6_installed() print_status("IPv6 is already installed.") return true + elsif not datastore['IPV6_XP'] + print_error("IPv6 is not installed. You need IPv6 to use portproxy.") + return false else - if not datastore['IPV6_XP'] - print_error("IPv6 is not installed. You need IPv6 to use portproxy.") + print_status("Installing IPv6 ...") + cmd_exec("netsh","interface ipv6 install",120) + if not ipv6_installed + print_error("IPv6 was not successfully installed. Run it again.") return false - else - print_status("Installing IPv6 ...") - cmd_exec("netsh","interface ipv6 install",120) - if not ipv6_installed - print_error("IPv6 was not successfully installed. Run it again.") - return false - end - print_good("IPv6 was successfully installed.") - return true end + print_good("IPv6 was successfully installed.") + return true end end