Skip to content

Commit b86c1f0

Browse files
committed
Land rapid7#7823, legacy_script_to_post_module check
2 parents 3c0ce8e + 8f6fe87 commit b86c1f0

36 files changed

+44
-6560
lines changed

lib/msf/base/sessions/scriptable.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,57 @@ def execute_file
5151
raise NotImplementedError
5252
end
5353

54+
#
55+
# Maps legacy Meterpreter script names to replacement post modules
56+
def legacy_script_to_post_module(script_name)
57+
{
58+
'autoroute' => 'post/windows/manage/autoroute',
59+
'checkvm' => 'post/windows/gather/checkvm',
60+
'duplicate' => 'post/windows/manage/multi_meterpreter_inject',
61+
'enum_chrome' => 'post/windows/gather/enum_chrome',
62+
'enum_firefox' => 'post/windows/gather/enum_firefox',
63+
'enum_logged_on_users' => 'post/windows/gather/enum_logged_on_users',
64+
'enum_powershell_env' => 'post/windows/gather/enum_powershell_env',
65+
'enum_putty' => 'post/windows/gather/enum_putty_saved_sessions',
66+
'enum_shares' => 'post/windows/gather/enum_shares',
67+
'file_collector' => 'post/windows/gather/enum_files',
68+
'get_application_list' => 'post/windows/gather/enum_applications',
69+
'getcountermeasure' => 'post/windows/manage/killav',
70+
'get_filezilla_creds' => 'post/windows/gather/credentials/filezilla_server',
71+
'getgui' => 'post/windows/manage/enable_rdp',
72+
'get_local_subnets' => 'post/windows/manage/autoroute',
73+
'get_valid_community' => 'post/windows/gather/enum_snmp',
74+
'getvncpw' => 'post/windows/gather/credentials/vnc',
75+
'hashdump' => 'post/windows/gather/smart_hashdump',
76+
'hostsedit' => 'post/windows/manage/inject_host',
77+
'keylogrecorder' => 'post/windows/capture/keylog_recorder',
78+
'killav' => 'post/windows/manage/killav',
79+
'metsvc' => 'post/windows/manage/persistence_exe',
80+
'migrate' => 'post/windows/manage/migrate',
81+
'packetrecorder' => 'post/windows/manage/rpcapd_start',
82+
'persistence' => 'post/window/manager/persistence_exe',
83+
'prefetchtool' => 'post/windows/gather/enum_prefetch',
84+
'remotewinenum' => 'post/windows/gather/wmic_command',
85+
'schelevator' => 'exploits/windows/local/ms10_092_schelevator',
86+
'screenspy' => 'post/windows/gather/screen_spy',
87+
'screen_unlock' => 'post/windows/escalate/screen_unlock',
88+
'search_dwld' => 'post/windows/gather/enum_files',
89+
'service_permissions_escalate' => 'exploits/windows/local/service_permissions',
90+
'uploadexec' => 'post/windows/manage/download_exec',
91+
'webcam' => 'post/windows/manage/webcam',
92+
'wmic' => 'post/windows/gather/wmic_command',
93+
}[script_name]
94+
end
95+
5496
#
5597
# Executes the supplied script, Post module, or local Exploit module with
5698
# arguments +args+
5799
#
58100
# Will search the script path.
59101
#
60102
def execute_script(script_name, *args)
103+
post_module = legacy_script_to_post_module(script_name)
104+
script_name = post_module if !post_module.nil?
61105
mod = framework.modules.create(script_name)
62106
if mod
63107
# Don't report module run events here as it will be taken care of

scripts/meterpreter/autoroute.rb

Lines changed: 0 additions & 209 deletions
This file was deleted.

0 commit comments

Comments
 (0)