Skip to content

Commit b44e7ff

Browse files
committed
Fix argument passing for deprecated scripts
This allows the scripts to continue working while warning the user. See also: c59b5ea.
1 parent 1791f20 commit b44e7ff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/msf/base/sessions/scriptable.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def execute_file
5353

5454
#
5555
# Maps legacy Meterpreter script names to replacement post modules
56+
#
5657
def legacy_script_to_post_module(script_name)
5758
{
5859
'autoroute' => 'post/windows/manage/autoroute',
@@ -66,11 +67,11 @@ def legacy_script_to_post_module(script_name)
6667
'enum_shares' => 'post/windows/gather/enum_shares',
6768
'file_collector' => 'post/windows/gather/enum_files',
6869
'get_application_list' => 'post/windows/gather/enum_applications',
69-
'getcountermeasure' => 'post/windows/manage/killav',
7070
'get_filezilla_creds' => 'post/windows/gather/credentials/filezilla_server',
71-
'getgui' => 'post/windows/manage/enable_rdp',
7271
'get_local_subnets' => 'post/windows/manage/autoroute',
7372
'get_valid_community' => 'post/windows/gather/enum_snmp',
73+
'getcountermeasure' => 'post/windows/manage/killav',
74+
'getgui' => 'post/windows/manage/enable_rdp',
7475
'getvncpw' => 'post/windows/gather/credentials/vnc',
7576
'hashdump' => 'post/windows/gather/smart_hashdump',
7677
'hostsedit' => 'post/windows/manage/inject_host',
@@ -83,8 +84,8 @@ def legacy_script_to_post_module(script_name)
8384
'prefetchtool' => 'post/windows/gather/enum_prefetch',
8485
'remotewinenum' => 'post/windows/gather/wmic_command',
8586
'schelevator' => 'exploit/windows/local/ms10_092_schelevator',
86-
'screenspy' => 'post/windows/gather/screen_spy',
8787
'screen_unlock' => 'post/windows/escalate/screen_unlock',
88+
'screenspy' => 'post/windows/gather/screen_spy',
8889
'search_dwld' => 'post/windows/gather/enum_files',
8990
'service_permissions_escalate' => 'exploits/windows/local/service_permissions',
9091
'uploadexec' => 'post/windows/manage/download_exec',
@@ -101,7 +102,12 @@ def legacy_script_to_post_module(script_name)
101102
#
102103
def execute_script(script_name, *args)
103104
post_module = legacy_script_to_post_module(script_name)
104-
script_name = post_module if !post_module.nil?
105+
106+
if post_module
107+
print_warning("Meterpreter scripts are deprecated. Try #{post_module}.")
108+
print_warning("Example: run #{post_module} OPTION=value [...]")
109+
end
110+
105111
mod = framework.modules.create(script_name)
106112
if mod
107113
# Don't report module run events here as it will be taken care of

0 commit comments

Comments
 (0)