Add dependency check for Impacket

GSoC/Meterpreter_Web_Console
William Vu 2018-06-20 12:22:17 -05:00
parent 0820268d8a
commit 13a4b2e359
1 changed files with 15 additions and 4 deletions

View File

@ -1,11 +1,18 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
from metasploit import module
from impacket import smb, ntlm
from struct import pack
from base64 import b64decode
import sys import sys
import socket import socket
from struct import pack
from base64 import b64decode
try:
from impacket import smb, ntlm
except ImportError:
no_impacket = True
else:
no_impacket = False
from metasploit import module
metadata = { metadata = {
'name': 'MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+', 'name': 'MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+',
@ -664,4 +671,8 @@ def exploit(args):
if __name__ == '__main__': if __name__ == '__main__':
if no_impacket:
module.log('Please install Impacket before continuing', 'error')
sys.exit(1)
module.run(metadata, exploit) module.run(metadata, exploit)