Skip to content

Commit a7c8060

Browse files
committed
Land rapid7#7523, Fix template location for psh payload creation
2 parents a651985 + 4516863 commit a7c8060

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/msf/util/exe.rb

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,17 +1346,11 @@ def self.to_mem_aspx(framework, code, exeopts = {})
13461346
end
13471347

13481348
def self.to_win32pe_psh_net(framework, code, opts={})
1349-
template_path = File.join(Msf::Config.data_directory,
1350-
"templates",
1351-
"scripts")
1352-
Rex::Powershell::Payload.to_win32pe_psh_net(template_path, code)
1349+
Rex::Powershell::Payload.to_win32pe_psh_net(Rex::Powershell::Templates::TEMPLATE_DIR, code)
13531350
end
13541351

13551352
def self.to_win32pe_psh(framework, code, opts = {})
1356-
template_path = File.join(Msf::Config.data_directory,
1357-
"templates",
1358-
"scripts")
1359-
Rex::Powershell::Payload.to_win32pe_psh(template_path, code)
1353+
Rex::Powershell::Payload.to_win32pe_psh(Rex::Powershell::Templates::TEMPLATE_DIR, code)
13601354
end
13611355

13621356
#
@@ -1365,10 +1359,7 @@ def self.to_win32pe_psh(framework, code, opts = {})
13651359
# Originally from PowerSploit
13661360
#
13671361
def self.to_win32pe_psh_reflection(framework, code, opts = {})
1368-
template_path = File.join(Msf::Config.data_directory,
1369-
"templates",
1370-
"scripts")
1371-
Rex::Powershell::Payload.to_win32pe_psh_reflection(template_path, code)
1362+
Rex::Powershell::Payload.to_win32pe_psh_reflection(Rex::Powershell::Templates::TEMPLATE_DIR, code)
13721363
end
13731364

13741365
def self.to_powershell_command(framework, arch, code)

0 commit comments

Comments
 (0)