Skip to content

Commit 9fe2dd5

Browse files
committed
Move error messages to check
1 parent 3ec30bd commit 9fe2dd5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/exploits/windows/local/mqac_write.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def open_device
110110
def check
111111
handle = open_device
112112
if handle.nil? || handle == INVALID_HANDLE_VALUE
113+
print_error("MSMQ installation not found")
113114
return Exploit::CheckCode::Safe
114115
end
115116
session.railgun.kernel32.CloseHandle(handle)
@@ -119,6 +120,7 @@ def check
119120
when /windows xp.*service pack 3/i
120121
return Exploit::CheckCode::Appears
121122
when /windows xp/i
123+
print_error("Incorrect version of Windows XP detected")
122124
return Exploit::CheckCode::Detected
123125
else
124126
return Exploit::CheckCode::Safe
@@ -141,10 +143,7 @@ def exploit
141143

142144
# Running on Windows XP versions that aren't listed in the supported list results
143145
# in a BSOD and so we should not let that happen.
144-
if check != Exploit::CheckCode::Appears
145-
print_error("Target machine not supported (incorrect Windows version or missing MSMQ)")
146-
return
147-
end
146+
return unless check == Exploit::CheckCode::Appears
148147

149148
kernel_info = find_sys_base(nil)
150149
base_addr = 0xffff

0 commit comments

Comments
 (0)