mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
no more annoying "no metasploit found" for case when msfpath provided with root directory of Metasploit (not the bin one)
This commit is contained in:
parent
83feb097ef
commit
c4c40308c6
|
@ -505,11 +505,18 @@ def __setMetasploit():
|
|||
raise sqlmapMissingPrivileges, errMsg
|
||||
|
||||
if conf.msfPath:
|
||||
condition = os.path.exists(normalizePath(conf.msfPath))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfcli")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfconsole")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfencode")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(conf.msfPath, "msfpayload")))
|
||||
condition = False
|
||||
|
||||
for path in [conf.msfPath, os.path.join(conf.msfPath, 'bin')]:
|
||||
condition = os.path.exists(normalizePath(path))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(path, "msfcli")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(path, "msfconsole")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(path, "msfencode")))
|
||||
condition &= os.path.exists(normalizePath(os.path.join(path, "msfpayload")))
|
||||
|
||||
if condition:
|
||||
conf.msfPath = path
|
||||
break
|
||||
|
||||
if condition:
|
||||
debugMsg = "provided Metasploit Framework 3 path "
|
||||
|
|
Loading…
Reference in New Issue
Block a user