Move dependency check so we can send our metadata
I missed this detail about the module.run method when adding the check. Defining the metadata or where you put it doesn't matter so much as if you're sending it over JSON-RPC.GSoC/Meterpreter_Web_Console
parent
8277a4da24
commit
4bb6afb24e
|
@ -8,9 +8,9 @@ from base64 import b64decode
|
|||
try:
|
||||
from impacket import smb, ntlm
|
||||
except ImportError:
|
||||
no_impacket = True
|
||||
dependencies_missing = True
|
||||
else:
|
||||
no_impacket = False
|
||||
dependencies_missing = False
|
||||
|
||||
from metasploit import module
|
||||
|
||||
|
@ -647,6 +647,10 @@ def _exploit(target, port, feaList, shellcode, numGroomConn, username, password)
|
|||
|
||||
|
||||
def exploit(args):
|
||||
if dependencies_missing:
|
||||
module.log('Module dependencies (impacket) missing, cannot continue', 'error')
|
||||
return
|
||||
|
||||
# XXX: Normalize strings to ints and unset options to empty strings
|
||||
rport = int(args['RPORT'])
|
||||
numGroomConn = int(args['GroomAllocations'])
|
||||
|
@ -671,8 +675,4 @@ def exploit(args):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if no_impacket:
|
||||
module.log('Please install Impacket before continuing', 'error')
|
||||
sys.exit(1)
|
||||
|
||||
module.run(metadata, exploit)
|
||||
|
|
Loading…
Reference in New Issue