Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0fb21c

Browse files
committed
Patch for an Issue #673
1 parent f29769b commit e0fb21c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/takeover/metasploit.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ def _initVars(self):
6565
self._msfPayload = normalizePath(os.path.join(conf.msfPath, "msfpayload"))
6666

6767
if IS_WIN:
68-
_ = normalizePath(os.path.join(conf.msfPath, "..", "scripts", "setenv.bat"))
68+
_ = conf.msfPath
69+
while _:
70+
if os.path.exists(os.path.join(_, "scripts")):
71+
_ = os.path.join(_, "scripts", "setenv.bat")
72+
break
73+
else:
74+
old = _
75+
_ = normalizePath(os.path.join(_, ".."))
76+
if _ == old:
77+
break
6978
self._msfCli = "%s & ruby %s" % (_, self._msfCli)
7079
self._msfEncode = "ruby %s" % self._msfEncode
7180
self._msfPayload = "%s & ruby %s" % (_, self._msfPayload)

0 commit comments

Comments
 (0)