add nil check for the return value of add_printer_driver_ex, since this will return nil if the response can't be mapped to a win32 status code

This commit is contained in:
kalba-security
2021-09-30 19:28:00 -04:00
parent 32306a3fb4
commit c1c71d34fe
@@ -337,6 +337,8 @@ class MetasploitModule < Msf::Auxiliary
)
case add_printer_driver_ex(container)
when nil # prevent the module from erroring out in case the response can't be mapped to a Win32 error code
return Exploit::CheckCode::Unknown('Received unknown status code, implying the target is not vulnerable.')
when ::WindowsError::Win32::ERROR_PATH_NOT_FOUND
return Exploit::CheckCode::Vulnerable('Received ERROR_PATH_NOT_FOUND, implying the target is vulnerable.')
when ::WindowsError::Win32::ERROR_BAD_NET_NAME